@nmtjs/type 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler.js +2 -2
- package/dist/compiler.js.map +1 -1
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/temporal.js +3 -1
- package/dist/temporal.js.map +1 -1
- package/dist/types/any.js +37 -5
- package/dist/types/any.js.map +1 -1
- package/dist/types/array.js +55 -24
- package/dist/types/array.js.map +1 -1
- package/dist/types/base.js +31 -62
- package/dist/types/base.js.map +1 -1
- package/dist/types/boolean.js +37 -5
- package/dist/types/boolean.js.map +1 -1
- package/dist/types/custom.js +37 -8
- package/dist/types/custom.js.map +1 -1
- package/dist/types/datetime.js +41 -22
- package/dist/types/datetime.js.map +1 -1
- package/dist/types/enum.js +74 -16
- package/dist/types/enum.js.map +1 -1
- package/dist/types/literal.js +35 -8
- package/dist/types/literal.js.map +1 -1
- package/dist/types/never.js +17 -2
- package/dist/types/never.js.map +1 -1
- package/dist/types/number.js +116 -62
- package/dist/types/number.js.map +1 -1
- package/dist/types/object.js +58 -17
- package/dist/types/object.js.map +1 -1
- package/dist/types/string.js +57 -21
- package/dist/types/string.js.map +1 -1
- package/dist/types/temporal.js +292 -74
- package/dist/types/temporal.js.map +1 -1
- package/dist/types/union.js +75 -17
- package/dist/types/union.js.map +1 -1
- package/package.json +3 -3
- package/src/compiler.ts +2 -2
- package/src/constants.ts +5 -0
- package/src/index.ts +5 -6
- package/src/temporal.ts +4 -2
- package/src/types/any.ts +32 -9
- package/src/types/array.ts +59 -28
- package/src/types/base.ts +59 -112
- package/src/types/boolean.ts +31 -9
- package/src/types/custom.ts +61 -24
- package/src/types/datetime.ts +40 -35
- package/src/types/enum.ts +78 -21
- package/src/types/literal.ts +42 -12
- package/src/types/never.ts +24 -11
- package/src/types/number.ts +103 -67
- package/src/types/object.ts +87 -32
- package/src/types/string.ts +38 -30
- package/src/types/temporal.ts +378 -118
- package/src/types/union.ts +103 -31
package/dist/types/datetime.js
CHANGED
|
@@ -1,34 +1,53 @@
|
|
|
1
1
|
import { Type } from '@sinclair/typebox';
|
|
2
2
|
import { BaseType } from "./base.js";
|
|
3
|
+
const decode = (value)=>new Date(value);
|
|
4
|
+
const encode = (value)=>value.toISOString();
|
|
3
5
|
export class DateType extends BaseType {
|
|
4
|
-
constructor(
|
|
5
|
-
|
|
6
|
-
})).Decode((value)=>new Date(value)).Encode((value)=>value.toJSON()), nullable = false, optional = false){
|
|
7
|
-
super(schema, nullable, optional);
|
|
6
|
+
constructor(options = {}, isNullable = false, isOptional = false, hasDefault = false){
|
|
7
|
+
super(options, isNullable, isOptional, hasDefault);
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
nullish() {
|
|
16
|
-
return new DateType(...this._nullish());
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export class DateTimeType extends BaseType {
|
|
20
|
-
constructor(schema = Type.Transform(Type.String({
|
|
21
|
-
format: 'date-time'
|
|
22
|
-
})).Decode((value)=>new Date(value)).Encode((value)=>value.toJSON()), nullable = false, optional = false){
|
|
23
|
-
super(schema, nullable, optional);
|
|
9
|
+
_constructSchema(options) {
|
|
10
|
+
return Type.Transform(Type.String({
|
|
11
|
+
...options,
|
|
12
|
+
format: 'date-time'
|
|
13
|
+
})).Decode(decode).Encode(encode);
|
|
24
14
|
}
|
|
25
15
|
nullable() {
|
|
26
|
-
return new
|
|
16
|
+
return new DateType(...this._with({
|
|
17
|
+
isNullable: true
|
|
18
|
+
}));
|
|
27
19
|
}
|
|
28
20
|
optional() {
|
|
29
|
-
return new
|
|
21
|
+
return new DateType(...this._with({
|
|
22
|
+
isOptional: true
|
|
23
|
+
}));
|
|
30
24
|
}
|
|
31
25
|
nullish() {
|
|
32
|
-
return new
|
|
26
|
+
return new DateType(...this._with({
|
|
27
|
+
isNullable: true,
|
|
28
|
+
isOptional: true
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
default(value) {
|
|
32
|
+
return new DateType(...this._with({
|
|
33
|
+
options: {
|
|
34
|
+
default: encode(value)
|
|
35
|
+
},
|
|
36
|
+
hasDefault: true
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
description(value) {
|
|
40
|
+
return new DateType(...this._with({
|
|
41
|
+
options: {
|
|
42
|
+
description: value
|
|
43
|
+
}
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
examples(...values) {
|
|
47
|
+
return new DateType(...this._with({
|
|
48
|
+
options: {
|
|
49
|
+
examples: values.map(encode)
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
33
52
|
}
|
|
34
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/types/datetime.ts"],"sourcesContent":["import { type TString
|
|
1
|
+
{"version":3,"sources":["../../../src/types/datetime.ts"],"sourcesContent":["import {\n type SchemaOptions,\n type StringOptions,\n type TString,\n type TTransform,\n Type,\n} from '@sinclair/typebox'\nimport { BaseType } from './base.ts'\n\nconst decode = (value: any): Date => new Date(value)\nconst encode = (value: Date): any => value.toISOString()\n\nexport class DateType<\n N extends boolean = false,\n O extends boolean = false,\n D extends boolean = false,\n> extends BaseType<TTransform<TString, Date>, N, O, D, StringOptions> {\n constructor(\n options: SchemaOptions = {},\n isNullable: N = false as N,\n isOptional: O = false as O,\n hasDefault: D = false as D,\n ) {\n super(options, isNullable, isOptional, hasDefault)\n }\n\n protected _constructSchema(\n options: StringOptions,\n ): TTransform<TString, Date> {\n return Type.Transform(Type.String({ ...options, format: 'date-time' }))\n .Decode(decode)\n .Encode(encode)\n }\n\n nullable() {\n return new DateType(...this._with({ isNullable: true }))\n }\n\n optional() {\n return new DateType(...this._with({ isOptional: true }))\n }\n\n nullish() {\n return new DateType(...this._with({ isNullable: true, isOptional: true }))\n }\n\n default(value: Date) {\n return new DateType(\n ...this._with({\n options: { default: encode(value) },\n hasDefault: true,\n }),\n )\n }\n\n description(value: string) {\n return new DateType(...this._with({ options: { description: value } }))\n }\n\n examples(...values: [Date, ...Date[]]) {\n return new DateType(\n ...this._with({ options: { examples: values.map(encode) } }),\n )\n }\n}\n"],"names":["Type","BaseType","decode","value","Date","encode","toISOString","DateType","constructor","options","isNullable","isOptional","hasDefault","_constructSchema","Transform","String","format","Decode","Encode","nullable","_with","optional","nullish","default","description","examples","values","map"],"mappings":"AAAA,SAKEA,IAAI,QACC,oBAAmB;AAC1B,SAASC,QAAQ,QAAQ,YAAW;AAEpC,MAAMC,SAAS,CAACC,QAAqB,IAAIC,KAAKD;AAC9C,MAAME,SAAS,CAACF,QAAqBA,MAAMG,WAAW;AAEtD,OAAO,MAAMC,iBAIHN;IACRO,YACEC,UAAyB,CAAC,CAAC,EAC3BC,aAAgB,KAAU,EAC1BC,aAAgB,KAAU,EAC1BC,aAAgB,KAAU,CAC1B;QACA,KAAK,CAACH,SAASC,YAAYC,YAAYC;IACzC;IAEUC,iBACRJ,OAAsB,EACK;QAC3B,OAAOT,KAAKc,SAAS,CAACd,KAAKe,MAAM,CAAC;YAAE,GAAGN,OAAO;YAAEO,QAAQ;QAAY,IACjEC,MAAM,CAACf,QACPgB,MAAM,CAACb;IACZ;IAEAc,WAAW;QACT,OAAO,IAAIZ,YAAY,IAAI,CAACa,KAAK,CAAC;YAAEV,YAAY;QAAK;IACvD;IAEAW,WAAW;QACT,OAAO,IAAId,YAAY,IAAI,CAACa,KAAK,CAAC;YAAET,YAAY;QAAK;IACvD;IAEAW,UAAU;QACR,OAAO,IAAIf,YAAY,IAAI,CAACa,KAAK,CAAC;YAAEV,YAAY;YAAMC,YAAY;QAAK;IACzE;IAEAY,QAAQpB,KAAW,EAAE;QACnB,OAAO,IAAII,YACN,IAAI,CAACa,KAAK,CAAC;YACZX,SAAS;gBAAEc,SAASlB,OAAOF;YAAO;YAClCS,YAAY;QACd;IAEJ;IAEAY,YAAYrB,KAAa,EAAE;QACzB,OAAO,IAAII,YAAY,IAAI,CAACa,KAAK,CAAC;YAAEX,SAAS;gBAAEe,aAAarB;YAAM;QAAE;IACtE;IAEAsB,SAAS,GAAGC,MAAyB,EAAE;QACrC,OAAO,IAAInB,YACN,IAAI,CAACa,KAAK,CAAC;YAAEX,SAAS;gBAAEgB,UAAUC,OAAOC,GAAG,CAACtB;YAAQ;QAAE;IAE9D;AACF"}
|
package/dist/types/enum.js
CHANGED
|
@@ -3,39 +3,97 @@ import { UnionEnum } from "../schemas/union-enum.js";
|
|
|
3
3
|
import { BaseType } from "./base.js";
|
|
4
4
|
export class NativeEnumType extends BaseType {
|
|
5
5
|
values;
|
|
6
|
-
constructor(values,
|
|
7
|
-
super(
|
|
6
|
+
constructor(values, options = {}, isNullable = false, isOptional = false, hasDefault = false){
|
|
7
|
+
super(options, isNullable, isOptional, hasDefault);
|
|
8
8
|
this.values = values;
|
|
9
9
|
}
|
|
10
|
+
_constructSchema(options) {
|
|
11
|
+
return NativeEnum(this.values, options);
|
|
12
|
+
}
|
|
10
13
|
nullable() {
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
return new NativeEnumType(this.values, ...this._with({
|
|
15
|
+
isNullable: true
|
|
16
|
+
}));
|
|
13
17
|
}
|
|
14
18
|
optional() {
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
return new NativeEnumType(this.values, ...this._with({
|
|
20
|
+
isOptional: true
|
|
21
|
+
}));
|
|
17
22
|
}
|
|
18
23
|
nullish() {
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
return new NativeEnumType(this.values, ...this._with({
|
|
25
|
+
isNullable: true,
|
|
26
|
+
isOptional: true
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
default(value) {
|
|
30
|
+
return new NativeEnumType(this.values, ...this._with({
|
|
31
|
+
options: {
|
|
32
|
+
default: value
|
|
33
|
+
},
|
|
34
|
+
hasDefault: true
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
description(description) {
|
|
38
|
+
return new NativeEnumType(this.values, ...this._with({
|
|
39
|
+
options: {
|
|
40
|
+
description
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
examples(...examples) {
|
|
45
|
+
return new NativeEnumType(this.values, ...this._with({
|
|
46
|
+
options: {
|
|
47
|
+
examples
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
21
50
|
}
|
|
22
51
|
}
|
|
23
52
|
export class EnumType extends BaseType {
|
|
24
53
|
values;
|
|
25
|
-
constructor(values,
|
|
26
|
-
super(
|
|
54
|
+
constructor(values, options = {}, isNullable = false, isOptional = false, hasDefault = false){
|
|
55
|
+
super(options, isNullable, isOptional, hasDefault, values);
|
|
27
56
|
this.values = values;
|
|
28
57
|
}
|
|
58
|
+
_constructSchema(options, values) {
|
|
59
|
+
return UnionEnum(values, options);
|
|
60
|
+
}
|
|
29
61
|
nullable() {
|
|
30
|
-
|
|
31
|
-
|
|
62
|
+
return new EnumType(this.values, ...this._with({
|
|
63
|
+
isNullable: true
|
|
64
|
+
}));
|
|
32
65
|
}
|
|
33
66
|
optional() {
|
|
34
|
-
|
|
35
|
-
|
|
67
|
+
return new EnumType(this.values, ...this._with({
|
|
68
|
+
isOptional: true
|
|
69
|
+
}));
|
|
36
70
|
}
|
|
37
71
|
nullish() {
|
|
38
|
-
|
|
39
|
-
|
|
72
|
+
return new EnumType(this.values, ...this._with({
|
|
73
|
+
isNullable: true,
|
|
74
|
+
isOptional: true
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
default(value) {
|
|
78
|
+
return new EnumType(this.values, ...this._with({
|
|
79
|
+
options: {
|
|
80
|
+
default: value
|
|
81
|
+
},
|
|
82
|
+
hasDefault: true
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
description(description) {
|
|
86
|
+
return new EnumType(this.values, ...this._with({
|
|
87
|
+
options: {
|
|
88
|
+
description
|
|
89
|
+
}
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
examples(...examples) {
|
|
93
|
+
return new EnumType(this.values, ...this._with({
|
|
94
|
+
options: {
|
|
95
|
+
examples
|
|
96
|
+
}
|
|
97
|
+
}));
|
|
40
98
|
}
|
|
41
99
|
}
|
package/dist/types/enum.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/types/enum.ts"],"sourcesContent":["import type { TNativeEnum } from '../schemas/native-enum.ts'\nimport { NativeEnum } from '../schemas/native-enum.ts'\nimport { type TUnionEnum, UnionEnum } from '../schemas/union-enum.ts'\nimport { BaseType } from './base.ts'\n\nexport class NativeEnumType<\n T extends { [K in string]: K } = { [K in string]: K },\n N extends boolean = false,\n O extends boolean = false,\n> extends BaseType<TNativeEnum<T>, N, O> {\n constructor(\n readonly values: T,\n
|
|
1
|
+
{"version":3,"sources":["../../../src/types/enum.ts"],"sourcesContent":["import type { SchemaOptions } from '@sinclair/typebox'\nimport type { TNativeEnum } from '../schemas/native-enum.ts'\nimport { NativeEnum } from '../schemas/native-enum.ts'\nimport { type TUnionEnum, UnionEnum } from '../schemas/union-enum.ts'\nimport { BaseType } from './base.ts'\n\nexport class NativeEnumType<\n T extends { [K in string]: K } = { [K in string]: K },\n N extends boolean = false,\n O extends boolean = false,\n D extends boolean = false,\n> extends BaseType<TNativeEnum<T>, N, O, D> {\n constructor(\n readonly values: T,\n options: SchemaOptions = {},\n isNullable: N = false as N,\n isOptional: O = false as O,\n hasDefault: D = false as D,\n ) {\n super(options, isNullable, isOptional, hasDefault)\n }\n\n protected _constructSchema(options: SchemaOptions): TNativeEnum<T> {\n return NativeEnum(this.values, options)\n }\n\n nullable() {\n return new NativeEnumType(this.values, ...this._with({ isNullable: true }))\n }\n\n optional() {\n return new NativeEnumType(this.values, ...this._with({ isOptional: true }))\n }\n\n nullish() {\n return new NativeEnumType(\n this.values,\n ...this._with({ isNullable: true, isOptional: true }),\n )\n }\n\n default(value: keyof T) {\n return new NativeEnumType(\n this.values,\n ...this._with({ options: { default: value }, hasDefault: true }),\n )\n }\n\n description(description: string) {\n return new NativeEnumType(\n this.values,\n ...this._with({ options: { description } }),\n )\n }\n\n examples(...examples: (keyof T)[]) {\n return new NativeEnumType(\n this.values,\n ...this._with({ options: { examples } }),\n )\n }\n}\n\nexport class EnumType<\n T extends (string | number)[],\n N extends boolean = false,\n O extends boolean = false,\n D extends boolean = false,\n> extends BaseType<TUnionEnum<T>, N, O, D> {\n constructor(\n protected readonly values: [...T],\n options: SchemaOptions = {},\n isNullable: N = false as N,\n isOptional: O = false as O,\n hasDefault: D = false as D,\n ) {\n super(options, isNullable, isOptional, hasDefault, values)\n }\n\n protected _constructSchema(\n options: SchemaOptions,\n values: [...T],\n ): TUnionEnum<T> {\n return UnionEnum(values, options)\n }\n\n nullable() {\n return new EnumType(this.values, ...this._with({ isNullable: true }))\n }\n\n optional() {\n return new EnumType(this.values, ...this._with({ isOptional: true }))\n }\n\n nullish() {\n return new EnumType(\n this.values,\n ...this._with({ isNullable: true, isOptional: true }),\n )\n }\n\n default(value: T[number]) {\n return new EnumType(\n this.values,\n ...this._with({ options: { default: value }, hasDefault: true }),\n )\n }\n\n description(description: string) {\n return new EnumType(\n this.values,\n ...this._with({ options: { description } }),\n )\n }\n\n examples(...examples: [T[number], ...T[number][]]) {\n return new EnumType(this.values, ...this._with({ options: { examples } }))\n }\n}\n"],"names":["NativeEnum","UnionEnum","BaseType","NativeEnumType","constructor","values","options","isNullable","isOptional","hasDefault","_constructSchema","nullable","_with","optional","nullish","default","value","description","examples","EnumType"],"mappings":"AAEA,SAASA,UAAU,QAAQ,4BAA2B;AACtD,SAA0BC,SAAS,QAAQ,2BAA0B;AACrE,SAASC,QAAQ,QAAQ,YAAW;AAEpC,OAAO,MAAMC,uBAKHD;;IACRE,YACE,AAASC,MAAS,EAClBC,UAAyB,CAAC,CAAC,EAC3BC,aAAgB,KAAU,EAC1BC,aAAgB,KAAU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,OAAOJ,UAAUI,QAAQC;IAC3B;IAEAK,WAAW;QACT,OAAO,IAAIQ,SAAS,IAAI,CAACd,MAAM,KAAK,IAAI,CAACO,KAAK,CAAC;YAAEL,YAAY;QAAK;IACpE;IAEAM,WAAW;QACT,OAAO,IAAIM,SAAS,IAAI,CAACd,MAAM,KAAK,IAAI,CAACO,KAAK,CAAC;YAAEJ,YAAY;QAAK;IACpE;IAEAM,UAAU;QACR,OAAO,IAAIK,SACT,IAAI,CAACd,MAAM,KACR,IAAI,CAACO,KAAK,CAAC;YAAEL,YAAY;YAAMC,YAAY;QAAK;IAEvD;IAEAO,QAAQC,KAAgB,EAAE;QACxB,OAAO,IAAIG,SACT,IAAI,CAACd,MAAM,KACR,IAAI,CAACO,KAAK,CAAC;YAAEN,SAAS;gBAAES,SAASC;YAAM;YAAGP,YAAY;QAAK;IAElE;IAEAQ,YAAYA,WAAmB,EAAE;QAC/B,OAAO,IAAIE,SACT,IAAI,CAACd,MAAM,KACR,IAAI,CAACO,KAAK,CAAC;YAAEN,SAAS;gBAAEW;YAAY;QAAE;IAE7C;IAEAC,SAAS,GAAGA,QAAqC,EAAE;QACjD,OAAO,IAAIC,SAAS,IAAI,CAACd,MAAM,KAAK,IAAI,CAACO,KAAK,CAAC;YAAEN,SAAS;gBAAEY;YAAS;QAAE;IACzE;AACF"}
|
package/dist/types/literal.js
CHANGED
|
@@ -2,20 +2,47 @@ import { Type } from '@sinclair/typebox';
|
|
|
2
2
|
import { BaseType } from "./base.js";
|
|
3
3
|
export class LiteralType extends BaseType {
|
|
4
4
|
value;
|
|
5
|
-
constructor(value,
|
|
6
|
-
super(
|
|
5
|
+
constructor(value, options = {}, isNullable = false, isOptional = false, hasDefault = false){
|
|
6
|
+
super(options, isNullable, isOptional, hasDefault, value);
|
|
7
7
|
this.value = value;
|
|
8
8
|
}
|
|
9
|
+
_constructSchema(options, value) {
|
|
10
|
+
return Type.Literal(value, options);
|
|
11
|
+
}
|
|
9
12
|
nullable() {
|
|
10
|
-
|
|
11
|
-
return new LiteralType(this.value, ...args);
|
|
13
|
+
return new LiteralType(this.value, this.options, true, this.isOptional);
|
|
12
14
|
}
|
|
13
15
|
optional() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
return new LiteralType(this.value, ...this._with({
|
|
17
|
+
isOptional: true
|
|
18
|
+
}));
|
|
16
19
|
}
|
|
17
20
|
nullish() {
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
return new LiteralType(this.value, ...this._with({
|
|
22
|
+
isNullable: true,
|
|
23
|
+
isOptional: true
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
default(value = this.value) {
|
|
27
|
+
return new LiteralType(this.value, ...this._with({
|
|
28
|
+
options: {
|
|
29
|
+
default: value
|
|
30
|
+
},
|
|
31
|
+
hasDefault: true
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
description(description) {
|
|
35
|
+
return new LiteralType(this.value, ...this._with({
|
|
36
|
+
options: {
|
|
37
|
+
description
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
examples(...examples) {
|
|
42
|
+
return new LiteralType(this.value, ...this._with({
|
|
43
|
+
options: {
|
|
44
|
+
examples
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
20
47
|
}
|
|
21
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/types/literal.ts"],"sourcesContent":["import { type TLiteral
|
|
1
|
+
{"version":3,"sources":["../../../src/types/literal.ts"],"sourcesContent":["import {\n type SchemaOptions,\n type TLiteral,\n type TLiteralValue,\n Type,\n} from '@sinclair/typebox'\nimport { BaseType } from './base.ts'\n\nexport class LiteralType<\n T extends TLiteralValue = TLiteralValue,\n N extends boolean = false,\n O extends boolean = false,\n D extends boolean = false,\n> extends BaseType<TLiteral<T>, N, O, D> {\n constructor(\n protected readonly value: T,\n options: SchemaOptions = {},\n isNullable: N = false as N,\n isOptional: O = false as O,\n hasDefault: D = false as D,\n ) {\n super(options, isNullable, isOptional, hasDefault, value)\n }\n\n protected _constructSchema(options: SchemaOptions, value: T): TLiteral<T> {\n return Type.Literal(value, options)\n }\n\n nullable() {\n return new LiteralType(this.value, this.options, true, this.isOptional)\n }\n\n optional() {\n return new LiteralType(this.value, ...this._with({ isOptional: true }))\n }\n\n nullish() {\n return new LiteralType(\n this.value,\n ...this._with({ isNullable: true, isOptional: true }),\n )\n }\n\n default(value: T = this.value) {\n return new LiteralType(\n this.value,\n ...this._with({ options: { default: value }, hasDefault: true }),\n )\n }\n\n description(description: string) {\n return new LiteralType(\n this.value,\n ...this._with({ options: { description } }),\n )\n }\n\n examples(...examples: [T, ...T[]]) {\n return new LiteralType(this.value, ...this._with({ options: { examples } }))\n }\n}\n"],"names":["Type","BaseType","LiteralType","constructor","value","options","isNullable","isOptional","hasDefault","_constructSchema","Literal","nullable","optional","_with","nullish","default","description","examples"],"mappings":"AAAA,SAIEA,IAAI,QACC,oBAAmB;AAC1B,SAASC,QAAQ,QAAQ,YAAW;AAEpC,OAAO,MAAMC,oBAKHD;;IACRE,YACE,AAAmBC,KAAQ,EAC3BC,UAAyB,CAAC,CAAC,EAC3BC,aAAgB,KAAU,EAC1BC,aAAgB,KAAU,EAC1BC,aAAgB,KAAU,CAC1B;QACA,KAAK,CAACH,SAASC,YAAYC,YAAYC,YAAYJ;aANhCA,QAAAA;IAOrB;IAEUK,iBAAiBJ,OAAsB,EAAED,KAAQ,EAAe;QACxE,OAAOJ,KAAKU,OAAO,CAACN,OAAOC;IAC7B;IAEAM,WAAW;QACT,OAAO,IAAIT,YAAY,IAAI,CAACE,KAAK,EAAE,IAAI,CAACC,OAAO,EAAE,MAAM,IAAI,CAACE,UAAU;IACxE;IAEAK,WAAW;QACT,OAAO,IAAIV,YAAY,IAAI,CAACE,KAAK,KAAK,IAAI,CAACS,KAAK,CAAC;YAAEN,YAAY;QAAK;IACtE;IAEAO,UAAU;QACR,OAAO,IAAIZ,YACT,IAAI,CAACE,KAAK,KACP,IAAI,CAACS,KAAK,CAAC;YAAEP,YAAY;YAAMC,YAAY;QAAK;IAEvD;IAEAQ,QAAQX,QAAW,IAAI,CAACA,KAAK,EAAE;QAC7B,OAAO,IAAIF,YACT,IAAI,CAACE,KAAK,KACP,IAAI,CAACS,KAAK,CAAC;YAAER,SAAS;gBAAEU,SAASX;YAAM;YAAGI,YAAY;QAAK;IAElE;IAEAQ,YAAYA,WAAmB,EAAE;QAC/B,OAAO,IAAId,YACT,IAAI,CAACE,KAAK,KACP,IAAI,CAACS,KAAK,CAAC;YAAER,SAAS;gBAAEW;YAAY;QAAE;IAE7C;IAEAC,SAAS,GAAGA,QAAqB,EAAE;QACjC,OAAO,IAAIf,YAAY,IAAI,CAACE,KAAK,KAAK,IAAI,CAACS,KAAK,CAAC;YAAER,SAAS;gBAAEY;YAAS;QAAE;IAC3E;AACF"}
|
package/dist/types/never.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Type } from '@sinclair/typebox';
|
|
2
2
|
import { BaseType } from "./base.js";
|
|
3
3
|
export class NeverType extends BaseType {
|
|
4
|
-
constructor(
|
|
5
|
-
super(
|
|
4
|
+
constructor(options = {}){
|
|
5
|
+
super(options, false, false, false);
|
|
6
|
+
}
|
|
7
|
+
_constructSchema(options) {
|
|
8
|
+
return Type.Never(options);
|
|
6
9
|
}
|
|
7
10
|
nullable() {
|
|
8
11
|
throw new Error('NeverType cannot be nullable');
|
|
@@ -13,4 +16,16 @@ export class NeverType extends BaseType {
|
|
|
13
16
|
nullish() {
|
|
14
17
|
throw new Error('NeverType cannot be nullish');
|
|
15
18
|
}
|
|
19
|
+
default() {
|
|
20
|
+
throw new Error('NeverType cannot have a default value');
|
|
21
|
+
}
|
|
22
|
+
description(description) {
|
|
23
|
+
return new NeverType({
|
|
24
|
+
...this.options,
|
|
25
|
+
description
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
examples() {
|
|
29
|
+
throw new Error('NeverType cannot have examples');
|
|
30
|
+
}
|
|
16
31
|
}
|
package/dist/types/never.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/types/never.ts"],"sourcesContent":["import { type TNever, Type } from '@sinclair/typebox'\nimport { BaseType } from './base.ts'\n\nexport class NeverType<\n N extends boolean = false,\n O extends boolean = false,\n> extends BaseType<TNever, N, O> {\n constructor(
|
|
1
|
+
{"version":3,"sources":["../../../src/types/never.ts"],"sourcesContent":["import { type SchemaOptions, type TNever, Type } from '@sinclair/typebox'\nimport { BaseType } from './base.ts'\n\nexport class NeverType<\n N extends boolean = false,\n O extends boolean = false,\n D extends boolean = false,\n> extends BaseType<TNever, N, O, D> {\n constructor(options: SchemaOptions = {}) {\n super(options, false as N, false as O, false as D)\n }\n\n protected _constructSchema(options: SchemaOptions): TNever {\n return Type.Never(options)\n }\n\n nullable(): NeverType<true, O, D> {\n throw new Error('NeverType cannot be nullable')\n }\n\n optional(): NeverType<N, true, D> {\n throw new Error('NeverType cannot be optional')\n }\n\n nullish(): NeverType<true, true, D> {\n throw new Error('NeverType cannot be nullish')\n }\n\n default(): NeverType<N, O, true> {\n throw new Error('NeverType cannot have a default value')\n }\n\n description(description: string): NeverType<N, O, D> {\n return new NeverType({ ...this.options, description })\n }\n\n examples(): NeverType<N, O, D> {\n throw new Error('NeverType cannot have examples')\n }\n}\n"],"names":["Type","BaseType","NeverType","constructor","options","_constructSchema","Never","nullable","Error","optional","nullish","default","description","examples"],"mappings":"AAAA,SAA0CA,IAAI,QAAQ,oBAAmB;AACzE,SAASC,QAAQ,QAAQ,YAAW;AAEpC,OAAO,MAAMC,kBAIHD;IACRE,YAAYC,UAAyB,CAAC,CAAC,CAAE;QACvC,KAAK,CAACA,SAAS,OAAY,OAAY;IACzC;IAEUC,iBAAiBD,OAAsB,EAAU;QACzD,OAAOJ,KAAKM,KAAK,CAACF;IACpB;IAEAG,WAAkC;QAChC,MAAM,IAAIC,MAAM;IAClB;IAEAC,WAAkC;QAChC,MAAM,IAAID,MAAM;IAClB;IAEAE,UAAoC;QAClC,MAAM,IAAIF,MAAM;IAClB;IAEAG,UAAiC;QAC/B,MAAM,IAAIH,MAAM;IAClB;IAEAI,YAAYA,WAAmB,EAAsB;QACnD,OAAO,IAAIV,UAAU;YAAE,GAAG,IAAI,CAACE,OAAO;YAAEQ;QAAY;IACtD;IAEAC,WAA+B;QAC7B,MAAM,IAAIL,MAAM;IAClB;AACF"}
|
package/dist/types/number.js
CHANGED
|
@@ -1,94 +1,148 @@
|
|
|
1
1
|
import { Type } from '@sinclair/typebox';
|
|
2
2
|
import { BaseType } from "./base.js";
|
|
3
3
|
export class NumberType extends BaseType {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
options;
|
|
5
|
+
constructor(options = {}, isNullable = false, isOptional = false, hasDefault = false){
|
|
6
|
+
super(options, isNullable, isOptional, hasDefault);
|
|
7
|
+
this.options = options;
|
|
8
|
+
}
|
|
9
|
+
_constructSchema(options) {
|
|
10
|
+
return Type.Number(options);
|
|
11
|
+
}
|
|
12
|
+
nullable() {
|
|
13
|
+
return new NumberType(...this._with({
|
|
14
|
+
isNullable: true
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
optional() {
|
|
18
|
+
return new NumberType(...this._with({
|
|
19
|
+
isOptional: true
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
nullish() {
|
|
23
|
+
return new NumberType(...this._with({
|
|
24
|
+
isNullable: true,
|
|
25
|
+
isOptional: true
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
default(value) {
|
|
29
|
+
return new NumberType(...this._with({
|
|
30
|
+
options: {
|
|
31
|
+
default: value
|
|
32
|
+
},
|
|
33
|
+
hasDefault: true
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
description(description) {
|
|
37
|
+
return new NumberType(...this._with({
|
|
38
|
+
options: {
|
|
39
|
+
description
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
examples(...examples) {
|
|
44
|
+
return new NumberType(...this._with({
|
|
45
|
+
options: {
|
|
46
|
+
examples
|
|
47
|
+
}
|
|
48
|
+
}));
|
|
6
49
|
}
|
|
7
50
|
positive() {
|
|
8
|
-
return
|
|
9
|
-
...this._schema,
|
|
10
|
-
minimum: 0,
|
|
11
|
-
exclusiveMinimum: 0
|
|
12
|
-
}), ...this._isNullableOptional);
|
|
51
|
+
return this.min(0, true);
|
|
13
52
|
}
|
|
14
53
|
negative() {
|
|
15
|
-
return
|
|
16
|
-
...this._schema,
|
|
17
|
-
maximum: 0,
|
|
18
|
-
exclusiveMaximum: 0
|
|
19
|
-
}), ...this._isNullableOptional);
|
|
54
|
+
return this.max(0, true);
|
|
20
55
|
}
|
|
21
56
|
max(value, exclusive) {
|
|
22
|
-
return new NumberType(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
57
|
+
return new NumberType(...this._with({
|
|
58
|
+
options: {
|
|
59
|
+
maximum: value,
|
|
60
|
+
...exclusive ? {} : {
|
|
61
|
+
exclusiveMaximum: value
|
|
62
|
+
}
|
|
27
63
|
}
|
|
28
|
-
})
|
|
64
|
+
}));
|
|
29
65
|
}
|
|
30
66
|
min(value, exclusive) {
|
|
31
|
-
return new NumberType(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
67
|
+
return new NumberType(...this._with({
|
|
68
|
+
options: {
|
|
69
|
+
minimum: value,
|
|
70
|
+
...exclusive ? {} : {
|
|
71
|
+
exclusiveMinimum: value
|
|
72
|
+
}
|
|
36
73
|
}
|
|
37
|
-
})
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export class IntegerType extends BaseType {
|
|
78
|
+
constructor(options = {}, isNullable = false, isOptional = false, hasDefault = false){
|
|
79
|
+
super(options, isNullable, isOptional, hasDefault);
|
|
80
|
+
}
|
|
81
|
+
_constructSchema(options) {
|
|
82
|
+
return Type.Integer(options);
|
|
38
83
|
}
|
|
39
84
|
nullable() {
|
|
40
|
-
return new
|
|
85
|
+
return new IntegerType(...this._with({
|
|
86
|
+
isNullable: true
|
|
87
|
+
}));
|
|
41
88
|
}
|
|
42
89
|
optional() {
|
|
43
|
-
return new
|
|
90
|
+
return new IntegerType(...this._with({
|
|
91
|
+
isOptional: true
|
|
92
|
+
}));
|
|
44
93
|
}
|
|
45
94
|
nullish() {
|
|
46
|
-
return new
|
|
95
|
+
return new IntegerType(...this._with({
|
|
96
|
+
isNullable: true,
|
|
97
|
+
isOptional: true
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
default(value) {
|
|
101
|
+
return new IntegerType(...this._with({
|
|
102
|
+
options: {
|
|
103
|
+
default: value
|
|
104
|
+
},
|
|
105
|
+
hasDefault: true
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
description(description) {
|
|
109
|
+
return new IntegerType(...this._with({
|
|
110
|
+
options: {
|
|
111
|
+
description
|
|
112
|
+
}
|
|
113
|
+
}));
|
|
47
114
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
115
|
+
examples(...examples) {
|
|
116
|
+
return new IntegerType(...this._with({
|
|
117
|
+
options: {
|
|
118
|
+
examples
|
|
119
|
+
}
|
|
120
|
+
}));
|
|
52
121
|
}
|
|
53
122
|
positive() {
|
|
54
|
-
return
|
|
55
|
-
...this._schema,
|
|
56
|
-
minimum: 0,
|
|
57
|
-
exclusiveMinimum: 0
|
|
58
|
-
}), ...this._isNullableOptional);
|
|
123
|
+
return this.min(0, true);
|
|
59
124
|
}
|
|
60
125
|
negative() {
|
|
61
|
-
return
|
|
62
|
-
...this._schema,
|
|
63
|
-
maximum: 0,
|
|
64
|
-
exclusiveMaximum: 0
|
|
65
|
-
}), ...this._isNullableOptional);
|
|
126
|
+
return this.max(0, true);
|
|
66
127
|
}
|
|
67
128
|
max(value, exclusive) {
|
|
68
|
-
return new IntegerType(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
129
|
+
return new IntegerType(...this._with({
|
|
130
|
+
options: {
|
|
131
|
+
maximum: value,
|
|
132
|
+
...exclusive ? {} : {
|
|
133
|
+
exclusiveMaximum: value
|
|
134
|
+
}
|
|
73
135
|
}
|
|
74
|
-
})
|
|
136
|
+
}));
|
|
75
137
|
}
|
|
76
138
|
min(value, exclusive) {
|
|
77
|
-
return new IntegerType(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
139
|
+
return new IntegerType(...this._with({
|
|
140
|
+
options: {
|
|
141
|
+
minimum: value,
|
|
142
|
+
...exclusive ? {} : {
|
|
143
|
+
exclusiveMinimum: value
|
|
144
|
+
}
|
|
82
145
|
}
|
|
83
|
-
})
|
|
84
|
-
}
|
|
85
|
-
nullable() {
|
|
86
|
-
return new IntegerType(...this._nullable());
|
|
87
|
-
}
|
|
88
|
-
optional() {
|
|
89
|
-
return new IntegerType(...this._optional());
|
|
90
|
-
}
|
|
91
|
-
nullish() {
|
|
92
|
-
return new IntegerType(...this._nullish());
|
|
146
|
+
}));
|
|
93
147
|
}
|
|
94
148
|
}
|
package/dist/types/number.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/types/number.ts"],"sourcesContent":["import { type TInteger
|
|
1
|
+
{"version":3,"sources":["../../../src/types/number.ts"],"sourcesContent":["import {\n type IntegerOptions,\n type NumberOptions,\n type TInteger,\n type TNumber,\n Type,\n} from '@sinclair/typebox'\nimport { BaseType } from './base.ts'\n\nexport class NumberType<\n N extends boolean = false,\n O extends boolean = false,\n D extends boolean = false,\n> extends BaseType<TNumber, N, O, D, NumberOptions> {\n constructor(\n protected readonly options: NumberOptions = {},\n isNullable: N = false as N,\n isOptional: O = false as O,\n hasDefault: D = false as D,\n ) {\n super(options, isNullable, isOptional, hasDefault)\n }\n\n protected _constructSchema(options: NumberOptions): TNumber {\n return Type.Number(options)\n }\n\n nullable() {\n return new NumberType(...this._with({ isNullable: true }))\n }\n\n optional() {\n return new NumberType(...this._with({ isOptional: true }))\n }\n\n nullish() {\n return new NumberType(...this._with({ isNullable: true, isOptional: true }))\n }\n\n default(value: number) {\n return new NumberType(\n ...this._with({ options: { default: value }, hasDefault: true }),\n )\n }\n\n description(description: string) {\n return new NumberType(...this._with({ options: { description } }))\n }\n\n examples(...examples: [number, ...number[]]) {\n return new NumberType(...this._with({ options: { examples } }))\n }\n\n positive() {\n return this.min(0, true)\n }\n\n negative() {\n return this.max(0, true)\n }\n\n max(value: number, exclusive?: true) {\n return new NumberType(\n ...this._with({\n options: {\n maximum: value,\n ...(exclusive ? {} : { exclusiveMaximum: value }),\n },\n }),\n )\n }\n\n min(value: number, exclusive?: true) {\n return new NumberType(\n ...this._with({\n options: {\n minimum: value,\n ...(exclusive ? {} : { exclusiveMinimum: value }),\n },\n }),\n )\n }\n}\n\nexport class IntegerType<\n N extends boolean = false,\n O extends boolean = false,\n D extends boolean = false,\n> extends BaseType<TInteger, N, O, D, IntegerOptions> {\n constructor(\n options: IntegerOptions = {},\n isNullable: N = false as N,\n isOptional: O = false as O,\n hasDefault: D = false as D,\n ) {\n super(options, isNullable, isOptional, hasDefault)\n }\n\n protected _constructSchema(options: IntegerOptions): TInteger {\n return Type.Integer(options)\n }\n\n nullable() {\n return new IntegerType(...this._with({ isNullable: true }))\n }\n\n optional() {\n return new IntegerType(...this._with({ isOptional: true }))\n }\n\n nullish() {\n return new IntegerType(\n ...this._with({ isNullable: true, isOptional: true }),\n )\n }\n\n default(value: number) {\n return new IntegerType(\n ...this._with({ options: { default: value }, hasDefault: true }),\n )\n }\n\n description(description: string) {\n return new IntegerType(...this._with({ options: { description } }))\n }\n\n examples(...examples: [number, ...number[]]) {\n return new IntegerType(...this._with({ options: { examples } }))\n }\n\n positive() {\n return this.min(0, true)\n }\n\n negative() {\n return this.max(0, true)\n }\n\n max(value: number, exclusive?: true) {\n return new IntegerType(\n ...this._with({\n options: {\n maximum: value,\n ...(exclusive ? {} : { exclusiveMaximum: value }),\n },\n }),\n )\n }\n\n min(value: number, exclusive?: true) {\n return new IntegerType(\n ...this._with({\n options: {\n minimum: value,\n ...(exclusive ? {} : { exclusiveMinimum: value }),\n },\n }),\n )\n }\n}\n"],"names":["Type","BaseType","NumberType","constructor","options","isNullable","isOptional","hasDefault","_constructSchema","Number","nullable","_with","optional","nullish","default","value","description","examples","positive","min","negative","max","exclusive","maximum","exclusiveMaximum","minimum","exclusiveMinimum","IntegerType","Integer"],"mappings":"AAAA,SAKEA,IAAI,QACC,oBAAmB;AAC1B,SAASC,QAAQ,QAAQ,YAAW;AAEpC,OAAO,MAAMC,mBAIHD;;IACRE,YACE,AAAmBC,UAAyB,CAAC,CAAC,EAC9CC,aAAgB,KAAU,EAC1BC,aAAgB,KAAU,EAC1BC,aAAgB,KAAU,CAC1B;QACA,KAAK,CAACH,SAASC,YAAYC,YAAYC;aALpBH,UAAAA;IAMrB;IAEUI,iBAAiBJ,OAAsB,EAAW;QAC1D,OAAOJ,KAAKS,MAAM,CAACL;IACrB;IAEAM,WAAW;QACT,OAAO,IAAIR,cAAc,IAAI,CAACS,KAAK,CAAC;YAAEN,YAAY;QAAK;IACzD;IAEAO,WAAW;QACT,OAAO,IAAIV,cAAc,IAAI,CAACS,KAAK,CAAC;YAAEL,YAAY;QAAK;IACzD;IAEAO,UAAU;QACR,OAAO,IAAIX,cAAc,IAAI,CAACS,KAAK,CAAC;YAAEN,YAAY;YAAMC,YAAY;QAAK;IAC3E;IAEAQ,QAAQC,KAAa,EAAE;QACrB,OAAO,IAAIb,cACN,IAAI,CAACS,KAAK,CAAC;YAAEP,SAAS;gBAAEU,SAASC;YAAM;YAAGR,YAAY;QAAK;IAElE;IAEAS,YAAYA,WAAmB,EAAE;QAC/B,OAAO,IAAId,cAAc,IAAI,CAACS,KAAK,CAAC;YAAEP,SAAS;gBAAEY;YAAY;QAAE;IACjE;IAEAC,SAAS,GAAGA,QAA+B,EAAE;QAC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