From 0702da150a8d34b590df5818a64c63a74157e3eb Mon Sep 17 00:00:00 2001 From: Shreyash Raj Date: Sat, 13 Aug 2022 19:06:16 +0530 Subject: [PATCH] Small changes --- ts-script/captcha.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ts-script/captcha.ts b/ts-script/captcha.ts index 8b0a59a..e339c15 100644 --- a/ts-script/captcha.ts +++ b/ts-script/captcha.ts @@ -125,8 +125,8 @@ export class Captcha { */ drawCaptcha(captchaOption: DrawCaptchaOption = {}): Captcha { const option = { ...this._captcha, ...captchaOption }; - if(captchaOption.text) option.text = captchaOption.text.slice(0, option.characters); - if(!option.text) option.text = randomText(option.characters || 6); + if(captchaOption.text) option.text = captchaOption.text; + if(!option.text) option.text = randomText(option.characters); if(option.text.length != option.characters) { if(captchaOption.text) { throw new Error("Size of text and no. of characters is not matching.");