Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

Commit 46b5dfc

Browse files
authored
fix: use stripRoot (#117)
1 parent 56a78bb commit 46b5dfc

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"test.watch": "yarn test --watch"
4545
},
4646
"dependencies": {
47-
"@stoplight/json": "^3.1.0",
48-
"@stoplight/path": "^1.2.1",
47+
"@stoplight/json": "^3.1.2",
48+
"@stoplight/path": "^1.3.0",
4949
"@stoplight/types": "^11.0.0",
5050
"@types/urijs": "1.x.x",
5151
"dependency-graph": "~0.8.0",

src/runner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { pathToPointer, pointerToPath, startsWith, trimStart } from '@stoplight/json';
2-
import { dirname, join, toFSPath } from '@stoplight/path';
2+
import { dirname, join, stripRoot, toFSPath } from '@stoplight/path';
33
import { DepGraph } from 'dependency-graph';
44
import produce, { original } from 'immer';
55
import { get, set } from 'lodash';
@@ -313,7 +313,7 @@ export class ResolveRunner implements Types.IResolveRunner {
313313
let absRef = ref.toString();
314314
if (!ref.is('absolute')) {
315315
if (this.baseUri.toString()) {
316-
absRef = join(dirname(this.baseUri.toString()), absRef);
316+
absRef = join(dirname(this.baseUri.toString()), stripRoot(absRef));
317317
} else {
318318
absRef = '';
319319
}

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -775,20 +775,20 @@
775775
lodash "^4.17.4"
776776
read-pkg-up "^6.0.0"
777777

778-
"@stoplight/json@^3.1.0":
779-
version "3.1.1"
780-
resolved "https://registry.yarnpkg.com/@stoplight/json/-/json-3.1.1.tgz#531d966a62247bf2ab1e8a06a685fa62e36cf890"
781-
integrity sha512-DK2ufmnPvfW9Mv0q4DYtldjicTTcBY+j4kiEUOEmc9hL+mzMDV08+5ix4tmPtheUDZH6OtEqEmGcf8ZKCHFbpg==
778+
"@stoplight/json@^3.1.2":
779+
version "3.1.2"
780+
resolved "https://registry.yarnpkg.com/@stoplight/json/-/json-3.1.2.tgz#ae89d1974f0b6f8bc5778f792aeed4664c95ec62"
781+
integrity sha512-7zt0zCN94m90X1sL7FrD7jXhPtkIup07MyG/00sELVrCvzb2wgNaiE+x2N7WSbk3Z0wS08e8B6kow81GQY+Isw==
782782
dependencies:
783783
"@stoplight/types" "^11.0.0"
784784
jsonc-parser "~2.1.1"
785785
lodash "^4.17.15"
786786
safe-stable-stringify "^1.1"
787787

788-
"@stoplight/path@^1.2.1":
789-
version "1.2.1"
790-
resolved "https://registry.yarnpkg.com/@stoplight/path/-/path-1.2.1.tgz#f39f408377a0d1a9c33a04ce08eb3a1691c457d6"
791-
integrity sha512-W/wBpTw6ThKZGPcb1ztKz6ULnMVnLE/ygzqIjnqnmKcpNrKkSuBLtL7+oQYZSkteZfJAryloAt3plU3sTiekcQ==
788+
"@stoplight/path@^1.3.0":
789+
version "1.3.0"
790+
resolved "https://registry.yarnpkg.com/@stoplight/path/-/path-1.3.0.tgz#da2282352a4eb23c09d5106b9d1650d30a9ca2ad"
791+
integrity sha512-t74/MHMgmFVMQhdQ/2Q766GryNTIW8McH8+vB25oeoBhYKTOrJ/wPDt+OCxIWHPUlcSi2fTWa4FKQ8qgmP2jVA==
792792

793793
"@stoplight/scripts@5.x.x":
794794
version "5.1.0"

0 commit comments

Comments
 (0)