Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashank3736 committed Aug 13, 2022
1 parent 12f2c6e commit 0702da1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ts-script/captcha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit 0702da1

Please sign in to comment.