@tstdl/base 0.78.0-beta2 → 0.78.0-beta5
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/api/server/gateway.js +3 -0
- package/api/server/gateway.js.map +1 -1
- package/api/types.d.ts +11 -8
- package/api/types.js.map +1 -1
- package/container/container.js.map +1 -1
- package/container/resolve-chain.d.ts +5 -5
- package/container/resolve-chain.js.map +1 -1
- package/database/mongo/mongo-base.repository.js.map +1 -1
- package/database/mongo/types.d.ts +2 -2
- package/enumerable/async-enumerable.d.ts +2 -1
- package/enumerable/async-enumerable.js +3 -0
- package/enumerable/async-enumerable.js.map +1 -1
- package/enumerable/enumerable-methods.d.ts +1 -0
- package/enumerable/enumerable.d.ts +1 -0
- package/enumerable/enumerable.js +12 -18
- package/enumerable/enumerable.js.map +1 -1
- package/key-value-store/mongo/mongo-key-value.model.d.ts +1 -0
- package/mail/template-providers/file-mail-template.provider.js +2 -2
- package/mail/template-providers/file-mail-template.provider.js.map +1 -1
- package/package.json +5 -5
- package/queue/mongo/mongo-job.repository.js +1 -1
- package/queue/mongo/mongo-job.repository.js.map +1 -1
- package/reflection/registry.d.ts +8 -8
- package/reflection/registry.js.map +1 -1
- package/schema/coercers/default-value.coercer.d.ts +1 -1
- package/schema/coercers/default-value.coercer.js +1 -1
- package/schema/coercers/default-value.coercer.js.map +1 -1
- package/schema/coercers/uint8-array.coercer.js +3 -8
- package/schema/coercers/uint8-array.coercer.js.map +1 -1
- package/schema/constraints/integer.js +1 -1
- package/schema/constraints/integer.js.map +1 -1
- package/schema/constraints/maximum-date.js +1 -1
- package/schema/constraints/maximum-date.js.map +1 -1
- package/schema/constraints/maximum.js +1 -1
- package/schema/constraints/maximum.js.map +1 -1
- package/schema/constraints/minimum-date.js +1 -1
- package/schema/constraints/minimum-date.js.map +1 -1
- package/schema/constraints/minimum.js +1 -1
- package/schema/constraints/minimum.js.map +1 -1
- package/schema/constraints/pattern.js +1 -1
- package/schema/constraints/pattern.js.map +1 -1
- package/schema/decorators/array.d.ts +3 -2
- package/schema/decorators/array.js +1 -1
- package/schema/decorators/array.js.map +1 -1
- package/schema/decorators/defaulted.d.ts +3 -2
- package/schema/decorators/defaulted.js +1 -1
- package/schema/decorators/defaulted.js.map +1 -1
- package/schema/decorators/property.d.ts +3 -3
- package/schema/decorators/property.js +4 -1
- package/schema/decorators/property.js.map +1 -1
- package/schema/decorators/types.d.ts +3 -3
- package/schema/decorators/utils.d.ts +3 -2
- package/schema/decorators/utils.js +4 -8
- package/schema/decorators/utils.js.map +1 -1
- package/schema/schema.d.ts +10 -9
- package/schema/schema.js +89 -93
- package/schema/schema.js.map +1 -1
- package/schema/schemas/any.d.ts +2 -2
- package/schema/schemas/any.js +2 -2
- package/schema/schemas/any.js.map +1 -1
- package/schema/schemas/array.d.ts +4 -2
- package/schema/schemas/array.js +1 -2
- package/schema/schemas/array.js.map +1 -1
- package/schema/schemas/assign.d.ts +5 -5
- package/schema/schemas/assign.js +0 -1
- package/schema/schemas/assign.js.map +1 -1
- package/schema/schemas/boolean.js +2 -3
- package/schema/schemas/boolean.js.map +1 -1
- package/schema/schemas/constraint.d.ts +1 -1
- package/schema/schemas/constraint.js +1 -2
- package/schema/schemas/constraint.js.map +1 -1
- package/schema/schemas/date.js +2 -3
- package/schema/schemas/date.js.map +1 -1
- package/schema/schemas/defaulted.d.ts +4 -2
- package/schema/schemas/defaulted.js +1 -2
- package/schema/schemas/defaulted.js.map +1 -1
- package/schema/schemas/enumeration.js +2 -3
- package/schema/schemas/enumeration.js.map +1 -1
- package/schema/schemas/exclude.js.map +1 -1
- package/schema/schemas/instance.d.ts +2 -2
- package/schema/schemas/instance.js +1 -1
- package/schema/schemas/instance.js.map +1 -1
- package/schema/schemas/literal.js +2 -3
- package/schema/schemas/literal.js.map +1 -1
- package/schema/schemas/nullable.d.ts +1 -1
- package/schema/schemas/nullable.js +1 -1
- package/schema/schemas/nullable.js.map +1 -1
- package/schema/schemas/number.d.ts +1 -1
- package/schema/schemas/number.js +5 -3
- package/schema/schemas/number.js.map +1 -1
- package/schema/schemas/object.d.ts +2 -3
- package/schema/schemas/object.js.map +1 -1
- package/schema/schemas/optional.d.ts +1 -1
- package/schema/schemas/optional.js +1 -1
- package/schema/schemas/optional.js.map +1 -1
- package/schema/schemas/pick.js.map +1 -1
- package/schema/schemas/readable-stream.d.ts +2 -2
- package/schema/schemas/readable-stream.js +3 -4
- package/schema/schemas/readable-stream.js.map +1 -1
- package/schema/schemas/record.d.ts +5 -4
- package/schema/schemas/record.js +2 -2
- package/schema/schemas/record.js.map +1 -1
- package/schema/schemas/regexp.js +3 -3
- package/schema/schemas/regexp.js.map +1 -1
- package/schema/schemas/string.js +2 -3
- package/schema/schemas/string.js.map +1 -1
- package/schema/schemas/transform.d.ts +4 -3
- package/schema/schemas/transform.js +1 -3
- package/schema/schemas/transform.js.map +1 -1
- package/schema/schemas/uint8-array.d.ts +2 -3
- package/schema/schemas/uint8-array.js +4 -4
- package/schema/schemas/uint8-array.js.map +1 -1
- package/schema/schemas/union.d.ts +9 -4
- package/schema/schemas/union.js +5 -4
- package/schema/schemas/union.js.map +1 -1
- package/schema/schemas/unknown.d.ts +2 -2
- package/schema/schemas/unknown.js +2 -2
- package/schema/schemas/unknown.js.map +1 -1
- package/schema/transformers/generic.d.ts +9 -9
- package/schema/transformers/generic.js.map +1 -1
- package/schema/transformers/lowercase.d.ts +2 -2
- package/schema/transformers/lowercase.js +1 -1
- package/schema/transformers/lowercase.js.map +1 -1
- package/schema/transformers/trim.d.ts +2 -2
- package/schema/transformers/trim.js +1 -1
- package/schema/transformers/trim.js.map +1 -1
- package/schema/transformers/uppercase.d.ts +2 -2
- package/schema/transformers/uppercase.js +1 -1
- package/schema/transformers/uppercase.js.map +1 -1
- package/schema/types.d.ts +66 -48
- package/schema/types.js +47 -12
- package/schema/types.js.map +1 -1
- package/schema/utils/schema.d.ts +10 -9
- package/schema/utils/schema.js +43 -47
- package/schema/utils/schema.js.map +1 -1
- package/schema/utils/value-type.d.ts +4 -3
- package/schema/utils/value-type.js +19 -15
- package/schema/utils/value-type.js.map +1 -1
- package/templates/providers/file-template.provider.js.map +1 -1
- package/types.d.ts +35 -1
- package/utils/async-iterable-helpers/includes.d.ts +2 -0
- package/utils/async-iterable-helpers/includes.js +13 -0
- package/utils/async-iterable-helpers/includes.js.map +1 -0
- package/utils/async-iterable-helpers/index.d.ts +1 -0
- package/utils/async-iterable-helpers/index.js +1 -0
- package/utils/async-iterable-helpers/index.js.map +1 -1
- package/utils/iterable-helpers/includes.d.ts +1 -0
- package/utils/iterable-helpers/includes.js +9 -0
- package/utils/iterable-helpers/includes.js.map +1 -0
- package/utils/iterable-helpers/index.d.ts +1 -0
- package/utils/iterable-helpers/index.js +1 -0
- package/utils/iterable-helpers/index.js.map +1 -1
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.nullable = void 0;
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
function nullable(schema) {
|
|
6
|
-
return (0, types_1.valueSchema)(
|
|
6
|
+
return (0, types_1.valueSchema)(schema, { nullable: true });
|
|
7
7
|
}
|
|
8
8
|
exports.nullable = nullable;
|
|
9
9
|
//# sourceMappingURL=nullable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../source/schema/schemas/nullable.ts"],"names":[],"mappings":";;;AAEA,oCAAuC;AAEvC,SAAgB,QAAQ,
|
|
1
|
+
{"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../source/schema/schemas/nullable.ts"],"names":[],"mappings":";;;AAEA,oCAAuC;AAEvC,SAAgB,QAAQ,CAAO,MAAoB;IACjD,OAAO,IAAA,mBAAW,EAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAoC,CAAC;AACpF,CAAC;AAFD,4BAEC"}
|
package/schema/schemas/number.js
CHANGED
|
@@ -19,15 +19,17 @@ function number(options = {}) {
|
|
|
19
19
|
if (options.integer == true) {
|
|
20
20
|
constraints.push(integer_1.integerConstraint);
|
|
21
21
|
}
|
|
22
|
-
return (0, types_1.valueSchema)({
|
|
23
|
-
|
|
22
|
+
return (0, types_1.valueSchema)((0, types_1.typeSchema)(globalThis.Number), {
|
|
23
|
+
array: false,
|
|
24
|
+
optional: false,
|
|
25
|
+
nullable: false,
|
|
24
26
|
coerce: options.coerce,
|
|
25
27
|
valueConstraints: constraints
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
30
|
exports.number = number;
|
|
29
31
|
function Number(options) {
|
|
30
|
-
return (0, decorators_1.
|
|
32
|
+
return (0, decorators_1.createSchemaPropertyDecoratorFromSchema)(number(options));
|
|
31
33
|
}
|
|
32
34
|
exports.Number = Number;
|
|
33
35
|
//# sourceMappingURL=number.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.js","sourceRoot":"","sources":["../../../source/schema/schemas/number.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,yDAAgD;AAChD,oDAA2D;AAC3D,oDAA2D;AAC3D,oDAA2D;AAC3D,
|
|
1
|
+
{"version":3,"file":"number.js","sourceRoot":"","sources":["../../../source/schema/schemas/number.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,yDAAgD;AAChD,oDAA2D;AAC3D,oDAA2D;AAC3D,oDAA2D;AAC3D,8CAAwE;AACxE,oCAAkG;AAQlG,SAAgB,MAAM,CAAC,UAAyB,EAAE;IAChD,MAAM,WAAW,GAA4B,EAAE,CAAC;IAEhD,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC9B,WAAW,CAAC,IAAI,CAAC,IAAI,2BAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;KAC1D;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC9B,WAAW,CAAC,IAAI,CAAC,IAAI,2BAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;KAC1D;IAED,IAAI,OAAO,CAAC,OAAO,IAAI,IAAI,EAAE;QAC3B,WAAW,CAAC,IAAI,CAAC,2BAAiB,CAAC,CAAC;KACrC;IAED,OAAO,IAAA,mBAAW,EAAC,IAAA,kBAAU,EAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QAChD,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,gBAAgB,EAAE,WAAW;KAC9B,CAAC,CAAC;AACL,CAAC;AAtBD,wBAsBC;AAED,SAAgB,MAAM,CAAC,OAAuB;IAC5C,OAAO,IAAA,oDAAuC,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;AAClE,CAAC;AAFD,wBAEC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Record, TypedOmit } from "../../types";
|
|
2
|
-
import type { PartialOnUndefinedDeep } from 'type-fest';
|
|
1
|
+
import type { Record, SimplifiedOptionalize, TypedOmit } from "../../types";
|
|
3
2
|
import type { ObjectSchema, ObjectSchemaProperties } from '../types';
|
|
4
3
|
export declare type ObjectOptions<T extends Record = Record> = TypedOmit<ObjectSchema<T>, 'properties'>;
|
|
5
4
|
export declare function explicitObject<T extends Record>(properties: ObjectSchemaProperties<T>, options?: ObjectOptions<T>): ObjectSchema<T>;
|
|
6
|
-
export declare function object<T extends Record>(properties: ObjectSchemaProperties<T>, options?: ObjectOptions<T>): ObjectSchema<
|
|
5
|
+
export declare function object<T extends Record>(properties: ObjectSchemaProperties<T>, options?: ObjectOptions<T>): ObjectSchema<SimplifiedOptionalize<T>, SimplifiedOptionalize<T>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../../source/schema/schemas/object.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;
|
|
1
|
+
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../../source/schema/schemas/object.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAIzD,oCAAwC;AAIxC,SAAgB,cAAc,CAAmB,UAAqC,EAAE,OAA0B;IAChH,OAAO,MAAM,CAAC,UAAU,EAAE,OAAO,CAA2B,CAAC;AAC/D,CAAC;AAFD,wCAEC;AAED,SAAgB,MAAM,CAAmB,UAAqC,EAAE,OAA0B;IACxG,OAAO,IAAA,oBAAY,EAAC;QAClB,UAAU;QACV,GAAG,OAAO;KACX,CAAgF,CAAC;AACpF,CAAC;AALD,wBAKC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Schema } from '../schema';
|
|
2
2
|
import type { ValueSchema } from '../types';
|
|
3
|
-
export declare function optional<T>(schema: Schema<T>): ValueSchema<T | undefined>;
|
|
3
|
+
export declare function optional<T, O>(schema: Schema<T, O>): ValueSchema<T | undefined, O | undefined>;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.optional = void 0;
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
function optional(schema) {
|
|
6
|
-
return (0, types_1.valueSchema)(
|
|
6
|
+
return (0, types_1.valueSchema)(schema, { optional: true });
|
|
7
7
|
}
|
|
8
8
|
exports.optional = optional;
|
|
9
9
|
//# sourceMappingURL=optional.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optional.js","sourceRoot":"","sources":["../../../source/schema/schemas/optional.ts"],"names":[],"mappings":";;;AAEA,oCAAuC;AAEvC,SAAgB,QAAQ,
|
|
1
|
+
{"version":3,"file":"optional.js","sourceRoot":"","sources":["../../../source/schema/schemas/optional.ts"],"names":[],"mappings":";;;AAEA,oCAAuC;AAEvC,SAAgB,QAAQ,CAAO,MAAoB;IACjD,OAAO,IAAA,mBAAW,EAAC,MAA8C,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACzF,CAAC;AAFD,4BAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pick.js","sourceRoot":"","sources":["../../../source/schema/schemas/pick.ts"],"names":[],"mappings":";;;AACA,mDAA8C;AAG9C,oCAAwC;AAExC,SAAgB,IAAI,CAAsC,MAAuB,EAAE,GAAiB;IAClG,MAAM,IAAI,GAAG,IAAA,eAAO,EAAC,GAAG,CAAC,CAAC;IAE1B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAgB,CAAC,CAAC,CAAC;IAEzF,MAAM,YAAY,GAAG,IAAA,oBAAY,EAAC;QAChC,GAAG,MAAM;QACT,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"pick.js","sourceRoot":"","sources":["../../../source/schema/schemas/pick.ts"],"names":[],"mappings":";;;AACA,mDAA8C;AAG9C,oCAAwC;AAExC,SAAgB,IAAI,CAAsC,MAAuB,EAAE,GAAiB;IAClG,MAAM,IAAI,GAAG,IAAA,eAAO,EAAC,GAAG,CAAC,CAAC;IAE1B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAgB,CAAC,CAAC,CAAC;IAEzF,MAAM,YAAY,GAAG,IAAA,oBAAY,EAAC;QAChC,GAAG,MAAM;QACT,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,aAAa,CAA8B;KAC3E,CAAC,CAAC;IAEH,OAAO,YAAmD,CAAC;AAC7D,CAAC;AAZD,oBAYC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Decorator } from "../../reflection";
|
|
2
|
-
import type {
|
|
3
|
-
export declare function readableStream():
|
|
2
|
+
import type { TypeSchema } from '../types';
|
|
3
|
+
export declare function readableStream(): TypeSchema<globalThis.ReadableStream>;
|
|
4
4
|
export declare function ReadableStream(): Decorator<'property' | 'accessor'>;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.ReadableStream = exports.readableStream = void 0;
|
|
4
5
|
const decorators_1 = require("../decorators");
|
|
5
6
|
const types_1 = require("../types");
|
|
6
7
|
function readableStream() {
|
|
7
|
-
return (0, types_1.
|
|
8
|
-
type: globalThis.ReadableStream
|
|
9
|
-
});
|
|
8
|
+
return (0, types_1.typeSchema)(globalThis.ReadableStream);
|
|
10
9
|
}
|
|
11
10
|
exports.readableStream = readableStream;
|
|
12
11
|
function ReadableStream() {
|
|
13
|
-
return (0, decorators_1.
|
|
12
|
+
return (0, decorators_1.createSchemaPropertyDecoratorFromSchema)(readableStream());
|
|
14
13
|
}
|
|
15
14
|
exports.ReadableStream = ReadableStream;
|
|
16
15
|
//# sourceMappingURL=readable-stream.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readable-stream.js","sourceRoot":"","sources":["../../../source/schema/schemas/readable-stream.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"readable-stream.js","sourceRoot":"","sources":["../../../source/schema/schemas/readable-stream.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAwE;AAExE,oCAAsC;AAEtC,SAAgB,cAAc;IAC5B,OAAO,IAAA,kBAAU,EAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAC/C,CAAC;AAFD,wCAEC;AAED,SAAgB,cAAc;IAC5B,OAAO,IAAA,oDAAuC,EAAC,cAAc,EAAE,CAAC,CAAC;AACnE,CAAC;AAFD,wCAEC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Record, TypedOmit } from "../../types";
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export declare
|
|
1
|
+
import type { OneOrMany, Record, TypedOmit } from "../../types";
|
|
2
|
+
import type { Schema } from '../schema';
|
|
3
|
+
import type { ObjectSchema } from '../types';
|
|
4
|
+
export declare type RecordOptions<T extends Record = Record> = TypedOmit<ObjectSchema<T>, 'properties' | 'allowUnknownProperties' | 'mask'>;
|
|
5
|
+
export declare function record<T, O>(valueType: OneOrMany<Schema<T, O>>, options?: RecordOptions): ObjectSchema<Record<any, O>>;
|
package/schema/schemas/record.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.record = void 0;
|
|
5
5
|
const types_1 = require("../types");
|
|
6
|
-
function record(
|
|
6
|
+
function record(valueType, options) {
|
|
7
7
|
return (0, types_1.objectSchema)({
|
|
8
8
|
properties: {},
|
|
9
|
-
allowUnknownProperties:
|
|
9
|
+
allowUnknownProperties: valueType,
|
|
10
10
|
...options
|
|
11
11
|
});
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../source/schema/schemas/record.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../source/schema/schemas/record.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAKzD,oCAAwC;AAIxC,SAAgB,MAAM,CAAO,SAAkC,EAAE,OAAuB;IACtF,OAAO,IAAA,oBAAY,EAAC;QAClB,UAAU,EAAE,EAAE;QACd,sBAAsB,EAAE,SAAS;QACjC,GAAG,OAAO;KACX,CAAiB,CAAC;AACrB,CAAC;AAND,wBAMC"}
|
package/schema/schemas/regexp.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.RegExp = exports.regexp = void 0;
|
|
4
5
|
const decorators_1 = require("../decorators");
|
|
5
6
|
const types_1 = require("../types");
|
|
6
7
|
function regexp(options = {}) {
|
|
7
|
-
return (0, types_1.valueSchema)({
|
|
8
|
-
type: globalThis.RegExp,
|
|
8
|
+
return (0, types_1.valueSchema)((0, types_1.typeSchema)(globalThis.RegExp), {
|
|
9
9
|
coerce: options.coerce
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
exports.regexp = regexp;
|
|
13
13
|
function RegExp(options) {
|
|
14
|
-
return (0, decorators_1.
|
|
14
|
+
return (0, decorators_1.createSchemaPropertyDecoratorFromSchema)(regexp(options));
|
|
15
15
|
}
|
|
16
16
|
exports.RegExp = RegExp;
|
|
17
17
|
//# sourceMappingURL=regexp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regexp.js","sourceRoot":"","sources":["../../../source/schema/schemas/regexp.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"regexp.js","sourceRoot":"","sources":["../../../source/schema/schemas/regexp.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAwE;AAGxE,oCAAmD;AAInD,SAAgB,MAAM,CAAC,UAA+B,EAAE;IACtD,OAAO,IAAA,mBAAW,EAAC,IAAA,kBAAU,EAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QAChD,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;AACL,CAAC;AAJD,wBAIC;AAED,SAAgB,MAAM,CAAC,OAA6B;IAClD,OAAO,IAAA,oDAAuC,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;AAClE,CAAC;AAFD,wBAEC"}
|
package/schema/schemas/string.js
CHANGED
|
@@ -29,8 +29,7 @@ function string(options = {}) {
|
|
|
29
29
|
if ((0, type_guards_1.isDefined)(options.uppercase)) {
|
|
30
30
|
transformers.push(new transformers_1.UppercaseTransformer());
|
|
31
31
|
}
|
|
32
|
-
return (0, types_1.valueSchema)({
|
|
33
|
-
type: globalThis.String,
|
|
32
|
+
return (0, types_1.valueSchema)((0, types_1.typeSchema)(globalThis.String), {
|
|
34
33
|
coerce: options.coerce,
|
|
35
34
|
valueConstraints: constraints,
|
|
36
35
|
transformers
|
|
@@ -38,7 +37,7 @@ function string(options = {}) {
|
|
|
38
37
|
}
|
|
39
38
|
exports.string = string;
|
|
40
39
|
function String(options) {
|
|
41
|
-
return (0, decorators_1.
|
|
40
|
+
return (0, decorators_1.createSchemaPropertyDecoratorFromSchema)(string(options));
|
|
42
41
|
}
|
|
43
42
|
exports.String = String;
|
|
44
43
|
//# sourceMappingURL=string.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../source/schema/schemas/string.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,yDAAgD;AAChD,gDAAqG;AACrG,
|
|
1
|
+
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../source/schema/schemas/string.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,yDAAgD;AAChD,gDAAqG;AACrG,8CAAwE;AACxE,kDAA8F;AAE9F,oCAAmD;AA4BnD,SAAgB,MAAM,CAAC,UAAyB,EAAE;IAChD,MAAM,WAAW,GAA4B,EAAE,CAAC;IAChD,MAAM,YAAY,GAA6B,EAAE,CAAC;IAElD,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,WAAW,CAAC,IAAI,CAAC,IAAI,qCAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;KACtE;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,WAAW,CAAC,IAAI,CAAC,IAAI,qCAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;KACtE;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;QAC9D,WAAW,CAAC,IAAI,CAAC,IAAI,+BAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;KACvE;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAC3B,YAAY,CAAC,IAAI,CAAC,IAAI,8BAAe,EAAE,CAAC,CAAC;KAC1C;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QAChC,YAAY,CAAC,IAAI,CAAC,IAAI,mCAAoB,EAAE,CAAC,CAAC;KAC/C;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QAChC,YAAY,CAAC,IAAI,CAAC,IAAI,mCAAoB,EAAE,CAAC,CAAC;KAC/C;IAED,OAAO,IAAA,mBAAW,EAAC,IAAA,kBAAU,EAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QAChD,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,gBAAgB,EAAE,WAAW;QAC7B,YAAY;KACb,CAAC,CAAC;AACL,CAAC;AAlCD,wBAkCC;AAED,SAAgB,MAAM,CAAC,OAAuB;IAC5C,OAAO,IAAA,oDAAuC,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;AAClE,CAAC;AAFD,wBAEC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { OneOrMany } from "../../types";
|
|
1
|
+
import type { AbstractConstructor, OneOrMany } from "../../types";
|
|
2
|
+
import type { Schema } from '../schema';
|
|
2
3
|
import type { GenericTransformFunction } from '../transformers/generic';
|
|
3
|
-
import type {
|
|
4
|
-
export declare function transform<T>(schema:
|
|
4
|
+
import type { ValueSchema, ValueType } from '../types';
|
|
5
|
+
export declare function transform<T, O, TransformOutput>(schema: OneOrMany<Schema<T, O>>, sourceType: OneOrMany<ValueType<T>>, targetType: AbstractConstructor<TransformOutput>, transformFunction: GenericTransformFunction<O, TransformOutput>): ValueSchema<TransformOutput>;
|
|
@@ -4,11 +4,9 @@ exports.transform = void 0;
|
|
|
4
4
|
const generic_1 = require("../transformers/generic");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
function transform(schema, sourceType, targetType, transformFunction) {
|
|
7
|
-
return (0, types_1.valueSchema)({
|
|
8
|
-
type: schema,
|
|
7
|
+
return (0, types_1.valueSchema)(schema, {
|
|
9
8
|
transformers: new generic_1.GenericTransformer(sourceType, targetType, transformFunction)
|
|
10
9
|
});
|
|
11
10
|
}
|
|
12
11
|
exports.transform = transform;
|
|
13
|
-
/* decorator is in file of GenericTransformer */
|
|
14
12
|
//# sourceMappingURL=transform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../source/schema/schemas/transform.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../source/schema/schemas/transform.ts"],"names":[],"mappings":";;;AAGA,qDAA6D;AAE7D,oCAAuC;AAEvC,SAAgB,SAAS,CAAwB,MAA+B,EAAE,UAAmC,EAAE,UAAgD,EAAE,iBAA+D;IACtO,OAAO,IAAA,mBAAW,EAAC,MAAM,EAAE;QACzB,YAAY,EAAE,IAAI,4BAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,iBAAiB,CAAC;KAChF,CAAqB,CAAC;AACzB,CAAC;AAJD,8BAIC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { Decorator } from "../../reflection";
|
|
2
|
-
import type {
|
|
3
|
-
import type { Coercible } from '../types';
|
|
2
|
+
import type { Coercible, ValueSchema } from '../types';
|
|
4
3
|
export declare type Uint8ArraySchemaOptions = Coercible & {
|
|
5
4
|
minimumLength?: number;
|
|
6
5
|
maximumLength?: number;
|
|
7
6
|
};
|
|
8
|
-
export declare function uint8Array(options?: Uint8ArraySchemaOptions):
|
|
7
|
+
export declare function uint8Array(options?: Uint8ArraySchemaOptions): ValueSchema<globalThis.Uint8Array>;
|
|
9
8
|
export declare function Uint8Array(options?: Uint8ArraySchemaOptions): Decorator<'property' | 'accessor'>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.Uint8Array = exports.uint8Array = void 0;
|
|
4
5
|
const type_guards_1 = require("../../utils/type-guards");
|
|
5
6
|
const uint8_array_coercer_1 = require("../coercers/uint8-array.coercer");
|
|
6
7
|
const maximum_length_1 = require("../constraints/maximum-length");
|
|
7
8
|
const minimum_length_1 = require("../constraints/minimum-length");
|
|
8
|
-
const
|
|
9
|
+
const utils_1 = require("../decorators/utils");
|
|
9
10
|
const types_1 = require("../types");
|
|
10
11
|
function uint8Array(options = {}) {
|
|
11
12
|
const constraints = [];
|
|
@@ -15,15 +16,14 @@ function uint8Array(options = {}) {
|
|
|
15
16
|
if ((0, type_guards_1.isDefined)(options.maximumLength)) {
|
|
16
17
|
constraints.push(new maximum_length_1.MaximumLengthConstraint(options.maximumLength));
|
|
17
18
|
}
|
|
18
|
-
return (0, types_1.valueSchema)({
|
|
19
|
-
type: globalThis.Uint8Array,
|
|
19
|
+
return (0, types_1.valueSchema)((0, types_1.typeSchema)(globalThis.Uint8Array), {
|
|
20
20
|
coercers: (options.coerce == true) ? uint8_array_coercer_1.uint8ArrayCoercer : undefined,
|
|
21
21
|
valueConstraints: constraints
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
exports.uint8Array = uint8Array;
|
|
25
25
|
function Uint8Array(options) {
|
|
26
|
-
return (0,
|
|
26
|
+
return (0, utils_1.createSchemaPropertyDecoratorFromSchema)(uint8Array(options));
|
|
27
27
|
}
|
|
28
28
|
exports.Uint8Array = Uint8Array;
|
|
29
29
|
//# sourceMappingURL=uint8-array.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uint8-array.js","sourceRoot":"","sources":["../../../source/schema/schemas/uint8-array.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"uint8-array.js","sourceRoot":"","sources":["../../../source/schema/schemas/uint8-array.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,yDAAgD;AAChD,yEAAoE;AACpE,kEAAwE;AACxE,kEAAwE;AACxE,+CAA8E;AAE9E,oCAAmD;AAOnD,SAAgB,UAAU,CAAC,UAAmC,EAAE;IAC9D,MAAM,WAAW,GAA4B,EAAE,CAAC;IAEhD,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,WAAW,CAAC,IAAI,CAAC,IAAI,wCAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;KACtE;IAED,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,WAAW,CAAC,IAAI,CAAC,IAAI,wCAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;KACtE;IAED,OAAO,IAAA,mBAAW,EAAC,IAAA,kBAAU,EAAC,UAAU,CAAC,UAAU,CAAC,EAAE;QACpD,QAAQ,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,uCAAiB,CAAC,CAAC,CAAC,SAAS;QAClE,gBAAgB,EAAE,WAAW;KAC9B,CAAC,CAAC;AACL,CAAC;AAfD,gCAeC;AAED,SAAgB,UAAU,CAAC,OAAiC;IAC1D,OAAO,IAAA,+CAAuC,EAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;AACtE,CAAC;AAFD,gCAEC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { Decorator } from "../../reflection";
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export declare function union<
|
|
5
|
-
export declare function
|
|
2
|
+
import type { Schema } from '../schema';
|
|
3
|
+
import type { ValueSchema } from '../types';
|
|
4
|
+
export declare function union<T1, O1, T2, O2>(schema1: Schema<T1, O1>, schema2: Schema<T2, O2>): ValueSchema<T1 | T2, O1 | O2>;
|
|
5
|
+
export declare function union<T1, O1, T2, O2, T3, O3>(schema1: Schema<T1, O1>, schema2: Schema<T2, O2>, schema3: Schema<T3, O3>): ValueSchema<T1 | T2 | T3, O1 | O2 | O3>;
|
|
6
|
+
export declare function union<T1, O1, T2, O2, T3, O3, T4, O4>(schema1: Schema<T1, O1>, schema2: Schema<T2, O2>, schema3: Schema<T3, O3>, schema4: Schema<T4, O4>): ValueSchema<T1 | T2 | T3 | T4, O1 | O2 | O3 | O4>;
|
|
7
|
+
export declare function union<T1, O1, T2, O2, T3, O3, T4, O4, T5, O5>(schema1: Schema<T1, O1>, schema2: Schema<T2, O2>, schema3: Schema<T3, O3>, schema4: Schema<T4, O4>, schema5: Schema<T5, O5>): ValueSchema<T1 | T2 | T3 | T4 | T5, O1 | O2 | O3 | O4 | O5>;
|
|
8
|
+
export declare function union<T1, O1, T2, O2, T3, O3, T4, O4, T5, O5, T6, O6>(schema1: Schema<T1, O1>, schema2: Schema<T2, O2>, schema3: Schema<T3, O3>, schema4: Schema<T4, O4>, schema5: Schema<T5, O5>, schema6: Schema<T6>): ValueSchema<T1 | T2 | T3 | T4 | T5 | T6, O1 | O2 | O3 | O4 | O5 | O6>;
|
|
9
|
+
export declare function union(...schemas: Schema[]): ValueSchema;
|
|
10
|
+
export declare function Union(...schemas: Schema[]): Decorator<'property' | 'accessor'>;
|
package/schema/schemas/union.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.Union = exports.union = void 0;
|
|
5
|
+
const type_guards_1 = require("../../utils/type-guards");
|
|
4
6
|
const decorators_1 = require("../decorators");
|
|
5
7
|
const types_1 = require("../types");
|
|
6
8
|
function union(...schemas) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
9
|
+
(0, type_guards_1.assert)(schemas.length >= 2, 'Assign requires at least 2 schemas.');
|
|
10
|
+
return (0, types_1.valueSchema)(schemas);
|
|
10
11
|
}
|
|
11
12
|
exports.union = union;
|
|
12
13
|
function Union(...schemas) {
|
|
13
|
-
return (0, decorators_1.
|
|
14
|
+
return (0, decorators_1.createSchemaPropertyDecoratorFromSchema)(union(...schemas));
|
|
14
15
|
}
|
|
15
16
|
exports.Union = Union;
|
|
16
17
|
//# sourceMappingURL=union.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"union.js","sourceRoot":"","sources":["../../../source/schema/schemas/union.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"union.js","sourceRoot":"","sources":["../../../source/schema/schemas/union.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,yDAA6C;AAC7C,8CAAwE;AAGxE,oCAAuC;AAQvC,SAAgB,KAAK,CAAC,GAAG,OAAiB;IACxC,IAAA,oBAAM,EAAC,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,qCAAqC,CAAC,CAAC;IACnE,OAAO,IAAA,mBAAW,EAAC,OAAO,CAAC,CAAC;AAC9B,CAAC;AAHD,sBAGC;AAED,SAAgB,KAAK,CAAC,GAAG,OAAiB;IACxC,OAAO,IAAA,oDAAuC,EAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;AACpE,CAAC;AAFD,sBAEC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Decorator } from "../../reflection";
|
|
2
|
-
import type {
|
|
3
|
-
export declare function unknown():
|
|
2
|
+
import type { TypeSchema } from '../types';
|
|
3
|
+
export declare function unknown(): TypeSchema<unknown>;
|
|
4
4
|
export declare function Unknwon(): Decorator<'property' | 'accessor'>;
|
|
@@ -5,11 +5,11 @@ exports.Unknwon = exports.unknown = void 0;
|
|
|
5
5
|
const decorators_1 = require("../decorators");
|
|
6
6
|
const types_1 = require("../types");
|
|
7
7
|
function unknown() {
|
|
8
|
-
return (0, types_1.
|
|
8
|
+
return (0, types_1.typeSchema)('any');
|
|
9
9
|
}
|
|
10
10
|
exports.unknown = unknown;
|
|
11
11
|
function Unknwon() {
|
|
12
|
-
return (0, decorators_1.
|
|
12
|
+
return (0, decorators_1.createSchemaPropertyDecoratorFromSchema)(unknown());
|
|
13
13
|
}
|
|
14
14
|
exports.Unknwon = Unknwon;
|
|
15
15
|
//# sourceMappingURL=unknown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unknown.js","sourceRoot":"","sources":["../../../source/schema/schemas/unknown.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,
|
|
1
|
+
{"version":3,"file":"unknown.js","sourceRoot":"","sources":["../../../source/schema/schemas/unknown.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAwE;AAExE,oCAAsC;AAEtC,SAAgB,OAAO;IACrB,OAAO,IAAA,kBAAU,EAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAFD,0BAEC;AAED,SAAgB,OAAO;IACrB,OAAO,IAAA,oDAAuC,EAAC,OAAO,EAAE,CAAC,CAAC;AAC5D,CAAC;AAFD,0BAEC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Decorator } from "../../reflection";
|
|
2
|
-
import type { OneOrMany, TypedOmit } from "../../types";
|
|
2
|
+
import type { AbstractConstructor, OneOrMany, TypedOmit } from "../../types";
|
|
3
3
|
import type { TransformResult, ValueType } from '../types';
|
|
4
4
|
import { SchemaValueTransformer } from '../types';
|
|
5
|
-
export declare type GenericTransformFunction<T> = (value: T) => TypedOmit<TransformResult
|
|
6
|
-
export declare class GenericTransformer<T> extends SchemaValueTransformer {
|
|
7
|
-
readonly sourceType: OneOrMany<ValueType
|
|
8
|
-
readonly targetType: ValueType
|
|
9
|
-
readonly transformFunction: GenericTransformFunction<
|
|
10
|
-
constructor(sourceType: OneOrMany<ValueType
|
|
11
|
-
transform(value:
|
|
5
|
+
export declare type GenericTransformFunction<T, O> = (value: T) => TypedOmit<TransformResult<O>, 'success'>;
|
|
6
|
+
export declare class GenericTransformer<T, O, TransformOutput> extends SchemaValueTransformer<T, O, TransformOutput> {
|
|
7
|
+
readonly sourceType: OneOrMany<ValueType<T>>;
|
|
8
|
+
readonly targetType: ValueType<TransformOutput>;
|
|
9
|
+
readonly transformFunction: GenericTransformFunction<O, TransformOutput>;
|
|
10
|
+
constructor(sourceType: OneOrMany<ValueType<T>>, targetType: AbstractConstructor<TransformOutput>, transformFunction: GenericTransformFunction<O, TransformOutput>);
|
|
11
|
+
transform(value: O): TransformResult<TransformOutput>;
|
|
12
12
|
}
|
|
13
|
-
export declare function Transform<T>(sourceType: OneOrMany<
|
|
13
|
+
export declare function Transform<T, O, TransformOutput>(sourceType: OneOrMany<AbstractConstructor<T>>, targetType: AbstractConstructor, transformFunction: GenericTransformFunction<O, TransformOutput>): Decorator<'property' | 'accessor'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic.js","sourceRoot":"","sources":["../../../source/schema/transformers/generic.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAIzD,yDAAgD;AAChD,8CAAsE;AAEtE,oCAAkD;AAIlD,MAAa,
|
|
1
|
+
{"version":3,"file":"generic.js","sourceRoot":"","sources":["../../../source/schema/transformers/generic.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAIzD,yDAAgD;AAChD,8CAAsE;AAEtE,oCAAkD;AAIlD,MAAa,kBAA0C,SAAQ,8BAA6C;IAK1G,YAAY,UAAmC,EAAE,UAAgD,EAAE,iBAA+D;QAChK,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAED,SAAS,CAAC,KAAQ;QAChB,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAE7C,IAAI,IAAA,uBAAS,EAAC,MAAM,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;SAChD;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAM,EAAE,CAAC;IACjD,CAAC;CACF;AAtBD,gDAsBC;AAED,SAAgB,SAAS,CAAwB,UAA6C,EAAE,UAA+B,EAAE,iBAA+D;IAC9L,OAAO,IAAA,kDAAqC,EAAC,IAAI,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAClH,CAAC;AAFD,8BAEC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Decorator } from "../../reflection";
|
|
2
2
|
import type { TransformResult } from '../types';
|
|
3
3
|
import { SchemaValueTransformer } from '../types';
|
|
4
|
-
export declare class LowercaseTransformer extends SchemaValueTransformer {
|
|
4
|
+
export declare class LowercaseTransformer extends SchemaValueTransformer<string, string, string> {
|
|
5
5
|
readonly sourceType: StringConstructor;
|
|
6
6
|
readonly targetType: StringConstructor;
|
|
7
|
-
transform(value: string): TransformResult
|
|
7
|
+
transform(value: string): TransformResult<string>;
|
|
8
8
|
}
|
|
9
9
|
export declare function Lowercase(): Decorator<'property' | 'accessor'>;
|
|
@@ -16,7 +16,7 @@ class LowercaseTransformer extends types_1.SchemaValueTransformer {
|
|
|
16
16
|
}
|
|
17
17
|
exports.LowercaseTransformer = LowercaseTransformer;
|
|
18
18
|
function Lowercase() {
|
|
19
|
-
return (0, decorators_1.createSchemaValueTransformerDecorator)(new LowercaseTransformer(), {
|
|
19
|
+
return (0, decorators_1.createSchemaValueTransformerDecorator)(new LowercaseTransformer(), { schema: (0, types_1.typeSchema)(String) });
|
|
20
20
|
}
|
|
21
21
|
exports.Lowercase = Lowercase;
|
|
22
22
|
//# sourceMappingURL=lowercase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lowercase.js","sourceRoot":"","sources":["../../../source/schema/transformers/lowercase.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAsE;AAEtE,
|
|
1
|
+
{"version":3,"file":"lowercase.js","sourceRoot":"","sources":["../../../source/schema/transformers/lowercase.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAsE;AAEtE,oCAA8D;AAE9D,MAAa,oBAAqB,SAAQ,8BAA8C;IAAxF;;QACW,eAAU,GAAG,MAAM,CAAC;QACpB,eAAU,GAAG,MAAM,CAAC;IAK/B,CAAC;IAHC,SAAS,CAAC,KAAa;QACrB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;IACvD,CAAC;CACF;AAPD,oDAOC;AAED,SAAgB,SAAS;IACvB,OAAO,IAAA,kDAAqC,EAAC,IAAI,oBAAoB,EAAE,EAAE,EAAE,MAAM,EAAE,IAAA,kBAAU,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC3G,CAAC;AAFD,8BAEC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Decorator } from "../../reflection";
|
|
2
2
|
import type { TransformResult } from '../types';
|
|
3
3
|
import { SchemaValueTransformer } from '../types';
|
|
4
|
-
export declare class TrimTransformer extends SchemaValueTransformer {
|
|
4
|
+
export declare class TrimTransformer extends SchemaValueTransformer<string, string, string> {
|
|
5
5
|
readonly sourceType: StringConstructor;
|
|
6
6
|
readonly targetType: StringConstructor;
|
|
7
|
-
transform(value: string): TransformResult
|
|
7
|
+
transform(value: string): TransformResult<string>;
|
|
8
8
|
}
|
|
9
9
|
export declare function Trim(): Decorator<'property' | 'accessor'>;
|
|
@@ -16,7 +16,7 @@ class TrimTransformer extends types_1.SchemaValueTransformer {
|
|
|
16
16
|
}
|
|
17
17
|
exports.TrimTransformer = TrimTransformer;
|
|
18
18
|
function Trim() {
|
|
19
|
-
return (0, decorators_1.createSchemaValueTransformerDecorator)(new TrimTransformer(), {
|
|
19
|
+
return (0, decorators_1.createSchemaValueTransformerDecorator)(new TrimTransformer(), { schema: (0, types_1.typeSchema)(String) });
|
|
20
20
|
}
|
|
21
21
|
exports.Trim = Trim;
|
|
22
22
|
//# sourceMappingURL=trim.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trim.js","sourceRoot":"","sources":["../../../source/schema/transformers/trim.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAsE;AAEtE,
|
|
1
|
+
{"version":3,"file":"trim.js","sourceRoot":"","sources":["../../../source/schema/transformers/trim.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAsE;AAEtE,oCAA8D;AAE9D,MAAa,eAAgB,SAAQ,8BAA8C;IAAnF;;QACW,eAAU,GAAG,MAAM,CAAC;QACpB,eAAU,GAAG,MAAM,CAAC;IAK/B,CAAC;IAHC,SAAS,CAAC,KAAa;QACrB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;IAChD,CAAC;CACF;AAPD,0CAOC;AAED,SAAgB,IAAI;IAClB,OAAO,IAAA,kDAAqC,EAAC,IAAI,eAAe,EAAE,EAAE,EAAE,MAAM,EAAE,IAAA,kBAAU,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACtG,CAAC;AAFD,oBAEC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Decorator } from "../../reflection";
|
|
2
2
|
import type { TransformResult } from '../types';
|
|
3
3
|
import { SchemaValueTransformer } from '../types';
|
|
4
|
-
export declare class UppercaseTransformer extends SchemaValueTransformer {
|
|
4
|
+
export declare class UppercaseTransformer extends SchemaValueTransformer<string, string, string> {
|
|
5
5
|
readonly sourceType: StringConstructor;
|
|
6
6
|
readonly targetType: StringConstructor;
|
|
7
|
-
transform(value: string): TransformResult
|
|
7
|
+
transform(value: string): TransformResult<string>;
|
|
8
8
|
}
|
|
9
9
|
export declare function Uppercase(): Decorator<'property' | 'accessor'>;
|
|
@@ -16,7 +16,7 @@ class UppercaseTransformer extends types_1.SchemaValueTransformer {
|
|
|
16
16
|
}
|
|
17
17
|
exports.UppercaseTransformer = UppercaseTransformer;
|
|
18
18
|
function Uppercase() {
|
|
19
|
-
return (0, decorators_1.createSchemaValueTransformerDecorator)(new UppercaseTransformer(), {
|
|
19
|
+
return (0, decorators_1.createSchemaValueTransformerDecorator)(new UppercaseTransformer(), { schema: (0, types_1.typeSchema)(String) });
|
|
20
20
|
}
|
|
21
21
|
exports.Uppercase = Uppercase;
|
|
22
22
|
//# sourceMappingURL=uppercase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uppercase.js","sourceRoot":"","sources":["../../../source/schema/transformers/uppercase.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAsE;AAEtE,
|
|
1
|
+
{"version":3,"file":"uppercase.js","sourceRoot":"","sources":["../../../source/schema/transformers/uppercase.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,8CAAsE;AAEtE,oCAA8D;AAE9D,MAAa,oBAAqB,SAAQ,8BAA8C;IAAxF;;QACW,eAAU,GAAG,MAAM,CAAC;QACpB,eAAU,GAAG,MAAM,CAAC;IAK/B,CAAC;IAHC,SAAS,CAAC,KAAa;QACrB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;IACvD,CAAC;CACF;AAPD,oDAOC;AAED,SAAgB,SAAS;IACvB,OAAO,IAAA,kDAAqC,EAAC,IAAI,oBAAoB,EAAE,EAAE,EAAE,MAAM,EAAE,IAAA,kBAAU,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC3G,CAAC;AAFD,8BAEC"}
|