@apidevtools/json-schema-ref-parser 13.0.0 → 13.0.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.
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +2 -1
- package/dist/lib/util/url.js +11 -8
- package/lib/index.ts +1 -0
- package/lib/util/url.ts +10 -7
- package/package.json +1 -1
package/dist/lib/index.d.ts
CHANGED
|
@@ -159,4 +159,4 @@ export declare const parse: typeof $RefParser.parse;
|
|
|
159
159
|
export declare const resolve: typeof $RefParser.resolve;
|
|
160
160
|
export declare const bundle: typeof $RefParser.bundle;
|
|
161
161
|
export declare const dereference: typeof $RefParser.dereference;
|
|
162
|
-
export { UnmatchedResolverError, JSONParserError, JSONSchema, InvalidPointerError, MissingPointerError, ResolverError, ParserError, UnmatchedParserError, ParserOptions, $RefsCallback, isHandledError, JSONParserErrorGroup, SchemaCallback, FileInfo, Plugin, ResolverOptions, HTTPResolverOptions, _dereference as dereferenceInternal, normalizeArgs as jsonSchemaParserNormalizeArgs, getJsonSchemaRefParserDefaultOptions, };
|
|
162
|
+
export { UnmatchedResolverError, JSONParserError, JSONSchema, InvalidPointerError, MissingPointerError, ResolverError, ParserError, UnmatchedParserError, ParserOptions, $RefsCallback, isHandledError, JSONParserErrorGroup, SchemaCallback, FileInfo, Plugin, ResolverOptions, HTTPResolverOptions, _dereference as dereferenceInternal, normalizeArgs as jsonSchemaParserNormalizeArgs, getJsonSchemaRefParserDefaultOptions, $Refs, };
|
package/dist/lib/index.js
CHANGED
|
@@ -36,8 +36,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.getJsonSchemaRefParserDefaultOptions = exports.jsonSchemaParserNormalizeArgs = exports.dereferenceInternal = exports.JSONParserErrorGroup = exports.isHandledError = exports.UnmatchedParserError = exports.ParserError = exports.ResolverError = exports.MissingPointerError = exports.InvalidPointerError = exports.JSONParserError = exports.UnmatchedResolverError = exports.dereference = exports.bundle = exports.resolve = exports.parse = exports.$RefParser = void 0;
|
|
39
|
+
exports.$Refs = exports.getJsonSchemaRefParserDefaultOptions = exports.jsonSchemaParserNormalizeArgs = exports.dereferenceInternal = exports.JSONParserErrorGroup = exports.isHandledError = exports.UnmatchedParserError = exports.ParserError = exports.ResolverError = exports.MissingPointerError = exports.InvalidPointerError = exports.JSONParserError = exports.UnmatchedResolverError = exports.dereference = exports.bundle = exports.resolve = exports.parse = exports.$RefParser = void 0;
|
|
40
40
|
const refs_js_1 = __importDefault(require("./refs.js"));
|
|
41
|
+
exports.$Refs = refs_js_1.default;
|
|
41
42
|
const parse_js_1 = __importDefault(require("./parse.js"));
|
|
42
43
|
const normalize_args_js_1 = __importDefault(require("./normalize-args.js"));
|
|
43
44
|
exports.jsonSchemaParserNormalizeArgs = normalize_args_js_1.default;
|
package/dist/lib/util/url.js
CHANGED
|
@@ -90,17 +90,20 @@ function resolve(from, to) {
|
|
|
90
90
|
* @returns
|
|
91
91
|
*/
|
|
92
92
|
function cwd() {
|
|
93
|
-
if (typeof window !== "undefined") {
|
|
93
|
+
if (typeof window !== "undefined" && window.location) {
|
|
94
94
|
return location.href;
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
if (typeof process !== "undefined" && process.cwd) {
|
|
97
|
+
const path = process.cwd();
|
|
98
|
+
const lastChar = path.slice(-1);
|
|
99
|
+
if (lastChar === "/" || lastChar === "\\") {
|
|
100
|
+
return path;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
return path + "/";
|
|
104
|
+
}
|
|
103
105
|
}
|
|
106
|
+
return "/";
|
|
104
107
|
}
|
|
105
108
|
/**
|
|
106
109
|
* Returns the protocol of the given URL, or `undefined` if it has no protocol.
|
package/lib/index.ts
CHANGED
package/lib/util/url.ts
CHANGED
|
@@ -44,18 +44,21 @@ export function resolve(from: string, to: string) {
|
|
|
44
44
|
* @returns
|
|
45
45
|
*/
|
|
46
46
|
export function cwd() {
|
|
47
|
-
if (typeof window !== "undefined") {
|
|
47
|
+
if (typeof window !== "undefined" && window.location) {
|
|
48
48
|
return location.href;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
if (typeof process !== "undefined" && process.cwd) {
|
|
52
|
+
const path = process.cwd();
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
const lastChar = path.slice(-1);
|
|
55
|
+
if (lastChar === "/" || lastChar === "\\") {
|
|
56
|
+
return path;
|
|
57
|
+
} else {
|
|
58
|
+
return path + "/";
|
|
59
|
+
}
|
|
58
60
|
}
|
|
61
|
+
return "/";
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
/**
|