@wener/utils 1.1.33 → 1.1.35
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/lib/arrays/MaybeArray.js +41 -0
- package/lib/arrays/MaybeArray.js.map +1 -0
- package/lib/arrays/arrayFromAsync.js +7 -0
- package/lib/arrays/arrayFromAsync.js.map +1 -0
- package/lib/asyncs/AsyncInterval.js +14 -0
- package/lib/asyncs/AsyncInterval.js.map +1 -0
- package/lib/asyncs/MaybePromise.js +3 -0
- package/lib/asyncs/MaybePromise.js.map +1 -0
- package/lib/asyncs/createAsyncIterator.js +41 -0
- package/lib/asyncs/createAsyncIterator.js.map +1 -0
- package/lib/asyncs/createLazyPromise.js +65 -0
- package/lib/asyncs/createLazyPromise.js.map +1 -0
- package/lib/asyncs/firstOfAsyncIterator.js +11 -0
- package/lib/asyncs/firstOfAsyncIterator.js.map +1 -0
- package/lib/asyncs/generatorOfStream.js +16 -0
- package/lib/asyncs/generatorOfStream.js.map +1 -0
- package/lib/asyncs/isIterator.js +5 -0
- package/lib/asyncs/isIterator.js.map +1 -0
- package/lib/asyncs/isPromise.js +5 -0
- package/lib/asyncs/isPromise.js.map +1 -0
- package/lib/asyncs/isThenable.js +6 -0
- package/lib/asyncs/isThenable.js.map +1 -0
- package/lib/asyncs/nextOfAsyncIterator.js +33 -0
- package/lib/asyncs/nextOfAsyncIterator.js.map +1 -0
- package/lib/asyncs/promiseOfCallback.js +17 -0
- package/lib/asyncs/promiseOfCallback.js.map +1 -0
- package/lib/asyncs/sleep.js +3 -0
- package/lib/asyncs/sleep.js.map +1 -0
- package/lib/asyncs/timeout.js +29 -0
- package/lib/asyncs/timeout.js.map +1 -0
- package/lib/browsers/copy.js +53 -0
- package/lib/browsers/copy.js.map +1 -0
- package/lib/browsers/download.js +41 -0
- package/lib/browsers/download.js.map +1 -0
- package/lib/browsers/getFileFromDataTransfer.js +45 -0
- package/lib/browsers/getFileFromDataTransfer.js.map +1 -0
- package/lib/browsers/loaders.js +49 -0
- package/lib/browsers/loaders.js.map +1 -0
- package/lib/cn/index.js +3 -0
- package/lib/cn/index.js.map +1 -0
- package/lib/cn/parseChineseNumber.js +94 -0
- package/lib/cn/parseChineseNumber.js.map +1 -0
- package/lib/crypto/base.js +7 -0
- package/lib/crypto/base.js.map +1 -0
- package/lib/crypto/getNodeCrypto.js +18 -0
- package/lib/crypto/getNodeCrypto.js.map +1 -0
- package/lib/crypto/getRandomValues.js +32 -0
- package/lib/crypto/getRandomValues.js.map +1 -0
- package/lib/crypto/hashing.js +57 -0
- package/lib/crypto/hashing.js.map +1 -0
- package/lib/crypto/md5.bench.js +21 -0
- package/lib/crypto/md5.bench.js.map +1 -0
- package/lib/crypto/md5.d.js +3 -0
- package/lib/crypto/md5.d.js.map +1 -0
- package/lib/crypto/md5.js +121 -0
- package/lib/crypto/md5.js.map +1 -0
- package/lib/crypto/pem/pem.js +35 -0
- package/lib/crypto/pem/pem.js.map +1 -0
- package/lib/crypto/randomUUID.js +16 -0
- package/lib/crypto/randomUUID.js.map +1 -0
- package/lib/crypto/ulid.js +153 -0
- package/lib/crypto/ulid.js.map +1 -0
- package/lib/errors/Errors.js +181 -0
- package/lib/errors/Errors.js.map +1 -0
- package/lib/fetch/createFetchWith.js +23 -0
- package/lib/fetch/createFetchWith.js.map +1 -0
- package/lib/fetch/createFetchWithLogging.js +25 -0
- package/lib/fetch/createFetchWithLogging.js.map +1 -0
- package/lib/fetch/createFetchWithRetry.js +66 -0
- package/lib/fetch/createFetchWithRetry.js.map +1 -0
- package/lib/fetch/dumpRequest.js +45 -0
- package/lib/fetch/dumpRequest.js.map +1 -0
- package/lib/fetch/dumpResponse.js +16 -0
- package/lib/fetch/dumpResponse.js.map +1 -0
- package/lib/fetch/index.js +7 -0
- package/lib/fetch/index.js.map +1 -0
- package/lib/fetch/types.js +3 -0
- package/lib/fetch/types.js.map +1 -0
- package/lib/http/HttpStatus.js +94 -0
- package/lib/http/HttpStatus.js.map +1 -0
- package/lib/i18n/createTranslate.js +54 -0
- package/lib/i18n/createTranslate.js.map +1 -0
- package/lib/index.js +83 -0
- package/lib/index.js.map +1 -0
- package/lib/io/AbstractEncoding.js +7 -0
- package/lib/io/AbstractEncoding.js.map +1 -0
- package/lib/io/ArrayBuffer.test-d.js +7 -0
- package/lib/io/ArrayBuffer.test-d.js.map +1 -0
- package/lib/io/ArrayBuffers.js +210 -0
- package/lib/io/ArrayBuffers.js.map +1 -0
- package/lib/io/Buffer.js +25 -0
- package/lib/io/Buffer.js.map +1 -0
- package/lib/io/Bytes.js +51 -0
- package/lib/io/Bytes.js.map +1 -0
- package/lib/io/base64.js +54 -0
- package/lib/io/base64.js.map +1 -0
- package/lib/io/isBuffer.js +9 -0
- package/lib/io/isBuffer.js.map +1 -0
- package/lib/io/isTransferable.js +30 -0
- package/lib/io/isTransferable.js.map +1 -0
- package/lib/isomorphics/getGlobalThis.js +19 -0
- package/lib/isomorphics/getGlobalThis.js.map +1 -0
- package/lib/isomorphics/structuredClone.js +78 -0
- package/lib/isomorphics/structuredClone.js.map +1 -0
- package/lib/langs/AsyncCloser.js +40 -0
- package/lib/langs/AsyncCloser.js.map +1 -0
- package/lib/langs/Closer.js +34 -0
- package/lib/langs/Closer.js.map +1 -0
- package/lib/langs/MaybeFunction.js +9 -0
- package/lib/langs/MaybeFunction.js.map +1 -0
- package/lib/langs/classOf.js +5 -0
- package/lib/langs/classOf.js.map +1 -0
- package/lib/langs/deepEqual.js +87 -0
- package/lib/langs/deepEqual.js.map +1 -0
- package/lib/langs/deepFreeze.js +20 -0
- package/lib/langs/deepFreeze.js.map +1 -0
- package/lib/langs/hashCode.ignored.js +112 -0
- package/lib/langs/hashCode.ignored.js.map +1 -0
- package/lib/langs/isClass.js +5 -0
- package/lib/langs/isClass.js.map +1 -0
- package/lib/langs/isDefined.js +5 -0
- package/lib/langs/isDefined.js.map +1 -0
- package/lib/langs/isEmptyObject.js +6 -0
- package/lib/langs/isEmptyObject.js.map +1 -0
- package/lib/langs/isFunction.js +5 -0
- package/lib/langs/isFunction.js.map +1 -0
- package/lib/langs/isPlainObject.js +10 -0
- package/lib/langs/isPlainObject.js.map +1 -0
- package/lib/langs/memoize.js +22 -0
- package/lib/langs/memoize.js.map +1 -0
- package/lib/langs/parseBoolean.js +30 -0
- package/lib/langs/parseBoolean.js.map +1 -0
- package/lib/langs/shallowClone.js +15 -0
- package/lib/langs/shallowClone.js.map +1 -0
- package/lib/langs/shallowEqual.js +24 -0
- package/lib/langs/shallowEqual.js.map +1 -0
- package/lib/libs/ms.js +137 -0
- package/lib/libs/ms.js.map +1 -0
- package/lib/logging/Logger.js +5 -0
- package/lib/logging/Logger.js.map +1 -0
- package/lib/logging/createChildLogger.js +16 -0
- package/lib/logging/createChildLogger.js.map +1 -0
- package/lib/logging/createLogger.js +63 -0
- package/lib/logging/createLogger.js.map +1 -0
- package/lib/logging/createNoopLogger.js +13 -0
- package/lib/logging/createNoopLogger.js.map +1 -0
- package/lib/logging/slog.js +143 -0
- package/lib/logging/slog.js.map +1 -0
- package/lib/maths/clamp.js +21 -0
- package/lib/maths/clamp.js.map +1 -0
- package/lib/maths/random.js +17 -0
- package/lib/maths/random.js.map +1 -0
- package/lib/modules/isModule.js +7 -0
- package/lib/modules/isModule.js.map +1 -0
- package/lib/modules/parseModuleId.js +39 -0
- package/lib/modules/parseModuleId.js.map +1 -0
- package/lib/objects/get.js +16 -0
- package/lib/objects/get.js.map +1 -0
- package/lib/objects/get.test-d.js +33 -0
- package/lib/objects/get.test-d.js.map +1 -0
- package/lib/objects/merge/index.js +3 -0
- package/lib/objects/merge/index.js.map +1 -0
- package/lib/objects/merge/isMergeableObject.js +19 -0
- package/lib/objects/merge/isMergeableObject.js.map +1 -0
- package/lib/objects/merge/merge.js +90 -0
- package/lib/objects/merge/merge.js.map +1 -0
- package/lib/objects/parseObjectPath.js +39 -0
- package/lib/objects/parseObjectPath.js.map +1 -0
- package/lib/objects/set.js +38 -0
- package/lib/objects/set.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/common/encoder.js +94 -0
- package/lib/schema/typebox/gen/codegen/common/encoder.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/common/formatter.js +33 -0
- package/lib/schema/typebox/gen/codegen/common/formatter.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/common/index.js +29 -0
- package/lib/schema/typebox/gen/codegen/common/index.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/common/jsdoc.js +117 -0
- package/lib/schema/typebox/gen/codegen/common/jsdoc.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/expression/compiler.js +364 -0
- package/lib/schema/typebox/gen/codegen/expression/compiler.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/expression/errors.js +259 -0
- package/lib/schema/typebox/gen/codegen/expression/errors.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/expression/evaluator.js +254 -0
- package/lib/schema/typebox/gen/codegen/expression/evaluator.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/expression/expression.js +381 -0
- package/lib/schema/typebox/gen/codegen/expression/expression.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/expression/index.js +32 -0
- package/lib/schema/typebox/gen/codegen/expression/index.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/index.js +29 -0
- package/lib/schema/typebox/gen/codegen/index.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/index.js +40 -0
- package/lib/schema/typebox/gen/codegen/model/index.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-arktype.js +260 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-arktype.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-expression.js +383 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-expression.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-grpc.js +238 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-grpc.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-io-ts.js +274 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-io-ts.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-javascript.js +47 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-javascript.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-json-schema.js +192 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-json-schema.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-typebox.js +33 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-typebox.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-typescript.js +188 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-typescript.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-valibot.js +239 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-valibot.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-value.js +43 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-value.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-yrel.js +227 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-yrel.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-yup.js +225 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-yup.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-zod.js +248 -0
- package/lib/schema/typebox/gen/codegen/model/model-to-zod.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/model/model.js +27 -0
- package/lib/schema/typebox/gen/codegen/model/model.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/typescript/index.js +28 -0
- package/lib/schema/typebox/gen/codegen/typescript/index.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/typescript/typescript-to-model.js +72 -0
- package/lib/schema/typebox/gen/codegen/typescript/typescript-to-model.js.map +1 -0
- package/lib/schema/typebox/gen/codegen/typescript/typescript-to-typebox.js +620 -0
- package/lib/schema/typebox/gen/codegen/typescript/typescript-to-typebox.js.map +1 -0
- package/lib/schema/typebox/gen/index.js +3 -0
- package/lib/schema/typebox/gen/index.js.map +1 -0
- package/lib/schema/typebox/index.js +3 -0
- package/lib/schema/typebox/index.js.map +1 -0
- package/lib/schema/typebox/typebox.js +23 -0
- package/lib/schema/typebox/typebox.js.map +1 -0
- package/lib/server/crypto/md5.js +6 -0
- package/lib/server/crypto/md5.js.map +1 -0
- package/lib/server/fetch/createFetchWithProxy.js +4 -0
- package/lib/server/fetch/createFetchWithProxy.js.map +1 -0
- package/lib/server/fetch/createFetchWithProxyByNodeFetch.js +38 -0
- package/lib/server/fetch/createFetchWithProxyByNodeFetch.js.map +1 -0
- package/lib/server/fetch/createFetchWithProxyByUndici.js +64 -0
- package/lib/server/fetch/createFetchWithProxyByUndici.js.map +1 -0
- package/lib/server/getPackageDir.js +16 -0
- package/lib/server/getPackageDir.js.map +1 -0
- package/lib/server/index.js +7 -0
- package/lib/server/index.js.map +1 -0
- package/lib/server/jsdom.js +3 -0
- package/lib/server/jsdom.js.map +1 -0
- package/lib/server/node-fetch.js +4 -0
- package/lib/server/node-fetch.js.map +1 -0
- package/lib/server/polyfill/polyfillBrowser.js +17 -0
- package/lib/server/polyfill/polyfillBrowser.js.map +1 -0
- package/lib/server/polyfill/polyfillCrypto.js +11 -0
- package/lib/server/polyfill/polyfillCrypto.js.map +1 -0
- package/lib/server/polyfill/polyfillFetch.js +25 -0
- package/lib/server/polyfill/polyfillFetch.js.map +1 -0
- package/lib/server/polyfill/polyfillJsDom.js +64 -0
- package/lib/server/polyfill/polyfillJsDom.js.map +1 -0
- package/lib/server/polyfill/polyfillWebSocket.js +21 -0
- package/lib/server/polyfill/polyfillWebSocket.js.map +1 -0
- package/lib/server/ws.js +3 -0
- package/lib/server/ws.js.map +1 -0
- package/lib/strings/camelCase.js +58 -0
- package/lib/strings/camelCase.js.map +1 -0
- package/lib/strings/formatBytes.js +43 -0
- package/lib/strings/formatBytes.js.map +1 -0
- package/lib/strings/renderTemplate.js +32 -0
- package/lib/strings/renderTemplate.js.map +1 -0
- package/lib/typedoc.js +4 -0
- package/lib/typedoc.js.map +1 -0
- package/lib/types.d.js +6 -0
- package/lib/types.d.js.map +1 -0
- package/lib/validations/asserts.js +14 -0
- package/lib/validations/asserts.js.map +1 -0
- package/lib/validations/isUUID.js +5 -0
- package/lib/validations/isUUID.js.map +1 -0
- package/lib/validations/parseTimestamp.js +29 -0
- package/lib/validations/parseTimestamp.js.map +1 -0
- package/package.json +1 -3
- package/dist/LICENSE.txt +0 -1
- package/dist/cjs/index.cjs +0 -21
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/esm/index.js +0 -21
- package/dist/esm/index.js.map +0 -1
- package/dist/system/index.js +0 -21
- package/dist/system/index.js.map +0 -1
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
/*--------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
@sinclair/typebox-expression
|
|
4
|
+
|
|
5
|
+
The MIT License (MIT)
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
|
17
|
+
all copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
25
|
+
THE SOFTWARE.
|
|
26
|
+
|
|
27
|
+
---------------------------------------------------------------------------*/ // -------------------------------------------------------------------------
|
|
28
|
+
// Expression: Error
|
|
29
|
+
// -------------------------------------------------------------------------
|
|
30
|
+
export var Expression;
|
|
31
|
+
(function(Expression) {
|
|
32
|
+
function And(expressions, options = {}) {
|
|
33
|
+
const expr = globalThis.Array.isArray(expressions) ? expressions : [
|
|
34
|
+
...expressions()
|
|
35
|
+
];
|
|
36
|
+
if (expr.length === 0) return Expression.False();
|
|
37
|
+
if (expr.length === 1) return expr[0];
|
|
38
|
+
return {
|
|
39
|
+
...options,
|
|
40
|
+
type: 'And',
|
|
41
|
+
expr
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** Creates a `And` expression where each sub expression is evaluated in sequence */ Expression.And = And;
|
|
45
|
+
function Call(target, parameters, expression, options = {}) {
|
|
46
|
+
return {
|
|
47
|
+
...options,
|
|
48
|
+
type: 'Call',
|
|
49
|
+
target,
|
|
50
|
+
parameters,
|
|
51
|
+
expr: expression
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/** Creates a `Call` expression that will invoke the object target and check the return for the given sub expression */ Expression.Call = Call;
|
|
55
|
+
function Equals(value, options = {}) {
|
|
56
|
+
return {
|
|
57
|
+
...options,
|
|
58
|
+
type: 'Equals',
|
|
59
|
+
value
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** Creates a `Equals` expression that will compare for value equality */ Expression.Equals = Equals;
|
|
63
|
+
function Function(callback, options = {}) {
|
|
64
|
+
return {
|
|
65
|
+
...options,
|
|
66
|
+
type: 'Function',
|
|
67
|
+
callback
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/** Creates a `Function` expression which invokes the given callback to check a value */ Expression.Function = Function;
|
|
71
|
+
function ElementsDistinct(options = {}) {
|
|
72
|
+
return {
|
|
73
|
+
...options,
|
|
74
|
+
type: 'ElementsDistinct'
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/** Creates a `ElementsDistinct` expression which will check an arrays elements are structurally distinct */ Expression.ElementsDistinct = ElementsDistinct;
|
|
78
|
+
function Elements(expression, options = {}) {
|
|
79
|
+
return {
|
|
80
|
+
...options,
|
|
81
|
+
type: 'Elements',
|
|
82
|
+
expr: expression
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** Creates a `Elements` expression that will check an arrays elements for the given sub expression */ Expression.Elements = Elements;
|
|
86
|
+
function False(options = {}) {
|
|
87
|
+
return {
|
|
88
|
+
...options,
|
|
89
|
+
type: 'False'
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/** Creates a `False` expression that evaluates `false` */ Expression.False = False;
|
|
93
|
+
function GreaterThanEqual(value, options = {}) {
|
|
94
|
+
return {
|
|
95
|
+
...options,
|
|
96
|
+
type: 'GreaterThanEqual',
|
|
97
|
+
value
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/** Creates a `GreaterThanEqual` comparison expression */ Expression.GreaterThanEqual = GreaterThanEqual;
|
|
101
|
+
function GreaterThan(value, options = {}) {
|
|
102
|
+
return {
|
|
103
|
+
...options,
|
|
104
|
+
type: 'GreaterThan',
|
|
105
|
+
value
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/** Creates a `GreaterThan` comparison expression */ Expression.GreaterThan = GreaterThan;
|
|
109
|
+
function IfThenElse($if, $then, $else, options = {}) {
|
|
110
|
+
return {
|
|
111
|
+
...options,
|
|
112
|
+
type: 'IfThenElse',
|
|
113
|
+
if: $if,
|
|
114
|
+
then: $then,
|
|
115
|
+
else: $else
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/** Creates a `IfThenElse` expression that will evaluate the `$if` expression followed by either the `$then` of `$else` expressions */ Expression.IfThenElse = IfThenElse;
|
|
119
|
+
function Index(index, expression, options = {}) {
|
|
120
|
+
return {
|
|
121
|
+
...options,
|
|
122
|
+
type: 'Index',
|
|
123
|
+
index,
|
|
124
|
+
expr: expression
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/** Creates a `Index` expression that will evaluate an array element by the given sub expression */ Expression.Index = Index;
|
|
128
|
+
function InstanceOf(value, options = {}) {
|
|
129
|
+
return {
|
|
130
|
+
...options,
|
|
131
|
+
type: 'InstanceOf',
|
|
132
|
+
value
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/** Creates a `InstanceOf` expression that will apply the `instanceof` operator */ Expression.InstanceOf = InstanceOf;
|
|
136
|
+
function IsArray(options = {}) {
|
|
137
|
+
return {
|
|
138
|
+
...options,
|
|
139
|
+
type: 'IsArray'
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/** Creates a `IsArray` expression that will check a value as an array */ Expression.IsArray = IsArray;
|
|
143
|
+
function IsNaN(options = {}) {
|
|
144
|
+
return {
|
|
145
|
+
...options,
|
|
146
|
+
type: 'IsNaN'
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/** Creates a `IsNaN` expression that will check for NaN */ Expression.IsNaN = IsNaN;
|
|
150
|
+
function IsInteger(options = {}) {
|
|
151
|
+
return {
|
|
152
|
+
...options,
|
|
153
|
+
type: 'IsInteger'
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/** Creates a `IsInteger` expression that will check for numeric integer values */ Expression.IsInteger = IsInteger;
|
|
157
|
+
function IsObject(options = {}) {
|
|
158
|
+
return Expression.TypeOf('object', options);
|
|
159
|
+
}
|
|
160
|
+
/** Creates a `IsObject` expression that will check a value as an object */ Expression.IsObject = IsObject;
|
|
161
|
+
function IsBigInt(options = {}) {
|
|
162
|
+
return Expression.TypeOf('bigint', options);
|
|
163
|
+
}
|
|
164
|
+
/** Creates a `IsBigInt` expression that will check a value as a bigint */ Expression.IsBigInt = IsBigInt;
|
|
165
|
+
function IsBoolean(options = {}) {
|
|
166
|
+
return Expression.TypeOf('boolean', options);
|
|
167
|
+
}
|
|
168
|
+
/** Creates a `IsBoolean` expression that will check a value as a boolean */ Expression.IsBoolean = IsBoolean;
|
|
169
|
+
function IsFinite(options = {}) {
|
|
170
|
+
return {
|
|
171
|
+
...options,
|
|
172
|
+
type: 'IsFinite'
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/** Creates a `IsFinite` expression that will check a numeric value if finite */ Expression.IsFinite = IsFinite;
|
|
176
|
+
function IsFunction(options = {}) {
|
|
177
|
+
return Expression.TypeOf('function', options);
|
|
178
|
+
}
|
|
179
|
+
/** Creates a `IsFunction` expression that will check a value as a function */ Expression.IsFunction = IsFunction;
|
|
180
|
+
function IsNumber(options = {}) {
|
|
181
|
+
return Expression.TypeOf('number', options);
|
|
182
|
+
}
|
|
183
|
+
/** Creates a `IsNumber` expression that will check a value as a number */ Expression.IsNumber = IsNumber;
|
|
184
|
+
function IsSafeInteger(options = {}) {
|
|
185
|
+
return {
|
|
186
|
+
...options,
|
|
187
|
+
type: 'IsSafeInteger'
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/** Creates a `IsSafeInteger` expression that will check a numeric value if finite */ Expression.IsSafeInteger = IsSafeInteger;
|
|
191
|
+
function IsString(options = {}) {
|
|
192
|
+
return Expression.TypeOf('string', options);
|
|
193
|
+
}
|
|
194
|
+
/** Creates a `IsString` expression that will check a value as a string */ Expression.IsString = IsString;
|
|
195
|
+
function IsSymbol(options = {}) {
|
|
196
|
+
return Expression.TypeOf('symbol', options);
|
|
197
|
+
}
|
|
198
|
+
/** Creates a `IsSymbol` expression that will check a value as a symbol */ Expression.IsSymbol = IsSymbol;
|
|
199
|
+
function IsUndefined(options = {}) {
|
|
200
|
+
return {
|
|
201
|
+
...options,
|
|
202
|
+
type: 'IsUndefined'
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/** Creates a `IsUndefined` expression that will check a value is undefined */ Expression.IsUndefined = IsUndefined;
|
|
206
|
+
function IsNull(options = {}) {
|
|
207
|
+
return Expression.Equals(null, options);
|
|
208
|
+
}
|
|
209
|
+
/** Creates a `IsNull` expression that will check a value is null */ Expression.IsNull = IsNull;
|
|
210
|
+
function IsPattern(pattern, options = {}) {
|
|
211
|
+
return {
|
|
212
|
+
...options,
|
|
213
|
+
type: 'IsPattern',
|
|
214
|
+
pattern
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
/** Creates a `IsPattern` expression that will check a string with a regular expression */ Expression.IsPattern = IsPattern;
|
|
218
|
+
function KeyIn(value, options = {}) {
|
|
219
|
+
return {
|
|
220
|
+
...options,
|
|
221
|
+
type: 'KeyIn',
|
|
222
|
+
value
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/** Creates a KeyIn expression that will check if a key exists on this value */ Expression.KeyIn = KeyIn;
|
|
226
|
+
function LessThanEqual(value, options = {}) {
|
|
227
|
+
return {
|
|
228
|
+
...options,
|
|
229
|
+
type: 'LessThanEqual',
|
|
230
|
+
value
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
/** Creates a `LessThanEqual` comparison expression */ Expression.LessThanEqual = LessThanEqual;
|
|
234
|
+
function LessThan(value, options = {}) {
|
|
235
|
+
return {
|
|
236
|
+
...options,
|
|
237
|
+
type: 'LessThan',
|
|
238
|
+
value
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/** Creates a `LessThan` comparison expression */ Expression.LessThan = LessThan;
|
|
242
|
+
function MultipleOf(value, options = {}) {
|
|
243
|
+
return {
|
|
244
|
+
...options,
|
|
245
|
+
type: 'MultipleOf',
|
|
246
|
+
value
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/** Creates a `MultipleOf` modulus expression that is true if the result is zero */ Expression.MultipleOf = MultipleOf;
|
|
250
|
+
function Not(expression, options = {}) {
|
|
251
|
+
return {
|
|
252
|
+
...options,
|
|
253
|
+
type: 'Not',
|
|
254
|
+
expr: expression
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
/** Creates a `Not` expression where the result of the sub expression is inverted */ Expression.Not = Not;
|
|
258
|
+
function Or(expressions, options = {}) {
|
|
259
|
+
const expr = globalThis.Array.isArray(expressions) ? expressions : [
|
|
260
|
+
...expressions()
|
|
261
|
+
];
|
|
262
|
+
if (expr.length === 0) return Expression.False();
|
|
263
|
+
if (expr.length === 1) return expr[0];
|
|
264
|
+
return {
|
|
265
|
+
...options,
|
|
266
|
+
type: 'Or',
|
|
267
|
+
expr
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
/** Creates a `Or` expression where each sub expression is evaluated in sequence */ Expression.Or = Or;
|
|
271
|
+
function PropertiesExcludePattern(pattern, expression, options = {}) {
|
|
272
|
+
return {
|
|
273
|
+
...options,
|
|
274
|
+
type: 'PropertiesExcludePattern',
|
|
275
|
+
expr: expression,
|
|
276
|
+
pattern
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
/** Creates a `PropertiesExcludePattern` expression that will enumerate each key matching the given regular expression */ Expression.PropertiesExcludePattern = PropertiesExcludePattern;
|
|
280
|
+
function PropertiesExclude(keys, expression, options = {}) {
|
|
281
|
+
return {
|
|
282
|
+
...options,
|
|
283
|
+
type: 'PropertiesExclude',
|
|
284
|
+
expr: expression,
|
|
285
|
+
keys
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
/** Creates a `PropertiesExclude` expression that will enumerate the unselected keys and check each for the sub expression */ Expression.PropertiesExclude = PropertiesExclude;
|
|
289
|
+
function PropertiesIncludePattern(pattern, expression, options = {}) {
|
|
290
|
+
return {
|
|
291
|
+
...options,
|
|
292
|
+
type: 'PropertiesIncludePattern',
|
|
293
|
+
expr: expression,
|
|
294
|
+
pattern
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
/** Creates a `PropertiesIncludePattern` expression that will enumerate each key matching the given regular expression */ Expression.PropertiesIncludePattern = PropertiesIncludePattern;
|
|
298
|
+
function PropertiesInclude(keys, expression, options = {}) {
|
|
299
|
+
return {
|
|
300
|
+
...options,
|
|
301
|
+
type: 'PropertiesInclude',
|
|
302
|
+
expr: expression,
|
|
303
|
+
keys
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
/** Creates a `PropertiesInclude` expression that will enumerate the selected keys and check each for the sub expression */ Expression.PropertiesInclude = PropertiesInclude;
|
|
307
|
+
function PropertiesLength(value, options = {}) {
|
|
308
|
+
return {
|
|
309
|
+
...options,
|
|
310
|
+
type: 'PropertiesLength',
|
|
311
|
+
value
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
/** Creates a `PropertiesLength` expression that checks an object a property length that equals the given value */ Expression.PropertiesLength = PropertiesLength;
|
|
315
|
+
function PropertiesMaximum(value, options = {}) {
|
|
316
|
+
return {
|
|
317
|
+
...options,
|
|
318
|
+
type: 'PropertiesMaximum',
|
|
319
|
+
value
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
/** Creates a `PropertiesMaximum` expression that will check an object has a property length less or equal the given value */ Expression.PropertiesMaximum = PropertiesMaximum;
|
|
323
|
+
function PropertiesMinimum(value, options = {}) {
|
|
324
|
+
return {
|
|
325
|
+
...options,
|
|
326
|
+
type: 'PropertiesMinimum',
|
|
327
|
+
value
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
/** Creates a `PropertiesMinimum` expression that will check an object has a property length greater or equal the given value */ Expression.PropertiesMinimum = PropertiesMinimum;
|
|
331
|
+
function Properties(expression, options = {}) {
|
|
332
|
+
return {
|
|
333
|
+
...options,
|
|
334
|
+
type: 'Properties',
|
|
335
|
+
expr: expression
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
/** Creates a `Properties` expression that will enumerate all object properties and check for the given sub expression */ Expression.Properties = Properties;
|
|
339
|
+
function PropertyKeys(keys, options = {}) {
|
|
340
|
+
return {
|
|
341
|
+
...options,
|
|
342
|
+
type: 'PropertyKeys',
|
|
343
|
+
keys
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
/** Creates a `PropertyKeys` expression that will check an object has the specified keys */ Expression.PropertyKeys = PropertyKeys;
|
|
347
|
+
function Property(key, expression, options = {}) {
|
|
348
|
+
return {
|
|
349
|
+
...options,
|
|
350
|
+
type: 'Property',
|
|
351
|
+
key,
|
|
352
|
+
expr: expression
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
/** Creates a `Property` expression that will evaluate the property value by the given sub expression */ Expression.Property = Property;
|
|
356
|
+
function Ref(value, options = {}) {
|
|
357
|
+
return {
|
|
358
|
+
...options,
|
|
359
|
+
type: 'Ref',
|
|
360
|
+
$ref: value
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
/** Creates a `Ref` that will reference another part of the expression tree via $id */ Expression.Ref = Ref;
|
|
364
|
+
function True(options = {}) {
|
|
365
|
+
return {
|
|
366
|
+
...options,
|
|
367
|
+
type: 'True'
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
/** Creates a `True` expression that evaluates `true` */ Expression.True = True;
|
|
371
|
+
function TypeOf(value, options = {}) {
|
|
372
|
+
return {
|
|
373
|
+
...options,
|
|
374
|
+
type: 'TypeOf',
|
|
375
|
+
value
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
/** Creates a `TypeOf` expression that will apply `typeof` operator for the evaluated value */ Expression.TypeOf = TypeOf;
|
|
379
|
+
})(Expression || (Expression = {}));
|
|
380
|
+
|
|
381
|
+
//# sourceMappingURL=expression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/schema/typebox/gen/codegen/expression/expression.ts"],"sourcesContent":["/*--------------------------------------------------------------------------\n\n@sinclair/typebox-expression\n\nThe MIT License (MIT)\n\nCopyright (c) 2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n---------------------------------------------------------------------------*/\n\n// -------------------------------------------------------------------------\n// Expression: Error\n// -------------------------------------------------------------------------\nexport interface ExpressionError {\n expression: Expression;\n path: string;\n value: unknown;\n}\n\n// -------------------------------------------------------------------------\n// Expression: Tree\n// -------------------------------------------------------------------------\n\nexport type Equatable = string | number | boolean | null | undefined;\nexport type Compariable = number | bigint;\nexport type TypeOf = 'undefined' | 'symbol' | 'function' | 'string' | 'number' | 'boolean' | 'bigint' | 'object';\n\nexport interface ExpressionOptions {\n $id?: string;\n [key: string]: any;\n}\nexport interface AndExpression extends ExpressionOptions {\n type: 'And';\n expr: Expression[];\n}\nexport interface CallExpression<\n E extends Expression = Expression,\n T extends string = string,\n A extends unknown[] = unknown[],\n> extends ExpressionOptions {\n type: 'Call';\n target: T;\n parameters: [...A];\n expr: E;\n}\n\nexport interface ElementsDistinctExpression extends ExpressionOptions {\n type: 'ElementsDistinct';\n}\nexport interface ElementsExpression<E extends Expression = Expression> extends ExpressionOptions {\n type: 'Elements';\n expr: E;\n}\nexport interface EqualsExpression<T extends Equatable = Equatable> extends ExpressionOptions {\n type: 'Equals';\n value: T;\n}\nexport type FunctionExpressionCallback = (value: unknown) => boolean;\n\nexport interface FunctionExpression<F extends FunctionExpressionCallback = FunctionExpressionCallback>\n extends ExpressionOptions {\n type: 'Function';\n callback: F;\n}\nexport interface GreaterThanEqualExpression<T extends Compariable = Compariable> extends ExpressionOptions {\n type: 'GreaterThanEqual';\n value: T;\n}\nexport interface GreaterThanExpression<T extends Compariable = Compariable> extends ExpressionOptions {\n type: 'GreaterThan';\n value: T;\n}\nexport interface FalseExpression extends ExpressionOptions {\n type: 'False';\n}\nexport interface IfThenElseExpression extends ExpressionOptions {\n type: 'IfThenElse';\n if: Expression;\n then: Expression;\n else: Expression;\n}\nexport interface InstanceOfExpression<T extends string = string> extends ExpressionOptions {\n type: 'InstanceOf';\n value: T;\n}\nexport interface IndexExpression<E extends Expression = Expression, I extends number = number>\n extends ExpressionOptions {\n type: 'Index';\n index: I;\n expr: E;\n}\n\nexport interface IsArrayExpression extends ExpressionOptions {\n type: 'IsArray';\n}\nexport interface IsBigIntExpression extends TypeOfExpression<'bigint'> {}\nexport interface IsBooleanExpression extends TypeOfExpression<'boolean'> {}\nexport interface IsFiniteExpression extends ExpressionOptions {\n type: 'IsFinite';\n}\nexport interface IsFunctionExpression extends TypeOfExpression<'function'> {}\nexport interface IsIntegerExpression extends ExpressionOptions {\n type: 'IsInteger';\n}\nexport interface IsNaNExpression extends ExpressionOptions {\n type: 'IsNaN';\n}\nexport interface IsNullExpression extends EqualsExpression<null> {}\nexport interface IsNumberExpression extends TypeOfExpression<'number'> {}\nexport interface IsSafeIntegerExpression extends ExpressionOptions {\n type: 'IsSafeInteger';\n}\nexport interface IsObjectExpression extends TypeOfExpression<'object'> {}\nexport interface IsStringExpression extends TypeOfExpression<'string'> {}\nexport interface IsSymbolExpression extends TypeOfExpression<'symbol'> {}\nexport interface IsUndefinedExpression extends ExpressionOptions {\n type: 'IsUndefined';\n}\nexport interface KeyInExpression<T extends string = string> extends ExpressionOptions {\n type: 'KeyIn';\n value: T;\n}\nexport interface OrExpression extends ExpressionOptions {\n type: 'Or';\n expr: Expression[];\n}\nexport interface NotExpression<E extends Expression = Expression> extends ExpressionOptions {\n type: 'Not';\n expr: E;\n}\nexport interface LessThanEqualExpression<T extends Compariable = Compariable> extends ExpressionOptions {\n type: 'LessThanEqual';\n value: T;\n}\nexport interface LessThanExpression<T extends Compariable = Compariable> extends ExpressionOptions {\n type: 'LessThan';\n value: T;\n}\nexport interface MultipleOfExpression<T extends number = number> extends ExpressionOptions {\n type: 'MultipleOf';\n value: T;\n}\nexport interface PropertiesIncludePatternExpression<E extends Expression = Expression> extends ExpressionOptions {\n type: 'PropertiesIncludePattern';\n pattern: string;\n expr: E;\n}\nexport interface PropertiesIncludeExpression<E extends Expression = Expression, K extends string[] = string[]>\n extends ExpressionOptions {\n type: 'PropertiesInclude';\n keys: K;\n expr: E;\n}\nexport interface PropertiesExcludePatternExpression<E extends Expression = Expression> extends ExpressionOptions {\n type: 'PropertiesExcludePattern';\n pattern: string;\n expr: E;\n}\nexport interface PropertiesExcludeExpression<E extends Expression = Expression, K extends string[] = string[]>\n extends ExpressionOptions {\n type: 'PropertiesExclude';\n keys: K;\n expr: E;\n}\nexport interface PropertiesLengthExpression<T extends number = number> extends ExpressionOptions {\n type: 'PropertiesLength';\n value: T;\n}\nexport interface PropertiesMaximumExpression<T extends number = number> extends ExpressionOptions {\n type: 'PropertiesMaximum';\n value: T;\n}\nexport interface PropertiesMinimumExpression<T extends number = number> extends ExpressionOptions {\n type: 'PropertiesMinimum';\n value: T;\n}\nexport interface PropertiesExpression<E extends Expression = Expression> extends ExpressionOptions {\n type: 'Properties';\n expr: E;\n}\nexport interface PropertyKeysExpression<T extends readonly string[] = string[]> extends ExpressionOptions {\n type: 'PropertyKeys';\n keys: [...T];\n}\nexport interface PropertyExpression<E extends Expression = Expression, K extends string = string>\n extends ExpressionOptions {\n type: 'Property';\n key: K;\n expr: E;\n}\nexport interface RefExpression<T extends string = string> extends ExpressionOptions {\n type: 'Ref';\n $ref: T;\n}\nexport interface IsPatternExpression extends ExpressionOptions {\n type: 'IsPattern';\n pattern: string;\n}\nexport interface TrueExpression extends ExpressionOptions {\n type: 'True';\n}\nexport interface TypeOfExpression<T extends TypeOf = TypeOf> extends ExpressionOptions {\n type: 'TypeOf';\n value: T;\n}\nexport type Expression =\n | AndExpression\n | CallExpression\n | FalseExpression\n | FunctionExpression\n | ElementsDistinctExpression\n | ElementsExpression\n | EqualsExpression\n | GreaterThanExpression\n | GreaterThanEqualExpression\n | IfThenElseExpression\n | IndexExpression\n | InstanceOfExpression\n | IsArrayExpression\n | IsIntegerExpression\n | IsNaNExpression\n | IsObjectExpression\n | IsBigIntExpression\n | IsBooleanExpression\n | IsFiniteExpression\n | IsFunctionExpression\n | IsNullExpression\n | IsNumberExpression\n | IsSafeIntegerExpression\n | IsStringExpression\n | IsSymbolExpression\n | IsUndefinedExpression\n | KeyInExpression\n | LessThanEqualExpression\n | LessThanExpression\n | MultipleOfExpression\n | NotExpression\n | OrExpression\n | PropertiesIncludeExpression\n | PropertiesIncludePatternExpression\n | PropertiesExcludeExpression\n | PropertiesExcludePatternExpression\n | PropertiesLengthExpression\n | PropertiesMaximumExpression\n | PropertiesMinimumExpression\n | PropertiesExpression\n | PropertyKeysExpression\n | PropertyExpression\n | RefExpression\n | IsPatternExpression\n | TrueExpression\n | TypeOfExpression;\n\n// ---------------------------------------------------------------\n// Expression: Builder\n// ---------------------------------------------------------------\n\n/** Type Expressions builder used to assert JavaScript values */\nexport namespace Expression {\n /** Creates a `And` expression where each sub expression is evaluated in sequence */\n export function And<E extends Expression>(\n expressions: (() => Generator<E>) | Array<E>,\n options: ExpressionOptions = {},\n ): Expression {\n const expr = globalThis.Array.isArray(expressions) ? expressions : [...expressions()];\n if (expr.length === 0) return Expression.False();\n if (expr.length === 1) return expr[0];\n return { ...options, type: 'And', expr };\n }\n /** Creates a `Call` expression that will invoke the object target and check the return for the given sub expression */\n export function Call<E extends Expression, T extends string, P extends unknown[]>(\n target: T,\n parameters: P,\n expression: E,\n options: ExpressionOptions = {},\n ): CallExpression<E, T, P> {\n return { ...options, type: 'Call', target, parameters, expr: expression };\n }\n /** Creates a `Equals` expression that will compare for value equality */\n export function Equals<T extends Equatable>(value: T, options: ExpressionOptions = {}): EqualsExpression<T> {\n return { ...options, type: 'Equals', value };\n }\n /** Creates a `Function` expression which invokes the given callback to check a value */\n export function Function<F extends (value: unknown) => boolean>(\n callback: F,\n options: ExpressionOptions = {},\n ): FunctionExpression<F> {\n return { ...options, type: 'Function', callback };\n }\n /** Creates a `ElementsDistinct` expression which will check an arrays elements are structurally distinct */\n export function ElementsDistinct(options: ExpressionOptions = {}): ElementsDistinctExpression {\n return { ...options, type: 'ElementsDistinct' };\n }\n /** Creates a `Elements` expression that will check an arrays elements for the given sub expression */\n export function Elements<E extends Expression>(\n expression: E,\n options: ExpressionOptions = {},\n ): ElementsExpression<E> {\n return { ...options, type: 'Elements', expr: expression };\n }\n /** Creates a `False` expression that evaluates `false` */\n export function False(options: ExpressionOptions = {}): FalseExpression {\n return { ...options, type: 'False' };\n }\n /** Creates a `GreaterThanEqual` comparison expression */\n export function GreaterThanEqual<T extends Compariable>(\n value: T,\n options: ExpressionOptions = {},\n ): GreaterThanEqualExpression<T> {\n return { ...options, type: 'GreaterThanEqual', value };\n }\n /** Creates a `GreaterThan` comparison expression */\n export function GreaterThan<T extends Compariable>(\n value: T,\n options: ExpressionOptions = {},\n ): GreaterThanExpression<T> {\n return { ...options, type: 'GreaterThan', value };\n }\n /** Creates a `IfThenElse` expression that will evaluate the `$if` expression followed by either the `$then` of `$else` expressions */\n export function IfThenElse(\n $if: Expression,\n $then: Expression,\n $else: Expression,\n options: ExpressionOptions = {},\n ): IfThenElseExpression {\n return { ...options, type: 'IfThenElse', if: $if, then: $then, else: $else };\n }\n /** Creates a `Index` expression that will evaluate an array element by the given sub expression */\n export function Index<E extends Expression, I extends number>(\n index: I,\n expression: E,\n options: ExpressionOptions = {},\n ): IndexExpression<E, I> {\n return { ...options, type: 'Index', index, expr: expression };\n }\n /** Creates a `InstanceOf` expression that will apply the `instanceof` operator */\n export function InstanceOf<T extends string>(value: T, options: ExpressionOptions = {}): InstanceOfExpression<T> {\n return { ...options, type: 'InstanceOf', value };\n }\n /** Creates a `IsArray` expression that will check a value as an array */\n export function IsArray(options: ExpressionOptions = {}): IsArrayExpression {\n return { ...options, type: 'IsArray' };\n }\n /** Creates a `IsNaN` expression that will check for NaN */\n export function IsNaN(options: ExpressionOptions = {}): IsNaNExpression {\n return { ...options, type: 'IsNaN' };\n }\n /** Creates a `IsInteger` expression that will check for numeric integer values */\n export function IsInteger(options: ExpressionOptions = {}): IsIntegerExpression {\n return { ...options, type: 'IsInteger' };\n }\n /** Creates a `IsObject` expression that will check a value as an object */\n export function IsObject(options: ExpressionOptions = {}): IsObjectExpression {\n return Expression.TypeOf('object', options);\n }\n /** Creates a `IsBigInt` expression that will check a value as a bigint */\n export function IsBigInt(options: ExpressionOptions = {}): IsBigIntExpression {\n return Expression.TypeOf('bigint', options);\n }\n /** Creates a `IsBoolean` expression that will check a value as a boolean */\n export function IsBoolean(options: ExpressionOptions = {}): IsBooleanExpression {\n return Expression.TypeOf('boolean', options);\n }\n /** Creates a `IsFinite` expression that will check a numeric value if finite */\n export function IsFinite(options: ExpressionOptions = {}): IsFiniteExpression {\n return { ...options, type: 'IsFinite' };\n }\n /** Creates a `IsFunction` expression that will check a value as a function */\n export function IsFunction(options: ExpressionOptions = {}): IsFunctionExpression {\n return Expression.TypeOf('function', options);\n }\n /** Creates a `IsNumber` expression that will check a value as a number */\n export function IsNumber(options: ExpressionOptions = {}): IsNumberExpression {\n return Expression.TypeOf('number', options);\n }\n /** Creates a `IsSafeInteger` expression that will check a numeric value if finite */\n export function IsSafeInteger(options: ExpressionOptions = {}): IsSafeIntegerExpression {\n return { ...options, type: 'IsSafeInteger' };\n }\n /** Creates a `IsString` expression that will check a value as a string */\n export function IsString(options: ExpressionOptions = {}): IsStringExpression {\n return Expression.TypeOf('string', options);\n }\n /** Creates a `IsSymbol` expression that will check a value as a symbol */\n export function IsSymbol(options: ExpressionOptions = {}): IsSymbolExpression {\n return Expression.TypeOf('symbol', options);\n }\n /** Creates a `IsUndefined` expression that will check a value is undefined */\n export function IsUndefined(options: ExpressionOptions = {}): IsUndefinedExpression {\n return { ...options, type: 'IsUndefined' };\n }\n /** Creates a `IsNull` expression that will check a value is null */\n export function IsNull(options: ExpressionOptions = {}): IsNullExpression {\n return Expression.Equals(null, options);\n }\n /** Creates a `IsPattern` expression that will check a string with a regular expression */\n export function IsPattern(pattern: string, options: ExpressionOptions = {}): IsPatternExpression {\n return { ...options, type: 'IsPattern', pattern };\n }\n /** Creates a KeyIn expression that will check if a key exists on this value */\n export function KeyIn<T extends string>(value: T, options: ExpressionOptions = {}): KeyInExpression<T> {\n return { ...options, type: 'KeyIn', value };\n }\n /** Creates a `LessThanEqual` comparison expression */\n export function LessThanEqual<T extends Compariable>(\n value: T,\n options: ExpressionOptions = {},\n ): LessThanEqualExpression<T> {\n return { ...options, type: 'LessThanEqual', value };\n }\n /** Creates a `LessThan` comparison expression */\n export function LessThan<T extends Compariable>(value: T, options: ExpressionOptions = {}): LessThanExpression<T> {\n return { ...options, type: 'LessThan', value };\n }\n /** Creates a `MultipleOf` modulus expression that is true if the result is zero */\n export function MultipleOf<T extends number>(value: T, options: ExpressionOptions = {}): MultipleOfExpression<T> {\n return { ...options, type: 'MultipleOf', value };\n }\n /** Creates a `Not` expression where the result of the sub expression is inverted */\n export function Not<E extends Expression>(expression: E, options: ExpressionOptions = {}): NotExpression<E> {\n return { ...options, type: 'Not', expr: expression };\n }\n /** Creates a `Or` expression where each sub expression is evaluated in sequence */\n export function Or<E extends Expression>(\n expressions: (() => Generator<E>) | Array<E>,\n options: ExpressionOptions = {},\n ): Expression {\n const expr = globalThis.Array.isArray(expressions) ? expressions : [...expressions()];\n if (expr.length === 0) return Expression.False();\n if (expr.length === 1) return expr[0];\n return { ...options, type: 'Or', expr };\n }\n /** Creates a `PropertiesExcludePattern` expression that will enumerate each key matching the given regular expression */\n export function PropertiesExcludePattern<E extends Expression>(\n pattern: string,\n expression: E,\n options: ExpressionOptions = {},\n ): PropertiesExcludePatternExpression<E> {\n return { ...options, type: 'PropertiesExcludePattern', expr: expression, pattern };\n }\n /** Creates a `PropertiesExclude` expression that will enumerate the unselected keys and check each for the sub expression */\n export function PropertiesExclude<E extends Expression, K extends string[]>(\n keys: K,\n expression: E,\n options: ExpressionOptions = {},\n ): PropertiesExcludeExpression<E, K> {\n return { ...options, type: 'PropertiesExclude', expr: expression, keys };\n }\n /** Creates a `PropertiesIncludePattern` expression that will enumerate each key matching the given regular expression */\n export function PropertiesIncludePattern<E extends Expression>(\n pattern: string,\n expression: E,\n options: ExpressionOptions = {},\n ): PropertiesIncludePatternExpression<E> {\n return { ...options, type: 'PropertiesIncludePattern', expr: expression, pattern };\n }\n /** Creates a `PropertiesInclude` expression that will enumerate the selected keys and check each for the sub expression */\n export function PropertiesInclude<E extends Expression, K extends string[]>(\n keys: K,\n expression: E,\n options: ExpressionOptions = {},\n ): PropertiesIncludeExpression<E, K> {\n return { ...options, type: 'PropertiesInclude', expr: expression, keys };\n }\n /** Creates a `PropertiesLength` expression that checks an object a property length that equals the given value */\n export function PropertiesLength<T extends number>(\n value: T,\n options: ExpressionOptions = {},\n ): PropertiesLengthExpression<T> {\n return { ...options, type: 'PropertiesLength', value };\n }\n /** Creates a `PropertiesMaximum` expression that will check an object has a property length less or equal the given value */\n export function PropertiesMaximum<T extends number>(\n value: T,\n options: ExpressionOptions = {},\n ): PropertiesMaximumExpression<T> {\n return { ...options, type: 'PropertiesMaximum', value };\n }\n /** Creates a `PropertiesMinimum` expression that will check an object has a property length greater or equal the given value */\n export function PropertiesMinimum<T extends number>(\n value: T,\n options: ExpressionOptions = {},\n ): PropertiesMinimumExpression<T> {\n return { ...options, type: 'PropertiesMinimum', value };\n }\n /** Creates a `Properties` expression that will enumerate all object properties and check for the given sub expression */\n export function Properties<E extends Expression>(\n expression: E,\n options: ExpressionOptions = {},\n ): PropertiesExpression<E> {\n return { ...options, type: 'Properties', expr: expression };\n }\n /** Creates a `PropertyKeys` expression that will check an object has the specified keys */\n export function PropertyKeys<T extends string[]>(\n keys: T,\n options: ExpressionOptions = {},\n ): PropertyKeysExpression<T> {\n return { ...options, type: 'PropertyKeys', keys };\n }\n /** Creates a `Property` expression that will evaluate the property value by the given sub expression */\n export function Property<E extends Expression, K extends string>(\n key: K,\n expression: E,\n options: ExpressionOptions = {},\n ): PropertyExpression<E, K> {\n return { ...options, type: 'Property', key, expr: expression };\n }\n /** Creates a `Ref` that will reference another part of the expression tree via $id */\n export function Ref<T extends string>(value: T, options: ExpressionOptions = {}): RefExpression<T> {\n return { ...options, type: 'Ref', $ref: value };\n }\n /** Creates a `True` expression that evaluates `true` */\n export function True(options: ExpressionOptions = {}): TrueExpression {\n return { ...options, type: 'True' };\n }\n /** Creates a `TypeOf` expression that will apply `typeof` operator for the evaluated value */\n export function TypeOf<E extends TypeOf>(value: E, options: ExpressionOptions = {}): TypeOfExpression<E> {\n return { ...options, type: 'TypeOf', value };\n }\n}\n"],"names":["Expression","And","expressions","options","expr","globalThis","Array","isArray","length","False","type","Call","target","parameters","expression","Equals","value","Function","callback","ElementsDistinct","Elements","GreaterThanEqual","GreaterThan","IfThenElse","$if","$then","$else","if","then","else","Index","index","InstanceOf","IsArray","IsNaN","IsInteger","IsObject","TypeOf","IsBigInt","IsBoolean","IsFinite","IsFunction","IsNumber","IsSafeInteger","IsString","IsSymbol","IsUndefined","IsNull","IsPattern","pattern","KeyIn","LessThanEqual","LessThan","MultipleOf","Not","Or","PropertiesExcludePattern","PropertiesExclude","keys","PropertiesIncludePattern","PropertiesInclude","PropertiesLength","PropertiesMaximum","PropertiesMinimum","Properties","PropertyKeys","Property","key","Ref","$ref","True"],"mappings":"AAAA;;;;;;;;;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AE/B,OAAO;YAAE,GAAGA,OAAO;YAAEO,MAAM;YAAqBM;QAAM;IACxD;IANA,8HAA8H,cAC9G+C,oBAAAA;IAOT,SAASC,WACdlD,UAAa,EACbX,UAA6B,CAAC,CAAC;QAE/B,OAAO;YAAE,GAAGA,OAAO;YAAEO,MAAM;YAAcN,MAAMU;QAAW;IAC5D;IANA,uHAAuH,cACvGkD,aAAAA;IAOT,SAASC,aACdP,IAAO,EACPvD,UAA6B,CAAC,CAAC;QAE/B,OAAO;YAAE,GAAGA,OAAO;YAAEO,MAAM;YAAgBgD;QAAK;IAClD;IANA,yFAAyF,cACzEO,eAAAA;IAOT,SAASC,SACdC,GAAM,EACNrD,UAAa,EACbX,UAA6B,CAAC,CAAC;QAE/B,OAAO;YAAE,GAAGA,OAAO;YAAEO,MAAM;YAAYyD;YAAK/D,MAAMU;QAAW;IAC/D;IAPA,sGAAsG,cACtFoD,WAAAA;IAQT,SAASE,IAAsBpD,KAAQ,EAAEb,UAA6B,CAAC,CAAC;QAC7E,OAAO;YAAE,GAAGA,OAAO;YAAEO,MAAM;YAAO2D,MAAMrD;QAAM;IAChD;IAHA,oFAAoF,cACpEoD,MAAAA;IAIT,SAASE,KAAKnE,UAA6B,CAAC,CAAC;QAClD,OAAO;YAAE,GAAGA,OAAO;YAAEO,MAAM;QAAO;IACpC;IAHA,sDAAsD,cACtC4D,OAAAA;IAIT,SAASjC,OAAyBrB,KAAQ,EAAEb,UAA6B,CAAC,CAAC;QAChF,OAAO;YAAE,GAAGA,OAAO;YAAEO,MAAM;YAAUM;QAAM;IAC7C;IAHA,4FAA4F,cAC5EqB,SAAAA;AAGlB,GArQiBrC,eAAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*--------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
@sinclair/typebox-expression
|
|
4
|
+
|
|
5
|
+
The MIT License (MIT)
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
|
17
|
+
all copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
25
|
+
THE SOFTWARE.
|
|
26
|
+
|
|
27
|
+
---------------------------------------------------------------------------*/ export * from './compiler.js';
|
|
28
|
+
export * from './errors.js';
|
|
29
|
+
export * from './evaluator.js';
|
|
30
|
+
export * from './expression.js';
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/schema/typebox/gen/codegen/expression/index.ts"],"sourcesContent":["/*--------------------------------------------------------------------------\n\n@sinclair/typebox-expression\n\nThe MIT License (MIT)\n\nCopyright (c) 2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n---------------------------------------------------------------------------*/\n\nexport * from './compiler';\nexport * from './errors';\nexport * from './evaluator';\nexport * from './expression';\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;2EA0B2E,GAE3E,cAAc,aAAa;AAC3B,cAAc,WAAW;AACzB,cAAc,cAAc;AAC5B,cAAc,eAAe"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*--------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
@sinclair/typebox-codegen
|
|
4
|
+
|
|
5
|
+
The MIT License (MIT)
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in
|
|
15
|
+
all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
THE SOFTWARE.
|
|
24
|
+
|
|
25
|
+
---------------------------------------------------------------------------*/ export * from './common/index.js';
|
|
26
|
+
export * from './model/index.js';
|
|
27
|
+
export * from './typescript/index.js';
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/schema/typebox/gen/codegen/index.ts"],"sourcesContent":["/*--------------------------------------------------------------------------\n\n@sinclair/typebox-codegen\n\nThe MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n---------------------------------------------------------------------------*/\n\nexport * from './common';\nexport * from './model';\nexport * from './typescript';\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;2EAwB2E,GAE3E,cAAc,WAAW;AACzB,cAAc,UAAU;AACxB,cAAc,eAAe"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*--------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
@sinclair/typebox-codegen
|
|
4
|
+
|
|
5
|
+
The MIT License (MIT)
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in
|
|
15
|
+
all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
THE SOFTWARE.
|
|
24
|
+
|
|
25
|
+
---------------------------------------------------------------------------*/ export * from './model-to-arktype.js';
|
|
26
|
+
export * from './model-to-expression.js';
|
|
27
|
+
export * from './model-to-grpc.js';
|
|
28
|
+
export * from './model-to-io-ts.js';
|
|
29
|
+
export * from './model-to-javascript.js';
|
|
30
|
+
export * from './model-to-json-schema.js';
|
|
31
|
+
export * from './model-to-typebox.js';
|
|
32
|
+
export * from './model-to-typescript.js';
|
|
33
|
+
export * from './model-to-valibot.js';
|
|
34
|
+
export * from './model-to-value.js';
|
|
35
|
+
export * from './model-to-yrel.js';
|
|
36
|
+
export * from './model-to-yup.js';
|
|
37
|
+
export * from './model-to-zod.js';
|
|
38
|
+
export * from './model.js';
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/schema/typebox/gen/codegen/model/index.ts"],"sourcesContent":["/*--------------------------------------------------------------------------\n\n@sinclair/typebox-codegen\n\nThe MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n---------------------------------------------------------------------------*/\n\nexport * from './model-to-arktype';\nexport * from './model-to-expression';\nexport * from './model-to-grpc';\nexport * from './model-to-io-ts';\nexport * from './model-to-javascript';\nexport * from './model-to-json-schema';\nexport * from './model-to-typebox';\nexport * from './model-to-typescript';\nexport * from './model-to-valibot';\nexport * from './model-to-value';\nexport * from './model-to-yrel';\nexport * from './model-to-yup';\nexport * from './model-to-zod';\nexport * from './model';\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;2EAwB2E,GAE3E,cAAc,qBAAqB;AACnC,cAAc,wBAAwB;AACtC,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,wBAAwB;AACtC,cAAc,yBAAyB;AACvC,cAAc,qBAAqB;AACnC,cAAc,wBAAwB;AACtC,cAAc,qBAAqB;AACnC,cAAc,mBAAmB;AACjC,cAAc,kBAAkB;AAChC,cAAc,iBAAiB;AAC/B,cAAc,iBAAiB;AAC/B,cAAc,UAAU"}
|