File tree 7 files changed +16
-14
lines changed
7 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## [ Unreleased]
4
4
### Changed
5
-
6
- ## [ v2.2.4] 12-11-2024
7
- ### Changed
8
- - fix: removed dependency on "node: url " to aid in bundling
9
5
- updated dependencies
10
6
- @biomejs/biome ^1.8.3 → ^1.9.4
11
7
Original file line number Diff line number Diff line change 1
1
import { readFileSync } from "node:fs" ;
2
2
import { readFile } from "node:fs/promises" ;
3
+ import { URL , fileURLToPath } from "node:url" ;
3
4
import Ajv04 from "ajv-draft-04" ;
4
5
import addFormats from "ajv-formats" ;
5
6
import Ajv2020 from "ajv/dist/2020.js" ;
@@ -13,8 +14,8 @@ const ajvVersions = {
13
14
} ;
14
15
const inlinedRefs = "x-inlined-refs" ;
15
16
16
- function localFile ( file ) {
17
- return new URL ( file , import . meta. url ) . pathname ;
17
+ function localFile ( fileName ) {
18
+ return fileURLToPath ( new URL ( fileName , import . meta. url ) ) ;
18
19
}
19
20
20
21
function importJSON ( file ) {
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { createHash } from "node:crypto";
3
3
import { readFileSync } from "node:fs" ;
4
4
import { readdir } from "node:fs/promises" ;
5
5
import { test } from "node:test" ;
6
+ import { URL } from "node:url" ;
6
7
import { Validator } from "../index.js" ;
7
8
import { Snapshot } from "./snapshot.js" ;
8
9
Original file line number Diff line number Diff line change @@ -2,10 +2,11 @@ import { strict as assert } from "node:assert/strict";
2
2
import { execSync } from "node:child_process" ;
3
3
import { readFileSync , unlinkSync } from "node:fs" ;
4
4
import { test } from "node:test" ;
5
+ import { URL , fileURLToPath } from "node:url" ;
5
6
import { load } from "js-yaml" ;
6
7
7
- function localFile ( file ) {
8
- return new URL ( file , import . meta. url ) . pathname ;
8
+ function localFile ( fileName ) {
9
+ return fileURLToPath ( new URL ( fileName , import . meta. url ) ) ;
9
10
}
10
11
11
12
function importJSON ( file ) {
Original file line number Diff line number Diff line change 1
1
import { strict as assert } from "node:assert/strict" ;
2
2
import { execSync } from "node:child_process" ;
3
3
import { test } from "node:test" ;
4
+ import { URL , fileURLToPath } from "node:url" ;
4
5
5
- function localFile ( file ) {
6
- return new URL ( file , import . meta. url ) . pathname ;
6
+ function localFile ( fileName ) {
7
+ return fileURLToPath ( new URL ( fileName , import . meta. url ) ) ;
7
8
}
8
9
9
10
const cli = localFile ( "../bin/validate-api-cli.js" ) ;
Original file line number Diff line number Diff line change 1
1
import { strict as assert } from "node:assert/strict" ;
2
2
import { test } from "node:test" ;
3
+ import { URL , fileURLToPath } from "node:url" ;
3
4
import { Validator } from "../index.js" ;
4
5
5
- function localFile ( file ) {
6
- return new URL ( file , import . meta. url ) . pathname ;
6
+ function localFile ( fileName ) {
7
+ return fileURLToPath ( new URL ( fileName , import . meta. url ) ) ;
7
8
}
8
9
9
10
const invalidRefsSpec = localFile ( "./validation/invalid-refs.yaml" ) ;
Original file line number Diff line number Diff line change @@ -2,10 +2,11 @@ import { strict as assert } from "node:assert/strict";
2
2
import { readFileSync } from "node:fs" ;
3
3
import { readFile } from "node:fs/promises" ;
4
4
import { test } from "node:test" ;
5
+ import { URL , fileURLToPath } from "node:url" ;
5
6
import { Validator } from "../index.js" ;
6
7
7
- function localFile ( file ) {
8
- return new URL ( file , import . meta. url ) . pathname ;
8
+ function localFile ( fileName ) {
9
+ return fileURLToPath ( new URL ( fileName , import . meta. url ) ) ;
9
10
}
10
11
11
12
function importJSON ( file ) {
You can’t perform that action at this time.
0 commit comments