-
-
Notifications
You must be signed in to change notification settings - Fork 0
#8 new kith() with options
Axorax edited this page Apr 14, 2023
·
1 revision
Allows you to provide a list of common passwords that will automatically get rejected (will return rejected as true) when tested.
You must provide an array and it is case-sensitive.
This command list applies to all password test's by default.
const pass = new kith({
common: [
"xyz",
"123"
]
});
const pass = new kith({
length: 12
});
If the score is less than a certain amount then it will return rejected as true
const pass = new kith({
rejectScore: 5 // score < 5
});
const pass = new kith({
checks: {
"hasNumbers": {
"score": 69, // score if "hasNumbers" is true
"code": "[0-9]" // regex
}
}
});
Invert the boolean
const pass = new kith({
checks: {
"hasNumbers": {
"score": 69,
"code": "[0-9]",
"invert": true
}
}
});
This will make the score increase if code is false and do nothing if the code is true.
It is helpful for checking something like whether the password has repeated characters or not.