Skip to content

Commit 9c15049

Browse files
authored
Merge pull request #346 from FerX/hotifx/deprecate-method
replace deprecated method substr
2 parents 821340d + 7b25607 commit 9c15049

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/validator.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -377,11 +377,11 @@ class Validator {
377377
};
378378
}
379379

380-
p.slice(1).map((s) => {
380+
p.slice(1).forEach((s) => {
381381
const idx = s.indexOf(":");
382382
if (idx !== -1) {
383-
const key = s.substr(0, idx).trim();
384-
let value = s.substr(idx + 1).trim();
383+
const key = s.substring(0, idx).trim();
384+
let value = s.substring(idx + 1).trim();
385385
if (value === "true" || value === "false")
386386
value = value === "true";
387387
else if (!Number.isNaN(Number(value))) {

0 commit comments

Comments
 (0)