Skip to content

Commit

Permalink
Merge pull request #346 from FerX/hotifx/deprecate-method
Browse files Browse the repository at this point in the history
replace deprecated method substr
  • Loading branch information
icebob authored Jun 19, 2024
2 parents 821340d + 7b25607 commit 9c15049
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,11 @@ class Validator {
};
}

p.slice(1).map((s) => {
p.slice(1).forEach((s) => {
const idx = s.indexOf(":");
if (idx !== -1) {
const key = s.substr(0, idx).trim();
let value = s.substr(idx + 1).trim();
const key = s.substring(0, idx).trim();
let value = s.substring(idx + 1).trim();
if (value === "true" || value === "false")
value = value === "true";
else if (!Number.isNaN(Number(value))) {
Expand Down

0 comments on commit 9c15049

Please sign in to comment.