We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b61540e commit f99f96dCopy full SHA for f99f96d
schemas/ajv.absolutePath.js
@@ -24,8 +24,9 @@ module.exports = ajv =>
24
compile(expected, schema) {
25
function callback(data) {
26
let passes = true;
27
- const isExclamationMarkPresent = data.indexOf("!") !== -1;
28
- const isAbsolutePath = expected === /^(?:[A-Za-z]:\\|\/)/.test(data);
+ const isExclamationMarkPresent = data.includes("!");
+ const isCorrectAbsoluteOrRelativePath =
29
+ expected === /^(?:[A-Za-z]:\\|\/)/.test(data);
30
31
if (isExclamationMarkPresent) {
32
callback.errors = [
@@ -40,7 +41,7 @@ module.exports = ajv =>
40
41
passes = false;
42
}
43
- if (!isAbsolutePath) {
44
+ if (!isCorrectAbsoluteOrRelativePath) {
45
callback.errors = [getErrorFor(expected, data, schema)];
46
47
0 commit comments