@kubb/plugin-ts 3.6.0 → 3.6.1
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/{chunk-ULWNGDG4.js → chunk-2WAGTL4H.js} +92 -99
- package/dist/chunk-2WAGTL4H.js.map +1 -0
- package/dist/{chunk-4SOGPJKA.cjs → chunk-46QPECUV.cjs} +21 -21
- package/dist/{chunk-4SOGPJKA.cjs.map → chunk-46QPECUV.cjs.map} +1 -1
- package/dist/{chunk-6TOW4T6P.js → chunk-AYA2SL3G.js} +18 -18
- package/dist/{chunk-6TOW4T6P.js.map → chunk-AYA2SL3G.js.map} +1 -1
- package/dist/{chunk-BORNH5HV.cjs → chunk-TBG2ENOI.cjs} +92 -99
- package/dist/chunk-TBG2ENOI.cjs.map +1 -0
- package/dist/components.cjs +3 -3
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/generators.cjs +4 -4
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{types-BJ5UjIUu.d.cts → types-D1yD2jvM.d.cts} +2 -2
- package/dist/{types-BJ5UjIUu.d.ts → types-D1yD2jvM.d.ts} +2 -2
- package/package.json +10 -10
- package/src/generators/__snapshots__/enumArray.ts +2 -14
- package/src/generators/__snapshots__/enumArray20.ts +15 -0
- package/dist/chunk-BORNH5HV.cjs.map +0 -1
- package/dist/chunk-ULWNGDG4.js.map +0 -1
|
@@ -35,9 +35,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
35
35
|
mod
|
|
36
36
|
));
|
|
37
37
|
|
|
38
|
-
// ../../node_modules/.pnpm/tsup@8.
|
|
38
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.0_@types+node@20.17.19__jiti@2.4.2_postcss@8.5.3_typescript@5.7.3_yaml@2.6.1/node_modules/tsup/assets/esm_shims.js
|
|
39
39
|
var init_esm_shims = __esm({
|
|
40
|
-
"../../node_modules/.pnpm/tsup@8.
|
|
40
|
+
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.0_@types+node@20.17.19__jiti@2.4.2_postcss@8.5.3_typescript@5.7.3_yaml@2.6.1/node_modules/tsup/assets/esm_shims.js"() {
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
|
|
@@ -103,14 +103,14 @@ var require_react_production_min = __commonJS({
|
|
|
103
103
|
var L = { key: true, ref: true, __self: true, __source: true };
|
|
104
104
|
function M(a, b, e) {
|
|
105
105
|
var d, c = {}, k = null, h = null;
|
|
106
|
-
if (null != b) for (d in
|
|
106
|
+
if (null != b) for (d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b) J.call(b, d) && !L.hasOwnProperty(d) && (c[d] = b[d]);
|
|
107
107
|
var g = arguments.length - 2;
|
|
108
108
|
if (1 === g) c.children = e;
|
|
109
109
|
else if (1 < g) {
|
|
110
110
|
for (var f = Array(g), m = 0; m < g; m++) f[m] = arguments[m + 2];
|
|
111
111
|
c.children = f;
|
|
112
112
|
}
|
|
113
|
-
if (a && a.defaultProps) for (d in g = a.defaultProps, g)
|
|
113
|
+
if (a && a.defaultProps) for (d in g = a.defaultProps, g) void 0 === c[d] && (c[d] = g[d]);
|
|
114
114
|
return { $$typeof: l, type: a, key: k, ref: h, props: c, _owner: K.current };
|
|
115
115
|
}
|
|
116
116
|
function N(a, b) {
|
|
@@ -215,13 +215,13 @@ var require_react_production_min = __commonJS({
|
|
|
215
215
|
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W;
|
|
216
216
|
exports.act = X;
|
|
217
217
|
exports.cloneElement = function(a, b, e) {
|
|
218
|
-
if (null === a ||
|
|
218
|
+
if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + ".");
|
|
219
219
|
var d = C({}, a.props), c = a.key, k = a.ref, h = a._owner;
|
|
220
220
|
if (null != b) {
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
void 0 !== b.ref && (k = b.ref, h = K.current);
|
|
222
|
+
void 0 !== b.key && (c = "" + b.key);
|
|
223
223
|
if (a.type && a.type.defaultProps) var g = a.type.defaultProps;
|
|
224
|
-
for (f in b) J.call(b, f) && !L.hasOwnProperty(f) && (d[f] =
|
|
224
|
+
for (f in b) J.call(b, f) && !L.hasOwnProperty(f) && (d[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]);
|
|
225
225
|
}
|
|
226
226
|
var f = arguments.length - 2;
|
|
227
227
|
if (1 === f) d.children = e;
|
|
@@ -254,7 +254,7 @@ var require_react_production_min = __commonJS({
|
|
|
254
254
|
return { $$typeof: y, _payload: { _status: -1, _result: a }, _init: T };
|
|
255
255
|
};
|
|
256
256
|
exports.memo = function(a, b) {
|
|
257
|
-
return { $$typeof: x, type: a, compare:
|
|
257
|
+
return { $$typeof: x, type: a, compare: void 0 === b ? null : b };
|
|
258
258
|
};
|
|
259
259
|
exports.startTransition = function(a) {
|
|
260
260
|
var b = V.transition;
|
|
@@ -551,7 +551,7 @@ var require_react_development = __commonJS({
|
|
|
551
551
|
Object.defineProperty(Component.prototype, methodName, {
|
|
552
552
|
get: function() {
|
|
553
553
|
warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
|
|
554
|
-
return
|
|
554
|
+
return void 0;
|
|
555
555
|
}
|
|
556
556
|
});
|
|
557
557
|
};
|
|
@@ -705,7 +705,7 @@ var require_react_development = __commonJS({
|
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
return config.ref !==
|
|
708
|
+
return config.ref !== void 0;
|
|
709
709
|
}
|
|
710
710
|
function hasValidKey(config) {
|
|
711
711
|
{
|
|
@@ -716,7 +716,7 @@ var require_react_development = __commonJS({
|
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
|
-
return config.key !==
|
|
719
|
+
return config.key !== void 0;
|
|
720
720
|
}
|
|
721
721
|
function defineKeyPropWarningGetter(props, displayName) {
|
|
722
722
|
var warnAboutAccessingKey = function() {
|
|
@@ -818,8 +818,8 @@ var require_react_development = __commonJS({
|
|
|
818
818
|
}
|
|
819
819
|
key = "" + config.key;
|
|
820
820
|
}
|
|
821
|
-
self = config.__self ===
|
|
822
|
-
source = config.__source ===
|
|
821
|
+
self = config.__self === void 0 ? null : config.__self;
|
|
822
|
+
source = config.__source === void 0 ? null : config.__source;
|
|
823
823
|
for (propName in config) {
|
|
824
824
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
825
825
|
props[propName] = config[propName];
|
|
@@ -844,7 +844,7 @@ var require_react_development = __commonJS({
|
|
|
844
844
|
if (type && type.defaultProps) {
|
|
845
845
|
var defaultProps = type.defaultProps;
|
|
846
846
|
for (propName in defaultProps) {
|
|
847
|
-
if (props[propName] ===
|
|
847
|
+
if (props[propName] === void 0) {
|
|
848
848
|
props[propName] = defaultProps[propName];
|
|
849
849
|
}
|
|
850
850
|
}
|
|
@@ -867,7 +867,7 @@ var require_react_development = __commonJS({
|
|
|
867
867
|
return newElement;
|
|
868
868
|
}
|
|
869
869
|
function cloneElement(element, config, children) {
|
|
870
|
-
if (element === null || element ===
|
|
870
|
+
if (element === null || element === void 0) {
|
|
871
871
|
throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
|
872
872
|
}
|
|
873
873
|
var propName;
|
|
@@ -894,7 +894,7 @@ var require_react_development = __commonJS({
|
|
|
894
894
|
}
|
|
895
895
|
for (propName in config) {
|
|
896
896
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
897
|
-
if (config[propName] ===
|
|
897
|
+
if (config[propName] === void 0 && defaultProps !== void 0) {
|
|
898
898
|
props[propName] = defaultProps[propName];
|
|
899
899
|
} else {
|
|
900
900
|
props[propName] = config[propName];
|
|
@@ -1200,7 +1200,7 @@ var require_react_development = __commonJS({
|
|
|
1200
1200
|
if (payload._status === Resolved) {
|
|
1201
1201
|
var moduleObject = payload._result;
|
|
1202
1202
|
{
|
|
1203
|
-
if (moduleObject ===
|
|
1203
|
+
if (moduleObject === void 0) {
|
|
1204
1204
|
error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject);
|
|
1205
1205
|
}
|
|
1206
1206
|
}
|
|
@@ -1314,7 +1314,7 @@ var require_react_development = __commonJS({
|
|
|
1314
1314
|
// types supported by any Flight configuration anywhere since
|
|
1315
1315
|
// we don't know which Flight build this will end up being used
|
|
1316
1316
|
// with.
|
|
1317
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !==
|
|
1317
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
1318
1318
|
return true;
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
@@ -1329,7 +1329,7 @@ var require_react_development = __commonJS({
|
|
|
1329
1329
|
var elementType = {
|
|
1330
1330
|
$$typeof: REACT_MEMO_TYPE,
|
|
1331
1331
|
type,
|
|
1332
|
-
compare: compare ===
|
|
1332
|
+
compare: compare === void 0 ? null : compare
|
|
1333
1333
|
};
|
|
1334
1334
|
{
|
|
1335
1335
|
var ownName;
|
|
@@ -1361,7 +1361,7 @@ var require_react_development = __commonJS({
|
|
|
1361
1361
|
function useContext(Context) {
|
|
1362
1362
|
var dispatcher = resolveDispatcher();
|
|
1363
1363
|
{
|
|
1364
|
-
if (Context._context !==
|
|
1364
|
+
if (Context._context !== void 0) {
|
|
1365
1365
|
var realContext = Context._context;
|
|
1366
1366
|
if (realContext.Consumer === Context) {
|
|
1367
1367
|
error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");
|
|
@@ -1512,7 +1512,7 @@ var require_react_development = __commonJS({
|
|
|
1512
1512
|
var prefix;
|
|
1513
1513
|
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
1514
1514
|
{
|
|
1515
|
-
if (prefix ===
|
|
1515
|
+
if (prefix === void 0) {
|
|
1516
1516
|
try {
|
|
1517
1517
|
throw Error();
|
|
1518
1518
|
} catch (x) {
|
|
@@ -1535,14 +1535,14 @@ var require_react_development = __commonJS({
|
|
|
1535
1535
|
}
|
|
1536
1536
|
{
|
|
1537
1537
|
var frame = componentFrameCache.get(fn);
|
|
1538
|
-
if (frame !==
|
|
1538
|
+
if (frame !== void 0) {
|
|
1539
1539
|
return frame;
|
|
1540
1540
|
}
|
|
1541
1541
|
}
|
|
1542
1542
|
var control;
|
|
1543
1543
|
reentry = true;
|
|
1544
1544
|
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
1545
|
-
Error.prepareStackTrace =
|
|
1545
|
+
Error.prepareStackTrace = void 0;
|
|
1546
1546
|
var previousDispatcher;
|
|
1547
1547
|
{
|
|
1548
1548
|
previousDispatcher = ReactCurrentDispatcher$1.current;
|
|
@@ -1696,7 +1696,7 @@ var require_react_development = __commonJS({
|
|
|
1696
1696
|
var has = Function.call.bind(hasOwnProperty);
|
|
1697
1697
|
for (var typeSpecName in typeSpecs) {
|
|
1698
1698
|
if (has(typeSpecs, typeSpecName)) {
|
|
1699
|
-
var error$1 =
|
|
1699
|
+
var error$1 = void 0;
|
|
1700
1700
|
try {
|
|
1701
1701
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
1702
1702
|
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
@@ -1747,7 +1747,7 @@ var require_react_development = __commonJS({
|
|
|
1747
1747
|
return "";
|
|
1748
1748
|
}
|
|
1749
1749
|
function getSourceInfoErrorAddendum(source) {
|
|
1750
|
-
if (source !==
|
|
1750
|
+
if (source !== void 0) {
|
|
1751
1751
|
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
1752
1752
|
var lineNumber = source.lineNumber;
|
|
1753
1753
|
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
@@ -1755,7 +1755,7 @@ var require_react_development = __commonJS({
|
|
|
1755
1755
|
return "";
|
|
1756
1756
|
}
|
|
1757
1757
|
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
1758
|
-
if (elementProps !== null && elementProps !==
|
|
1758
|
+
if (elementProps !== null && elementProps !== void 0) {
|
|
1759
1759
|
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
1760
1760
|
}
|
|
1761
1761
|
return "";
|
|
@@ -1824,7 +1824,7 @@ var require_react_development = __commonJS({
|
|
|
1824
1824
|
function validatePropTypes(element) {
|
|
1825
1825
|
{
|
|
1826
1826
|
var type = element.type;
|
|
1827
|
-
if (type === null || type ===
|
|
1827
|
+
if (type === null || type === void 0 || typeof type === "string") {
|
|
1828
1828
|
return;
|
|
1829
1829
|
}
|
|
1830
1830
|
var propTypes;
|
|
@@ -1840,7 +1840,7 @@ var require_react_development = __commonJS({
|
|
|
1840
1840
|
if (propTypes) {
|
|
1841
1841
|
var name = getComponentNameFromType(type);
|
|
1842
1842
|
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
1843
|
-
} else if (type.PropTypes !==
|
|
1843
|
+
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
1844
1844
|
propTypesMisspellWarningShown = true;
|
|
1845
1845
|
var _name = getComponentNameFromType(type);
|
|
1846
1846
|
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
@@ -1873,7 +1873,7 @@ var require_react_development = __commonJS({
|
|
|
1873
1873
|
var validType = isValidElementType(type);
|
|
1874
1874
|
if (!validType) {
|
|
1875
1875
|
var info = "";
|
|
1876
|
-
if (type ===
|
|
1876
|
+
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
1877
1877
|
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
1878
1878
|
}
|
|
1879
1879
|
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
@@ -1887,7 +1887,7 @@ var require_react_development = __commonJS({
|
|
|
1887
1887
|
typeString = "null";
|
|
1888
1888
|
} else if (isArray(type)) {
|
|
1889
1889
|
typeString = "array";
|
|
1890
|
-
} else if (type !==
|
|
1890
|
+
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1891
1891
|
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
1892
1892
|
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
1893
1893
|
} else {
|
|
@@ -1985,7 +1985,7 @@ var require_react_development = __commonJS({
|
|
|
1985
1985
|
}
|
|
1986
1986
|
var channel = new MessageChannel();
|
|
1987
1987
|
channel.port1.onmessage = callback;
|
|
1988
|
-
channel.port2.postMessage(
|
|
1988
|
+
channel.port2.postMessage(void 0);
|
|
1989
1989
|
};
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
@@ -2206,7 +2206,7 @@ init_esm_shims();
|
|
|
2206
2206
|
init_esm_shims();
|
|
2207
2207
|
function OasType({ name, typeName, api }) {
|
|
2208
2208
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2209
|
-
/* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: `export const ${name} = ${JSON.stringify(api,
|
|
2209
|
+
/* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: `export const ${name} = ${JSON.stringify(api, void 0, 2)} as const` }),
|
|
2210
2210
|
/* @__PURE__ */ jsx("br", {}),
|
|
2211
2211
|
/* @__PURE__ */ jsx(File.Source, { name: typeName, isExportable: true, isIndexable: true, isTypeOnly: true, children: /* @__PURE__ */ jsx(Type, { name: typeName, export: true, children: `Infer<typeof ${name}>` }) })
|
|
2212
2212
|
] });
|
|
@@ -2232,30 +2232,30 @@ var typeKeywordMapper = {
|
|
|
2232
2232
|
string: () => factory.keywordTypeNodes.string,
|
|
2233
2233
|
boolean: () => factory.keywordTypeNodes.boolean,
|
|
2234
2234
|
undefined: () => factory.keywordTypeNodes.undefined,
|
|
2235
|
-
nullable:
|
|
2235
|
+
nullable: void 0,
|
|
2236
2236
|
null: () => factory.keywordTypeNodes.null,
|
|
2237
|
-
nullish:
|
|
2237
|
+
nullish: void 0,
|
|
2238
2238
|
array: (nodes) => {
|
|
2239
2239
|
if (!nodes) {
|
|
2240
|
-
return
|
|
2240
|
+
return void 0;
|
|
2241
2241
|
}
|
|
2242
2242
|
return factory.createArrayDeclaration({ nodes });
|
|
2243
2243
|
},
|
|
2244
2244
|
tuple: (nodes) => {
|
|
2245
2245
|
if (!nodes) {
|
|
2246
|
-
return
|
|
2246
|
+
return void 0;
|
|
2247
2247
|
}
|
|
2248
2248
|
return factory.createTupleTypeNode(nodes);
|
|
2249
2249
|
},
|
|
2250
2250
|
enum: (name) => {
|
|
2251
2251
|
if (!name) {
|
|
2252
|
-
return
|
|
2252
|
+
return void 0;
|
|
2253
2253
|
}
|
|
2254
|
-
return factory.createTypeReferenceNode(name,
|
|
2254
|
+
return factory.createTypeReferenceNode(name, void 0);
|
|
2255
2255
|
},
|
|
2256
2256
|
union: (nodes) => {
|
|
2257
2257
|
if (!nodes) {
|
|
2258
|
-
return
|
|
2258
|
+
return void 0;
|
|
2259
2259
|
}
|
|
2260
2260
|
return factory.createUnionDeclaration({
|
|
2261
2261
|
withParentheses: true,
|
|
@@ -2264,7 +2264,7 @@ var typeKeywordMapper = {
|
|
|
2264
2264
|
},
|
|
2265
2265
|
const: (name, format) => {
|
|
2266
2266
|
if (!name) {
|
|
2267
|
-
return
|
|
2267
|
+
return void 0;
|
|
2268
2268
|
}
|
|
2269
2269
|
if (format === "boolean") {
|
|
2270
2270
|
if (name === true) {
|
|
@@ -2282,58 +2282,58 @@ var typeKeywordMapper = {
|
|
|
2282
2282
|
time: (type = "string") => type === "string" ? factory.keywordTypeNodes.string : factory.createTypeReferenceNode(factory.createIdentifier("Date")),
|
|
2283
2283
|
uuid: () => factory.keywordTypeNodes.string,
|
|
2284
2284
|
url: () => factory.keywordTypeNodes.string,
|
|
2285
|
-
strict:
|
|
2286
|
-
default:
|
|
2285
|
+
strict: void 0,
|
|
2286
|
+
default: void 0,
|
|
2287
2287
|
and: (nodes) => {
|
|
2288
2288
|
if (!nodes) {
|
|
2289
|
-
return
|
|
2289
|
+
return void 0;
|
|
2290
2290
|
}
|
|
2291
2291
|
return factory.createIntersectionDeclaration({
|
|
2292
2292
|
withParentheses: true,
|
|
2293
2293
|
nodes
|
|
2294
2294
|
});
|
|
2295
2295
|
},
|
|
2296
|
-
describe:
|
|
2297
|
-
min:
|
|
2298
|
-
max:
|
|
2299
|
-
optional:
|
|
2296
|
+
describe: void 0,
|
|
2297
|
+
min: void 0,
|
|
2298
|
+
max: void 0,
|
|
2299
|
+
optional: void 0,
|
|
2300
2300
|
matches: () => factory.keywordTypeNodes.string,
|
|
2301
2301
|
email: () => factory.keywordTypeNodes.string,
|
|
2302
|
-
firstName:
|
|
2303
|
-
lastName:
|
|
2304
|
-
password:
|
|
2305
|
-
phone:
|
|
2306
|
-
readOnly:
|
|
2307
|
-
writeOnly:
|
|
2302
|
+
firstName: void 0,
|
|
2303
|
+
lastName: void 0,
|
|
2304
|
+
password: void 0,
|
|
2305
|
+
phone: void 0,
|
|
2306
|
+
readOnly: void 0,
|
|
2307
|
+
writeOnly: void 0,
|
|
2308
2308
|
ref: (propertyName) => {
|
|
2309
2309
|
if (!propertyName) {
|
|
2310
|
-
return
|
|
2310
|
+
return void 0;
|
|
2311
2311
|
}
|
|
2312
|
-
return factory.createTypeReferenceNode(propertyName,
|
|
2312
|
+
return factory.createTypeReferenceNode(propertyName, void 0);
|
|
2313
2313
|
},
|
|
2314
2314
|
blob: () => factory.createTypeReferenceNode("Blob", []),
|
|
2315
|
-
deprecated:
|
|
2316
|
-
example:
|
|
2317
|
-
schema:
|
|
2318
|
-
catchall:
|
|
2319
|
-
name:
|
|
2315
|
+
deprecated: void 0,
|
|
2316
|
+
example: void 0,
|
|
2317
|
+
schema: void 0,
|
|
2318
|
+
catchall: void 0,
|
|
2319
|
+
name: void 0
|
|
2320
2320
|
};
|
|
2321
2321
|
function parse({ current, siblings }, options) {
|
|
2322
2322
|
const value = typeKeywordMapper[current.keyword];
|
|
2323
2323
|
if (!value) {
|
|
2324
|
-
return
|
|
2324
|
+
return void 0;
|
|
2325
2325
|
}
|
|
2326
2326
|
if (isKeyword(current, schemaKeywords.union)) {
|
|
2327
2327
|
return typeKeywordMapper.union(
|
|
2328
|
-
current.args.map((schema) => parse({
|
|
2328
|
+
current.args.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
|
|
2329
2329
|
);
|
|
2330
2330
|
}
|
|
2331
2331
|
if (isKeyword(current, schemaKeywords.and)) {
|
|
2332
|
-
return typeKeywordMapper.and(current.args.map((schema) => parse({
|
|
2332
|
+
return typeKeywordMapper.and(current.args.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean));
|
|
2333
2333
|
}
|
|
2334
2334
|
if (isKeyword(current, schemaKeywords.array)) {
|
|
2335
2335
|
return typeKeywordMapper.array(
|
|
2336
|
-
current.args.items.map((schema) => parse({
|
|
2336
|
+
current.args.items.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
|
|
2337
2337
|
);
|
|
2338
2338
|
}
|
|
2339
2339
|
if (isKeyword(current, schemaKeywords.enum)) {
|
|
@@ -2347,7 +2347,7 @@ function parse({ current, siblings }, options) {
|
|
|
2347
2347
|
}
|
|
2348
2348
|
if (isKeyword(current, schemaKeywords.tuple)) {
|
|
2349
2349
|
return typeKeywordMapper.tuple(
|
|
2350
|
-
current.args.items.map((schema) => parse({
|
|
2350
|
+
current.args.items.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
|
|
2351
2351
|
);
|
|
2352
2352
|
}
|
|
2353
2353
|
if (isKeyword(current, schemaKeywords.const)) {
|
|
@@ -2375,7 +2375,7 @@ function parse({ current, siblings }, options) {
|
|
|
2375
2375
|
const minSchema = schemas.find((schema) => schema.keyword === schemaKeywords.min);
|
|
2376
2376
|
const maxSchema = schemas.find((schema) => schema.keyword === schemaKeywords.max);
|
|
2377
2377
|
const matchesSchema = schemas.find((schema) => schema.keyword === schemaKeywords.matches);
|
|
2378
|
-
let type = schemas.map((schema) => parse({
|
|
2378
|
+
let type = schemas.map((schema) => parse({ current: schema, siblings: schemas }, options)).filter(Boolean)[0];
|
|
2379
2379
|
if (isNullable) {
|
|
2380
2380
|
type = factory.createUnionDeclaration({
|
|
2381
2381
|
nodes: [type, factory.keywordTypeNodes.null]
|
|
@@ -2400,20 +2400,20 @@ function parse({ current, siblings }, options) {
|
|
|
2400
2400
|
return factory.appendJSDocToNode({
|
|
2401
2401
|
node: propertySignature,
|
|
2402
2402
|
comments: [
|
|
2403
|
-
describeSchema ? `@description ${transformers2.jsStringEscape(describeSchema.args)}` :
|
|
2404
|
-
deprecatedSchema ? "@deprecated" :
|
|
2405
|
-
minSchema ? `@minLength ${minSchema.args}` :
|
|
2406
|
-
maxSchema ? `@maxLength ${maxSchema.args}` :
|
|
2407
|
-
matchesSchema ? `@pattern ${matchesSchema.args}` :
|
|
2408
|
-
defaultSchema ? `@default ${defaultSchema.args}` :
|
|
2409
|
-
exampleSchema ? `@example ${exampleSchema.args}` :
|
|
2410
|
-
schemaSchema?.args?.type || schemaSchema?.args?.format ? [`@type ${schemaSchema?.args?.type || "unknown"}${!isOptional ? "" : " | undefined"}`, schemaSchema?.args?.format].filter(Boolean).join(", ") :
|
|
2403
|
+
describeSchema ? `@description ${transformers2.jsStringEscape(describeSchema.args)}` : void 0,
|
|
2404
|
+
deprecatedSchema ? "@deprecated" : void 0,
|
|
2405
|
+
minSchema ? `@minLength ${minSchema.args}` : void 0,
|
|
2406
|
+
maxSchema ? `@maxLength ${maxSchema.args}` : void 0,
|
|
2407
|
+
matchesSchema ? `@pattern ${matchesSchema.args}` : void 0,
|
|
2408
|
+
defaultSchema ? `@default ${defaultSchema.args}` : void 0,
|
|
2409
|
+
exampleSchema ? `@example ${exampleSchema.args}` : void 0,
|
|
2410
|
+
schemaSchema?.args?.type || schemaSchema?.args?.format ? [`@type ${schemaSchema?.args?.type || "unknown"}${!isOptional ? "" : " | undefined"}`, schemaSchema?.args?.format].filter(Boolean).join(", ") : void 0
|
|
2411
2411
|
].filter(Boolean)
|
|
2412
2412
|
});
|
|
2413
2413
|
});
|
|
2414
2414
|
const additionalProperties = current.args?.additionalProperties?.length ? factory.createIndexSignature(
|
|
2415
|
-
current.args.additionalProperties.map((schema) => parse({
|
|
2416
|
-
) :
|
|
2415
|
+
current.args.additionalProperties.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean).at(0)
|
|
2416
|
+
) : void 0;
|
|
2417
2417
|
return typeKeywordMapper.object([...properties, additionalProperties].filter(Boolean));
|
|
2418
2418
|
}
|
|
2419
2419
|
if (isKeyword(current, schemaKeywords.datetime)) {
|
|
@@ -2428,7 +2428,7 @@ function parse({ current, siblings }, options) {
|
|
|
2428
2428
|
if (current.keyword in typeKeywordMapper) {
|
|
2429
2429
|
return value();
|
|
2430
2430
|
}
|
|
2431
|
-
return
|
|
2431
|
+
return void 0;
|
|
2432
2432
|
}
|
|
2433
2433
|
function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntaxType, enumType, mapper, description }) {
|
|
2434
2434
|
const typeNodes = [];
|
|
@@ -2438,17 +2438,10 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2438
2438
|
const schemaFromTree = tree.find((item) => item.keyword === schemaKeywords.schema);
|
|
2439
2439
|
let type = tree.map(
|
|
2440
2440
|
(current, _index, siblings) => parse(
|
|
2441
|
-
{
|
|
2441
|
+
{ current, siblings },
|
|
2442
2442
|
{
|
|
2443
|
-
name,
|
|
2444
|
-
typedName,
|
|
2445
|
-
description,
|
|
2446
|
-
keysToOmit,
|
|
2447
2443
|
optionalType,
|
|
2448
|
-
|
|
2449
|
-
mapper,
|
|
2450
|
-
syntaxType
|
|
2451
|
-
}
|
|
2444
|
+
mapper}
|
|
2452
2445
|
)
|
|
2453
2446
|
).filter(Boolean).at(0) || typeKeywordMapper.undefined();
|
|
2454
2447
|
if (schemaFromTree && isKeyword(schemaFromTree, schemaKeywords.schema) && schemaFromTree.args.type !== "object") {
|
|
@@ -2483,13 +2476,13 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2483
2476
|
}) : type,
|
|
2484
2477
|
syntax: useTypeGeneration ? "type" : "interface",
|
|
2485
2478
|
comments: [
|
|
2486
|
-
description ? `@description ${transformers2.jsStringEscape(description)}` :
|
|
2487
|
-
schema.deprecated ? "@deprecated" :
|
|
2488
|
-
schema.minLength ? `@minLength ${schema.minLength}` :
|
|
2489
|
-
schema.maxLength ? `@maxLength ${schema.maxLength}` :
|
|
2490
|
-
schema.pattern ? `@pattern ${schema.pattern}` :
|
|
2491
|
-
schema.default ? `@default ${schema.default}` :
|
|
2492
|
-
schema.example ? `@example ${schema.example}` :
|
|
2479
|
+
description ? `@description ${transformers2.jsStringEscape(description)}` : void 0,
|
|
2480
|
+
schema.deprecated ? "@deprecated" : void 0,
|
|
2481
|
+
schema.minLength ? `@minLength ${schema.minLength}` : void 0,
|
|
2482
|
+
schema.maxLength ? `@maxLength ${schema.maxLength}` : void 0,
|
|
2483
|
+
schema.pattern ? `@pattern ${schema.pattern}` : void 0,
|
|
2484
|
+
schema.default ? `@default ${schema.default}` : void 0,
|
|
2485
|
+
schema.example ? `@example ${schema.example}` : void 0
|
|
2493
2486
|
]
|
|
2494
2487
|
})
|
|
2495
2488
|
);
|
|
@@ -2500,7 +2493,7 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2500
2493
|
const [nameNode, typeNode] = factory.createEnumDeclaration({
|
|
2501
2494
|
name: name2,
|
|
2502
2495
|
typeName,
|
|
2503
|
-
enums: enumSchema.args.items.map((item) => item.value ===
|
|
2496
|
+
enums: enumSchema.args.items.map((item) => item.value === void 0 ? void 0 : [transformers2.trimQuotes(item.name?.toString()), item.value]).filter(Boolean),
|
|
2504
2497
|
type: enumType
|
|
2505
2498
|
});
|
|
2506
2499
|
return {
|
|
@@ -2520,8 +2513,8 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2520
2513
|
{
|
|
2521
2514
|
name: typeName,
|
|
2522
2515
|
isIndexable: true,
|
|
2523
|
-
isExportable: ["enum", "asConst", "constEnum", "literal",
|
|
2524
|
-
isTypeOnly: ["asConst", "constEnum", "literal",
|
|
2516
|
+
isExportable: ["enum", "asConst", "constEnum", "literal", void 0].includes(enumType),
|
|
2517
|
+
isTypeOnly: ["asConst", "constEnum", "literal", void 0].includes(enumType),
|
|
2525
2518
|
children: print([typeNode])
|
|
2526
2519
|
}
|
|
2527
2520
|
)
|
|
@@ -2556,5 +2549,5 @@ react/cjs/react.development.js:
|
|
|
2556
2549
|
*/
|
|
2557
2550
|
|
|
2558
2551
|
export { OasType, Type2 as Type, init_esm_shims };
|
|
2559
|
-
//# sourceMappingURL=chunk-
|
|
2560
|
-
//# sourceMappingURL=chunk-
|
|
2552
|
+
//# sourceMappingURL=chunk-2WAGTL4H.js.map
|
|
2553
|
+
//# sourceMappingURL=chunk-2WAGTL4H.js.map
|