@amritk/adapters 0.2.0 → 0.2.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,11 +1,15 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __returnValue = (v) => v;
|
|
3
|
+
function __exportSetter(name, newValue) {
|
|
4
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
5
|
+
}
|
|
2
6
|
var __export = (target, all) => {
|
|
3
7
|
for (var name in all)
|
|
4
8
|
__defProp(target, name, {
|
|
5
9
|
get: all[name],
|
|
6
10
|
enumerable: true,
|
|
7
11
|
configurable: true,
|
|
8
|
-
set: (
|
|
12
|
+
set: __exportSetter.bind(all, name)
|
|
9
13
|
});
|
|
10
14
|
};
|
|
11
15
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
package/dist/get-adapter.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __returnValue = (v) => v;
|
|
3
|
+
function __exportSetter(name, newValue) {
|
|
4
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
5
|
+
}
|
|
2
6
|
var __export = (target, all) => {
|
|
3
7
|
for (var name in all)
|
|
4
8
|
__defProp(target, name, {
|
|
5
9
|
get: all[name],
|
|
6
10
|
enumerable: true,
|
|
7
11
|
configurable: true,
|
|
8
|
-
set: (
|
|
12
|
+
set: __exportSetter.bind(all, name)
|
|
9
13
|
});
|
|
10
14
|
};
|
|
11
15
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -78073,7 +78077,7 @@ function finalize(ctx, schema) {
|
|
|
78073
78077
|
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
78074
78078
|
} else if (ctx.target === "draft-04") {
|
|
78075
78079
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
78076
|
-
} else if (ctx.target === "openapi-3.0") {}
|
|
78080
|
+
} else if (ctx.target === "openapi-3.0") {}
|
|
78077
78081
|
if (ctx.external?.uri) {
|
|
78078
78082
|
const id3 = ctx.external.registry.get(schema)?.id;
|
|
78079
78083
|
if (!id3)
|
|
@@ -78334,7 +78338,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
78334
78338
|
if (val === undefined) {
|
|
78335
78339
|
if (ctx.unrepresentable === "throw") {
|
|
78336
78340
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
78337
|
-
}
|
|
78341
|
+
}
|
|
78338
78342
|
} else if (typeof val === "bigint") {
|
|
78339
78343
|
if (ctx.unrepresentable === "throw") {
|
|
78340
78344
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __returnValue = (v) => v;
|
|
3
|
+
function __exportSetter(name, newValue) {
|
|
4
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
5
|
+
}
|
|
2
6
|
var __export = (target, all) => {
|
|
3
7
|
for (var name in all)
|
|
4
8
|
__defProp(target, name, {
|
|
5
9
|
get: all[name],
|
|
6
10
|
enumerable: true,
|
|
7
11
|
configurable: true,
|
|
8
|
-
set: (
|
|
12
|
+
set: __exportSetter.bind(all, name)
|
|
9
13
|
});
|
|
10
14
|
};
|
|
11
15
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __returnValue = (v) => v;
|
|
3
|
+
function __exportSetter(name, newValue) {
|
|
4
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
5
|
+
}
|
|
2
6
|
var __export = (target, all) => {
|
|
3
7
|
for (var name in all)
|
|
4
8
|
__defProp(target, name, {
|
|
5
9
|
get: all[name],
|
|
6
10
|
enumerable: true,
|
|
7
11
|
configurable: true,
|
|
8
|
-
set: (
|
|
12
|
+
set: __exportSetter.bind(all, name)
|
|
9
13
|
});
|
|
10
14
|
};
|
|
11
15
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __returnValue = (v) => v;
|
|
3
|
+
function __exportSetter(name, newValue) {
|
|
4
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
5
|
+
}
|
|
2
6
|
var __export = (target, all) => {
|
|
3
7
|
for (var name in all)
|
|
4
8
|
__defProp(target, name, {
|
|
5
9
|
get: all[name],
|
|
6
10
|
enumerable: true,
|
|
7
11
|
configurable: true,
|
|
8
|
-
set: (
|
|
12
|
+
set: __exportSetter.bind(all, name)
|
|
9
13
|
});
|
|
10
14
|
};
|
|
11
15
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -11243,7 +11247,7 @@ function finalize(ctx, schema) {
|
|
|
11243
11247
|
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
11244
11248
|
} else if (ctx.target === "draft-04") {
|
|
11245
11249
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
11246
|
-
} else if (ctx.target === "openapi-3.0") {}
|
|
11250
|
+
} else if (ctx.target === "openapi-3.0") {}
|
|
11247
11251
|
if (ctx.external?.uri) {
|
|
11248
11252
|
const id = ctx.external.registry.get(schema)?.id;
|
|
11249
11253
|
if (!id)
|
|
@@ -11504,7 +11508,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
11504
11508
|
if (val === undefined) {
|
|
11505
11509
|
if (ctx.unrepresentable === "throw") {
|
|
11506
11510
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
11507
|
-
}
|
|
11511
|
+
}
|
|
11508
11512
|
} else if (typeof val === "bigint") {
|
|
11509
11513
|
if (ctx.unrepresentable === "throw") {
|
|
11510
11514
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amritk/adapters",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Convert schemas from external libraries (TypeBox, Zod, ...) into JSON Schema for mjst.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"build:types": "tsc -p ."
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"json-schema-typed": "
|
|
41
|
-
"@amritk/helpers": "
|
|
40
|
+
"json-schema-typed": "^8.0.1",
|
|
41
|
+
"@amritk/helpers": "0.5.0"
|
|
42
42
|
},
|
|
43
43
|
"exports": {
|
|
44
44
|
"./package.json": "./package.json",
|