@apidevtools/json-schema-ref-parser 15.1.0 → 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(path?.win32?.sep).join(path?.posix?.sep ?? "/");
8
+ return filePath.split(win32Sep).join(path?.posix?.sep ?? "/");
8
9
  }
@@ -1,11 +1,12 @@
1
1
  import convertPathToPosix from "./convert-path-to-posix.js";
2
- import path, { win32 } from "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 = win32?.isAbsolute(path) ||
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(path?.win32?.sep).join(path?.posix?.sep ?? "/");
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, { win32 } from "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
- win32?.isAbsolute(path) ||
396
+ isAbsoluteWin32Path.test(path) ||
395
397
  path.startsWith("http://") ||
396
398
  path.startsWith("https://") ||
397
399
  path.startsWith("file://");
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@apidevtools/json-schema-ref-parser",
3
- "version": "15.1.0",
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",
7
7
  "module": "dist/lib/index.js",
8
+ "main": "dist/lib/index.js",
8
9
  "scripts": {
9
10
  "prepublishOnly": "yarn build",
10
11
  "lint": "eslint lib",
@@ -71,10 +72,10 @@
71
72
  "@types/json-schema": "^7.0.15"
72
73
  },
73
74
  "dependencies": {
74
- "js-yaml": "^4.1.0"
75
+ "js-yaml": "^4.1.1"
75
76
  },
76
77
  "devDependencies": {
77
- "@eslint/compat": "^1.4.1",
78
+ "@eslint/compat": "^2.0.0",
78
79
  "@eslint/js": "^9.39.1",
79
80
  "@types/eslint": "^9.6.1",
80
81
  "@types/js-yaml": "^4.0.9",
@@ -82,7 +83,7 @@
82
83
  "@types/node": "^24",
83
84
  "@typescript-eslint/eslint-plugin": "^8.46.4",
84
85
  "@typescript-eslint/parser": "^8.46.4",
85
- "@vitest/coverage-v8": "^4.0.8",
86
+ "@vitest/coverage-v8": "^4.0.9",
86
87
  "cross-env": "^10.1.0",
87
88
  "eslint": "^9.39.1",
88
89
  "eslint-config-prettier": "^10.1.8",
@@ -91,12 +92,12 @@
91
92
  "eslint-plugin-promise": "^7.2.1",
92
93
  "eslint-plugin-unused-imports": "^4.3.0",
93
94
  "globals": "^16.5.0",
94
- "jsdom": "^27.1.0",
95
+ "jsdom": "^27.2.0",
95
96
  "prettier": "^3.6.2",
96
97
  "rimraf": "^6.1.0",
97
98
  "typescript": "^5.9.3",
98
99
  "typescript-eslint": "^8.46.4",
99
- "vitest": "^4.0.8"
100
+ "vitest": "^4.0.9"
100
101
  },
101
102
  "release": {
102
103
  "branches": [