skilld 1.5.2 → 1.5.4
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/THIRD-PARTY-LICENSES.md +38 -0
- package/dist/_chunks/agent.mjs +281 -147
- package/dist/_chunks/agent.mjs.map +1 -1
- package/dist/_chunks/assemble.mjs +2 -1
- package/dist/_chunks/assemble.mjs.map +1 -1
- package/dist/_chunks/author.mjs +26 -2
- package/dist/_chunks/author.mjs.map +1 -1
- package/dist/_chunks/cli-helpers.mjs +22 -5
- package/dist/_chunks/cli-helpers.mjs.map +1 -1
- package/dist/_chunks/cli-helpers2.mjs +2 -1
- package/dist/_chunks/index3.d.mts.map +1 -1
- package/dist/_chunks/install.mjs +6 -2
- package/dist/_chunks/install.mjs.map +1 -1
- package/dist/_chunks/libs/@sinclair/typebox.mjs +2748 -0
- package/dist/_chunks/libs/@sinclair/typebox.mjs.map +1 -0
- package/dist/_chunks/list.mjs +2 -1
- package/dist/_chunks/list.mjs.map +1 -1
- package/dist/_chunks/prepare2.mjs +2 -1
- package/dist/_chunks/prepare2.mjs.map +1 -1
- package/dist/_chunks/prompts.mjs +10 -15
- package/dist/_chunks/prompts.mjs.map +1 -1
- package/dist/_chunks/rolldown-runtime.mjs +13 -0
- package/dist/_chunks/sanitize.mjs +3 -0
- package/dist/_chunks/sanitize.mjs.map +1 -1
- package/dist/_chunks/search-interactive.mjs +2 -1
- package/dist/_chunks/search-interactive.mjs.map +1 -1
- package/dist/_chunks/search.mjs +2 -1
- package/dist/_chunks/setup.mjs +2 -1
- package/dist/_chunks/setup.mjs.map +1 -1
- package/dist/_chunks/sources.mjs +20 -7
- package/dist/_chunks/sources.mjs.map +1 -1
- package/dist/_chunks/sync-shared.mjs +2 -1
- package/dist/_chunks/sync-shared2.mjs +8 -4
- package/dist/_chunks/sync-shared2.mjs.map +1 -1
- package/dist/_chunks/sync.mjs +1 -1
- package/dist/_chunks/sync2.mjs +2 -1
- package/dist/_chunks/uninstall.mjs +2 -1
- package/dist/_chunks/uninstall.mjs.map +1 -1
- package/dist/_chunks/wizard.mjs +1 -1
- package/dist/agent/index.d.mts.map +1 -1
- package/dist/agent/index.mjs +2 -1
- package/dist/cli.mjs +2 -1
- package/dist/cli.mjs.map +1 -1
- package/package.json +7 -1
|
@@ -0,0 +1,2748 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime.mjs";
|
|
2
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
3
|
+
/** Returns true if this value is an async iterator */
|
|
4
|
+
function IsAsyncIterator$2(value) {
|
|
5
|
+
return IsObject$3(value) && !IsArray$3(value) && !IsUint8Array$2(value) && Symbol.asyncIterator in value;
|
|
6
|
+
}
|
|
7
|
+
/** Returns true if this value is an array */
|
|
8
|
+
function IsArray$3(value) {
|
|
9
|
+
return Array.isArray(value);
|
|
10
|
+
}
|
|
11
|
+
/** Returns true if this value is bigint */
|
|
12
|
+
function IsBigInt$2(value) {
|
|
13
|
+
return typeof value === "bigint";
|
|
14
|
+
}
|
|
15
|
+
/** Returns true if this value is a boolean */
|
|
16
|
+
function IsBoolean$2(value) {
|
|
17
|
+
return typeof value === "boolean";
|
|
18
|
+
}
|
|
19
|
+
/** Returns true if this value is a Date object */
|
|
20
|
+
function IsDate$2(value) {
|
|
21
|
+
return value instanceof globalThis.Date;
|
|
22
|
+
}
|
|
23
|
+
/** Returns true if this value is a function */
|
|
24
|
+
function IsFunction$2(value) {
|
|
25
|
+
return typeof value === "function";
|
|
26
|
+
}
|
|
27
|
+
/** Returns true if this value is an iterator */
|
|
28
|
+
function IsIterator$2(value) {
|
|
29
|
+
return IsObject$3(value) && !IsArray$3(value) && !IsUint8Array$2(value) && Symbol.iterator in value;
|
|
30
|
+
}
|
|
31
|
+
/** Returns true if this value is null */
|
|
32
|
+
function IsNull$2(value) {
|
|
33
|
+
return value === null;
|
|
34
|
+
}
|
|
35
|
+
/** Returns true if this value is number */
|
|
36
|
+
function IsNumber$3(value) {
|
|
37
|
+
return typeof value === "number";
|
|
38
|
+
}
|
|
39
|
+
/** Returns true if this value is an object */
|
|
40
|
+
function IsObject$3(value) {
|
|
41
|
+
return typeof value === "object" && value !== null;
|
|
42
|
+
}
|
|
43
|
+
/** Returns true if this value is RegExp */
|
|
44
|
+
function IsRegExp$2(value) {
|
|
45
|
+
return value instanceof globalThis.RegExp;
|
|
46
|
+
}
|
|
47
|
+
/** Returns true if this value is string */
|
|
48
|
+
function IsString$2(value) {
|
|
49
|
+
return typeof value === "string";
|
|
50
|
+
}
|
|
51
|
+
/** Returns true if this value is symbol */
|
|
52
|
+
function IsSymbol$2(value) {
|
|
53
|
+
return typeof value === "symbol";
|
|
54
|
+
}
|
|
55
|
+
/** Returns true if this value is a Uint8Array */
|
|
56
|
+
function IsUint8Array$2(value) {
|
|
57
|
+
return value instanceof globalThis.Uint8Array;
|
|
58
|
+
}
|
|
59
|
+
/** Returns true if this value is undefined */
|
|
60
|
+
function IsUndefined$3(value) {
|
|
61
|
+
return value === void 0;
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs
|
|
65
|
+
function ArrayType(value) {
|
|
66
|
+
return value.map((value) => Visit$2(value));
|
|
67
|
+
}
|
|
68
|
+
function DateType(value) {
|
|
69
|
+
return new Date(value.getTime());
|
|
70
|
+
}
|
|
71
|
+
function Uint8ArrayType(value) {
|
|
72
|
+
return new Uint8Array(value);
|
|
73
|
+
}
|
|
74
|
+
function RegExpType(value) {
|
|
75
|
+
return new RegExp(value.source, value.flags);
|
|
76
|
+
}
|
|
77
|
+
function ObjectType(value) {
|
|
78
|
+
const result = {};
|
|
79
|
+
for (const key of Object.getOwnPropertyNames(value)) result[key] = Visit$2(value[key]);
|
|
80
|
+
for (const key of Object.getOwnPropertySymbols(value)) result[key] = Visit$2(value[key]);
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
function Visit$2(value) {
|
|
84
|
+
return IsArray$3(value) ? ArrayType(value) : IsDate$2(value) ? DateType(value) : IsUint8Array$2(value) ? Uint8ArrayType(value) : IsRegExp$2(value) ? RegExpType(value) : IsObject$3(value) ? ObjectType(value) : value;
|
|
85
|
+
}
|
|
86
|
+
/** Clones a value */
|
|
87
|
+
function Clone(value) {
|
|
88
|
+
return Visit$2(value);
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
|
|
92
|
+
/** Clones a Type */
|
|
93
|
+
function CloneType(schema, options) {
|
|
94
|
+
return options === void 0 ? Clone(schema) : Clone({
|
|
95
|
+
...options,
|
|
96
|
+
...schema
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
|
|
101
|
+
/** Returns true of this value is an object type */
|
|
102
|
+
function IsObject$2(value) {
|
|
103
|
+
return value !== null && typeof value === "object";
|
|
104
|
+
}
|
|
105
|
+
/** Returns true if this value is an array, but not a typed array */
|
|
106
|
+
function IsArray$2(value) {
|
|
107
|
+
return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value);
|
|
108
|
+
}
|
|
109
|
+
/** Returns true if this value is an undefined */
|
|
110
|
+
function IsUndefined$2(value) {
|
|
111
|
+
return value === void 0;
|
|
112
|
+
}
|
|
113
|
+
/** Returns true if this value is an number */
|
|
114
|
+
function IsNumber$2(value) {
|
|
115
|
+
return typeof value === "number";
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/system/policy.mjs
|
|
119
|
+
var TypeSystemPolicy;
|
|
120
|
+
(function(TypeSystemPolicy) {
|
|
121
|
+
/**
|
|
122
|
+
* Configures the instantiation behavior of TypeBox types. The `default` option assigns raw JavaScript
|
|
123
|
+
* references for embedded types, which may cause side effects if type properties are explicitly updated
|
|
124
|
+
* outside the TypeBox type builder. The `clone` option creates copies of any shared types upon creation,
|
|
125
|
+
* preventing unintended side effects. The `freeze` option applies `Object.freeze()` to the type, making
|
|
126
|
+
* it fully readonly and immutable. Implementations should use `default` whenever possible, as it is the
|
|
127
|
+
* fastest way to instantiate types. The default setting is `default`.
|
|
128
|
+
*/
|
|
129
|
+
TypeSystemPolicy.InstanceMode = "default";
|
|
130
|
+
/** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */
|
|
131
|
+
TypeSystemPolicy.ExactOptionalPropertyTypes = false;
|
|
132
|
+
/** Sets whether arrays should be treated as a kind of objects. The default is `false` */
|
|
133
|
+
TypeSystemPolicy.AllowArrayObject = false;
|
|
134
|
+
/** Sets whether `NaN` or `Infinity` should be treated as valid numeric values. The default is `false` */
|
|
135
|
+
TypeSystemPolicy.AllowNaN = false;
|
|
136
|
+
/** Sets whether `null` should validate for void types. The default is `false` */
|
|
137
|
+
TypeSystemPolicy.AllowNullVoid = false;
|
|
138
|
+
/** Checks this value using the ExactOptionalPropertyTypes policy */
|
|
139
|
+
function IsExactOptionalProperty(value, key) {
|
|
140
|
+
return TypeSystemPolicy.ExactOptionalPropertyTypes ? key in value : value[key] !== void 0;
|
|
141
|
+
}
|
|
142
|
+
TypeSystemPolicy.IsExactOptionalProperty = IsExactOptionalProperty;
|
|
143
|
+
/** Checks this value using the AllowArrayObjects policy */
|
|
144
|
+
function IsObjectLike(value) {
|
|
145
|
+
const isObject = IsObject$2(value);
|
|
146
|
+
return TypeSystemPolicy.AllowArrayObject ? isObject : isObject && !IsArray$2(value);
|
|
147
|
+
}
|
|
148
|
+
TypeSystemPolicy.IsObjectLike = IsObjectLike;
|
|
149
|
+
/** Checks this value as a record using the AllowArrayObjects policy */
|
|
150
|
+
function IsRecordLike(value) {
|
|
151
|
+
return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array);
|
|
152
|
+
}
|
|
153
|
+
TypeSystemPolicy.IsRecordLike = IsRecordLike;
|
|
154
|
+
/** Checks this value using the AllowNaN policy */
|
|
155
|
+
function IsNumberLike(value) {
|
|
156
|
+
return TypeSystemPolicy.AllowNaN ? IsNumber$2(value) : Number.isFinite(value);
|
|
157
|
+
}
|
|
158
|
+
TypeSystemPolicy.IsNumberLike = IsNumberLike;
|
|
159
|
+
/** Checks this value using the AllowVoidNull policy */
|
|
160
|
+
function IsVoidLike(value) {
|
|
161
|
+
const isUndefined = IsUndefined$2(value);
|
|
162
|
+
return TypeSystemPolicy.AllowNullVoid ? isUndefined || value === null : isUndefined;
|
|
163
|
+
}
|
|
164
|
+
TypeSystemPolicy.IsVoidLike = IsVoidLike;
|
|
165
|
+
})(TypeSystemPolicy || (TypeSystemPolicy = {}));
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs
|
|
168
|
+
function ImmutableArray(value) {
|
|
169
|
+
return globalThis.Object.freeze(value).map((value) => Immutable(value));
|
|
170
|
+
}
|
|
171
|
+
function ImmutableDate(value) {
|
|
172
|
+
return value;
|
|
173
|
+
}
|
|
174
|
+
function ImmutableUint8Array(value) {
|
|
175
|
+
return value;
|
|
176
|
+
}
|
|
177
|
+
function ImmutableRegExp(value) {
|
|
178
|
+
return value;
|
|
179
|
+
}
|
|
180
|
+
function ImmutableObject(value) {
|
|
181
|
+
const result = {};
|
|
182
|
+
for (const key of Object.getOwnPropertyNames(value)) result[key] = Immutable(value[key]);
|
|
183
|
+
for (const key of Object.getOwnPropertySymbols(value)) result[key] = Immutable(value[key]);
|
|
184
|
+
return globalThis.Object.freeze(result);
|
|
185
|
+
}
|
|
186
|
+
/** Specialized deep immutable value. Applies freeze recursively to the given value */
|
|
187
|
+
function Immutable(value) {
|
|
188
|
+
return IsArray$3(value) ? ImmutableArray(value) : IsDate$2(value) ? ImmutableDate(value) : IsUint8Array$2(value) ? ImmutableUint8Array(value) : IsRegExp$2(value) ? ImmutableRegExp(value) : IsObject$3(value) ? ImmutableObject(value) : value;
|
|
189
|
+
}
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/create/type.mjs
|
|
192
|
+
/** Creates TypeBox schematics using the configured InstanceMode */
|
|
193
|
+
function CreateType(schema, options) {
|
|
194
|
+
const result = options !== void 0 ? {
|
|
195
|
+
...options,
|
|
196
|
+
...schema
|
|
197
|
+
} : schema;
|
|
198
|
+
switch (TypeSystemPolicy.InstanceMode) {
|
|
199
|
+
case "freeze": return Immutable(result);
|
|
200
|
+
case "clone": return Clone(result);
|
|
201
|
+
default: return result;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
|
|
206
|
+
/** The base Error type thrown for all TypeBox exceptions */
|
|
207
|
+
var TypeBoxError = class extends Error {
|
|
208
|
+
constructor(message) {
|
|
209
|
+
super(message);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs
|
|
214
|
+
/** Symbol key applied to transform types */
|
|
215
|
+
const TransformKind = Symbol.for("TypeBox.Transform");
|
|
216
|
+
/** Symbol key applied to readonly types */
|
|
217
|
+
const ReadonlyKind = Symbol.for("TypeBox.Readonly");
|
|
218
|
+
/** Symbol key applied to optional types */
|
|
219
|
+
const OptionalKind = Symbol.for("TypeBox.Optional");
|
|
220
|
+
/** Symbol key applied to types */
|
|
221
|
+
const Hint = Symbol.for("TypeBox.Hint");
|
|
222
|
+
/** Symbol key applied to types */
|
|
223
|
+
const Kind = Symbol.for("TypeBox.Kind");
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs
|
|
226
|
+
/** `[Kind-Only]` Returns true if this value has a Readonly symbol */
|
|
227
|
+
function IsReadonly(value) {
|
|
228
|
+
return IsObject$3(value) && value[ReadonlyKind] === "Readonly";
|
|
229
|
+
}
|
|
230
|
+
/** `[Kind-Only]` Returns true if this value has a Optional symbol */
|
|
231
|
+
function IsOptional$1(value) {
|
|
232
|
+
return IsObject$3(value) && value[OptionalKind] === "Optional";
|
|
233
|
+
}
|
|
234
|
+
/** `[Kind-Only]` Returns true if the given value is TAny */
|
|
235
|
+
function IsAny$1(value) {
|
|
236
|
+
return IsKindOf$1(value, "Any");
|
|
237
|
+
}
|
|
238
|
+
/** `[Kind-Only]` Returns true if the given value is TArgument */
|
|
239
|
+
function IsArgument$1(value) {
|
|
240
|
+
return IsKindOf$1(value, "Argument");
|
|
241
|
+
}
|
|
242
|
+
/** `[Kind-Only]` Returns true if the given value is TArray */
|
|
243
|
+
function IsArray$1(value) {
|
|
244
|
+
return IsKindOf$1(value, "Array");
|
|
245
|
+
}
|
|
246
|
+
/** `[Kind-Only]` Returns true if the given value is TAsyncIterator */
|
|
247
|
+
function IsAsyncIterator$1(value) {
|
|
248
|
+
return IsKindOf$1(value, "AsyncIterator");
|
|
249
|
+
}
|
|
250
|
+
/** `[Kind-Only]` Returns true if the given value is TBigInt */
|
|
251
|
+
function IsBigInt$1(value) {
|
|
252
|
+
return IsKindOf$1(value, "BigInt");
|
|
253
|
+
}
|
|
254
|
+
/** `[Kind-Only]` Returns true if the given value is TBoolean */
|
|
255
|
+
function IsBoolean$1(value) {
|
|
256
|
+
return IsKindOf$1(value, "Boolean");
|
|
257
|
+
}
|
|
258
|
+
/** `[Kind-Only]` Returns true if the given value is TComputed */
|
|
259
|
+
function IsComputed$1(value) {
|
|
260
|
+
return IsKindOf$1(value, "Computed");
|
|
261
|
+
}
|
|
262
|
+
/** `[Kind-Only]` Returns true if the given value is TConstructor */
|
|
263
|
+
function IsConstructor$1(value) {
|
|
264
|
+
return IsKindOf$1(value, "Constructor");
|
|
265
|
+
}
|
|
266
|
+
/** `[Kind-Only]` Returns true if the given value is TDate */
|
|
267
|
+
function IsDate$1(value) {
|
|
268
|
+
return IsKindOf$1(value, "Date");
|
|
269
|
+
}
|
|
270
|
+
/** `[Kind-Only]` Returns true if the given value is TFunction */
|
|
271
|
+
function IsFunction$1(value) {
|
|
272
|
+
return IsKindOf$1(value, "Function");
|
|
273
|
+
}
|
|
274
|
+
/** `[Kind-Only]` Returns true if the given value is TInteger */
|
|
275
|
+
function IsInteger$1(value) {
|
|
276
|
+
return IsKindOf$1(value, "Integer");
|
|
277
|
+
}
|
|
278
|
+
/** `[Kind-Only]` Returns true if the given value is TIntersect */
|
|
279
|
+
function IsIntersect$1(value) {
|
|
280
|
+
return IsKindOf$1(value, "Intersect");
|
|
281
|
+
}
|
|
282
|
+
/** `[Kind-Only]` Returns true if the given value is TIterator */
|
|
283
|
+
function IsIterator$1(value) {
|
|
284
|
+
return IsKindOf$1(value, "Iterator");
|
|
285
|
+
}
|
|
286
|
+
/** `[Kind-Only]` Returns true if the given value is a TKind with the given name. */
|
|
287
|
+
function IsKindOf$1(value, kind) {
|
|
288
|
+
return IsObject$3(value) && Kind in value && value[Kind] === kind;
|
|
289
|
+
}
|
|
290
|
+
/** `[Kind-Only]` Returns true if the given value is TLiteralValue */
|
|
291
|
+
function IsLiteralValue$1(value) {
|
|
292
|
+
return IsBoolean$2(value) || IsNumber$3(value) || IsString$2(value);
|
|
293
|
+
}
|
|
294
|
+
/** `[Kind-Only]` Returns true if the given value is TLiteral */
|
|
295
|
+
function IsLiteral$1(value) {
|
|
296
|
+
return IsKindOf$1(value, "Literal");
|
|
297
|
+
}
|
|
298
|
+
/** `[Kind-Only]` Returns true if the given value is a TMappedKey */
|
|
299
|
+
function IsMappedKey$1(value) {
|
|
300
|
+
return IsKindOf$1(value, "MappedKey");
|
|
301
|
+
}
|
|
302
|
+
/** `[Kind-Only]` Returns true if the given value is TMappedResult */
|
|
303
|
+
function IsMappedResult$1(value) {
|
|
304
|
+
return IsKindOf$1(value, "MappedResult");
|
|
305
|
+
}
|
|
306
|
+
/** `[Kind-Only]` Returns true if the given value is TNever */
|
|
307
|
+
function IsNever$1(value) {
|
|
308
|
+
return IsKindOf$1(value, "Never");
|
|
309
|
+
}
|
|
310
|
+
/** `[Kind-Only]` Returns true if the given value is TNot */
|
|
311
|
+
function IsNot$1(value) {
|
|
312
|
+
return IsKindOf$1(value, "Not");
|
|
313
|
+
}
|
|
314
|
+
/** `[Kind-Only]` Returns true if the given value is TNull */
|
|
315
|
+
function IsNull$1(value) {
|
|
316
|
+
return IsKindOf$1(value, "Null");
|
|
317
|
+
}
|
|
318
|
+
/** `[Kind-Only]` Returns true if the given value is TNumber */
|
|
319
|
+
function IsNumber$1(value) {
|
|
320
|
+
return IsKindOf$1(value, "Number");
|
|
321
|
+
}
|
|
322
|
+
/** `[Kind-Only]` Returns true if the given value is TObject */
|
|
323
|
+
function IsObject$1(value) {
|
|
324
|
+
return IsKindOf$1(value, "Object");
|
|
325
|
+
}
|
|
326
|
+
/** `[Kind-Only]` Returns true if the given value is TPromise */
|
|
327
|
+
function IsPromise$1(value) {
|
|
328
|
+
return IsKindOf$1(value, "Promise");
|
|
329
|
+
}
|
|
330
|
+
/** `[Kind-Only]` Returns true if the given value is TRecord */
|
|
331
|
+
function IsRecord$1(value) {
|
|
332
|
+
return IsKindOf$1(value, "Record");
|
|
333
|
+
}
|
|
334
|
+
/** `[Kind-Only]` Returns true if the given value is TRef */
|
|
335
|
+
function IsRef$1(value) {
|
|
336
|
+
return IsKindOf$1(value, "Ref");
|
|
337
|
+
}
|
|
338
|
+
/** `[Kind-Only]` Returns true if the given value is TRegExp */
|
|
339
|
+
function IsRegExp$1(value) {
|
|
340
|
+
return IsKindOf$1(value, "RegExp");
|
|
341
|
+
}
|
|
342
|
+
/** `[Kind-Only]` Returns true if the given value is TString */
|
|
343
|
+
function IsString$1(value) {
|
|
344
|
+
return IsKindOf$1(value, "String");
|
|
345
|
+
}
|
|
346
|
+
/** `[Kind-Only]` Returns true if the given value is TSymbol */
|
|
347
|
+
function IsSymbol$1(value) {
|
|
348
|
+
return IsKindOf$1(value, "Symbol");
|
|
349
|
+
}
|
|
350
|
+
/** `[Kind-Only]` Returns true if the given value is TTemplateLiteral */
|
|
351
|
+
function IsTemplateLiteral$1(value) {
|
|
352
|
+
return IsKindOf$1(value, "TemplateLiteral");
|
|
353
|
+
}
|
|
354
|
+
/** `[Kind-Only]` Returns true if the given value is TThis */
|
|
355
|
+
function IsThis$1(value) {
|
|
356
|
+
return IsKindOf$1(value, "This");
|
|
357
|
+
}
|
|
358
|
+
/** `[Kind-Only]` Returns true of this value is TTransform */
|
|
359
|
+
function IsTransform$1(value) {
|
|
360
|
+
return IsObject$3(value) && TransformKind in value;
|
|
361
|
+
}
|
|
362
|
+
/** `[Kind-Only]` Returns true if the given value is TTuple */
|
|
363
|
+
function IsTuple$1(value) {
|
|
364
|
+
return IsKindOf$1(value, "Tuple");
|
|
365
|
+
}
|
|
366
|
+
/** `[Kind-Only]` Returns true if the given value is TUndefined */
|
|
367
|
+
function IsUndefined$1(value) {
|
|
368
|
+
return IsKindOf$1(value, "Undefined");
|
|
369
|
+
}
|
|
370
|
+
/** `[Kind-Only]` Returns true if the given value is TUnion */
|
|
371
|
+
function IsUnion$1(value) {
|
|
372
|
+
return IsKindOf$1(value, "Union");
|
|
373
|
+
}
|
|
374
|
+
/** `[Kind-Only]` Returns true if the given value is TUint8Array */
|
|
375
|
+
function IsUint8Array$1(value) {
|
|
376
|
+
return IsKindOf$1(value, "Uint8Array");
|
|
377
|
+
}
|
|
378
|
+
/** `[Kind-Only]` Returns true if the given value is TUnknown */
|
|
379
|
+
function IsUnknown$1(value) {
|
|
380
|
+
return IsKindOf$1(value, "Unknown");
|
|
381
|
+
}
|
|
382
|
+
/** `[Kind-Only]` Returns true if the given value is a raw TUnsafe */
|
|
383
|
+
function IsUnsafe$1(value) {
|
|
384
|
+
return IsKindOf$1(value, "Unsafe");
|
|
385
|
+
}
|
|
386
|
+
/** `[Kind-Only]` Returns true if the given value is TVoid */
|
|
387
|
+
function IsVoid$1(value) {
|
|
388
|
+
return IsKindOf$1(value, "Void");
|
|
389
|
+
}
|
|
390
|
+
/** `[Kind-Only]` Returns true if the given value is TKind */
|
|
391
|
+
function IsKind$1(value) {
|
|
392
|
+
return IsObject$3(value) && Kind in value && IsString$2(value[Kind]);
|
|
393
|
+
}
|
|
394
|
+
/** `[Kind-Only]` Returns true if the given value is TSchema */
|
|
395
|
+
function IsSchema$1(value) {
|
|
396
|
+
return IsAny$1(value) || IsArgument$1(value) || IsArray$1(value) || IsBoolean$1(value) || IsBigInt$1(value) || IsAsyncIterator$1(value) || IsComputed$1(value) || IsConstructor$1(value) || IsDate$1(value) || IsFunction$1(value) || IsInteger$1(value) || IsIntersect$1(value) || IsIterator$1(value) || IsLiteral$1(value) || IsMappedKey$1(value) || IsMappedResult$1(value) || IsNever$1(value) || IsNot$1(value) || IsNull$1(value) || IsNumber$1(value) || IsObject$1(value) || IsPromise$1(value) || IsRecord$1(value) || IsRef$1(value) || IsRegExp$1(value) || IsString$1(value) || IsSymbol$1(value) || IsTemplateLiteral$1(value) || IsThis$1(value) || IsTuple$1(value) || IsUndefined$1(value) || IsUnion$1(value) || IsUint8Array$1(value) || IsUnknown$1(value) || IsUnsafe$1(value) || IsVoid$1(value) || IsKind$1(value);
|
|
397
|
+
}
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
|
|
400
|
+
const KnownTypes = [
|
|
401
|
+
"Argument",
|
|
402
|
+
"Any",
|
|
403
|
+
"Array",
|
|
404
|
+
"AsyncIterator",
|
|
405
|
+
"BigInt",
|
|
406
|
+
"Boolean",
|
|
407
|
+
"Computed",
|
|
408
|
+
"Constructor",
|
|
409
|
+
"Date",
|
|
410
|
+
"Enum",
|
|
411
|
+
"Function",
|
|
412
|
+
"Integer",
|
|
413
|
+
"Intersect",
|
|
414
|
+
"Iterator",
|
|
415
|
+
"Literal",
|
|
416
|
+
"MappedKey",
|
|
417
|
+
"MappedResult",
|
|
418
|
+
"Not",
|
|
419
|
+
"Null",
|
|
420
|
+
"Number",
|
|
421
|
+
"Object",
|
|
422
|
+
"Promise",
|
|
423
|
+
"Record",
|
|
424
|
+
"Ref",
|
|
425
|
+
"RegExp",
|
|
426
|
+
"String",
|
|
427
|
+
"Symbol",
|
|
428
|
+
"TemplateLiteral",
|
|
429
|
+
"This",
|
|
430
|
+
"Tuple",
|
|
431
|
+
"Undefined",
|
|
432
|
+
"Union",
|
|
433
|
+
"Uint8Array",
|
|
434
|
+
"Unknown",
|
|
435
|
+
"Void"
|
|
436
|
+
];
|
|
437
|
+
function IsPattern(value) {
|
|
438
|
+
try {
|
|
439
|
+
new RegExp(value);
|
|
440
|
+
return true;
|
|
441
|
+
} catch {
|
|
442
|
+
return false;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
function IsControlCharacterFree(value) {
|
|
446
|
+
if (!IsString$2(value)) return false;
|
|
447
|
+
for (let i = 0; i < value.length; i++) {
|
|
448
|
+
const code = value.charCodeAt(i);
|
|
449
|
+
if (code >= 7 && code <= 13 || code === 27 || code === 127) return false;
|
|
450
|
+
}
|
|
451
|
+
return true;
|
|
452
|
+
}
|
|
453
|
+
function IsAdditionalProperties(value) {
|
|
454
|
+
return IsOptionalBoolean(value) || IsSchema(value);
|
|
455
|
+
}
|
|
456
|
+
function IsOptionalBigInt(value) {
|
|
457
|
+
return IsUndefined$3(value) || IsBigInt$2(value);
|
|
458
|
+
}
|
|
459
|
+
function IsOptionalNumber(value) {
|
|
460
|
+
return IsUndefined$3(value) || IsNumber$3(value);
|
|
461
|
+
}
|
|
462
|
+
function IsOptionalBoolean(value) {
|
|
463
|
+
return IsUndefined$3(value) || IsBoolean$2(value);
|
|
464
|
+
}
|
|
465
|
+
function IsOptionalString(value) {
|
|
466
|
+
return IsUndefined$3(value) || IsString$2(value);
|
|
467
|
+
}
|
|
468
|
+
function IsOptionalPattern(value) {
|
|
469
|
+
return IsUndefined$3(value) || IsString$2(value) && IsControlCharacterFree(value) && IsPattern(value);
|
|
470
|
+
}
|
|
471
|
+
function IsOptionalFormat(value) {
|
|
472
|
+
return IsUndefined$3(value) || IsString$2(value) && IsControlCharacterFree(value);
|
|
473
|
+
}
|
|
474
|
+
function IsOptionalSchema(value) {
|
|
475
|
+
return IsUndefined$3(value) || IsSchema(value);
|
|
476
|
+
}
|
|
477
|
+
/** Returns true if this value has a Optional symbol */
|
|
478
|
+
function IsOptional(value) {
|
|
479
|
+
return IsObject$3(value) && value[OptionalKind] === "Optional";
|
|
480
|
+
}
|
|
481
|
+
/** Returns true if the given value is TAny */
|
|
482
|
+
function IsAny(value) {
|
|
483
|
+
return IsKindOf(value, "Any") && IsOptionalString(value.$id);
|
|
484
|
+
}
|
|
485
|
+
/** Returns true if the given value is TArgument */
|
|
486
|
+
function IsArgument(value) {
|
|
487
|
+
return IsKindOf(value, "Argument") && IsNumber$3(value.index);
|
|
488
|
+
}
|
|
489
|
+
/** Returns true if the given value is TArray */
|
|
490
|
+
function IsArray(value) {
|
|
491
|
+
return IsKindOf(value, "Array") && value.type === "array" && IsOptionalString(value.$id) && IsSchema(value.items) && IsOptionalNumber(value.minItems) && IsOptionalNumber(value.maxItems) && IsOptionalBoolean(value.uniqueItems) && IsOptionalSchema(value.contains) && IsOptionalNumber(value.minContains) && IsOptionalNumber(value.maxContains);
|
|
492
|
+
}
|
|
493
|
+
/** Returns true if the given value is TAsyncIterator */
|
|
494
|
+
function IsAsyncIterator(value) {
|
|
495
|
+
return IsKindOf(value, "AsyncIterator") && value.type === "AsyncIterator" && IsOptionalString(value.$id) && IsSchema(value.items);
|
|
496
|
+
}
|
|
497
|
+
/** Returns true if the given value is TBigInt */
|
|
498
|
+
function IsBigInt(value) {
|
|
499
|
+
return IsKindOf(value, "BigInt") && value.type === "bigint" && IsOptionalString(value.$id) && IsOptionalBigInt(value.exclusiveMaximum) && IsOptionalBigInt(value.exclusiveMinimum) && IsOptionalBigInt(value.maximum) && IsOptionalBigInt(value.minimum) && IsOptionalBigInt(value.multipleOf);
|
|
500
|
+
}
|
|
501
|
+
/** Returns true if the given value is TBoolean */
|
|
502
|
+
function IsBoolean(value) {
|
|
503
|
+
return IsKindOf(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
|
|
504
|
+
}
|
|
505
|
+
/** Returns true if the given value is TComputed */
|
|
506
|
+
function IsComputed(value) {
|
|
507
|
+
return IsKindOf(value, "Computed") && IsString$2(value.target) && IsArray$3(value.parameters) && value.parameters.every((schema) => IsSchema(schema));
|
|
508
|
+
}
|
|
509
|
+
/** Returns true if the given value is TConstructor */
|
|
510
|
+
function IsConstructor(value) {
|
|
511
|
+
return IsKindOf(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray$3(value.parameters) && value.parameters.every((schema) => IsSchema(schema)) && IsSchema(value.returns);
|
|
512
|
+
}
|
|
513
|
+
/** Returns true if the given value is TDate */
|
|
514
|
+
function IsDate(value) {
|
|
515
|
+
return IsKindOf(value, "Date") && value.type === "Date" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximumTimestamp) && IsOptionalNumber(value.exclusiveMinimumTimestamp) && IsOptionalNumber(value.maximumTimestamp) && IsOptionalNumber(value.minimumTimestamp) && IsOptionalNumber(value.multipleOfTimestamp);
|
|
516
|
+
}
|
|
517
|
+
/** Returns true if the given value is TFunction */
|
|
518
|
+
function IsFunction(value) {
|
|
519
|
+
return IsKindOf(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray$3(value.parameters) && value.parameters.every((schema) => IsSchema(schema)) && IsSchema(value.returns);
|
|
520
|
+
}
|
|
521
|
+
/** Returns true if the given value is TInteger */
|
|
522
|
+
function IsInteger(value) {
|
|
523
|
+
return IsKindOf(value, "Integer") && value.type === "integer" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
|
|
524
|
+
}
|
|
525
|
+
/** Returns true if the given schema is TProperties */
|
|
526
|
+
function IsProperties(value) {
|
|
527
|
+
return IsObject$3(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema(schema));
|
|
528
|
+
}
|
|
529
|
+
/** Returns true if the given value is TIntersect */
|
|
530
|
+
function IsIntersect(value) {
|
|
531
|
+
return IsKindOf(value, "Intersect") && (IsString$2(value.type) && value.type !== "object" ? false : true) && IsArray$3(value.allOf) && value.allOf.every((schema) => IsSchema(schema) && !IsTransform(schema)) && IsOptionalString(value.type) && (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && IsOptionalString(value.$id);
|
|
532
|
+
}
|
|
533
|
+
/** Returns true if the given value is TIterator */
|
|
534
|
+
function IsIterator(value) {
|
|
535
|
+
return IsKindOf(value, "Iterator") && value.type === "Iterator" && IsOptionalString(value.$id) && IsSchema(value.items);
|
|
536
|
+
}
|
|
537
|
+
/** Returns true if the given value is a TKind with the given name. */
|
|
538
|
+
function IsKindOf(value, kind) {
|
|
539
|
+
return IsObject$3(value) && Kind in value && value[Kind] === kind;
|
|
540
|
+
}
|
|
541
|
+
/** Returns true if the given value is TLiteral<string> */
|
|
542
|
+
function IsLiteralString(value) {
|
|
543
|
+
return IsLiteral(value) && IsString$2(value.const);
|
|
544
|
+
}
|
|
545
|
+
/** Returns true if the given value is TLiteral<number> */
|
|
546
|
+
function IsLiteralNumber(value) {
|
|
547
|
+
return IsLiteral(value) && IsNumber$3(value.const);
|
|
548
|
+
}
|
|
549
|
+
/** Returns true if the given value is TLiteral<boolean> */
|
|
550
|
+
function IsLiteralBoolean(value) {
|
|
551
|
+
return IsLiteral(value) && IsBoolean$2(value.const);
|
|
552
|
+
}
|
|
553
|
+
/** Returns true if the given value is TLiteral */
|
|
554
|
+
function IsLiteral(value) {
|
|
555
|
+
return IsKindOf(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue(value.const);
|
|
556
|
+
}
|
|
557
|
+
/** Returns true if the given value is a TLiteralValue */
|
|
558
|
+
function IsLiteralValue(value) {
|
|
559
|
+
return IsBoolean$2(value) || IsNumber$3(value) || IsString$2(value);
|
|
560
|
+
}
|
|
561
|
+
/** Returns true if the given value is a TMappedKey */
|
|
562
|
+
function IsMappedKey(value) {
|
|
563
|
+
return IsKindOf(value, "MappedKey") && IsArray$3(value.keys) && value.keys.every((key) => IsNumber$3(key) || IsString$2(key));
|
|
564
|
+
}
|
|
565
|
+
/** Returns true if the given value is TMappedResult */
|
|
566
|
+
function IsMappedResult(value) {
|
|
567
|
+
return IsKindOf(value, "MappedResult") && IsProperties(value.properties);
|
|
568
|
+
}
|
|
569
|
+
/** Returns true if the given value is TNever */
|
|
570
|
+
function IsNever(value) {
|
|
571
|
+
return IsKindOf(value, "Never") && IsObject$3(value.not) && Object.getOwnPropertyNames(value.not).length === 0;
|
|
572
|
+
}
|
|
573
|
+
/** Returns true if the given value is TNot */
|
|
574
|
+
function IsNot(value) {
|
|
575
|
+
return IsKindOf(value, "Not") && IsSchema(value.not);
|
|
576
|
+
}
|
|
577
|
+
/** Returns true if the given value is TNull */
|
|
578
|
+
function IsNull(value) {
|
|
579
|
+
return IsKindOf(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
|
|
580
|
+
}
|
|
581
|
+
/** Returns true if the given value is TNumber */
|
|
582
|
+
function IsNumber(value) {
|
|
583
|
+
return IsKindOf(value, "Number") && value.type === "number" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
|
|
584
|
+
}
|
|
585
|
+
/** Returns true if the given value is TObject */
|
|
586
|
+
function IsObject(value) {
|
|
587
|
+
return IsKindOf(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
|
|
588
|
+
}
|
|
589
|
+
/** Returns true if the given value is TPromise */
|
|
590
|
+
function IsPromise(value) {
|
|
591
|
+
return IsKindOf(value, "Promise") && value.type === "Promise" && IsOptionalString(value.$id) && IsSchema(value.item);
|
|
592
|
+
}
|
|
593
|
+
/** Returns true if the given value is TRecord */
|
|
594
|
+
function IsRecord(value) {
|
|
595
|
+
return IsKindOf(value, "Record") && value.type === "object" && IsOptionalString(value.$id) && IsAdditionalProperties(value.additionalProperties) && IsObject$3(value.patternProperties) && ((schema) => {
|
|
596
|
+
const keys = Object.getOwnPropertyNames(schema.patternProperties);
|
|
597
|
+
return keys.length === 1 && IsPattern(keys[0]) && IsObject$3(schema.patternProperties) && IsSchema(schema.patternProperties[keys[0]]);
|
|
598
|
+
})(value);
|
|
599
|
+
}
|
|
600
|
+
/** Returns true if the given value is TRef */
|
|
601
|
+
function IsRef(value) {
|
|
602
|
+
return IsKindOf(value, "Ref") && IsOptionalString(value.$id) && IsString$2(value.$ref);
|
|
603
|
+
}
|
|
604
|
+
/** Returns true if the given value is TRegExp */
|
|
605
|
+
function IsRegExp(value) {
|
|
606
|
+
return IsKindOf(value, "RegExp") && IsOptionalString(value.$id) && IsString$2(value.source) && IsString$2(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength);
|
|
607
|
+
}
|
|
608
|
+
/** Returns true if the given value is TString */
|
|
609
|
+
function IsString(value) {
|
|
610
|
+
return IsKindOf(value, "String") && value.type === "string" && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format);
|
|
611
|
+
}
|
|
612
|
+
/** Returns true if the given value is TSymbol */
|
|
613
|
+
function IsSymbol(value) {
|
|
614
|
+
return IsKindOf(value, "Symbol") && value.type === "symbol" && IsOptionalString(value.$id);
|
|
615
|
+
}
|
|
616
|
+
/** Returns true if the given value is TTemplateLiteral */
|
|
617
|
+
function IsTemplateLiteral(value) {
|
|
618
|
+
return IsKindOf(value, "TemplateLiteral") && value.type === "string" && IsString$2(value.pattern) && value.pattern[0] === "^" && value.pattern[value.pattern.length - 1] === "$";
|
|
619
|
+
}
|
|
620
|
+
/** Returns true if the given value is TThis */
|
|
621
|
+
function IsThis(value) {
|
|
622
|
+
return IsKindOf(value, "This") && IsOptionalString(value.$id) && IsString$2(value.$ref);
|
|
623
|
+
}
|
|
624
|
+
/** Returns true of this value is TTransform */
|
|
625
|
+
function IsTransform(value) {
|
|
626
|
+
return IsObject$3(value) && TransformKind in value;
|
|
627
|
+
}
|
|
628
|
+
/** Returns true if the given value is TTuple */
|
|
629
|
+
function IsTuple(value) {
|
|
630
|
+
return IsKindOf(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber$3(value.minItems) && IsNumber$3(value.maxItems) && value.minItems === value.maxItems && (IsUndefined$3(value.items) && IsUndefined$3(value.additionalItems) && value.minItems === 0 || IsArray$3(value.items) && value.items.every((schema) => IsSchema(schema)));
|
|
631
|
+
}
|
|
632
|
+
/** Returns true if the given value is TUndefined */
|
|
633
|
+
function IsUndefined(value) {
|
|
634
|
+
return IsKindOf(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id);
|
|
635
|
+
}
|
|
636
|
+
/** Returns true if the given value is TUnion */
|
|
637
|
+
function IsUnion(value) {
|
|
638
|
+
return IsKindOf(value, "Union") && IsOptionalString(value.$id) && IsObject$3(value) && IsArray$3(value.anyOf) && value.anyOf.every((schema) => IsSchema(schema));
|
|
639
|
+
}
|
|
640
|
+
/** Returns true if the given value is TUint8Array */
|
|
641
|
+
function IsUint8Array(value) {
|
|
642
|
+
return IsKindOf(value, "Uint8Array") && value.type === "Uint8Array" && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength);
|
|
643
|
+
}
|
|
644
|
+
/** Returns true if the given value is TUnknown */
|
|
645
|
+
function IsUnknown(value) {
|
|
646
|
+
return IsKindOf(value, "Unknown") && IsOptionalString(value.$id);
|
|
647
|
+
}
|
|
648
|
+
/** Returns true if the given value is a raw TUnsafe */
|
|
649
|
+
function IsUnsafe(value) {
|
|
650
|
+
return IsKindOf(value, "Unsafe");
|
|
651
|
+
}
|
|
652
|
+
/** Returns true if the given value is TVoid */
|
|
653
|
+
function IsVoid(value) {
|
|
654
|
+
return IsKindOf(value, "Void") && value.type === "void" && IsOptionalString(value.$id);
|
|
655
|
+
}
|
|
656
|
+
/** Returns true if the given value is TKind */
|
|
657
|
+
function IsKind(value) {
|
|
658
|
+
return IsObject$3(value) && Kind in value && IsString$2(value[Kind]) && !KnownTypes.includes(value[Kind]);
|
|
659
|
+
}
|
|
660
|
+
/** Returns true if the given value is TSchema */
|
|
661
|
+
function IsSchema(value) {
|
|
662
|
+
return IsObject$3(value) && (IsAny(value) || IsArgument(value) || IsArray(value) || IsBoolean(value) || IsBigInt(value) || IsAsyncIterator(value) || IsComputed(value) || IsConstructor(value) || IsDate(value) || IsFunction(value) || IsInteger(value) || IsIntersect(value) || IsIterator(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull(value) || IsNumber(value) || IsObject(value) || IsPromise(value) || IsRecord(value) || IsRef(value) || IsRegExp(value) || IsString(value) || IsSymbol(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined(value) || IsUnion(value) || IsUint8Array(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value));
|
|
663
|
+
}
|
|
664
|
+
//#endregion
|
|
665
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
|
|
666
|
+
const PatternBoolean = "(true|false)";
|
|
667
|
+
const PatternNumber = "(0|[1-9][0-9]*)";
|
|
668
|
+
const PatternString = "(.*)";
|
|
669
|
+
const PatternNever = "(?!.*)";
|
|
670
|
+
`${PatternBoolean}`;
|
|
671
|
+
const PatternNumberExact = `^${PatternNumber}$`;
|
|
672
|
+
const PatternStringExact = `^${PatternString}$`;
|
|
673
|
+
const PatternNeverExact = `^${PatternNever}$`;
|
|
674
|
+
//#endregion
|
|
675
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
|
|
676
|
+
/** Returns true if element right is in the set of left */
|
|
677
|
+
function SetIncludes(T, S) {
|
|
678
|
+
return T.includes(S);
|
|
679
|
+
}
|
|
680
|
+
/** Returns a distinct set of elements */
|
|
681
|
+
function SetDistinct(T) {
|
|
682
|
+
return [...new Set(T)];
|
|
683
|
+
}
|
|
684
|
+
/** Returns the Intersect of the given sets */
|
|
685
|
+
function SetIntersect(T, S) {
|
|
686
|
+
return T.filter((L) => S.includes(L));
|
|
687
|
+
}
|
|
688
|
+
function SetIntersectManyResolve(T, Init) {
|
|
689
|
+
return T.reduce((Acc, L) => {
|
|
690
|
+
return SetIntersect(Acc, L);
|
|
691
|
+
}, Init);
|
|
692
|
+
}
|
|
693
|
+
function SetIntersectMany(T) {
|
|
694
|
+
return T.length === 1 ? T[0] : T.length > 1 ? SetIntersectManyResolve(T.slice(1), T[0]) : [];
|
|
695
|
+
}
|
|
696
|
+
/** Returns the Union of multiple sets */
|
|
697
|
+
function SetUnionMany(T) {
|
|
698
|
+
const Acc = [];
|
|
699
|
+
for (const L of T) Acc.push(...L);
|
|
700
|
+
return Acc;
|
|
701
|
+
}
|
|
702
|
+
//#endregion
|
|
703
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
|
|
704
|
+
/** `[Json]` Creates an Any type */
|
|
705
|
+
function Any(options) {
|
|
706
|
+
return CreateType({ [Kind]: "Any" }, options);
|
|
707
|
+
}
|
|
708
|
+
//#endregion
|
|
709
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
|
|
710
|
+
/** `[Json]` Creates an Array type */
|
|
711
|
+
function Array$1(items, options) {
|
|
712
|
+
return CreateType({
|
|
713
|
+
[Kind]: "Array",
|
|
714
|
+
type: "array",
|
|
715
|
+
items
|
|
716
|
+
}, options);
|
|
717
|
+
}
|
|
718
|
+
//#endregion
|
|
719
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs
|
|
720
|
+
/** `[JavaScript]` Creates an Argument Type. */
|
|
721
|
+
function Argument(index) {
|
|
722
|
+
return CreateType({
|
|
723
|
+
[Kind]: "Argument",
|
|
724
|
+
index
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
//#endregion
|
|
728
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
|
|
729
|
+
/** `[JavaScript]` Creates a AsyncIterator type */
|
|
730
|
+
function AsyncIterator(items, options) {
|
|
731
|
+
return CreateType({
|
|
732
|
+
[Kind]: "AsyncIterator",
|
|
733
|
+
type: "AsyncIterator",
|
|
734
|
+
items
|
|
735
|
+
}, options);
|
|
736
|
+
}
|
|
737
|
+
//#endregion
|
|
738
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs
|
|
739
|
+
/** `[Internal]` Creates a deferred computed type. This type is used exclusively in modules to defer resolution of computable types that contain interior references */
|
|
740
|
+
function Computed(target, parameters, options) {
|
|
741
|
+
return CreateType({
|
|
742
|
+
[Kind]: "Computed",
|
|
743
|
+
target,
|
|
744
|
+
parameters
|
|
745
|
+
}, options);
|
|
746
|
+
}
|
|
747
|
+
//#endregion
|
|
748
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
|
|
749
|
+
function DiscardKey(value, key) {
|
|
750
|
+
const { [key]: _, ...rest } = value;
|
|
751
|
+
return rest;
|
|
752
|
+
}
|
|
753
|
+
/** Discards property keys from the given value. This function returns a shallow Clone. */
|
|
754
|
+
function Discard(value, keys) {
|
|
755
|
+
return keys.reduce((acc, key) => DiscardKey(acc, key), value);
|
|
756
|
+
}
|
|
757
|
+
//#endregion
|
|
758
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
|
|
759
|
+
/** `[Json]` Creates a Never type */
|
|
760
|
+
function Never(options) {
|
|
761
|
+
return CreateType({
|
|
762
|
+
[Kind]: "Never",
|
|
763
|
+
not: {}
|
|
764
|
+
}, options);
|
|
765
|
+
}
|
|
766
|
+
//#endregion
|
|
767
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
|
|
768
|
+
function MappedResult(properties) {
|
|
769
|
+
return CreateType({
|
|
770
|
+
[Kind]: "MappedResult",
|
|
771
|
+
properties
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
//#endregion
|
|
775
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
|
|
776
|
+
/** `[JavaScript]` Creates a Constructor type */
|
|
777
|
+
function Constructor(parameters, returns, options) {
|
|
778
|
+
return CreateType({
|
|
779
|
+
[Kind]: "Constructor",
|
|
780
|
+
type: "Constructor",
|
|
781
|
+
parameters,
|
|
782
|
+
returns
|
|
783
|
+
}, options);
|
|
784
|
+
}
|
|
785
|
+
//#endregion
|
|
786
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
|
|
787
|
+
/** `[JavaScript]` Creates a Function type */
|
|
788
|
+
function Function(parameters, returns, options) {
|
|
789
|
+
return CreateType({
|
|
790
|
+
[Kind]: "Function",
|
|
791
|
+
type: "Function",
|
|
792
|
+
parameters,
|
|
793
|
+
returns
|
|
794
|
+
}, options);
|
|
795
|
+
}
|
|
796
|
+
//#endregion
|
|
797
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
|
|
798
|
+
function UnionCreate(T, options) {
|
|
799
|
+
return CreateType({
|
|
800
|
+
[Kind]: "Union",
|
|
801
|
+
anyOf: T
|
|
802
|
+
}, options);
|
|
803
|
+
}
|
|
804
|
+
//#endregion
|
|
805
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
|
|
806
|
+
function IsUnionOptional(types) {
|
|
807
|
+
return types.some((type) => IsOptional$1(type));
|
|
808
|
+
}
|
|
809
|
+
function RemoveOptionalFromRest$1(types) {
|
|
810
|
+
return types.map((left) => IsOptional$1(left) ? RemoveOptionalFromType$1(left) : left);
|
|
811
|
+
}
|
|
812
|
+
function RemoveOptionalFromType$1(T) {
|
|
813
|
+
return Discard(T, [OptionalKind]);
|
|
814
|
+
}
|
|
815
|
+
function ResolveUnion(types, options) {
|
|
816
|
+
return IsUnionOptional(types) ? Optional(UnionCreate(RemoveOptionalFromRest$1(types), options)) : UnionCreate(RemoveOptionalFromRest$1(types), options);
|
|
817
|
+
}
|
|
818
|
+
/** `[Json]` Creates an evaluated Union type */
|
|
819
|
+
function UnionEvaluated(T, options) {
|
|
820
|
+
return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options);
|
|
821
|
+
}
|
|
822
|
+
//#endregion
|
|
823
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
|
|
824
|
+
/** `[Json]` Creates a Union type */
|
|
825
|
+
function Union(types, options) {
|
|
826
|
+
return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options);
|
|
827
|
+
}
|
|
828
|
+
//#endregion
|
|
829
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
|
|
830
|
+
var TemplateLiteralParserError = class extends TypeBoxError {};
|
|
831
|
+
function Unescape(pattern) {
|
|
832
|
+
return pattern.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
|
|
833
|
+
}
|
|
834
|
+
function IsNonEscaped(pattern, index, char) {
|
|
835
|
+
return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92;
|
|
836
|
+
}
|
|
837
|
+
function IsOpenParen(pattern, index) {
|
|
838
|
+
return IsNonEscaped(pattern, index, "(");
|
|
839
|
+
}
|
|
840
|
+
function IsCloseParen(pattern, index) {
|
|
841
|
+
return IsNonEscaped(pattern, index, ")");
|
|
842
|
+
}
|
|
843
|
+
function IsSeparator(pattern, index) {
|
|
844
|
+
return IsNonEscaped(pattern, index, "|");
|
|
845
|
+
}
|
|
846
|
+
function IsGroup(pattern) {
|
|
847
|
+
if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1))) return false;
|
|
848
|
+
let count = 0;
|
|
849
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
850
|
+
if (IsOpenParen(pattern, index)) count += 1;
|
|
851
|
+
if (IsCloseParen(pattern, index)) count -= 1;
|
|
852
|
+
if (count === 0 && index !== pattern.length - 1) return false;
|
|
853
|
+
}
|
|
854
|
+
return true;
|
|
855
|
+
}
|
|
856
|
+
function InGroup(pattern) {
|
|
857
|
+
return pattern.slice(1, pattern.length - 1);
|
|
858
|
+
}
|
|
859
|
+
function IsPrecedenceOr(pattern) {
|
|
860
|
+
let count = 0;
|
|
861
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
862
|
+
if (IsOpenParen(pattern, index)) count += 1;
|
|
863
|
+
if (IsCloseParen(pattern, index)) count -= 1;
|
|
864
|
+
if (IsSeparator(pattern, index) && count === 0) return true;
|
|
865
|
+
}
|
|
866
|
+
return false;
|
|
867
|
+
}
|
|
868
|
+
function IsPrecedenceAnd(pattern) {
|
|
869
|
+
for (let index = 0; index < pattern.length; index++) if (IsOpenParen(pattern, index)) return true;
|
|
870
|
+
return false;
|
|
871
|
+
}
|
|
872
|
+
function Or(pattern) {
|
|
873
|
+
let [count, start] = [0, 0];
|
|
874
|
+
const expressions = [];
|
|
875
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
876
|
+
if (IsOpenParen(pattern, index)) count += 1;
|
|
877
|
+
if (IsCloseParen(pattern, index)) count -= 1;
|
|
878
|
+
if (IsSeparator(pattern, index) && count === 0) {
|
|
879
|
+
const range = pattern.slice(start, index);
|
|
880
|
+
if (range.length > 0) expressions.push(TemplateLiteralParse(range));
|
|
881
|
+
start = index + 1;
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
const range = pattern.slice(start);
|
|
885
|
+
if (range.length > 0) expressions.push(TemplateLiteralParse(range));
|
|
886
|
+
if (expressions.length === 0) return {
|
|
887
|
+
type: "const",
|
|
888
|
+
const: ""
|
|
889
|
+
};
|
|
890
|
+
if (expressions.length === 1) return expressions[0];
|
|
891
|
+
return {
|
|
892
|
+
type: "or",
|
|
893
|
+
expr: expressions
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
function And(pattern) {
|
|
897
|
+
function Group(value, index) {
|
|
898
|
+
if (!IsOpenParen(value, index)) throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`);
|
|
899
|
+
let count = 0;
|
|
900
|
+
for (let scan = index; scan < value.length; scan++) {
|
|
901
|
+
if (IsOpenParen(value, scan)) count += 1;
|
|
902
|
+
if (IsCloseParen(value, scan)) count -= 1;
|
|
903
|
+
if (count === 0) return [index, scan];
|
|
904
|
+
}
|
|
905
|
+
throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`);
|
|
906
|
+
}
|
|
907
|
+
function Range(pattern, index) {
|
|
908
|
+
for (let scan = index; scan < pattern.length; scan++) if (IsOpenParen(pattern, scan)) return [index, scan];
|
|
909
|
+
return [index, pattern.length];
|
|
910
|
+
}
|
|
911
|
+
const expressions = [];
|
|
912
|
+
for (let index = 0; index < pattern.length; index++) if (IsOpenParen(pattern, index)) {
|
|
913
|
+
const [start, end] = Group(pattern, index);
|
|
914
|
+
const range = pattern.slice(start, end + 1);
|
|
915
|
+
expressions.push(TemplateLiteralParse(range));
|
|
916
|
+
index = end;
|
|
917
|
+
} else {
|
|
918
|
+
const [start, end] = Range(pattern, index);
|
|
919
|
+
const range = pattern.slice(start, end);
|
|
920
|
+
if (range.length > 0) expressions.push(TemplateLiteralParse(range));
|
|
921
|
+
index = end - 1;
|
|
922
|
+
}
|
|
923
|
+
return expressions.length === 0 ? {
|
|
924
|
+
type: "const",
|
|
925
|
+
const: ""
|
|
926
|
+
} : expressions.length === 1 ? expressions[0] : {
|
|
927
|
+
type: "and",
|
|
928
|
+
expr: expressions
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
/** Parses a pattern and returns an expression tree */
|
|
932
|
+
function TemplateLiteralParse(pattern) {
|
|
933
|
+
return IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : IsPrecedenceOr(pattern) ? Or(pattern) : IsPrecedenceAnd(pattern) ? And(pattern) : {
|
|
934
|
+
type: "const",
|
|
935
|
+
const: Unescape(pattern)
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
/** Parses a pattern and strips forward and trailing ^ and $ */
|
|
939
|
+
function TemplateLiteralParseExact(pattern) {
|
|
940
|
+
return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));
|
|
941
|
+
}
|
|
942
|
+
//#endregion
|
|
943
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs
|
|
944
|
+
var TemplateLiteralFiniteError = class extends TypeBoxError {};
|
|
945
|
+
function IsNumberExpression(expression) {
|
|
946
|
+
return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "0" && expression.expr[1].type === "const" && expression.expr[1].const === "[1-9][0-9]*";
|
|
947
|
+
}
|
|
948
|
+
function IsBooleanExpression(expression) {
|
|
949
|
+
return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "true" && expression.expr[1].type === "const" && expression.expr[1].const === "false";
|
|
950
|
+
}
|
|
951
|
+
function IsStringExpression(expression) {
|
|
952
|
+
return expression.type === "const" && expression.const === ".*";
|
|
953
|
+
}
|
|
954
|
+
function IsTemplateLiteralExpressionFinite(expression) {
|
|
955
|
+
return IsNumberExpression(expression) || IsStringExpression(expression) ? false : IsBooleanExpression(expression) ? true : expression.type === "and" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "or" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "const" ? true : (() => {
|
|
956
|
+
throw new TemplateLiteralFiniteError(`Unknown expression type`);
|
|
957
|
+
})();
|
|
958
|
+
}
|
|
959
|
+
/** Returns true if this TemplateLiteral resolves to a finite set of values */
|
|
960
|
+
function IsTemplateLiteralFinite(schema) {
|
|
961
|
+
return IsTemplateLiteralExpressionFinite(TemplateLiteralParseExact(schema.pattern));
|
|
962
|
+
}
|
|
963
|
+
//#endregion
|
|
964
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs
|
|
965
|
+
var TemplateLiteralGenerateError = class extends TypeBoxError {};
|
|
966
|
+
function* GenerateReduce(buffer) {
|
|
967
|
+
if (buffer.length === 1) return yield* buffer[0];
|
|
968
|
+
for (const left of buffer[0]) for (const right of GenerateReduce(buffer.slice(1))) yield `${left}${right}`;
|
|
969
|
+
}
|
|
970
|
+
function* GenerateAnd(expression) {
|
|
971
|
+
return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)]));
|
|
972
|
+
}
|
|
973
|
+
function* GenerateOr(expression) {
|
|
974
|
+
for (const expr of expression.expr) yield* TemplateLiteralExpressionGenerate(expr);
|
|
975
|
+
}
|
|
976
|
+
function* GenerateConst(expression) {
|
|
977
|
+
return yield expression.const;
|
|
978
|
+
}
|
|
979
|
+
function* TemplateLiteralExpressionGenerate(expression) {
|
|
980
|
+
return expression.type === "and" ? yield* GenerateAnd(expression) : expression.type === "or" ? yield* GenerateOr(expression) : expression.type === "const" ? yield* GenerateConst(expression) : (() => {
|
|
981
|
+
throw new TemplateLiteralGenerateError("Unknown expression");
|
|
982
|
+
})();
|
|
983
|
+
}
|
|
984
|
+
/** Generates a tuple of strings from the given TemplateLiteral. Returns an empty tuple if infinite. */
|
|
985
|
+
function TemplateLiteralGenerate(schema) {
|
|
986
|
+
const expression = TemplateLiteralParseExact(schema.pattern);
|
|
987
|
+
return IsTemplateLiteralExpressionFinite(expression) ? [...TemplateLiteralExpressionGenerate(expression)] : [];
|
|
988
|
+
}
|
|
989
|
+
//#endregion
|
|
990
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
|
|
991
|
+
/** `[Json]` Creates a Literal type */
|
|
992
|
+
function Literal(value, options) {
|
|
993
|
+
return CreateType({
|
|
994
|
+
[Kind]: "Literal",
|
|
995
|
+
const: value,
|
|
996
|
+
type: typeof value
|
|
997
|
+
}, options);
|
|
998
|
+
}
|
|
999
|
+
//#endregion
|
|
1000
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
|
|
1001
|
+
/** `[Json]` Creates a Boolean type */
|
|
1002
|
+
function Boolean(options) {
|
|
1003
|
+
return CreateType({
|
|
1004
|
+
[Kind]: "Boolean",
|
|
1005
|
+
type: "boolean"
|
|
1006
|
+
}, options);
|
|
1007
|
+
}
|
|
1008
|
+
//#endregion
|
|
1009
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
|
|
1010
|
+
/** `[JavaScript]` Creates a BigInt type */
|
|
1011
|
+
function BigInt(options) {
|
|
1012
|
+
return CreateType({
|
|
1013
|
+
[Kind]: "BigInt",
|
|
1014
|
+
type: "bigint"
|
|
1015
|
+
}, options);
|
|
1016
|
+
}
|
|
1017
|
+
//#endregion
|
|
1018
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
|
|
1019
|
+
/** `[Json]` Creates a Number type */
|
|
1020
|
+
function Number$1(options) {
|
|
1021
|
+
return CreateType({
|
|
1022
|
+
[Kind]: "Number",
|
|
1023
|
+
type: "number"
|
|
1024
|
+
}, options);
|
|
1025
|
+
}
|
|
1026
|
+
//#endregion
|
|
1027
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
|
|
1028
|
+
/** `[Json]` Creates a String type */
|
|
1029
|
+
function String(options) {
|
|
1030
|
+
return CreateType({
|
|
1031
|
+
[Kind]: "String",
|
|
1032
|
+
type: "string"
|
|
1033
|
+
}, options);
|
|
1034
|
+
}
|
|
1035
|
+
//#endregion
|
|
1036
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
|
|
1037
|
+
function* FromUnion$9(syntax) {
|
|
1038
|
+
const trim = syntax.trim().replace(/"|'/g, "");
|
|
1039
|
+
return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number$1() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String() : yield (() => {
|
|
1040
|
+
const literals = trim.split("|").map((literal) => Literal(literal.trim()));
|
|
1041
|
+
return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
|
|
1042
|
+
})();
|
|
1043
|
+
}
|
|
1044
|
+
function* FromTerminal(syntax) {
|
|
1045
|
+
if (syntax[1] !== "{") return yield* [Literal("$"), ...FromSyntax(syntax.slice(1))];
|
|
1046
|
+
for (let i = 2; i < syntax.length; i++) if (syntax[i] === "}") {
|
|
1047
|
+
const L = FromUnion$9(syntax.slice(2, i));
|
|
1048
|
+
const R = FromSyntax(syntax.slice(i + 1));
|
|
1049
|
+
return yield* [...L, ...R];
|
|
1050
|
+
}
|
|
1051
|
+
yield Literal(syntax);
|
|
1052
|
+
}
|
|
1053
|
+
function* FromSyntax(syntax) {
|
|
1054
|
+
for (let i = 0; i < syntax.length; i++) if (syntax[i] === "$") return yield* [Literal(syntax.slice(0, i)), ...FromTerminal(syntax.slice(i))];
|
|
1055
|
+
yield Literal(syntax);
|
|
1056
|
+
}
|
|
1057
|
+
/** Parses TemplateLiteralSyntax and returns a tuple of TemplateLiteralKinds */
|
|
1058
|
+
function TemplateLiteralSyntax(syntax) {
|
|
1059
|
+
return [...FromSyntax(syntax)];
|
|
1060
|
+
}
|
|
1061
|
+
//#endregion
|
|
1062
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs
|
|
1063
|
+
var TemplateLiteralPatternError = class extends TypeBoxError {};
|
|
1064
|
+
function Escape(value) {
|
|
1065
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1066
|
+
}
|
|
1067
|
+
function Visit$1(schema, acc) {
|
|
1068
|
+
return IsTemplateLiteral$1(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : IsUnion$1(schema) ? `(${schema.anyOf.map((schema) => Visit$1(schema, acc)).join("|")})` : IsNumber$1(schema) ? `${acc}${PatternNumber}` : IsInteger$1(schema) ? `${acc}${PatternNumber}` : IsBigInt$1(schema) ? `${acc}${PatternNumber}` : IsString$1(schema) ? `${acc}${PatternString}` : IsLiteral$1(schema) ? `${acc}${Escape(schema.const.toString())}` : IsBoolean$1(schema) ? `${acc}${PatternBoolean}` : (() => {
|
|
1069
|
+
throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
|
|
1070
|
+
})();
|
|
1071
|
+
}
|
|
1072
|
+
function TemplateLiteralPattern(kinds) {
|
|
1073
|
+
return `^${kinds.map((schema) => Visit$1(schema, "")).join("")}\$`;
|
|
1074
|
+
}
|
|
1075
|
+
//#endregion
|
|
1076
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs
|
|
1077
|
+
/** Returns a Union from the given TemplateLiteral */
|
|
1078
|
+
function TemplateLiteralToUnion(schema) {
|
|
1079
|
+
return UnionEvaluated(TemplateLiteralGenerate(schema).map((S) => Literal(S)));
|
|
1080
|
+
}
|
|
1081
|
+
//#endregion
|
|
1082
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
|
|
1083
|
+
/** `[Json]` Creates a TemplateLiteral type */
|
|
1084
|
+
function TemplateLiteral(unresolved, options) {
|
|
1085
|
+
const pattern = IsString$2(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
|
|
1086
|
+
return CreateType({
|
|
1087
|
+
[Kind]: "TemplateLiteral",
|
|
1088
|
+
type: "string",
|
|
1089
|
+
pattern
|
|
1090
|
+
}, options);
|
|
1091
|
+
}
|
|
1092
|
+
//#endregion
|
|
1093
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
|
|
1094
|
+
function FromTemplateLiteral$2(templateLiteral) {
|
|
1095
|
+
return TemplateLiteralGenerate(templateLiteral).map((key) => key.toString());
|
|
1096
|
+
}
|
|
1097
|
+
function FromUnion$8(types) {
|
|
1098
|
+
const result = [];
|
|
1099
|
+
for (const type of types) result.push(...IndexPropertyKeys(type));
|
|
1100
|
+
return result;
|
|
1101
|
+
}
|
|
1102
|
+
function FromLiteral$1(literalValue) {
|
|
1103
|
+
return [literalValue.toString()];
|
|
1104
|
+
}
|
|
1105
|
+
/** Returns a tuple of PropertyKeys derived from the given TSchema */
|
|
1106
|
+
function IndexPropertyKeys(type) {
|
|
1107
|
+
return [...new Set(IsTemplateLiteral$1(type) ? FromTemplateLiteral$2(type) : IsUnion$1(type) ? FromUnion$8(type.anyOf) : IsLiteral$1(type) ? FromLiteral$1(type.const) : IsNumber$1(type) ? ["[number]"] : IsInteger$1(type) ? ["[number]"] : [])];
|
|
1108
|
+
}
|
|
1109
|
+
//#endregion
|
|
1110
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
|
|
1111
|
+
function FromProperties$18(type, properties, options) {
|
|
1112
|
+
const result = {};
|
|
1113
|
+
for (const K2 of Object.getOwnPropertyNames(properties)) result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options);
|
|
1114
|
+
return result;
|
|
1115
|
+
}
|
|
1116
|
+
function FromMappedResult$11(type, mappedResult, options) {
|
|
1117
|
+
return FromProperties$18(type, mappedResult.properties, options);
|
|
1118
|
+
}
|
|
1119
|
+
function IndexFromMappedResult(type, mappedResult, options) {
|
|
1120
|
+
return MappedResult(FromMappedResult$11(type, mappedResult, options));
|
|
1121
|
+
}
|
|
1122
|
+
//#endregion
|
|
1123
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
|
|
1124
|
+
function FromRest$6(types, key) {
|
|
1125
|
+
return types.map((type) => IndexFromPropertyKey(type, key));
|
|
1126
|
+
}
|
|
1127
|
+
function FromIntersectRest(types) {
|
|
1128
|
+
return types.filter((type) => !IsNever$1(type));
|
|
1129
|
+
}
|
|
1130
|
+
function FromIntersect$7(types, key) {
|
|
1131
|
+
return IntersectEvaluated(FromIntersectRest(FromRest$6(types, key)));
|
|
1132
|
+
}
|
|
1133
|
+
function FromUnionRest(types) {
|
|
1134
|
+
return types.some((L) => IsNever$1(L)) ? [] : types;
|
|
1135
|
+
}
|
|
1136
|
+
function FromUnion$7(types, key) {
|
|
1137
|
+
return UnionEvaluated(FromUnionRest(FromRest$6(types, key)));
|
|
1138
|
+
}
|
|
1139
|
+
function FromTuple$4(types, key) {
|
|
1140
|
+
return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never();
|
|
1141
|
+
}
|
|
1142
|
+
function FromArray$5(type, key) {
|
|
1143
|
+
return key === "[number]" ? type : Never();
|
|
1144
|
+
}
|
|
1145
|
+
function FromProperty$2(properties, propertyKey) {
|
|
1146
|
+
return propertyKey in properties ? properties[propertyKey] : Never();
|
|
1147
|
+
}
|
|
1148
|
+
function IndexFromPropertyKey(type, propertyKey) {
|
|
1149
|
+
return IsIntersect$1(type) ? FromIntersect$7(type.allOf, propertyKey) : IsUnion$1(type) ? FromUnion$7(type.anyOf, propertyKey) : IsTuple$1(type) ? FromTuple$4(type.items ?? [], propertyKey) : IsArray$1(type) ? FromArray$5(type.items, propertyKey) : IsObject$1(type) ? FromProperty$2(type.properties, propertyKey) : Never();
|
|
1150
|
+
}
|
|
1151
|
+
function IndexFromPropertyKeys(type, propertyKeys) {
|
|
1152
|
+
return propertyKeys.map((propertyKey) => IndexFromPropertyKey(type, propertyKey));
|
|
1153
|
+
}
|
|
1154
|
+
function FromSchema(type, propertyKeys) {
|
|
1155
|
+
return UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys));
|
|
1156
|
+
}
|
|
1157
|
+
/** `[Json]` Returns an Indexed property type for the given keys */
|
|
1158
|
+
function Index(type, key, options) {
|
|
1159
|
+
if (IsRef$1(type) || IsRef$1(key)) {
|
|
1160
|
+
const error = `Index types using Ref parameters require both Type and Key to be of TSchema`;
|
|
1161
|
+
if (!IsSchema$1(type) || !IsSchema$1(key)) throw new TypeBoxError(error);
|
|
1162
|
+
return Computed("Index", [type, key]);
|
|
1163
|
+
}
|
|
1164
|
+
if (IsMappedResult$1(key)) return IndexFromMappedResult(type, key, options);
|
|
1165
|
+
if (IsMappedKey$1(key)) return IndexFromMappedKey(type, key, options);
|
|
1166
|
+
return CreateType(IsSchema$1(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
|
|
1167
|
+
}
|
|
1168
|
+
//#endregion
|
|
1169
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
|
|
1170
|
+
function MappedIndexPropertyKey(type, key, options) {
|
|
1171
|
+
return { [key]: Index(type, [key], Clone(options)) };
|
|
1172
|
+
}
|
|
1173
|
+
function MappedIndexPropertyKeys(type, propertyKeys, options) {
|
|
1174
|
+
return propertyKeys.reduce((result, left) => {
|
|
1175
|
+
return {
|
|
1176
|
+
...result,
|
|
1177
|
+
...MappedIndexPropertyKey(type, left, options)
|
|
1178
|
+
};
|
|
1179
|
+
}, {});
|
|
1180
|
+
}
|
|
1181
|
+
function MappedIndexProperties(type, mappedKey, options) {
|
|
1182
|
+
return MappedIndexPropertyKeys(type, mappedKey.keys, options);
|
|
1183
|
+
}
|
|
1184
|
+
function IndexFromMappedKey(type, mappedKey, options) {
|
|
1185
|
+
return MappedResult(MappedIndexProperties(type, mappedKey, options));
|
|
1186
|
+
}
|
|
1187
|
+
//#endregion
|
|
1188
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
|
|
1189
|
+
/** `[JavaScript]` Creates an Iterator type */
|
|
1190
|
+
function Iterator(items, options) {
|
|
1191
|
+
return CreateType({
|
|
1192
|
+
[Kind]: "Iterator",
|
|
1193
|
+
type: "Iterator",
|
|
1194
|
+
items
|
|
1195
|
+
}, options);
|
|
1196
|
+
}
|
|
1197
|
+
//#endregion
|
|
1198
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
|
|
1199
|
+
/** Creates a RequiredArray derived from the given TProperties value. */
|
|
1200
|
+
function RequiredArray(properties) {
|
|
1201
|
+
return globalThis.Object.keys(properties).filter((key) => !IsOptional$1(properties[key]));
|
|
1202
|
+
}
|
|
1203
|
+
/** `[Json]` Creates an Object type */
|
|
1204
|
+
function _Object(properties, options) {
|
|
1205
|
+
const required = RequiredArray(properties);
|
|
1206
|
+
return CreateType(required.length > 0 ? {
|
|
1207
|
+
[Kind]: "Object",
|
|
1208
|
+
type: "object",
|
|
1209
|
+
required,
|
|
1210
|
+
properties
|
|
1211
|
+
} : {
|
|
1212
|
+
[Kind]: "Object",
|
|
1213
|
+
type: "object",
|
|
1214
|
+
properties
|
|
1215
|
+
}, options);
|
|
1216
|
+
}
|
|
1217
|
+
/** `[Json]` Creates an Object type */
|
|
1218
|
+
var Object$1 = _Object;
|
|
1219
|
+
//#endregion
|
|
1220
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
|
|
1221
|
+
/** `[JavaScript]` Creates a Promise type */
|
|
1222
|
+
function Promise$1(item, options) {
|
|
1223
|
+
return CreateType({
|
|
1224
|
+
[Kind]: "Promise",
|
|
1225
|
+
type: "Promise",
|
|
1226
|
+
item
|
|
1227
|
+
}, options);
|
|
1228
|
+
}
|
|
1229
|
+
//#endregion
|
|
1230
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
|
|
1231
|
+
function RemoveReadonly(schema) {
|
|
1232
|
+
return CreateType(Discard(schema, [ReadonlyKind]));
|
|
1233
|
+
}
|
|
1234
|
+
function AddReadonly(schema) {
|
|
1235
|
+
return CreateType({
|
|
1236
|
+
...schema,
|
|
1237
|
+
[ReadonlyKind]: "Readonly"
|
|
1238
|
+
});
|
|
1239
|
+
}
|
|
1240
|
+
function ReadonlyWithFlag(schema, F) {
|
|
1241
|
+
return F === false ? RemoveReadonly(schema) : AddReadonly(schema);
|
|
1242
|
+
}
|
|
1243
|
+
/** `[Json]` Creates a Readonly property */
|
|
1244
|
+
function Readonly(schema, enable) {
|
|
1245
|
+
const F = enable ?? true;
|
|
1246
|
+
return IsMappedResult$1(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);
|
|
1247
|
+
}
|
|
1248
|
+
//#endregion
|
|
1249
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs
|
|
1250
|
+
function FromProperties$17(K, F) {
|
|
1251
|
+
const Acc = {};
|
|
1252
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(K)) Acc[K2] = Readonly(K[K2], F);
|
|
1253
|
+
return Acc;
|
|
1254
|
+
}
|
|
1255
|
+
function FromMappedResult$10(R, F) {
|
|
1256
|
+
return FromProperties$17(R.properties, F);
|
|
1257
|
+
}
|
|
1258
|
+
function ReadonlyFromMappedResult(R, F) {
|
|
1259
|
+
return MappedResult(FromMappedResult$10(R, F));
|
|
1260
|
+
}
|
|
1261
|
+
//#endregion
|
|
1262
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
|
|
1263
|
+
/** `[Json]` Creates a Tuple type */
|
|
1264
|
+
function Tuple(types, options) {
|
|
1265
|
+
return CreateType(types.length > 0 ? {
|
|
1266
|
+
[Kind]: "Tuple",
|
|
1267
|
+
type: "array",
|
|
1268
|
+
items: types,
|
|
1269
|
+
additionalItems: false,
|
|
1270
|
+
minItems: types.length,
|
|
1271
|
+
maxItems: types.length
|
|
1272
|
+
} : {
|
|
1273
|
+
[Kind]: "Tuple",
|
|
1274
|
+
type: "array",
|
|
1275
|
+
minItems: types.length,
|
|
1276
|
+
maxItems: types.length
|
|
1277
|
+
}, options);
|
|
1278
|
+
}
|
|
1279
|
+
//#endregion
|
|
1280
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
|
|
1281
|
+
function FromMappedResult$9(K, P) {
|
|
1282
|
+
return K in P ? FromSchemaType(K, P[K]) : MappedResult(P);
|
|
1283
|
+
}
|
|
1284
|
+
function MappedKeyToKnownMappedResultProperties(K) {
|
|
1285
|
+
return { [K]: Literal(K) };
|
|
1286
|
+
}
|
|
1287
|
+
function MappedKeyToUnknownMappedResultProperties(P) {
|
|
1288
|
+
const Acc = {};
|
|
1289
|
+
for (const L of P) Acc[L] = Literal(L);
|
|
1290
|
+
return Acc;
|
|
1291
|
+
}
|
|
1292
|
+
function MappedKeyToMappedResultProperties(K, P) {
|
|
1293
|
+
return SetIncludes(P, K) ? MappedKeyToKnownMappedResultProperties(K) : MappedKeyToUnknownMappedResultProperties(P);
|
|
1294
|
+
}
|
|
1295
|
+
function FromMappedKey$3(K, P) {
|
|
1296
|
+
return FromMappedResult$9(K, MappedKeyToMappedResultProperties(K, P));
|
|
1297
|
+
}
|
|
1298
|
+
function FromRest$5(K, T) {
|
|
1299
|
+
return T.map((L) => FromSchemaType(K, L));
|
|
1300
|
+
}
|
|
1301
|
+
function FromProperties$16(K, T) {
|
|
1302
|
+
const Acc = {};
|
|
1303
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(T)) Acc[K2] = FromSchemaType(K, T[K2]);
|
|
1304
|
+
return Acc;
|
|
1305
|
+
}
|
|
1306
|
+
function FromSchemaType(K, T) {
|
|
1307
|
+
const options = { ...T };
|
|
1308
|
+
return IsOptional$1(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : IsMappedResult$1(T) ? FromMappedResult$9(K, T.properties) : IsMappedKey$1(T) ? FromMappedKey$3(K, T.keys) : IsConstructor$1(T) ? Constructor(FromRest$5(K, T.parameters), FromSchemaType(K, T.returns), options) : IsFunction$1(T) ? Function(FromRest$5(K, T.parameters), FromSchemaType(K, T.returns), options) : IsAsyncIterator$1(T) ? AsyncIterator(FromSchemaType(K, T.items), options) : IsIterator$1(T) ? Iterator(FromSchemaType(K, T.items), options) : IsIntersect$1(T) ? Intersect(FromRest$5(K, T.allOf), options) : IsUnion$1(T) ? Union(FromRest$5(K, T.anyOf), options) : IsTuple$1(T) ? Tuple(FromRest$5(K, T.items ?? []), options) : IsObject$1(T) ? Object$1(FromProperties$16(K, T.properties), options) : IsArray$1(T) ? Array$1(FromSchemaType(K, T.items), options) : IsPromise$1(T) ? Promise$1(FromSchemaType(K, T.item), options) : T;
|
|
1309
|
+
}
|
|
1310
|
+
function MappedFunctionReturnType(K, T) {
|
|
1311
|
+
const Acc = {};
|
|
1312
|
+
for (const L of K) Acc[L] = FromSchemaType(L, T);
|
|
1313
|
+
return Acc;
|
|
1314
|
+
}
|
|
1315
|
+
/** `[Json]` Creates a Mapped object type */
|
|
1316
|
+
function Mapped(key, map, options) {
|
|
1317
|
+
const K = IsSchema$1(key) ? IndexPropertyKeys(key) : key;
|
|
1318
|
+
return Object$1(MappedFunctionReturnType(K, map({
|
|
1319
|
+
[Kind]: "MappedKey",
|
|
1320
|
+
keys: K
|
|
1321
|
+
})), options);
|
|
1322
|
+
}
|
|
1323
|
+
//#endregion
|
|
1324
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
|
|
1325
|
+
function RemoveOptional(schema) {
|
|
1326
|
+
return CreateType(Discard(schema, [OptionalKind]));
|
|
1327
|
+
}
|
|
1328
|
+
function AddOptional(schema) {
|
|
1329
|
+
return CreateType({
|
|
1330
|
+
...schema,
|
|
1331
|
+
[OptionalKind]: "Optional"
|
|
1332
|
+
});
|
|
1333
|
+
}
|
|
1334
|
+
function OptionalWithFlag(schema, F) {
|
|
1335
|
+
return F === false ? RemoveOptional(schema) : AddOptional(schema);
|
|
1336
|
+
}
|
|
1337
|
+
/** `[Json]` Creates a Optional property */
|
|
1338
|
+
function Optional(schema, enable) {
|
|
1339
|
+
const F = enable ?? true;
|
|
1340
|
+
return IsMappedResult$1(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
|
|
1341
|
+
}
|
|
1342
|
+
//#endregion
|
|
1343
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs
|
|
1344
|
+
function FromProperties$15(P, F) {
|
|
1345
|
+
const Acc = {};
|
|
1346
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(P)) Acc[K2] = Optional(P[K2], F);
|
|
1347
|
+
return Acc;
|
|
1348
|
+
}
|
|
1349
|
+
function FromMappedResult$8(R, F) {
|
|
1350
|
+
return FromProperties$15(R.properties, F);
|
|
1351
|
+
}
|
|
1352
|
+
function OptionalFromMappedResult(R, F) {
|
|
1353
|
+
return MappedResult(FromMappedResult$8(R, F));
|
|
1354
|
+
}
|
|
1355
|
+
//#endregion
|
|
1356
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
|
|
1357
|
+
function IntersectCreate(T, options = {}) {
|
|
1358
|
+
const allObjects = T.every((schema) => IsObject$1(schema));
|
|
1359
|
+
const clonedUnevaluatedProperties = IsSchema$1(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
|
|
1360
|
+
return CreateType(options.unevaluatedProperties === false || IsSchema$1(options.unevaluatedProperties) || allObjects ? {
|
|
1361
|
+
...clonedUnevaluatedProperties,
|
|
1362
|
+
[Kind]: "Intersect",
|
|
1363
|
+
type: "object",
|
|
1364
|
+
allOf: T
|
|
1365
|
+
} : {
|
|
1366
|
+
...clonedUnevaluatedProperties,
|
|
1367
|
+
[Kind]: "Intersect",
|
|
1368
|
+
allOf: T
|
|
1369
|
+
}, options);
|
|
1370
|
+
}
|
|
1371
|
+
//#endregion
|
|
1372
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
|
|
1373
|
+
function IsIntersectOptional(types) {
|
|
1374
|
+
return types.every((left) => IsOptional$1(left));
|
|
1375
|
+
}
|
|
1376
|
+
function RemoveOptionalFromType(type) {
|
|
1377
|
+
return Discard(type, [OptionalKind]);
|
|
1378
|
+
}
|
|
1379
|
+
function RemoveOptionalFromRest(types) {
|
|
1380
|
+
return types.map((left) => IsOptional$1(left) ? RemoveOptionalFromType(left) : left);
|
|
1381
|
+
}
|
|
1382
|
+
function ResolveIntersect(types, options) {
|
|
1383
|
+
return IsIntersectOptional(types) ? Optional(IntersectCreate(RemoveOptionalFromRest(types), options)) : IntersectCreate(RemoveOptionalFromRest(types), options);
|
|
1384
|
+
}
|
|
1385
|
+
/** `[Json]` Creates an evaluated Intersect type */
|
|
1386
|
+
function IntersectEvaluated(types, options = {}) {
|
|
1387
|
+
if (types.length === 1) return CreateType(types[0], options);
|
|
1388
|
+
if (types.length === 0) return Never(options);
|
|
1389
|
+
if (types.some((schema) => IsTransform$1(schema))) throw new Error("Cannot intersect transform types");
|
|
1390
|
+
return ResolveIntersect(types, options);
|
|
1391
|
+
}
|
|
1392
|
+
//#endregion
|
|
1393
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
|
|
1394
|
+
/** `[Json]` Creates an evaluated Intersect type */
|
|
1395
|
+
function Intersect(types, options) {
|
|
1396
|
+
if (types.length === 1) return CreateType(types[0], options);
|
|
1397
|
+
if (types.length === 0) return Never(options);
|
|
1398
|
+
if (types.some((schema) => IsTransform$1(schema))) throw new Error("Cannot intersect transform types");
|
|
1399
|
+
return IntersectCreate(types, options);
|
|
1400
|
+
}
|
|
1401
|
+
//#endregion
|
|
1402
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
|
|
1403
|
+
/** `[Json]` Creates a Ref type. The referenced type must contain a $id */
|
|
1404
|
+
function Ref(...args) {
|
|
1405
|
+
const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
|
|
1406
|
+
if (typeof $ref !== "string") throw new TypeBoxError("Ref: $ref must be a string");
|
|
1407
|
+
return CreateType({
|
|
1408
|
+
[Kind]: "Ref",
|
|
1409
|
+
$ref
|
|
1410
|
+
}, options);
|
|
1411
|
+
}
|
|
1412
|
+
//#endregion
|
|
1413
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
|
|
1414
|
+
function FromComputed$4(target, parameters) {
|
|
1415
|
+
return Computed("Awaited", [Computed(target, parameters)]);
|
|
1416
|
+
}
|
|
1417
|
+
function FromRef$3($ref) {
|
|
1418
|
+
return Computed("Awaited", [Ref($ref)]);
|
|
1419
|
+
}
|
|
1420
|
+
function FromIntersect$6(types) {
|
|
1421
|
+
return Intersect(FromRest$4(types));
|
|
1422
|
+
}
|
|
1423
|
+
function FromUnion$6(types) {
|
|
1424
|
+
return Union(FromRest$4(types));
|
|
1425
|
+
}
|
|
1426
|
+
function FromPromise$2(type) {
|
|
1427
|
+
return Awaited(type);
|
|
1428
|
+
}
|
|
1429
|
+
function FromRest$4(types) {
|
|
1430
|
+
return types.map((type) => Awaited(type));
|
|
1431
|
+
}
|
|
1432
|
+
/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */
|
|
1433
|
+
function Awaited(type, options) {
|
|
1434
|
+
return CreateType(IsComputed$1(type) ? FromComputed$4(type.target, type.parameters) : IsIntersect$1(type) ? FromIntersect$6(type.allOf) : IsUnion$1(type) ? FromUnion$6(type.anyOf) : IsPromise$1(type) ? FromPromise$2(type.item) : IsRef$1(type) ? FromRef$3(type.$ref) : type, options);
|
|
1435
|
+
}
|
|
1436
|
+
//#endregion
|
|
1437
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
|
|
1438
|
+
function FromRest$3(types) {
|
|
1439
|
+
const result = [];
|
|
1440
|
+
for (const L of types) result.push(KeyOfPropertyKeys(L));
|
|
1441
|
+
return result;
|
|
1442
|
+
}
|
|
1443
|
+
function FromIntersect$5(types) {
|
|
1444
|
+
return SetUnionMany(FromRest$3(types));
|
|
1445
|
+
}
|
|
1446
|
+
function FromUnion$5(types) {
|
|
1447
|
+
return SetIntersectMany(FromRest$3(types));
|
|
1448
|
+
}
|
|
1449
|
+
function FromTuple$3(types) {
|
|
1450
|
+
return types.map((_, indexer) => indexer.toString());
|
|
1451
|
+
}
|
|
1452
|
+
function FromArray$4(_) {
|
|
1453
|
+
return ["[number]"];
|
|
1454
|
+
}
|
|
1455
|
+
function FromProperties$14(T) {
|
|
1456
|
+
return globalThis.Object.getOwnPropertyNames(T);
|
|
1457
|
+
}
|
|
1458
|
+
function FromPatternProperties(patternProperties) {
|
|
1459
|
+
if (!includePatternProperties) return [];
|
|
1460
|
+
return globalThis.Object.getOwnPropertyNames(patternProperties).map((key) => {
|
|
1461
|
+
return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
|
|
1462
|
+
});
|
|
1463
|
+
}
|
|
1464
|
+
/** Returns a tuple of PropertyKeys derived from the given TSchema. */
|
|
1465
|
+
function KeyOfPropertyKeys(type) {
|
|
1466
|
+
return IsIntersect$1(type) ? FromIntersect$5(type.allOf) : IsUnion$1(type) ? FromUnion$5(type.anyOf) : IsTuple$1(type) ? FromTuple$3(type.items ?? []) : IsArray$1(type) ? FromArray$4(type.items) : IsObject$1(type) ? FromProperties$14(type.properties) : IsRecord$1(type) ? FromPatternProperties(type.patternProperties) : [];
|
|
1467
|
+
}
|
|
1468
|
+
let includePatternProperties = false;
|
|
1469
|
+
//#endregion
|
|
1470
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
|
|
1471
|
+
function FromComputed$3(target, parameters) {
|
|
1472
|
+
return Computed("KeyOf", [Computed(target, parameters)]);
|
|
1473
|
+
}
|
|
1474
|
+
function FromRef$2($ref) {
|
|
1475
|
+
return Computed("KeyOf", [Ref($ref)]);
|
|
1476
|
+
}
|
|
1477
|
+
function KeyOfFromType(type, options) {
|
|
1478
|
+
return CreateType(UnionEvaluated(KeyOfPropertyKeysToRest(KeyOfPropertyKeys(type))), options);
|
|
1479
|
+
}
|
|
1480
|
+
function KeyOfPropertyKeysToRest(propertyKeys) {
|
|
1481
|
+
return propertyKeys.map((L) => L === "[number]" ? Number$1() : Literal(L));
|
|
1482
|
+
}
|
|
1483
|
+
/** `[Json]` Creates a KeyOf type */
|
|
1484
|
+
function KeyOf(type, options) {
|
|
1485
|
+
return IsComputed$1(type) ? FromComputed$3(type.target, type.parameters) : IsRef$1(type) ? FromRef$2(type.$ref) : IsMappedResult$1(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options);
|
|
1486
|
+
}
|
|
1487
|
+
//#endregion
|
|
1488
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
|
|
1489
|
+
function FromProperties$13(properties, options) {
|
|
1490
|
+
const result = {};
|
|
1491
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) result[K2] = KeyOf(properties[K2], Clone(options));
|
|
1492
|
+
return result;
|
|
1493
|
+
}
|
|
1494
|
+
function FromMappedResult$7(mappedResult, options) {
|
|
1495
|
+
return FromProperties$13(mappedResult.properties, options);
|
|
1496
|
+
}
|
|
1497
|
+
function KeyOfFromMappedResult(mappedResult, options) {
|
|
1498
|
+
return MappedResult(FromMappedResult$7(mappedResult, options));
|
|
1499
|
+
}
|
|
1500
|
+
//#endregion
|
|
1501
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
|
|
1502
|
+
function CompositeKeys(T) {
|
|
1503
|
+
const Acc = [];
|
|
1504
|
+
for (const L of T) Acc.push(...KeyOfPropertyKeys(L));
|
|
1505
|
+
return SetDistinct(Acc);
|
|
1506
|
+
}
|
|
1507
|
+
function FilterNever(T) {
|
|
1508
|
+
return T.filter((L) => !IsNever$1(L));
|
|
1509
|
+
}
|
|
1510
|
+
function CompositeProperty(T, K) {
|
|
1511
|
+
const Acc = [];
|
|
1512
|
+
for (const L of T) Acc.push(...IndexFromPropertyKeys(L, [K]));
|
|
1513
|
+
return FilterNever(Acc);
|
|
1514
|
+
}
|
|
1515
|
+
function CompositeProperties(T, K) {
|
|
1516
|
+
const Acc = {};
|
|
1517
|
+
for (const L of K) Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
|
|
1518
|
+
return Acc;
|
|
1519
|
+
}
|
|
1520
|
+
function Composite(T, options) {
|
|
1521
|
+
return Object$1(CompositeProperties(T, CompositeKeys(T)), options);
|
|
1522
|
+
}
|
|
1523
|
+
//#endregion
|
|
1524
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
|
|
1525
|
+
/** `[JavaScript]` Creates a Date type */
|
|
1526
|
+
function Date$1(options) {
|
|
1527
|
+
return CreateType({
|
|
1528
|
+
[Kind]: "Date",
|
|
1529
|
+
type: "Date"
|
|
1530
|
+
}, options);
|
|
1531
|
+
}
|
|
1532
|
+
//#endregion
|
|
1533
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
|
|
1534
|
+
/** `[Json]` Creates a Null type */
|
|
1535
|
+
function Null(options) {
|
|
1536
|
+
return CreateType({
|
|
1537
|
+
[Kind]: "Null",
|
|
1538
|
+
type: "null"
|
|
1539
|
+
}, options);
|
|
1540
|
+
}
|
|
1541
|
+
//#endregion
|
|
1542
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
|
|
1543
|
+
/** `[JavaScript]` Creates a Symbol type */
|
|
1544
|
+
function Symbol$1(options) {
|
|
1545
|
+
return CreateType({
|
|
1546
|
+
[Kind]: "Symbol",
|
|
1547
|
+
type: "symbol"
|
|
1548
|
+
}, options);
|
|
1549
|
+
}
|
|
1550
|
+
//#endregion
|
|
1551
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
|
|
1552
|
+
/** `[JavaScript]` Creates a Undefined type */
|
|
1553
|
+
function Undefined(options) {
|
|
1554
|
+
return CreateType({
|
|
1555
|
+
[Kind]: "Undefined",
|
|
1556
|
+
type: "undefined"
|
|
1557
|
+
}, options);
|
|
1558
|
+
}
|
|
1559
|
+
//#endregion
|
|
1560
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
|
|
1561
|
+
/** `[JavaScript]` Creates a Uint8Array type */
|
|
1562
|
+
function Uint8Array$1(options) {
|
|
1563
|
+
return CreateType({
|
|
1564
|
+
[Kind]: "Uint8Array",
|
|
1565
|
+
type: "Uint8Array"
|
|
1566
|
+
}, options);
|
|
1567
|
+
}
|
|
1568
|
+
//#endregion
|
|
1569
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
|
|
1570
|
+
/** `[Json]` Creates an Unknown type */
|
|
1571
|
+
function Unknown(options) {
|
|
1572
|
+
return CreateType({ [Kind]: "Unknown" }, options);
|
|
1573
|
+
}
|
|
1574
|
+
//#endregion
|
|
1575
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
|
|
1576
|
+
function FromArray$3(T) {
|
|
1577
|
+
return T.map((L) => FromValue(L, false));
|
|
1578
|
+
}
|
|
1579
|
+
function FromProperties$12(value) {
|
|
1580
|
+
const Acc = {};
|
|
1581
|
+
for (const K of globalThis.Object.getOwnPropertyNames(value)) Acc[K] = Readonly(FromValue(value[K], false));
|
|
1582
|
+
return Acc;
|
|
1583
|
+
}
|
|
1584
|
+
function ConditionalReadonly(T, root) {
|
|
1585
|
+
return root === true ? T : Readonly(T);
|
|
1586
|
+
}
|
|
1587
|
+
function FromValue(value, root) {
|
|
1588
|
+
return IsAsyncIterator$2(value) ? ConditionalReadonly(Any(), root) : IsIterator$2(value) ? ConditionalReadonly(Any(), root) : IsArray$3(value) ? Readonly(Tuple(FromArray$3(value))) : IsUint8Array$2(value) ? Uint8Array$1() : IsDate$2(value) ? Date$1() : IsObject$3(value) ? ConditionalReadonly(Object$1(FromProperties$12(value)), root) : IsFunction$2(value) ? ConditionalReadonly(Function([], Unknown()), root) : IsUndefined$3(value) ? Undefined() : IsNull$2(value) ? Null() : IsSymbol$2(value) ? Symbol$1() : IsBigInt$2(value) ? BigInt() : IsNumber$3(value) ? Literal(value) : IsBoolean$2(value) ? Literal(value) : IsString$2(value) ? Literal(value) : Object$1({});
|
|
1589
|
+
}
|
|
1590
|
+
/** `[JavaScript]` Creates a readonly const type from the given value. */
|
|
1591
|
+
function Const(T, options) {
|
|
1592
|
+
return CreateType(FromValue(T, true), options);
|
|
1593
|
+
}
|
|
1594
|
+
//#endregion
|
|
1595
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
|
|
1596
|
+
/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */
|
|
1597
|
+
function ConstructorParameters(schema, options) {
|
|
1598
|
+
return IsConstructor$1(schema) ? Tuple(schema.parameters, options) : Never(options);
|
|
1599
|
+
}
|
|
1600
|
+
//#endregion
|
|
1601
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
|
|
1602
|
+
/** `[Json]` Creates a Enum type */
|
|
1603
|
+
function Enum(item, options) {
|
|
1604
|
+
if (IsUndefined$3(item)) throw new Error("Enum undefined or empty");
|
|
1605
|
+
const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
|
|
1606
|
+
return Union([...new Set(values1)].map((value) => Literal(value)), {
|
|
1607
|
+
...options,
|
|
1608
|
+
[Hint]: "Enum"
|
|
1609
|
+
});
|
|
1610
|
+
}
|
|
1611
|
+
//#endregion
|
|
1612
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs
|
|
1613
|
+
var ExtendsResolverError = class extends TypeBoxError {};
|
|
1614
|
+
var ExtendsResult;
|
|
1615
|
+
(function(ExtendsResult) {
|
|
1616
|
+
ExtendsResult[ExtendsResult["Union"] = 0] = "Union";
|
|
1617
|
+
ExtendsResult[ExtendsResult["True"] = 1] = "True";
|
|
1618
|
+
ExtendsResult[ExtendsResult["False"] = 2] = "False";
|
|
1619
|
+
})(ExtendsResult || (ExtendsResult = {}));
|
|
1620
|
+
function IntoBooleanResult(result) {
|
|
1621
|
+
return result === ExtendsResult.False ? result : ExtendsResult.True;
|
|
1622
|
+
}
|
|
1623
|
+
function Throw(message) {
|
|
1624
|
+
throw new ExtendsResolverError(message);
|
|
1625
|
+
}
|
|
1626
|
+
function IsStructuralRight(right) {
|
|
1627
|
+
return IsNever(right) || IsIntersect(right) || IsUnion(right) || IsUnknown(right) || IsAny(right);
|
|
1628
|
+
}
|
|
1629
|
+
function StructuralRight(left, right) {
|
|
1630
|
+
return IsNever(right) ? FromNeverRight(left, right) : IsIntersect(right) ? FromIntersectRight(left, right) : IsUnion(right) ? FromUnionRight(left, right) : IsUnknown(right) ? FromUnknownRight(left, right) : IsAny(right) ? FromAnyRight(left, right) : Throw("StructuralRight");
|
|
1631
|
+
}
|
|
1632
|
+
function FromAnyRight(left, right) {
|
|
1633
|
+
return ExtendsResult.True;
|
|
1634
|
+
}
|
|
1635
|
+
function FromAny(left, right) {
|
|
1636
|
+
return IsIntersect(right) ? FromIntersectRight(left, right) : IsUnion(right) && right.anyOf.some((schema) => IsAny(schema) || IsUnknown(schema)) ? ExtendsResult.True : IsUnion(right) ? ExtendsResult.Union : IsUnknown(right) ? ExtendsResult.True : IsAny(right) ? ExtendsResult.True : ExtendsResult.Union;
|
|
1637
|
+
}
|
|
1638
|
+
function FromArrayRight(left, right) {
|
|
1639
|
+
return IsUnknown(left) ? ExtendsResult.False : IsAny(left) ? ExtendsResult.Union : IsNever(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1640
|
+
}
|
|
1641
|
+
function FromArray$2(left, right) {
|
|
1642
|
+
return IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : !IsArray(right) ? ExtendsResult.False : IntoBooleanResult(Visit(left.items, right.items));
|
|
1643
|
+
}
|
|
1644
|
+
function FromAsyncIterator$2(left, right) {
|
|
1645
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : !IsAsyncIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit(left.items, right.items));
|
|
1646
|
+
}
|
|
1647
|
+
function FromBigInt(left, right) {
|
|
1648
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsBigInt(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1649
|
+
}
|
|
1650
|
+
function FromBooleanRight(left, right) {
|
|
1651
|
+
return IsLiteralBoolean(left) ? ExtendsResult.True : IsBoolean(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1652
|
+
}
|
|
1653
|
+
function FromBoolean(left, right) {
|
|
1654
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsBoolean(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1655
|
+
}
|
|
1656
|
+
function FromConstructor$2(left, right) {
|
|
1657
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : !IsConstructor(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit(left.returns, right.returns));
|
|
1658
|
+
}
|
|
1659
|
+
function FromDate(left, right) {
|
|
1660
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsDate(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1661
|
+
}
|
|
1662
|
+
function FromFunction$2(left, right) {
|
|
1663
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : !IsFunction(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit(left.returns, right.returns));
|
|
1664
|
+
}
|
|
1665
|
+
function FromIntegerRight(left, right) {
|
|
1666
|
+
return IsLiteral(left) && IsNumber$3(left.const) ? ExtendsResult.True : IsNumber(left) || IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1667
|
+
}
|
|
1668
|
+
function FromInteger(left, right) {
|
|
1669
|
+
return IsInteger(right) || IsNumber(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : ExtendsResult.False;
|
|
1670
|
+
}
|
|
1671
|
+
function FromIntersectRight(left, right) {
|
|
1672
|
+
return right.allOf.every((schema) => Visit(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1673
|
+
}
|
|
1674
|
+
function FromIntersect$4(left, right) {
|
|
1675
|
+
return left.allOf.some((schema) => Visit(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1676
|
+
}
|
|
1677
|
+
function FromIterator$2(left, right) {
|
|
1678
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : !IsIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit(left.items, right.items));
|
|
1679
|
+
}
|
|
1680
|
+
function FromLiteral(left, right) {
|
|
1681
|
+
return IsLiteral(right) && right.const === left.const ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsString(right) ? FromStringRight(left, right) : IsNumber(right) ? FromNumberRight(left, right) : IsInteger(right) ? FromIntegerRight(left, right) : IsBoolean(right) ? FromBooleanRight(left, right) : ExtendsResult.False;
|
|
1682
|
+
}
|
|
1683
|
+
function FromNeverRight(left, right) {
|
|
1684
|
+
return ExtendsResult.False;
|
|
1685
|
+
}
|
|
1686
|
+
function FromNever(left, right) {
|
|
1687
|
+
return ExtendsResult.True;
|
|
1688
|
+
}
|
|
1689
|
+
function UnwrapTNot(schema) {
|
|
1690
|
+
let [current, depth] = [schema, 0];
|
|
1691
|
+
while (true) {
|
|
1692
|
+
if (!IsNot(current)) break;
|
|
1693
|
+
current = current.not;
|
|
1694
|
+
depth += 1;
|
|
1695
|
+
}
|
|
1696
|
+
return depth % 2 === 0 ? current : Unknown();
|
|
1697
|
+
}
|
|
1698
|
+
function FromNot(left, right) {
|
|
1699
|
+
return IsNot(left) ? Visit(UnwrapTNot(left), right) : IsNot(right) ? Visit(left, UnwrapTNot(right)) : Throw("Invalid fallthrough for Not");
|
|
1700
|
+
}
|
|
1701
|
+
function FromNull(left, right) {
|
|
1702
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsNull(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1703
|
+
}
|
|
1704
|
+
function FromNumberRight(left, right) {
|
|
1705
|
+
return IsLiteralNumber(left) ? ExtendsResult.True : IsNumber(left) || IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1706
|
+
}
|
|
1707
|
+
function FromNumber(left, right) {
|
|
1708
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsInteger(right) || IsNumber(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1709
|
+
}
|
|
1710
|
+
function IsObjectPropertyCount(schema, count) {
|
|
1711
|
+
return Object.getOwnPropertyNames(schema.properties).length === count;
|
|
1712
|
+
}
|
|
1713
|
+
function IsObjectStringLike(schema) {
|
|
1714
|
+
return IsObjectArrayLike(schema);
|
|
1715
|
+
}
|
|
1716
|
+
function IsObjectSymbolLike(schema) {
|
|
1717
|
+
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "description" in schema.properties && IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && (IsString(schema.properties.description.anyOf[0]) && IsUndefined(schema.properties.description.anyOf[1]) || IsString(schema.properties.description.anyOf[1]) && IsUndefined(schema.properties.description.anyOf[0]));
|
|
1718
|
+
}
|
|
1719
|
+
function IsObjectNumberLike(schema) {
|
|
1720
|
+
return IsObjectPropertyCount(schema, 0);
|
|
1721
|
+
}
|
|
1722
|
+
function IsObjectBooleanLike(schema) {
|
|
1723
|
+
return IsObjectPropertyCount(schema, 0);
|
|
1724
|
+
}
|
|
1725
|
+
function IsObjectBigIntLike(schema) {
|
|
1726
|
+
return IsObjectPropertyCount(schema, 0);
|
|
1727
|
+
}
|
|
1728
|
+
function IsObjectDateLike(schema) {
|
|
1729
|
+
return IsObjectPropertyCount(schema, 0);
|
|
1730
|
+
}
|
|
1731
|
+
function IsObjectUint8ArrayLike(schema) {
|
|
1732
|
+
return IsObjectArrayLike(schema);
|
|
1733
|
+
}
|
|
1734
|
+
function IsObjectFunctionLike(schema) {
|
|
1735
|
+
const length = Number$1();
|
|
1736
|
+
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit(schema.properties["length"], length)) === ExtendsResult.True;
|
|
1737
|
+
}
|
|
1738
|
+
function IsObjectConstructorLike(schema) {
|
|
1739
|
+
return IsObjectPropertyCount(schema, 0);
|
|
1740
|
+
}
|
|
1741
|
+
function IsObjectArrayLike(schema) {
|
|
1742
|
+
const length = Number$1();
|
|
1743
|
+
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit(schema.properties["length"], length)) === ExtendsResult.True;
|
|
1744
|
+
}
|
|
1745
|
+
function IsObjectPromiseLike(schema) {
|
|
1746
|
+
const then = Function([Any()], Any());
|
|
1747
|
+
return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "then" in schema.properties && IntoBooleanResult(Visit(schema.properties["then"], then)) === ExtendsResult.True;
|
|
1748
|
+
}
|
|
1749
|
+
function Property(left, right) {
|
|
1750
|
+
return Visit(left, right) === ExtendsResult.False ? ExtendsResult.False : IsOptional(left) && !IsOptional(right) ? ExtendsResult.False : ExtendsResult.True;
|
|
1751
|
+
}
|
|
1752
|
+
function FromObjectRight(left, right) {
|
|
1753
|
+
return IsUnknown(left) ? ExtendsResult.False : IsAny(left) ? ExtendsResult.Union : IsNever(left) || IsLiteralString(left) && IsObjectStringLike(right) || IsLiteralNumber(left) && IsObjectNumberLike(right) || IsLiteralBoolean(left) && IsObjectBooleanLike(right) || IsSymbol(left) && IsObjectSymbolLike(right) || IsBigInt(left) && IsObjectBigIntLike(right) || IsString(left) && IsObjectStringLike(right) || IsSymbol(left) && IsObjectSymbolLike(right) || IsNumber(left) && IsObjectNumberLike(right) || IsInteger(left) && IsObjectNumberLike(right) || IsBoolean(left) && IsObjectBooleanLike(right) || IsUint8Array(left) && IsObjectUint8ArrayLike(right) || IsDate(left) && IsObjectDateLike(right) || IsConstructor(left) && IsObjectConstructorLike(right) || IsFunction(left) && IsObjectFunctionLike(right) ? ExtendsResult.True : IsRecord(left) && IsString(RecordKey$1(left)) ? right[Hint] === "Record" ? ExtendsResult.True : ExtendsResult.False : IsRecord(left) && IsNumber(RecordKey$1(left)) ? IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False : ExtendsResult.False;
|
|
1754
|
+
}
|
|
1755
|
+
function FromObject$6(left, right) {
|
|
1756
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : !IsObject(right) ? ExtendsResult.False : (() => {
|
|
1757
|
+
for (const key of Object.getOwnPropertyNames(right.properties)) {
|
|
1758
|
+
if (!(key in left.properties) && !IsOptional(right.properties[key])) return ExtendsResult.False;
|
|
1759
|
+
if (IsOptional(right.properties[key])) return ExtendsResult.True;
|
|
1760
|
+
if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) return ExtendsResult.False;
|
|
1761
|
+
}
|
|
1762
|
+
return ExtendsResult.True;
|
|
1763
|
+
})();
|
|
1764
|
+
}
|
|
1765
|
+
function FromPromise$1(left, right) {
|
|
1766
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True : !IsPromise(right) ? ExtendsResult.False : IntoBooleanResult(Visit(left.item, right.item));
|
|
1767
|
+
}
|
|
1768
|
+
function RecordKey$1(schema) {
|
|
1769
|
+
return PatternNumberExact in schema.patternProperties ? Number$1() : PatternStringExact in schema.patternProperties ? String() : Throw("Unknown record key pattern");
|
|
1770
|
+
}
|
|
1771
|
+
function RecordValue$1(schema) {
|
|
1772
|
+
return PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : Throw("Unable to get record value schema");
|
|
1773
|
+
}
|
|
1774
|
+
function FromRecordRight(left, right) {
|
|
1775
|
+
const [Key, Value] = [RecordKey$1(right), RecordValue$1(right)];
|
|
1776
|
+
return IsLiteralString(left) && IsNumber(Key) && IntoBooleanResult(Visit(left, Value)) === ExtendsResult.True ? ExtendsResult.True : IsUint8Array(left) && IsNumber(Key) ? Visit(left, Value) : IsString(left) && IsNumber(Key) ? Visit(left, Value) : IsArray(left) && IsNumber(Key) ? Visit(left, Value) : IsObject(left) ? (() => {
|
|
1777
|
+
for (const key of Object.getOwnPropertyNames(left.properties)) if (Property(Value, left.properties[key]) === ExtendsResult.False) return ExtendsResult.False;
|
|
1778
|
+
return ExtendsResult.True;
|
|
1779
|
+
})() : ExtendsResult.False;
|
|
1780
|
+
}
|
|
1781
|
+
function FromRecord$2(left, right) {
|
|
1782
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : !IsRecord(right) ? ExtendsResult.False : Visit(RecordValue$1(left), RecordValue$1(right));
|
|
1783
|
+
}
|
|
1784
|
+
function FromRegExp(left, right) {
|
|
1785
|
+
return Visit(IsRegExp(left) ? String() : left, IsRegExp(right) ? String() : right);
|
|
1786
|
+
}
|
|
1787
|
+
function FromStringRight(left, right) {
|
|
1788
|
+
return IsLiteral(left) && IsString$2(left.const) ? ExtendsResult.True : IsString(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1789
|
+
}
|
|
1790
|
+
function FromString(left, right) {
|
|
1791
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsString(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1792
|
+
}
|
|
1793
|
+
function FromSymbol(left, right) {
|
|
1794
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsSymbol(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1795
|
+
}
|
|
1796
|
+
function FromTemplateLiteral$1(left, right) {
|
|
1797
|
+
return IsTemplateLiteral(left) ? Visit(TemplateLiteralToUnion(left), right) : IsTemplateLiteral(right) ? Visit(left, TemplateLiteralToUnion(right)) : Throw("Invalid fallthrough for TemplateLiteral");
|
|
1798
|
+
}
|
|
1799
|
+
function IsArrayOfTuple(left, right) {
|
|
1800
|
+
return IsArray(right) && left.items !== void 0 && left.items.every((schema) => Visit(schema, right.items) === ExtendsResult.True);
|
|
1801
|
+
}
|
|
1802
|
+
function FromTupleRight(left, right) {
|
|
1803
|
+
return IsNever(left) ? ExtendsResult.True : IsUnknown(left) ? ExtendsResult.False : IsAny(left) ? ExtendsResult.Union : ExtendsResult.False;
|
|
1804
|
+
}
|
|
1805
|
+
function FromTuple$2(left, right) {
|
|
1806
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True : !IsTuple(right) ? ExtendsResult.False : IsUndefined$3(left.items) && !IsUndefined$3(right.items) || !IsUndefined$3(left.items) && IsUndefined$3(right.items) ? ExtendsResult.False : IsUndefined$3(left.items) && !IsUndefined$3(right.items) ? ExtendsResult.True : left.items.every((schema, index) => Visit(schema, right.items[index]) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1807
|
+
}
|
|
1808
|
+
function FromUint8Array(left, right) {
|
|
1809
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsUint8Array(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1810
|
+
}
|
|
1811
|
+
function FromUndefined(left, right) {
|
|
1812
|
+
return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsVoid(right) ? FromVoidRight(left, right) : IsUndefined(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1813
|
+
}
|
|
1814
|
+
function FromUnionRight(left, right) {
|
|
1815
|
+
return right.anyOf.some((schema) => Visit(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1816
|
+
}
|
|
1817
|
+
function FromUnion$4(left, right) {
|
|
1818
|
+
return left.anyOf.every((schema) => Visit(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
|
|
1819
|
+
}
|
|
1820
|
+
function FromUnknownRight(left, right) {
|
|
1821
|
+
return ExtendsResult.True;
|
|
1822
|
+
}
|
|
1823
|
+
function FromUnknown(left, right) {
|
|
1824
|
+
return IsNever(right) ? FromNeverRight(left, right) : IsIntersect(right) ? FromIntersectRight(left, right) : IsUnion(right) ? FromUnionRight(left, right) : IsAny(right) ? FromAnyRight(left, right) : IsString(right) ? FromStringRight(left, right) : IsNumber(right) ? FromNumberRight(left, right) : IsInteger(right) ? FromIntegerRight(left, right) : IsBoolean(right) ? FromBooleanRight(left, right) : IsArray(right) ? FromArrayRight(left, right) : IsTuple(right) ? FromTupleRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsUnknown(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1825
|
+
}
|
|
1826
|
+
function FromVoidRight(left, right) {
|
|
1827
|
+
return IsUndefined(left) ? ExtendsResult.True : IsUndefined(left) ? ExtendsResult.True : ExtendsResult.False;
|
|
1828
|
+
}
|
|
1829
|
+
function FromVoid(left, right) {
|
|
1830
|
+
return IsIntersect(right) ? FromIntersectRight(left, right) : IsUnion(right) ? FromUnionRight(left, right) : IsUnknown(right) ? FromUnknownRight(left, right) : IsAny(right) ? FromAnyRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsVoid(right) ? ExtendsResult.True : ExtendsResult.False;
|
|
1831
|
+
}
|
|
1832
|
+
function Visit(left, right) {
|
|
1833
|
+
return IsTemplateLiteral(left) || IsTemplateLiteral(right) ? FromTemplateLiteral$1(left, right) : IsRegExp(left) || IsRegExp(right) ? FromRegExp(left, right) : IsNot(left) || IsNot(right) ? FromNot(left, right) : IsAny(left) ? FromAny(left, right) : IsArray(left) ? FromArray$2(left, right) : IsBigInt(left) ? FromBigInt(left, right) : IsBoolean(left) ? FromBoolean(left, right) : IsAsyncIterator(left) ? FromAsyncIterator$2(left, right) : IsConstructor(left) ? FromConstructor$2(left, right) : IsDate(left) ? FromDate(left, right) : IsFunction(left) ? FromFunction$2(left, right) : IsInteger(left) ? FromInteger(left, right) : IsIntersect(left) ? FromIntersect$4(left, right) : IsIterator(left) ? FromIterator$2(left, right) : IsLiteral(left) ? FromLiteral(left, right) : IsNever(left) ? FromNever(left, right) : IsNull(left) ? FromNull(left, right) : IsNumber(left) ? FromNumber(left, right) : IsObject(left) ? FromObject$6(left, right) : IsRecord(left) ? FromRecord$2(left, right) : IsString(left) ? FromString(left, right) : IsSymbol(left) ? FromSymbol(left, right) : IsTuple(left) ? FromTuple$2(left, right) : IsPromise(left) ? FromPromise$1(left, right) : IsUint8Array(left) ? FromUint8Array(left, right) : IsUndefined(left) ? FromUndefined(left, right) : IsUnion(left) ? FromUnion$4(left, right) : IsUnknown(left) ? FromUnknown(left, right) : IsVoid(left) ? FromVoid(left, right) : Throw(`Unknown left type operand '${left[Kind]}'`);
|
|
1834
|
+
}
|
|
1835
|
+
function ExtendsCheck(left, right) {
|
|
1836
|
+
return Visit(left, right);
|
|
1837
|
+
}
|
|
1838
|
+
//#endregion
|
|
1839
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs
|
|
1840
|
+
function FromProperties$11(P, Right, True, False, options) {
|
|
1841
|
+
const Acc = {};
|
|
1842
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(P)) Acc[K2] = Extends(P[K2], Right, True, False, Clone(options));
|
|
1843
|
+
return Acc;
|
|
1844
|
+
}
|
|
1845
|
+
function FromMappedResult$6(Left, Right, True, False, options) {
|
|
1846
|
+
return FromProperties$11(Left.properties, Right, True, False, options);
|
|
1847
|
+
}
|
|
1848
|
+
function ExtendsFromMappedResult(Left, Right, True, False, options) {
|
|
1849
|
+
return MappedResult(FromMappedResult$6(Left, Right, True, False, options));
|
|
1850
|
+
}
|
|
1851
|
+
//#endregion
|
|
1852
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs
|
|
1853
|
+
function ExtendsResolve(left, right, trueType, falseType) {
|
|
1854
|
+
const R = ExtendsCheck(left, right);
|
|
1855
|
+
return R === ExtendsResult.Union ? Union([trueType, falseType]) : R === ExtendsResult.True ? trueType : falseType;
|
|
1856
|
+
}
|
|
1857
|
+
/** `[Json]` Creates a Conditional type */
|
|
1858
|
+
function Extends(L, R, T, F, options) {
|
|
1859
|
+
return IsMappedResult$1(L) ? ExtendsFromMappedResult(L, R, T, F, options) : IsMappedKey$1(L) ? CreateType(ExtendsFromMappedKey(L, R, T, F, options)) : CreateType(ExtendsResolve(L, R, T, F), options);
|
|
1860
|
+
}
|
|
1861
|
+
//#endregion
|
|
1862
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs
|
|
1863
|
+
function FromPropertyKey$2(K, U, L, R, options) {
|
|
1864
|
+
return { [K]: Extends(Literal(K), U, L, R, Clone(options)) };
|
|
1865
|
+
}
|
|
1866
|
+
function FromPropertyKeys$2(K, U, L, R, options) {
|
|
1867
|
+
return K.reduce((Acc, LK) => {
|
|
1868
|
+
return {
|
|
1869
|
+
...Acc,
|
|
1870
|
+
...FromPropertyKey$2(LK, U, L, R, options)
|
|
1871
|
+
};
|
|
1872
|
+
}, {});
|
|
1873
|
+
}
|
|
1874
|
+
function FromMappedKey$2(K, U, L, R, options) {
|
|
1875
|
+
return FromPropertyKeys$2(K.keys, U, L, R, options);
|
|
1876
|
+
}
|
|
1877
|
+
function ExtendsFromMappedKey(T, U, L, R, options) {
|
|
1878
|
+
return MappedResult(FromMappedKey$2(T, U, L, R, options));
|
|
1879
|
+
}
|
|
1880
|
+
//#endregion
|
|
1881
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs
|
|
1882
|
+
function ExcludeFromTemplateLiteral(L, R) {
|
|
1883
|
+
return Exclude(TemplateLiteralToUnion(L), R);
|
|
1884
|
+
}
|
|
1885
|
+
//#endregion
|
|
1886
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs
|
|
1887
|
+
function ExcludeRest(L, R) {
|
|
1888
|
+
const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);
|
|
1889
|
+
return excluded.length === 1 ? excluded[0] : Union(excluded);
|
|
1890
|
+
}
|
|
1891
|
+
/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */
|
|
1892
|
+
function Exclude(L, R, options = {}) {
|
|
1893
|
+
if (IsTemplateLiteral$1(L)) return CreateType(ExcludeFromTemplateLiteral(L, R), options);
|
|
1894
|
+
if (IsMappedResult$1(L)) return CreateType(ExcludeFromMappedResult(L, R), options);
|
|
1895
|
+
return CreateType(IsUnion$1(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
|
|
1896
|
+
}
|
|
1897
|
+
//#endregion
|
|
1898
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
|
|
1899
|
+
function FromProperties$10(P, U) {
|
|
1900
|
+
const Acc = {};
|
|
1901
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(P)) Acc[K2] = Exclude(P[K2], U);
|
|
1902
|
+
return Acc;
|
|
1903
|
+
}
|
|
1904
|
+
function FromMappedResult$5(R, T) {
|
|
1905
|
+
return FromProperties$10(R.properties, T);
|
|
1906
|
+
}
|
|
1907
|
+
function ExcludeFromMappedResult(R, T) {
|
|
1908
|
+
return MappedResult(FromMappedResult$5(R, T));
|
|
1909
|
+
}
|
|
1910
|
+
//#endregion
|
|
1911
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs
|
|
1912
|
+
function ExtractFromTemplateLiteral(L, R) {
|
|
1913
|
+
return Extract(TemplateLiteralToUnion(L), R);
|
|
1914
|
+
}
|
|
1915
|
+
//#endregion
|
|
1916
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs
|
|
1917
|
+
function ExtractRest(L, R) {
|
|
1918
|
+
const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
|
|
1919
|
+
return extracted.length === 1 ? extracted[0] : Union(extracted);
|
|
1920
|
+
}
|
|
1921
|
+
/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */
|
|
1922
|
+
function Extract(L, R, options) {
|
|
1923
|
+
if (IsTemplateLiteral$1(L)) return CreateType(ExtractFromTemplateLiteral(L, R), options);
|
|
1924
|
+
if (IsMappedResult$1(L)) return CreateType(ExtractFromMappedResult(L, R), options);
|
|
1925
|
+
return CreateType(IsUnion$1(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
|
|
1926
|
+
}
|
|
1927
|
+
//#endregion
|
|
1928
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
|
|
1929
|
+
function FromProperties$9(P, T) {
|
|
1930
|
+
const Acc = {};
|
|
1931
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(P)) Acc[K2] = Extract(P[K2], T);
|
|
1932
|
+
return Acc;
|
|
1933
|
+
}
|
|
1934
|
+
function FromMappedResult$4(R, T) {
|
|
1935
|
+
return FromProperties$9(R.properties, T);
|
|
1936
|
+
}
|
|
1937
|
+
function ExtractFromMappedResult(R, T) {
|
|
1938
|
+
return MappedResult(FromMappedResult$4(R, T));
|
|
1939
|
+
}
|
|
1940
|
+
//#endregion
|
|
1941
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
|
|
1942
|
+
/** `[JavaScript]` Extracts the InstanceType from the given Constructor type */
|
|
1943
|
+
function InstanceType(schema, options) {
|
|
1944
|
+
return IsConstructor$1(schema) ? CreateType(schema.returns, options) : Never(options);
|
|
1945
|
+
}
|
|
1946
|
+
//#endregion
|
|
1947
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
|
|
1948
|
+
/** `[Json]` Creates a Readonly and Optional property */
|
|
1949
|
+
function ReadonlyOptional(schema) {
|
|
1950
|
+
return Readonly(Optional(schema));
|
|
1951
|
+
}
|
|
1952
|
+
//#endregion
|
|
1953
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
|
|
1954
|
+
function RecordCreateFromPattern(pattern, T, options) {
|
|
1955
|
+
return CreateType({
|
|
1956
|
+
[Kind]: "Record",
|
|
1957
|
+
type: "object",
|
|
1958
|
+
patternProperties: { [pattern]: T }
|
|
1959
|
+
}, options);
|
|
1960
|
+
}
|
|
1961
|
+
function RecordCreateFromKeys(K, T, options) {
|
|
1962
|
+
const result = {};
|
|
1963
|
+
for (const K2 of K) result[K2] = T;
|
|
1964
|
+
return Object$1(result, {
|
|
1965
|
+
...options,
|
|
1966
|
+
[Hint]: "Record"
|
|
1967
|
+
});
|
|
1968
|
+
}
|
|
1969
|
+
function FromTemplateLiteralKey(K, T, options) {
|
|
1970
|
+
return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
|
|
1971
|
+
}
|
|
1972
|
+
function FromUnionKey(key, type, options) {
|
|
1973
|
+
return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
|
|
1974
|
+
}
|
|
1975
|
+
function FromLiteralKey(key, type, options) {
|
|
1976
|
+
return RecordCreateFromKeys([key.toString()], type, options);
|
|
1977
|
+
}
|
|
1978
|
+
function FromRegExpKey(key, type, options) {
|
|
1979
|
+
return RecordCreateFromPattern(key.source, type, options);
|
|
1980
|
+
}
|
|
1981
|
+
function FromStringKey(key, type, options) {
|
|
1982
|
+
return RecordCreateFromPattern(IsUndefined$3(key.pattern) ? PatternStringExact : key.pattern, type, options);
|
|
1983
|
+
}
|
|
1984
|
+
function FromAnyKey(_, type, options) {
|
|
1985
|
+
return RecordCreateFromPattern(PatternStringExact, type, options);
|
|
1986
|
+
}
|
|
1987
|
+
function FromNeverKey(_key, type, options) {
|
|
1988
|
+
return RecordCreateFromPattern(PatternNeverExact, type, options);
|
|
1989
|
+
}
|
|
1990
|
+
function FromBooleanKey(_key, type, options) {
|
|
1991
|
+
return Object$1({
|
|
1992
|
+
true: type,
|
|
1993
|
+
false: type
|
|
1994
|
+
}, options);
|
|
1995
|
+
}
|
|
1996
|
+
function FromIntegerKey(_key, type, options) {
|
|
1997
|
+
return RecordCreateFromPattern(PatternNumberExact, type, options);
|
|
1998
|
+
}
|
|
1999
|
+
function FromNumberKey(_, type, options) {
|
|
2000
|
+
return RecordCreateFromPattern(PatternNumberExact, type, options);
|
|
2001
|
+
}
|
|
2002
|
+
/** `[Json]` Creates a Record type */
|
|
2003
|
+
function Record(key, type, options = {}) {
|
|
2004
|
+
return IsUnion$1(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral$1(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral$1(key) ? FromLiteralKey(key.const, type, options) : IsBoolean$1(key) ? FromBooleanKey(key, type, options) : IsInteger$1(key) ? FromIntegerKey(key, type, options) : IsNumber$1(key) ? FromNumberKey(key, type, options) : IsRegExp$1(key) ? FromRegExpKey(key, type, options) : IsString$1(key) ? FromStringKey(key, type, options) : IsAny$1(key) ? FromAnyKey(key, type, options) : IsNever$1(key) ? FromNeverKey(key, type, options) : Never(options);
|
|
2005
|
+
}
|
|
2006
|
+
/** Gets the Records Pattern */
|
|
2007
|
+
function RecordPattern(record) {
|
|
2008
|
+
return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
|
|
2009
|
+
}
|
|
2010
|
+
/** Gets the Records Key Type */
|
|
2011
|
+
function RecordKey(type) {
|
|
2012
|
+
const pattern = RecordPattern(type);
|
|
2013
|
+
return pattern === PatternStringExact ? String() : pattern === PatternNumberExact ? Number$1() : String({ pattern });
|
|
2014
|
+
}
|
|
2015
|
+
/** Gets a Record Value Type */
|
|
2016
|
+
function RecordValue(type) {
|
|
2017
|
+
return type.patternProperties[RecordPattern(type)];
|
|
2018
|
+
}
|
|
2019
|
+
//#endregion
|
|
2020
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
|
|
2021
|
+
function FromConstructor$1(args, type) {
|
|
2022
|
+
type.parameters = FromTypes$1(args, type.parameters);
|
|
2023
|
+
type.returns = FromType$1(args, type.returns);
|
|
2024
|
+
return type;
|
|
2025
|
+
}
|
|
2026
|
+
function FromFunction$1(args, type) {
|
|
2027
|
+
type.parameters = FromTypes$1(args, type.parameters);
|
|
2028
|
+
type.returns = FromType$1(args, type.returns);
|
|
2029
|
+
return type;
|
|
2030
|
+
}
|
|
2031
|
+
function FromIntersect$3(args, type) {
|
|
2032
|
+
type.allOf = FromTypes$1(args, type.allOf);
|
|
2033
|
+
return type;
|
|
2034
|
+
}
|
|
2035
|
+
function FromUnion$3(args, type) {
|
|
2036
|
+
type.anyOf = FromTypes$1(args, type.anyOf);
|
|
2037
|
+
return type;
|
|
2038
|
+
}
|
|
2039
|
+
function FromTuple$1(args, type) {
|
|
2040
|
+
if (IsUndefined$3(type.items)) return type;
|
|
2041
|
+
type.items = FromTypes$1(args, type.items);
|
|
2042
|
+
return type;
|
|
2043
|
+
}
|
|
2044
|
+
function FromArray$1(args, type) {
|
|
2045
|
+
type.items = FromType$1(args, type.items);
|
|
2046
|
+
return type;
|
|
2047
|
+
}
|
|
2048
|
+
function FromAsyncIterator$1(args, type) {
|
|
2049
|
+
type.items = FromType$1(args, type.items);
|
|
2050
|
+
return type;
|
|
2051
|
+
}
|
|
2052
|
+
function FromIterator$1(args, type) {
|
|
2053
|
+
type.items = FromType$1(args, type.items);
|
|
2054
|
+
return type;
|
|
2055
|
+
}
|
|
2056
|
+
function FromPromise(args, type) {
|
|
2057
|
+
type.item = FromType$1(args, type.item);
|
|
2058
|
+
return type;
|
|
2059
|
+
}
|
|
2060
|
+
function FromObject$5(args, type) {
|
|
2061
|
+
const mappedProperties = FromProperties$8(args, type.properties);
|
|
2062
|
+
return {
|
|
2063
|
+
...type,
|
|
2064
|
+
...Object$1(mappedProperties)
|
|
2065
|
+
};
|
|
2066
|
+
}
|
|
2067
|
+
function FromRecord$1(args, type) {
|
|
2068
|
+
const result = Record(FromType$1(args, RecordKey(type)), FromType$1(args, RecordValue(type)));
|
|
2069
|
+
return {
|
|
2070
|
+
...type,
|
|
2071
|
+
...result
|
|
2072
|
+
};
|
|
2073
|
+
}
|
|
2074
|
+
function FromArgument(args, argument) {
|
|
2075
|
+
return argument.index in args ? args[argument.index] : Unknown();
|
|
2076
|
+
}
|
|
2077
|
+
function FromProperty$1(args, type) {
|
|
2078
|
+
const isReadonly = IsReadonly(type);
|
|
2079
|
+
const isOptional = IsOptional$1(type);
|
|
2080
|
+
const mapped = FromType$1(args, type);
|
|
2081
|
+
return isReadonly && isOptional ? ReadonlyOptional(mapped) : isReadonly && !isOptional ? Readonly(mapped) : !isReadonly && isOptional ? Optional(mapped) : mapped;
|
|
2082
|
+
}
|
|
2083
|
+
function FromProperties$8(args, properties) {
|
|
2084
|
+
return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => {
|
|
2085
|
+
return {
|
|
2086
|
+
...result,
|
|
2087
|
+
[key]: FromProperty$1(args, properties[key])
|
|
2088
|
+
};
|
|
2089
|
+
}, {});
|
|
2090
|
+
}
|
|
2091
|
+
function FromTypes$1(args, types) {
|
|
2092
|
+
return types.map((type) => FromType$1(args, type));
|
|
2093
|
+
}
|
|
2094
|
+
function FromType$1(args, type) {
|
|
2095
|
+
return IsConstructor$1(type) ? FromConstructor$1(args, type) : IsFunction$1(type) ? FromFunction$1(args, type) : IsIntersect$1(type) ? FromIntersect$3(args, type) : IsUnion$1(type) ? FromUnion$3(args, type) : IsTuple$1(type) ? FromTuple$1(args, type) : IsArray$1(type) ? FromArray$1(args, type) : IsAsyncIterator$1(type) ? FromAsyncIterator$1(args, type) : IsIterator$1(type) ? FromIterator$1(args, type) : IsPromise$1(type) ? FromPromise(args, type) : IsObject$1(type) ? FromObject$5(args, type) : IsRecord$1(type) ? FromRecord$1(args, type) : IsArgument$1(type) ? FromArgument(args, type) : type;
|
|
2096
|
+
}
|
|
2097
|
+
/** `[JavaScript]` Instantiates a type with the given parameters */
|
|
2098
|
+
function Instantiate(type, args) {
|
|
2099
|
+
return FromType$1(args, CloneType(type));
|
|
2100
|
+
}
|
|
2101
|
+
//#endregion
|
|
2102
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
|
|
2103
|
+
/** `[Json]` Creates an Integer type */
|
|
2104
|
+
function Integer(options) {
|
|
2105
|
+
return CreateType({
|
|
2106
|
+
[Kind]: "Integer",
|
|
2107
|
+
type: "integer"
|
|
2108
|
+
}, options);
|
|
2109
|
+
}
|
|
2110
|
+
//#endregion
|
|
2111
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs
|
|
2112
|
+
function MappedIntrinsicPropertyKey(K, M, options) {
|
|
2113
|
+
return { [K]: Intrinsic(Literal(K), M, Clone(options)) };
|
|
2114
|
+
}
|
|
2115
|
+
function MappedIntrinsicPropertyKeys(K, M, options) {
|
|
2116
|
+
return K.reduce((Acc, L) => {
|
|
2117
|
+
return {
|
|
2118
|
+
...Acc,
|
|
2119
|
+
...MappedIntrinsicPropertyKey(L, M, options)
|
|
2120
|
+
};
|
|
2121
|
+
}, {});
|
|
2122
|
+
}
|
|
2123
|
+
function MappedIntrinsicProperties(T, M, options) {
|
|
2124
|
+
return MappedIntrinsicPropertyKeys(T["keys"], M, options);
|
|
2125
|
+
}
|
|
2126
|
+
function IntrinsicFromMappedKey(T, M, options) {
|
|
2127
|
+
return MappedResult(MappedIntrinsicProperties(T, M, options));
|
|
2128
|
+
}
|
|
2129
|
+
//#endregion
|
|
2130
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs
|
|
2131
|
+
function ApplyUncapitalize(value) {
|
|
2132
|
+
const [first, rest] = [value.slice(0, 1), value.slice(1)];
|
|
2133
|
+
return [first.toLowerCase(), rest].join("");
|
|
2134
|
+
}
|
|
2135
|
+
function ApplyCapitalize(value) {
|
|
2136
|
+
const [first, rest] = [value.slice(0, 1), value.slice(1)];
|
|
2137
|
+
return [first.toUpperCase(), rest].join("");
|
|
2138
|
+
}
|
|
2139
|
+
function ApplyUppercase(value) {
|
|
2140
|
+
return value.toUpperCase();
|
|
2141
|
+
}
|
|
2142
|
+
function ApplyLowercase(value) {
|
|
2143
|
+
return value.toLowerCase();
|
|
2144
|
+
}
|
|
2145
|
+
function FromTemplateLiteral(schema, mode, options) {
|
|
2146
|
+
const expression = TemplateLiteralParseExact(schema.pattern);
|
|
2147
|
+
if (!IsTemplateLiteralExpressionFinite(expression)) return {
|
|
2148
|
+
...schema,
|
|
2149
|
+
pattern: FromLiteralValue(schema.pattern, mode)
|
|
2150
|
+
};
|
|
2151
|
+
return TemplateLiteral([Union(FromRest$2([...TemplateLiteralExpressionGenerate(expression)].map((value) => Literal(value)), mode))], options);
|
|
2152
|
+
}
|
|
2153
|
+
function FromLiteralValue(value, mode) {
|
|
2154
|
+
return typeof value === "string" ? mode === "Uncapitalize" ? ApplyUncapitalize(value) : mode === "Capitalize" ? ApplyCapitalize(value) : mode === "Uppercase" ? ApplyUppercase(value) : mode === "Lowercase" ? ApplyLowercase(value) : value : value.toString();
|
|
2155
|
+
}
|
|
2156
|
+
function FromRest$2(T, M) {
|
|
2157
|
+
return T.map((L) => Intrinsic(L, M));
|
|
2158
|
+
}
|
|
2159
|
+
/** Applies an intrinsic string manipulation to the given type. */
|
|
2160
|
+
function Intrinsic(schema, mode, options = {}) {
|
|
2161
|
+
return IsMappedKey$1(schema) ? IntrinsicFromMappedKey(schema, mode, options) : IsTemplateLiteral$1(schema) ? FromTemplateLiteral(schema, mode, options) : IsUnion$1(schema) ? Union(FromRest$2(schema.anyOf, mode), options) : IsLiteral$1(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : CreateType(schema, options);
|
|
2162
|
+
}
|
|
2163
|
+
//#endregion
|
|
2164
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs
|
|
2165
|
+
/** `[Json]` Intrinsic function to Capitalize LiteralString types */
|
|
2166
|
+
function Capitalize(T, options = {}) {
|
|
2167
|
+
return Intrinsic(T, "Capitalize", options);
|
|
2168
|
+
}
|
|
2169
|
+
//#endregion
|
|
2170
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs
|
|
2171
|
+
/** `[Json]` Intrinsic function to Lowercase LiteralString types */
|
|
2172
|
+
function Lowercase(T, options = {}) {
|
|
2173
|
+
return Intrinsic(T, "Lowercase", options);
|
|
2174
|
+
}
|
|
2175
|
+
//#endregion
|
|
2176
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs
|
|
2177
|
+
/** `[Json]` Intrinsic function to Uncapitalize LiteralString types */
|
|
2178
|
+
function Uncapitalize(T, options = {}) {
|
|
2179
|
+
return Intrinsic(T, "Uncapitalize", options);
|
|
2180
|
+
}
|
|
2181
|
+
//#endregion
|
|
2182
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs
|
|
2183
|
+
/** `[Json]` Intrinsic function to Uppercase LiteralString types */
|
|
2184
|
+
function Uppercase(T, options = {}) {
|
|
2185
|
+
return Intrinsic(T, "Uppercase", options);
|
|
2186
|
+
}
|
|
2187
|
+
//#endregion
|
|
2188
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
|
|
2189
|
+
function FromProperties$7(properties, propertyKeys, options) {
|
|
2190
|
+
const result = {};
|
|
2191
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) result[K2] = Omit(properties[K2], propertyKeys, Clone(options));
|
|
2192
|
+
return result;
|
|
2193
|
+
}
|
|
2194
|
+
function FromMappedResult$3(mappedResult, propertyKeys, options) {
|
|
2195
|
+
return FromProperties$7(mappedResult.properties, propertyKeys, options);
|
|
2196
|
+
}
|
|
2197
|
+
function OmitFromMappedResult(mappedResult, propertyKeys, options) {
|
|
2198
|
+
return MappedResult(FromMappedResult$3(mappedResult, propertyKeys, options));
|
|
2199
|
+
}
|
|
2200
|
+
//#endregion
|
|
2201
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
|
|
2202
|
+
function FromIntersect$2(types, propertyKeys) {
|
|
2203
|
+
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
2204
|
+
}
|
|
2205
|
+
function FromUnion$2(types, propertyKeys) {
|
|
2206
|
+
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
2207
|
+
}
|
|
2208
|
+
function FromProperty(properties, key) {
|
|
2209
|
+
const { [key]: _, ...R } = properties;
|
|
2210
|
+
return R;
|
|
2211
|
+
}
|
|
2212
|
+
function FromProperties$6(properties, propertyKeys) {
|
|
2213
|
+
return propertyKeys.reduce((T, K2) => FromProperty(T, K2), properties);
|
|
2214
|
+
}
|
|
2215
|
+
function FromObject$4(type, propertyKeys, properties) {
|
|
2216
|
+
const options = Discard(type, [
|
|
2217
|
+
TransformKind,
|
|
2218
|
+
"$id",
|
|
2219
|
+
"required",
|
|
2220
|
+
"properties"
|
|
2221
|
+
]);
|
|
2222
|
+
return Object$1(FromProperties$6(properties, propertyKeys), options);
|
|
2223
|
+
}
|
|
2224
|
+
function UnionFromPropertyKeys$1(propertyKeys) {
|
|
2225
|
+
return Union(propertyKeys.reduce((result, key) => IsLiteralValue$1(key) ? [...result, Literal(key)] : result, []));
|
|
2226
|
+
}
|
|
2227
|
+
function OmitResolve(type, propertyKeys) {
|
|
2228
|
+
return IsIntersect$1(type) ? Intersect(FromIntersect$2(type.allOf, propertyKeys)) : IsUnion$1(type) ? Union(FromUnion$2(type.anyOf, propertyKeys)) : IsObject$1(type) ? FromObject$4(type, propertyKeys, type.properties) : Object$1({});
|
|
2229
|
+
}
|
|
2230
|
+
/** `[Json]` Constructs a type whose keys are picked from the given type */
|
|
2231
|
+
function Omit(type, key, options) {
|
|
2232
|
+
const typeKey = IsArray$3(key) ? UnionFromPropertyKeys$1(key) : key;
|
|
2233
|
+
const propertyKeys = IsSchema$1(key) ? IndexPropertyKeys(key) : key;
|
|
2234
|
+
const isTypeRef = IsRef$1(type);
|
|
2235
|
+
const isKeyRef = IsRef$1(key);
|
|
2236
|
+
return IsMappedResult$1(type) ? OmitFromMappedResult(type, propertyKeys, options) : IsMappedKey$1(key) ? OmitFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Omit", [type, typeKey], options) : CreateType({
|
|
2237
|
+
...OmitResolve(type, propertyKeys),
|
|
2238
|
+
...options
|
|
2239
|
+
});
|
|
2240
|
+
}
|
|
2241
|
+
//#endregion
|
|
2242
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs
|
|
2243
|
+
function FromPropertyKey$1(type, key, options) {
|
|
2244
|
+
return { [key]: Omit(type, [key], Clone(options)) };
|
|
2245
|
+
}
|
|
2246
|
+
function FromPropertyKeys$1(type, propertyKeys, options) {
|
|
2247
|
+
return propertyKeys.reduce((Acc, LK) => {
|
|
2248
|
+
return {
|
|
2249
|
+
...Acc,
|
|
2250
|
+
...FromPropertyKey$1(type, LK, options)
|
|
2251
|
+
};
|
|
2252
|
+
}, {});
|
|
2253
|
+
}
|
|
2254
|
+
function FromMappedKey$1(type, mappedKey, options) {
|
|
2255
|
+
return FromPropertyKeys$1(type, mappedKey.keys, options);
|
|
2256
|
+
}
|
|
2257
|
+
function OmitFromMappedKey(type, mappedKey, options) {
|
|
2258
|
+
return MappedResult(FromMappedKey$1(type, mappedKey, options));
|
|
2259
|
+
}
|
|
2260
|
+
//#endregion
|
|
2261
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
|
|
2262
|
+
function FromProperties$5(properties, propertyKeys, options) {
|
|
2263
|
+
const result = {};
|
|
2264
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) result[K2] = Pick(properties[K2], propertyKeys, Clone(options));
|
|
2265
|
+
return result;
|
|
2266
|
+
}
|
|
2267
|
+
function FromMappedResult$2(mappedResult, propertyKeys, options) {
|
|
2268
|
+
return FromProperties$5(mappedResult.properties, propertyKeys, options);
|
|
2269
|
+
}
|
|
2270
|
+
function PickFromMappedResult(mappedResult, propertyKeys, options) {
|
|
2271
|
+
return MappedResult(FromMappedResult$2(mappedResult, propertyKeys, options));
|
|
2272
|
+
}
|
|
2273
|
+
//#endregion
|
|
2274
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
|
|
2275
|
+
function FromIntersect$1(types, propertyKeys) {
|
|
2276
|
+
return types.map((type) => PickResolve(type, propertyKeys));
|
|
2277
|
+
}
|
|
2278
|
+
function FromUnion$1(types, propertyKeys) {
|
|
2279
|
+
return types.map((type) => PickResolve(type, propertyKeys));
|
|
2280
|
+
}
|
|
2281
|
+
function FromProperties$4(properties, propertyKeys) {
|
|
2282
|
+
const result = {};
|
|
2283
|
+
for (const K2 of propertyKeys) if (K2 in properties) result[K2] = properties[K2];
|
|
2284
|
+
return result;
|
|
2285
|
+
}
|
|
2286
|
+
function FromObject$3(Type, keys, properties) {
|
|
2287
|
+
const options = Discard(Type, [
|
|
2288
|
+
TransformKind,
|
|
2289
|
+
"$id",
|
|
2290
|
+
"required",
|
|
2291
|
+
"properties"
|
|
2292
|
+
]);
|
|
2293
|
+
return Object$1(FromProperties$4(properties, keys), options);
|
|
2294
|
+
}
|
|
2295
|
+
function UnionFromPropertyKeys(propertyKeys) {
|
|
2296
|
+
return Union(propertyKeys.reduce((result, key) => IsLiteralValue$1(key) ? [...result, Literal(key)] : result, []));
|
|
2297
|
+
}
|
|
2298
|
+
function PickResolve(type, propertyKeys) {
|
|
2299
|
+
return IsIntersect$1(type) ? Intersect(FromIntersect$1(type.allOf, propertyKeys)) : IsUnion$1(type) ? Union(FromUnion$1(type.anyOf, propertyKeys)) : IsObject$1(type) ? FromObject$3(type, propertyKeys, type.properties) : Object$1({});
|
|
2300
|
+
}
|
|
2301
|
+
/** `[Json]` Constructs a type whose keys are picked from the given type */
|
|
2302
|
+
function Pick(type, key, options) {
|
|
2303
|
+
const typeKey = IsArray$3(key) ? UnionFromPropertyKeys(key) : key;
|
|
2304
|
+
const propertyKeys = IsSchema$1(key) ? IndexPropertyKeys(key) : key;
|
|
2305
|
+
const isTypeRef = IsRef$1(type);
|
|
2306
|
+
const isKeyRef = IsRef$1(key);
|
|
2307
|
+
return IsMappedResult$1(type) ? PickFromMappedResult(type, propertyKeys, options) : IsMappedKey$1(key) ? PickFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Pick", [type, typeKey], options) : CreateType({
|
|
2308
|
+
...PickResolve(type, propertyKeys),
|
|
2309
|
+
...options
|
|
2310
|
+
});
|
|
2311
|
+
}
|
|
2312
|
+
//#endregion
|
|
2313
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs
|
|
2314
|
+
function FromPropertyKey(type, key, options) {
|
|
2315
|
+
return { [key]: Pick(type, [key], Clone(options)) };
|
|
2316
|
+
}
|
|
2317
|
+
function FromPropertyKeys(type, propertyKeys, options) {
|
|
2318
|
+
return propertyKeys.reduce((result, leftKey) => {
|
|
2319
|
+
return {
|
|
2320
|
+
...result,
|
|
2321
|
+
...FromPropertyKey(type, leftKey, options)
|
|
2322
|
+
};
|
|
2323
|
+
}, {});
|
|
2324
|
+
}
|
|
2325
|
+
function FromMappedKey(type, mappedKey, options) {
|
|
2326
|
+
return FromPropertyKeys(type, mappedKey.keys, options);
|
|
2327
|
+
}
|
|
2328
|
+
function PickFromMappedKey(type, mappedKey, options) {
|
|
2329
|
+
return MappedResult(FromMappedKey(type, mappedKey, options));
|
|
2330
|
+
}
|
|
2331
|
+
//#endregion
|
|
2332
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs
|
|
2333
|
+
function FromComputed$2(target, parameters) {
|
|
2334
|
+
return Computed("Partial", [Computed(target, parameters)]);
|
|
2335
|
+
}
|
|
2336
|
+
function FromRef$1($ref) {
|
|
2337
|
+
return Computed("Partial", [Ref($ref)]);
|
|
2338
|
+
}
|
|
2339
|
+
function FromProperties$3(properties) {
|
|
2340
|
+
const partialProperties = {};
|
|
2341
|
+
for (const K of globalThis.Object.getOwnPropertyNames(properties)) partialProperties[K] = Optional(properties[K]);
|
|
2342
|
+
return partialProperties;
|
|
2343
|
+
}
|
|
2344
|
+
function FromObject$2(type, properties) {
|
|
2345
|
+
const options = Discard(type, [
|
|
2346
|
+
TransformKind,
|
|
2347
|
+
"$id",
|
|
2348
|
+
"required",
|
|
2349
|
+
"properties"
|
|
2350
|
+
]);
|
|
2351
|
+
return Object$1(FromProperties$3(properties), options);
|
|
2352
|
+
}
|
|
2353
|
+
function FromRest$1(types) {
|
|
2354
|
+
return types.map((type) => PartialResolve(type));
|
|
2355
|
+
}
|
|
2356
|
+
function PartialResolve(type) {
|
|
2357
|
+
return IsComputed$1(type) ? FromComputed$2(type.target, type.parameters) : IsRef$1(type) ? FromRef$1(type.$ref) : IsIntersect$1(type) ? Intersect(FromRest$1(type.allOf)) : IsUnion$1(type) ? Union(FromRest$1(type.anyOf)) : IsObject$1(type) ? FromObject$2(type, type.properties) : IsBigInt$1(type) ? type : IsBoolean$1(type) ? type : IsInteger$1(type) ? type : IsLiteral$1(type) ? type : IsNull$1(type) ? type : IsNumber$1(type) ? type : IsString$1(type) ? type : IsSymbol$1(type) ? type : IsUndefined$1(type) ? type : Object$1({});
|
|
2358
|
+
}
|
|
2359
|
+
/** `[Json]` Constructs a type where all properties are optional */
|
|
2360
|
+
function Partial(type, options) {
|
|
2361
|
+
if (IsMappedResult$1(type)) return PartialFromMappedResult(type, options);
|
|
2362
|
+
else return CreateType({
|
|
2363
|
+
...PartialResolve(type),
|
|
2364
|
+
...options
|
|
2365
|
+
});
|
|
2366
|
+
}
|
|
2367
|
+
//#endregion
|
|
2368
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
|
|
2369
|
+
function FromProperties$2(K, options) {
|
|
2370
|
+
const Acc = {};
|
|
2371
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(K)) Acc[K2] = Partial(K[K2], Clone(options));
|
|
2372
|
+
return Acc;
|
|
2373
|
+
}
|
|
2374
|
+
function FromMappedResult$1(R, options) {
|
|
2375
|
+
return FromProperties$2(R.properties, options);
|
|
2376
|
+
}
|
|
2377
|
+
function PartialFromMappedResult(R, options) {
|
|
2378
|
+
return MappedResult(FromMappedResult$1(R, options));
|
|
2379
|
+
}
|
|
2380
|
+
//#endregion
|
|
2381
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
|
|
2382
|
+
function FromComputed$1(target, parameters) {
|
|
2383
|
+
return Computed("Required", [Computed(target, parameters)]);
|
|
2384
|
+
}
|
|
2385
|
+
function FromRef($ref) {
|
|
2386
|
+
return Computed("Required", [Ref($ref)]);
|
|
2387
|
+
}
|
|
2388
|
+
function FromProperties$1(properties) {
|
|
2389
|
+
const requiredProperties = {};
|
|
2390
|
+
for (const K of globalThis.Object.getOwnPropertyNames(properties)) requiredProperties[K] = Discard(properties[K], [OptionalKind]);
|
|
2391
|
+
return requiredProperties;
|
|
2392
|
+
}
|
|
2393
|
+
function FromObject$1(type, properties) {
|
|
2394
|
+
const options = Discard(type, [
|
|
2395
|
+
TransformKind,
|
|
2396
|
+
"$id",
|
|
2397
|
+
"required",
|
|
2398
|
+
"properties"
|
|
2399
|
+
]);
|
|
2400
|
+
return Object$1(FromProperties$1(properties), options);
|
|
2401
|
+
}
|
|
2402
|
+
function FromRest(types) {
|
|
2403
|
+
return types.map((type) => RequiredResolve(type));
|
|
2404
|
+
}
|
|
2405
|
+
function RequiredResolve(type) {
|
|
2406
|
+
return IsComputed$1(type) ? FromComputed$1(type.target, type.parameters) : IsRef$1(type) ? FromRef(type.$ref) : IsIntersect$1(type) ? Intersect(FromRest(type.allOf)) : IsUnion$1(type) ? Union(FromRest(type.anyOf)) : IsObject$1(type) ? FromObject$1(type, type.properties) : IsBigInt$1(type) ? type : IsBoolean$1(type) ? type : IsInteger$1(type) ? type : IsLiteral$1(type) ? type : IsNull$1(type) ? type : IsNumber$1(type) ? type : IsString$1(type) ? type : IsSymbol$1(type) ? type : IsUndefined$1(type) ? type : Object$1({});
|
|
2407
|
+
}
|
|
2408
|
+
/** `[Json]` Constructs a type where all properties are required */
|
|
2409
|
+
function Required(type, options) {
|
|
2410
|
+
if (IsMappedResult$1(type)) return RequiredFromMappedResult(type, options);
|
|
2411
|
+
else return CreateType({
|
|
2412
|
+
...RequiredResolve(type),
|
|
2413
|
+
...options
|
|
2414
|
+
});
|
|
2415
|
+
}
|
|
2416
|
+
//#endregion
|
|
2417
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
|
|
2418
|
+
function FromProperties(P, options) {
|
|
2419
|
+
const Acc = {};
|
|
2420
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(P)) Acc[K2] = Required(P[K2], options);
|
|
2421
|
+
return Acc;
|
|
2422
|
+
}
|
|
2423
|
+
function FromMappedResult(R, options) {
|
|
2424
|
+
return FromProperties(R.properties, options);
|
|
2425
|
+
}
|
|
2426
|
+
function RequiredFromMappedResult(R, options) {
|
|
2427
|
+
return MappedResult(FromMappedResult(R, options));
|
|
2428
|
+
}
|
|
2429
|
+
//#endregion
|
|
2430
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs
|
|
2431
|
+
function DereferenceParameters(moduleProperties, types) {
|
|
2432
|
+
return types.map((type) => {
|
|
2433
|
+
return IsRef$1(type) ? Dereference(moduleProperties, type.$ref) : FromType(moduleProperties, type);
|
|
2434
|
+
});
|
|
2435
|
+
}
|
|
2436
|
+
function Dereference(moduleProperties, ref) {
|
|
2437
|
+
return ref in moduleProperties ? IsRef$1(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) : FromType(moduleProperties, moduleProperties[ref]) : Never();
|
|
2438
|
+
}
|
|
2439
|
+
function FromAwaited(parameters) {
|
|
2440
|
+
return Awaited(parameters[0]);
|
|
2441
|
+
}
|
|
2442
|
+
function FromIndex(parameters) {
|
|
2443
|
+
return Index(parameters[0], parameters[1]);
|
|
2444
|
+
}
|
|
2445
|
+
function FromKeyOf(parameters) {
|
|
2446
|
+
return KeyOf(parameters[0]);
|
|
2447
|
+
}
|
|
2448
|
+
function FromPartial(parameters) {
|
|
2449
|
+
return Partial(parameters[0]);
|
|
2450
|
+
}
|
|
2451
|
+
function FromOmit(parameters) {
|
|
2452
|
+
return Omit(parameters[0], parameters[1]);
|
|
2453
|
+
}
|
|
2454
|
+
function FromPick(parameters) {
|
|
2455
|
+
return Pick(parameters[0], parameters[1]);
|
|
2456
|
+
}
|
|
2457
|
+
function FromRequired(parameters) {
|
|
2458
|
+
return Required(parameters[0]);
|
|
2459
|
+
}
|
|
2460
|
+
function FromComputed(moduleProperties, target, parameters) {
|
|
2461
|
+
const dereferenced = DereferenceParameters(moduleProperties, parameters);
|
|
2462
|
+
return target === "Awaited" ? FromAwaited(dereferenced) : target === "Index" ? FromIndex(dereferenced) : target === "KeyOf" ? FromKeyOf(dereferenced) : target === "Partial" ? FromPartial(dereferenced) : target === "Omit" ? FromOmit(dereferenced) : target === "Pick" ? FromPick(dereferenced) : target === "Required" ? FromRequired(dereferenced) : Never();
|
|
2463
|
+
}
|
|
2464
|
+
function FromArray(moduleProperties, type) {
|
|
2465
|
+
return Array$1(FromType(moduleProperties, type));
|
|
2466
|
+
}
|
|
2467
|
+
function FromAsyncIterator(moduleProperties, type) {
|
|
2468
|
+
return AsyncIterator(FromType(moduleProperties, type));
|
|
2469
|
+
}
|
|
2470
|
+
function FromConstructor(moduleProperties, parameters, instanceType) {
|
|
2471
|
+
return Constructor(FromTypes(moduleProperties, parameters), FromType(moduleProperties, instanceType));
|
|
2472
|
+
}
|
|
2473
|
+
function FromFunction(moduleProperties, parameters, returnType) {
|
|
2474
|
+
return Function(FromTypes(moduleProperties, parameters), FromType(moduleProperties, returnType));
|
|
2475
|
+
}
|
|
2476
|
+
function FromIntersect(moduleProperties, types) {
|
|
2477
|
+
return Intersect(FromTypes(moduleProperties, types));
|
|
2478
|
+
}
|
|
2479
|
+
function FromIterator(moduleProperties, type) {
|
|
2480
|
+
return Iterator(FromType(moduleProperties, type));
|
|
2481
|
+
}
|
|
2482
|
+
function FromObject(moduleProperties, properties) {
|
|
2483
|
+
return Object$1(globalThis.Object.keys(properties).reduce((result, key) => {
|
|
2484
|
+
return {
|
|
2485
|
+
...result,
|
|
2486
|
+
[key]: FromType(moduleProperties, properties[key])
|
|
2487
|
+
};
|
|
2488
|
+
}, {}));
|
|
2489
|
+
}
|
|
2490
|
+
function FromRecord(moduleProperties, type) {
|
|
2491
|
+
const [value, pattern] = [FromType(moduleProperties, RecordValue(type)), RecordPattern(type)];
|
|
2492
|
+
const result = CloneType(type);
|
|
2493
|
+
result.patternProperties[pattern] = value;
|
|
2494
|
+
return result;
|
|
2495
|
+
}
|
|
2496
|
+
function FromTransform(moduleProperties, transform) {
|
|
2497
|
+
return IsRef$1(transform) ? {
|
|
2498
|
+
...Dereference(moduleProperties, transform.$ref),
|
|
2499
|
+
[TransformKind]: transform[TransformKind]
|
|
2500
|
+
} : transform;
|
|
2501
|
+
}
|
|
2502
|
+
function FromTuple(moduleProperties, types) {
|
|
2503
|
+
return Tuple(FromTypes(moduleProperties, types));
|
|
2504
|
+
}
|
|
2505
|
+
function FromUnion(moduleProperties, types) {
|
|
2506
|
+
return Union(FromTypes(moduleProperties, types));
|
|
2507
|
+
}
|
|
2508
|
+
function FromTypes(moduleProperties, types) {
|
|
2509
|
+
return types.map((type) => FromType(moduleProperties, type));
|
|
2510
|
+
}
|
|
2511
|
+
function FromType(moduleProperties, type) {
|
|
2512
|
+
return IsOptional$1(type) ? CreateType(FromType(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType(moduleProperties, Discard(type, [ReadonlyKind])), type) : IsTransform$1(type) ? CreateType(FromTransform(moduleProperties, type), type) : IsArray$1(type) ? CreateType(FromArray(moduleProperties, type.items), type) : IsAsyncIterator$1(type) ? CreateType(FromAsyncIterator(moduleProperties, type.items), type) : IsComputed$1(type) ? CreateType(FromComputed(moduleProperties, type.target, type.parameters)) : IsConstructor$1(type) ? CreateType(FromConstructor(moduleProperties, type.parameters, type.returns), type) : IsFunction$1(type) ? CreateType(FromFunction(moduleProperties, type.parameters, type.returns), type) : IsIntersect$1(type) ? CreateType(FromIntersect(moduleProperties, type.allOf), type) : IsIterator$1(type) ? CreateType(FromIterator(moduleProperties, type.items), type) : IsObject$1(type) ? CreateType(FromObject(moduleProperties, type.properties), type) : IsRecord$1(type) ? CreateType(FromRecord(moduleProperties, type)) : IsTuple$1(type) ? CreateType(FromTuple(moduleProperties, type.items || []), type) : IsUnion$1(type) ? CreateType(FromUnion(moduleProperties, type.anyOf), type) : type;
|
|
2513
|
+
}
|
|
2514
|
+
function ComputeType(moduleProperties, key) {
|
|
2515
|
+
return key in moduleProperties ? FromType(moduleProperties, moduleProperties[key]) : Never();
|
|
2516
|
+
}
|
|
2517
|
+
function ComputeModuleProperties(moduleProperties) {
|
|
2518
|
+
return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {
|
|
2519
|
+
return {
|
|
2520
|
+
...result,
|
|
2521
|
+
[key]: ComputeType(moduleProperties, key)
|
|
2522
|
+
};
|
|
2523
|
+
}, {});
|
|
2524
|
+
}
|
|
2525
|
+
//#endregion
|
|
2526
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/module/module.mjs
|
|
2527
|
+
var TModule = class {
|
|
2528
|
+
constructor($defs) {
|
|
2529
|
+
const computed = ComputeModuleProperties($defs);
|
|
2530
|
+
this.$defs = this.WithIdentifiers(computed);
|
|
2531
|
+
}
|
|
2532
|
+
/** `[Json]` Imports a Type by Key. */
|
|
2533
|
+
Import(key, options) {
|
|
2534
|
+
const $defs = {
|
|
2535
|
+
...this.$defs,
|
|
2536
|
+
[key]: CreateType(this.$defs[key], options)
|
|
2537
|
+
};
|
|
2538
|
+
return CreateType({
|
|
2539
|
+
[Kind]: "Import",
|
|
2540
|
+
$defs,
|
|
2541
|
+
$ref: key
|
|
2542
|
+
});
|
|
2543
|
+
}
|
|
2544
|
+
WithIdentifiers($defs) {
|
|
2545
|
+
return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => {
|
|
2546
|
+
return {
|
|
2547
|
+
...result,
|
|
2548
|
+
[key]: {
|
|
2549
|
+
...$defs[key],
|
|
2550
|
+
$id: key
|
|
2551
|
+
}
|
|
2552
|
+
};
|
|
2553
|
+
}, {});
|
|
2554
|
+
}
|
|
2555
|
+
};
|
|
2556
|
+
/** `[Json]` Creates a Type Definition Module. */
|
|
2557
|
+
function Module(properties) {
|
|
2558
|
+
return new TModule(properties);
|
|
2559
|
+
}
|
|
2560
|
+
//#endregion
|
|
2561
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
|
|
2562
|
+
/** `[Json]` Creates a Not type */
|
|
2563
|
+
function Not(type, options) {
|
|
2564
|
+
return CreateType({
|
|
2565
|
+
[Kind]: "Not",
|
|
2566
|
+
not: type
|
|
2567
|
+
}, options);
|
|
2568
|
+
}
|
|
2569
|
+
//#endregion
|
|
2570
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
|
|
2571
|
+
/** `[JavaScript]` Extracts the Parameters from the given Function type */
|
|
2572
|
+
function Parameters(schema, options) {
|
|
2573
|
+
return IsFunction$1(schema) ? Tuple(schema.parameters, options) : Never();
|
|
2574
|
+
}
|
|
2575
|
+
//#endregion
|
|
2576
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
|
|
2577
|
+
let Ordinal = 0;
|
|
2578
|
+
/** `[Json]` Creates a Recursive type */
|
|
2579
|
+
function Recursive(callback, options = {}) {
|
|
2580
|
+
if (IsUndefined$3(options.$id)) options.$id = `T${Ordinal++}`;
|
|
2581
|
+
const thisType = CloneType(callback({
|
|
2582
|
+
[Kind]: "This",
|
|
2583
|
+
$ref: `${options.$id}`
|
|
2584
|
+
}));
|
|
2585
|
+
thisType.$id = options.$id;
|
|
2586
|
+
return CreateType({
|
|
2587
|
+
[Hint]: "Recursive",
|
|
2588
|
+
...thisType
|
|
2589
|
+
}, options);
|
|
2590
|
+
}
|
|
2591
|
+
//#endregion
|
|
2592
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
|
|
2593
|
+
/** `[JavaScript]` Creates a RegExp type */
|
|
2594
|
+
function RegExp$1(unresolved, options) {
|
|
2595
|
+
const expr = IsString$2(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
|
|
2596
|
+
return CreateType({
|
|
2597
|
+
[Kind]: "RegExp",
|
|
2598
|
+
type: "RegExp",
|
|
2599
|
+
source: expr.source,
|
|
2600
|
+
flags: expr.flags
|
|
2601
|
+
}, options);
|
|
2602
|
+
}
|
|
2603
|
+
//#endregion
|
|
2604
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs
|
|
2605
|
+
function RestResolve(T) {
|
|
2606
|
+
return IsIntersect$1(T) ? T.allOf : IsUnion$1(T) ? T.anyOf : IsTuple$1(T) ? T.items ?? [] : [];
|
|
2607
|
+
}
|
|
2608
|
+
/** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */
|
|
2609
|
+
function Rest(T) {
|
|
2610
|
+
return RestResolve(T);
|
|
2611
|
+
}
|
|
2612
|
+
//#endregion
|
|
2613
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
|
|
2614
|
+
/** `[JavaScript]` Extracts the ReturnType from the given Function type */
|
|
2615
|
+
function ReturnType(schema, options) {
|
|
2616
|
+
return IsFunction$1(schema) ? CreateType(schema.returns, options) : Never(options);
|
|
2617
|
+
}
|
|
2618
|
+
//#endregion
|
|
2619
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
|
|
2620
|
+
var TransformDecodeBuilder = class {
|
|
2621
|
+
constructor(schema) {
|
|
2622
|
+
this.schema = schema;
|
|
2623
|
+
}
|
|
2624
|
+
Decode(decode) {
|
|
2625
|
+
return new TransformEncodeBuilder(this.schema, decode);
|
|
2626
|
+
}
|
|
2627
|
+
};
|
|
2628
|
+
var TransformEncodeBuilder = class {
|
|
2629
|
+
constructor(schema, decode) {
|
|
2630
|
+
this.schema = schema;
|
|
2631
|
+
this.decode = decode;
|
|
2632
|
+
}
|
|
2633
|
+
EncodeTransform(encode, schema) {
|
|
2634
|
+
const Encode = (value) => schema[TransformKind].Encode(encode(value));
|
|
2635
|
+
const Decode = (value) => this.decode(schema[TransformKind].Decode(value));
|
|
2636
|
+
const Codec = {
|
|
2637
|
+
Encode,
|
|
2638
|
+
Decode
|
|
2639
|
+
};
|
|
2640
|
+
return {
|
|
2641
|
+
...schema,
|
|
2642
|
+
[TransformKind]: Codec
|
|
2643
|
+
};
|
|
2644
|
+
}
|
|
2645
|
+
EncodeSchema(encode, schema) {
|
|
2646
|
+
const Codec = {
|
|
2647
|
+
Decode: this.decode,
|
|
2648
|
+
Encode: encode
|
|
2649
|
+
};
|
|
2650
|
+
return {
|
|
2651
|
+
...schema,
|
|
2652
|
+
[TransformKind]: Codec
|
|
2653
|
+
};
|
|
2654
|
+
}
|
|
2655
|
+
Encode(encode) {
|
|
2656
|
+
return IsTransform$1(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema);
|
|
2657
|
+
}
|
|
2658
|
+
};
|
|
2659
|
+
/** `[Json]` Creates a Transform type */
|
|
2660
|
+
function Transform(schema) {
|
|
2661
|
+
return new TransformDecodeBuilder(schema);
|
|
2662
|
+
}
|
|
2663
|
+
//#endregion
|
|
2664
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs
|
|
2665
|
+
/** `[Json]` Creates a Unsafe type that will infers as the generic argument T */
|
|
2666
|
+
function Unsafe(options = {}) {
|
|
2667
|
+
return CreateType({ [Kind]: options[Kind] ?? "Unsafe" }, options);
|
|
2668
|
+
}
|
|
2669
|
+
//#endregion
|
|
2670
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
|
|
2671
|
+
/** `[JavaScript]` Creates a Void type */
|
|
2672
|
+
function Void(options) {
|
|
2673
|
+
return CreateType({
|
|
2674
|
+
[Kind]: "Void",
|
|
2675
|
+
type: "void"
|
|
2676
|
+
}, options);
|
|
2677
|
+
}
|
|
2678
|
+
//#endregion
|
|
2679
|
+
//#region node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
|
|
2680
|
+
/** JavaScript Type Builder with Static Resolution for TypeScript */
|
|
2681
|
+
const Type = /* @__PURE__ */ __exportAll({
|
|
2682
|
+
Any: () => Any,
|
|
2683
|
+
Argument: () => Argument,
|
|
2684
|
+
Array: () => Array$1,
|
|
2685
|
+
AsyncIterator: () => AsyncIterator,
|
|
2686
|
+
Awaited: () => Awaited,
|
|
2687
|
+
BigInt: () => BigInt,
|
|
2688
|
+
Boolean: () => Boolean,
|
|
2689
|
+
Capitalize: () => Capitalize,
|
|
2690
|
+
Composite: () => Composite,
|
|
2691
|
+
Const: () => Const,
|
|
2692
|
+
Constructor: () => Constructor,
|
|
2693
|
+
ConstructorParameters: () => ConstructorParameters,
|
|
2694
|
+
Date: () => Date$1,
|
|
2695
|
+
Enum: () => Enum,
|
|
2696
|
+
Exclude: () => Exclude,
|
|
2697
|
+
Extends: () => Extends,
|
|
2698
|
+
Extract: () => Extract,
|
|
2699
|
+
Function: () => Function,
|
|
2700
|
+
Index: () => Index,
|
|
2701
|
+
InstanceType: () => InstanceType,
|
|
2702
|
+
Instantiate: () => Instantiate,
|
|
2703
|
+
Integer: () => Integer,
|
|
2704
|
+
Intersect: () => Intersect,
|
|
2705
|
+
Iterator: () => Iterator,
|
|
2706
|
+
KeyOf: () => KeyOf,
|
|
2707
|
+
Literal: () => Literal,
|
|
2708
|
+
Lowercase: () => Lowercase,
|
|
2709
|
+
Mapped: () => Mapped,
|
|
2710
|
+
Module: () => Module,
|
|
2711
|
+
Never: () => Never,
|
|
2712
|
+
Not: () => Not,
|
|
2713
|
+
Null: () => Null,
|
|
2714
|
+
Number: () => Number$1,
|
|
2715
|
+
Object: () => Object$1,
|
|
2716
|
+
Omit: () => Omit,
|
|
2717
|
+
Optional: () => Optional,
|
|
2718
|
+
Parameters: () => Parameters,
|
|
2719
|
+
Partial: () => Partial,
|
|
2720
|
+
Pick: () => Pick,
|
|
2721
|
+
Promise: () => Promise$1,
|
|
2722
|
+
Readonly: () => Readonly,
|
|
2723
|
+
ReadonlyOptional: () => ReadonlyOptional,
|
|
2724
|
+
Record: () => Record,
|
|
2725
|
+
Recursive: () => Recursive,
|
|
2726
|
+
Ref: () => Ref,
|
|
2727
|
+
RegExp: () => RegExp$1,
|
|
2728
|
+
Required: () => Required,
|
|
2729
|
+
Rest: () => Rest,
|
|
2730
|
+
ReturnType: () => ReturnType,
|
|
2731
|
+
String: () => String,
|
|
2732
|
+
Symbol: () => Symbol$1,
|
|
2733
|
+
TemplateLiteral: () => TemplateLiteral,
|
|
2734
|
+
Transform: () => Transform,
|
|
2735
|
+
Tuple: () => Tuple,
|
|
2736
|
+
Uint8Array: () => Uint8Array$1,
|
|
2737
|
+
Uncapitalize: () => Uncapitalize,
|
|
2738
|
+
Undefined: () => Undefined,
|
|
2739
|
+
Union: () => Union,
|
|
2740
|
+
Unknown: () => Unknown,
|
|
2741
|
+
Unsafe: () => Unsafe,
|
|
2742
|
+
Uppercase: () => Uppercase,
|
|
2743
|
+
Void: () => Void
|
|
2744
|
+
});
|
|
2745
|
+
//#endregion
|
|
2746
|
+
export { Type as t };
|
|
2747
|
+
|
|
2748
|
+
//# sourceMappingURL=typebox.mjs.map
|