There was an error while loading. Please reload this page.
2 parents 5e9f083 + e826575 commit 627510dCopy full SHA for 627510d
1 file changed
schemas/ajv.absolutePath.js
@@ -25,8 +25,6 @@ module.exports = ajv =>
25
function callback(data) {
26
let passes = true;
27
const isExclamationMarkPresent = data.includes("!");
28
- const isCorrectAbsoluteOrRelativePath =
29
- expected === /^(?:[A-Za-z]:\\|\/)/.test(data);
30
31
if (isExclamationMarkPresent) {
32
callback.errors = [
@@ -40,8 +38,12 @@ module.exports = ajv =>
40
38
];
41
39
passes = false;
42
}
43
-
44
- if (!isCorrectAbsoluteOrRelativePath) {
+ // ?:[A-Za-z]:\\ - Windows absolute path
+ // \\\\ - Windows network absolute path
+ // \/ - Unix-like OS absolute path
+ const isCorrectAbsolutePath =
45
+ expected === /^(?:[A-Za-z]:\\|\\\\|\/)/.test(data);
46
+ if (!isCorrectAbsolutePath) {
47
callback.errors = [getErrorFor(expected, data, schema)];
48
49
0 commit comments