File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,6 @@ module.exports = ajv =>
2525function callback ( data ) {
2626let passes = true ;
2727const isExclamationMarkPresent = data . includes ( "!" ) ;
28- const isCorrectAbsoluteOrRelativePath =
29- expected === / ^ (?: [ A - Z a - z ] : \\ | \/ ) / . test ( data ) ;
3028
3129if ( isExclamationMarkPresent ) {
3230callback . errors = [
@@ -40,8 +38,12 @@ module.exports = ajv =>
4038] ;
4139passes = false ;
4240}
43-
44- if ( ! isCorrectAbsoluteOrRelativePath ) {
41+ // ?:[A-Za-z]:\\ - Windows absolute path
42+ // \\\\ - Windows network absolute path
43+ // \/ - Unix-like OS absolute path
44+ const isCorrectAbsolutePath =
45+ expected === / ^ (?: [ A - Z a - z ] : ( \\ | \/ ) | \\ \\ | \/ ) / . test ( data ) ;
46+ if ( ! isCorrectAbsolutePath ) {
4547callback . errors = [ getErrorFor ( expected , data , schema ) ] ;
4648passes = false ;
4749}
You can’t perform that action at this time.
0 commit comments