@apidevtools/json-schema-ref-parser 15.1.1 → 15.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
+
const win32Sep = "\\";
|
|
2
3
|
export default function convertPathToPosix(filePath) {
|
|
3
4
|
const isExtendedLengthPath = filePath.startsWith("\\\\?\\");
|
|
4
5
|
if (isExtendedLengthPath) {
|
|
5
6
|
return filePath;
|
|
6
7
|
}
|
|
7
|
-
return filePath.split(
|
|
8
|
+
return filePath.split(win32Sep).join(path?.posix?.sep ?? "/");
|
|
8
9
|
}
|
package/dist/lib/util/url.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import convertPathToPosix from "./convert-path-to-posix.js";
|
|
2
|
-
import path
|
|
2
|
+
import path from "path";
|
|
3
3
|
const forwardSlashPattern = /\//g;
|
|
4
4
|
const protocolPattern = /^(\w{2,}):\/\//i;
|
|
5
5
|
const jsonPointerSlash = /~1/g;
|
|
6
6
|
const jsonPointerTilde = /~0/g;
|
|
7
7
|
import { join } from "path";
|
|
8
8
|
import { isWindows } from "./is-windows.js";
|
|
9
|
+
const isAbsoluteWin32Path = /^[a-zA-Z]:\\/;
|
|
9
10
|
// RegExp patterns to URL-encode special characters in local filesystem paths
|
|
10
11
|
const urlEncodePatterns = [
|
|
11
12
|
[/\?/g, "%3F"],
|
|
@@ -351,7 +352,7 @@ export function fromFileSystemPath(path) {
|
|
|
351
352
|
const posixUpper = projectDirPosixPath.toUpperCase();
|
|
352
353
|
const hasProjectDir = upperPath.includes(posixUpper);
|
|
353
354
|
const hasProjectUri = upperPath.includes(posixUpper);
|
|
354
|
-
const isAbsolutePath =
|
|
355
|
+
const isAbsolutePath = isAbsoluteWin32Path.test(path) ||
|
|
355
356
|
path.startsWith("http://") ||
|
|
356
357
|
path.startsWith("https://") ||
|
|
357
358
|
path.startsWith("file://");
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
|
|
3
|
+
const win32Sep = "\\";
|
|
3
4
|
export default function convertPathToPosix(filePath: string) {
|
|
4
5
|
const isExtendedLengthPath = filePath.startsWith("\\\\?\\");
|
|
5
6
|
|
|
@@ -7,5 +8,5 @@ export default function convertPathToPosix(filePath: string) {
|
|
|
7
8
|
return filePath;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
return filePath.split(
|
|
11
|
+
return filePath.split(win32Sep).join(path?.posix?.sep ?? "/");
|
|
11
12
|
}
|
package/lib/util/url.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import convertPathToPosix from "./convert-path-to-posix.js";
|
|
2
|
-
import path
|
|
2
|
+
import path from "path";
|
|
3
3
|
|
|
4
4
|
const forwardSlashPattern = /\//g;
|
|
5
5
|
const protocolPattern = /^(\w{2,}):\/\//i;
|
|
@@ -9,6 +9,8 @@ const jsonPointerTilde = /~0/g;
|
|
|
9
9
|
import { join } from "path";
|
|
10
10
|
import { isWindows } from "./is-windows.js";
|
|
11
11
|
|
|
12
|
+
const isAbsoluteWin32Path = /^[a-zA-Z]:\\/;
|
|
13
|
+
|
|
12
14
|
// RegExp patterns to URL-encode special characters in local filesystem paths
|
|
13
15
|
const urlEncodePatterns = [
|
|
14
16
|
[/\?/g, "%3F"],
|
|
@@ -391,7 +393,7 @@ export function fromFileSystemPath(path: string) {
|
|
|
391
393
|
const hasProjectDir = upperPath.includes(posixUpper);
|
|
392
394
|
const hasProjectUri = upperPath.includes(posixUpper);
|
|
393
395
|
const isAbsolutePath =
|
|
394
|
-
|
|
396
|
+
isAbsoluteWin32Path.test(path) ||
|
|
395
397
|
path.startsWith("http://") ||
|
|
396
398
|
path.startsWith("https://") ||
|
|
397
399
|
path.startsWith("file://");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apidevtools/json-schema-ref-parser",
|
|
3
|
-
"version": "15.1.
|
|
3
|
+
"version": "15.1.2",
|
|
4
4
|
"description": "Parse, Resolve, and Dereference JSON Schema $ref pointers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/lib/index.d.ts",
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
"@types/json-schema": "^7.0.15"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"js-yaml": "^4.1.
|
|
75
|
+
"js-yaml": "^4.1.1"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@eslint/compat": "^
|
|
78
|
+
"@eslint/compat": "^2.0.0",
|
|
79
79
|
"@eslint/js": "^9.39.1",
|
|
80
80
|
"@types/eslint": "^9.6.1",
|
|
81
81
|
"@types/js-yaml": "^4.0.9",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@types/node": "^24",
|
|
84
84
|
"@typescript-eslint/eslint-plugin": "^8.46.4",
|
|
85
85
|
"@typescript-eslint/parser": "^8.46.4",
|
|
86
|
-
"@vitest/coverage-v8": "^4.0.
|
|
86
|
+
"@vitest/coverage-v8": "^4.0.9",
|
|
87
87
|
"cross-env": "^10.1.0",
|
|
88
88
|
"eslint": "^9.39.1",
|
|
89
89
|
"eslint-config-prettier": "^10.1.8",
|
|
@@ -92,12 +92,12 @@
|
|
|
92
92
|
"eslint-plugin-promise": "^7.2.1",
|
|
93
93
|
"eslint-plugin-unused-imports": "^4.3.0",
|
|
94
94
|
"globals": "^16.5.0",
|
|
95
|
-
"jsdom": "^27.
|
|
95
|
+
"jsdom": "^27.2.0",
|
|
96
96
|
"prettier": "^3.6.2",
|
|
97
97
|
"rimraf": "^6.1.0",
|
|
98
98
|
"typescript": "^5.9.3",
|
|
99
99
|
"typescript-eslint": "^8.46.4",
|
|
100
|
-
"vitest": "^4.0.
|
|
100
|
+
"vitest": "^4.0.9"
|
|
101
101
|
},
|
|
102
102
|
"release": {
|
|
103
103
|
"branches": [
|