1- const _ = require ( '../helper' ) ;
1+ var _ = require ( '../helper' ) ;
22
33/**
44 * @readonly
55 * @enum {number}
66 */
7- const Direction = {
7+ var Direction = {
88 Ascending : 1 ,
99 Descending : - 1 ,
1010 None : 0
@@ -14,7 +14,7 @@ const Direction = {
1414 * @readonly
1515 * @enum {number}
1616 */
17- const CharacterCodes = {
17+ var CharacterCodes = {
1818 LowerCaseA : 'a' . charCodeAt ( 0 ) ,
1919 LowerCaseZ : 'z' . charCodeAt ( 0 ) ,
2020 Zero : '0' . charCodeAt ( 0 ) ,
@@ -57,20 +57,20 @@ function assert(options, password) {
5757 return false ;
5858 }
5959
60- let prevCode = password . charCodeAt ( 0 ) ;
61- let seqLen = isAlphanumeric ( prevCode ) ? 1 : 0 ;
62- let currentDirection = Direction . None ;
60+ var prevCode = password . charCodeAt ( 0 ) ;
61+ var seqLen = isAlphanumeric ( prevCode ) ? 1 : 0 ;
62+ var currentDirection = Direction . None ;
6363
64- for ( let i = 1 ; i < password . length ; i ++ ) {
65- const currentCode = password . charCodeAt ( i ) ;
64+ for ( var i = 1 ; i < password . length ; i ++ ) {
65+ var currentCode = password . charCodeAt ( i ) ;
6666 if ( ! isAlphanumeric ( currentCode ) || ! isAlphanumeric ( prevCode ) ) {
6767 currentDirection = Direction . None ;
6868 seqLen = 1 ;
6969 prevCode = currentCode ;
7070 continue ;
7171 }
7272
73- const diff = currentCode - prevCode ;
73+ var diff = currentCode - prevCode ;
7474 prevCode = currentCode ;
7575
7676 if ( diff === Direction . Ascending || diff === Direction . Descending ) {
@@ -100,11 +100,11 @@ function assert(options, password) {
100100 * @return {boolean }
101101 */
102102function explain ( options , verified ) {
103- let example = '' ;
104- for ( let i = 0 ; i < options . max + 1 ; i ++ ) {
103+ var example = '' ;
104+ for ( var i = 0 ; i < options . max + 1 ; i ++ ) {
105105 example += String . fromCharCode ( 'a' . charCodeAt ( 0 ) + i ) ;
106106 }
107- const d = {
107+ var d = {
108108 message : 'No more than %d sequential alphanumeric characters (e.g., "%s" not allowed)' , // updated
109109 code : 'sequentialChars' ,
110110 format : [ options . max , example ]
0 commit comments