diff --git a/dist/validator.js b/dist/validator.js index 250d12c..ddbc0b2 100644 --- a/dist/validator.js +++ b/dist/validator.js @@ -1814,7 +1814,7 @@ Validator.prototype = { if(Array.isArray(path2)){ path2 = path2[0]; } - const pos = path2.indexOf('*'); + const pos = path2.indexOf !== undefined ? path2.indexOf('*') : -1; if (pos === -1) { return path2; } diff --git a/src/validator.js b/src/validator.js index ce5ba32..07fb397 100755 --- a/src/validator.js +++ b/src/validator.js @@ -296,7 +296,7 @@ Validator.prototype = { if(Array.isArray(path2)){ path2 = path2[0]; } - const pos = path2.indexOf('*'); + const pos = path2.indexOf !== undefined ? path2.indexOf('*') : -1; if (pos === -1) { return path2; }