@puq/type 0.0.10 → 0.0.12
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/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/property/array.d.ts +11 -5
- package/dist/lib/property/array.d.ts.map +1 -1
- package/dist/lib/property/array.js.map +1 -1
- package/dist/lib/property/big-integer.d.ts +6 -0
- package/dist/lib/property/big-integer.d.ts.map +1 -0
- package/dist/lib/property/big-integer.js +3 -0
- package/dist/lib/property/big-integer.js.map +1 -0
- package/dist/lib/property/boolean.d.ts +1 -5
- package/dist/lib/property/boolean.d.ts.map +1 -1
- package/dist/lib/property/boolean.js.map +1 -1
- package/dist/lib/property/common-number.d.ts +27 -0
- package/dist/lib/property/common-number.d.ts.map +1 -0
- package/dist/lib/property/common-number.js +3 -0
- package/dist/lib/property/common-number.js.map +1 -0
- package/dist/lib/property/common.d.ts +52 -2
- package/dist/lib/property/common.d.ts.map +1 -1
- package/dist/lib/property/common.js +3 -1
- package/dist/lib/property/common.js.map +1 -1
- package/dist/lib/property/date.d.ts +54 -0
- package/dist/lib/property/date.d.ts.map +1 -0
- package/dist/lib/property/date.js +3 -0
- package/dist/lib/property/date.js.map +1 -0
- package/dist/lib/property/integer.d.ts +5 -9
- package/dist/lib/property/integer.d.ts.map +1 -1
- package/dist/lib/property/integer.js.map +1 -1
- package/dist/lib/property/number.d.ts +9 -9
- package/dist/lib/property/number.d.ts.map +1 -1
- package/dist/lib/property/number.js.map +1 -1
- package/dist/lib/property/object.d.ts +6 -6
- package/dist/lib/property/object.d.ts.map +1 -1
- package/dist/lib/property/object.js.map +1 -1
- package/dist/lib/property/property-type.d.ts +1 -1
- package/dist/lib/property/property-type.d.ts.map +1 -1
- package/dist/lib/property/property-type.js.map +1 -1
- package/dist/lib/property/property.d.ts +4 -2
- package/dist/lib/property/property.d.ts.map +1 -1
- package/dist/lib/property/property.js.map +1 -1
- package/dist/lib/property/string.d.ts +32 -8
- package/dist/lib/property/string.d.ts.map +1 -1
- package/dist/lib/property/string.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -2,8 +2,10 @@ export * from './lib/model/base.js';
|
|
2
2
|
export * from './lib/model/id.js';
|
3
3
|
export * from './lib/model/timestamp.js';
|
4
4
|
export * from './lib/property/array.js';
|
5
|
+
export * from './lib/property/big-integer.js';
|
5
6
|
export * from './lib/property/boolean.js';
|
6
7
|
export * from './lib/property/common.js';
|
8
|
+
export * from './lib/property/date.js';
|
7
9
|
export * from './lib/property/integer-format.js';
|
8
10
|
export * from './lib/property/integer.js';
|
9
11
|
export * from './lib/property/number-format.js';
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
@@ -3,8 +3,10 @@ export * from './lib/model/base.js';
|
|
3
3
|
export * from './lib/model/id.js';
|
4
4
|
export * from './lib/model/timestamp.js';
|
5
5
|
export * from './lib/property/array.js';
|
6
|
+
export * from './lib/property/big-integer.js';
|
6
7
|
export * from './lib/property/boolean.js';
|
7
8
|
export * from './lib/property/common.js';
|
9
|
+
export * from './lib/property/date.js';
|
8
10
|
export * from './lib/property/integer-format.js';
|
9
11
|
export * from './lib/property/integer.js';
|
10
12
|
export * from './lib/property/number-format.js';
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @index('./**/*.ts', f => `export * from '${f.path}.js'`)\nexport * from './lib/model/base.js';\nexport * from './lib/model/id.js';\nexport * from './lib/model/timestamp.js';\nexport * from './lib/property/array.js';\nexport * from './lib/property/boolean.js';\nexport * from './lib/property/common.js';\nexport * from './lib/property/integer-format.js';\nexport * from './lib/property/integer.js';\nexport * from './lib/property/number-format.js';\nexport * from './lib/property/number.js';\nexport * from './lib/property/object.js';\nexport * from './lib/property/property-type.js';\nexport * from './lib/property/property.js';\nexport * from './lib/property/string-format.js';\nexport * from './lib/property/string.js';\nexport * from './lib/utils/key-of.js';\nexport * from './lib/utils/keys.js';\nexport * from './lib/utils/pick-optional.js';\nexport * from './lib/utils/pick-required.js';\nexport * from './lib/utils/type.js';\n"],"names":[],"rangeMappings":"
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @index('./**/*.ts', f => `export * from '${f.path}.js'`)\nexport * from './lib/model/base.js';\nexport * from './lib/model/id.js';\nexport * from './lib/model/timestamp.js';\nexport * from './lib/property/array.js';\nexport * from './lib/property/big-integer.js';\nexport * from './lib/property/boolean.js';\nexport * from './lib/property/common.js';\nexport * from './lib/property/date.js';\nexport * from './lib/property/integer-format.js';\nexport * from './lib/property/integer.js';\nexport * from './lib/property/number-format.js';\nexport * from './lib/property/number.js';\nexport * from './lib/property/object.js';\nexport * from './lib/property/property-type.js';\nexport * from './lib/property/property.js';\nexport * from './lib/property/string-format.js';\nexport * from './lib/property/string.js';\nexport * from './lib/utils/key-of.js';\nexport * from './lib/utils/keys.js';\nexport * from './lib/utils/pick-optional.js';\nexport * from './lib/utils/pick-required.js';\nexport * from './lib/utils/type.js';\n"],"names":[],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,2DAA2D;AAC3D,cAAc,sBAAsB;AACpC,cAAc,oBAAoB;AAClC,cAAc,2BAA2B;AACzC,cAAc,0BAA0B;AACxC,cAAc,gCAAgC;AAC9C,cAAc,4BAA4B;AAC1C,cAAc,2BAA2B;AACzC,cAAc,yBAAyB;AACvC,cAAc,mCAAmC;AACjD,cAAc,4BAA4B;AAC1C,cAAc,kCAAkC;AAChD,cAAc,2BAA2B;AACzC,cAAc,2BAA2B;AACzC,cAAc,kCAAkC;AAChD,cAAc,6BAA6B;AAC3C,cAAc,kCAAkC;AAChD,cAAc,2BAA2B;AACzC,cAAc,wBAAwB;AACtC,cAAc,sBAAsB;AACpC,cAAc,+BAA+B;AAC7C,cAAc,+BAA+B;AAC7C,cAAc,sBAAsB"}
|
@@ -2,12 +2,18 @@ import { CommonOptions } from './common.js';
|
|
2
2
|
export type __ArrayOptions<P> = {
|
3
3
|
type: 'array';
|
4
4
|
items: P;
|
5
|
+
/**
|
6
|
+
* Maximumm allowed size of the array
|
7
|
+
*/
|
5
8
|
minSize?: number;
|
9
|
+
/**
|
10
|
+
* Minimum allowed size of the array
|
11
|
+
*/
|
6
12
|
maxSize?: number;
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
13
|
+
/**
|
14
|
+
* Check the array has unique items
|
15
|
+
*/
|
16
|
+
uniqueItems?: boolean;
|
11
17
|
};
|
12
|
-
export type ArrayOptions<P> = CommonOptions & __ArrayOptions<P
|
18
|
+
export type ArrayOptions<P> = Readonly<CommonOptions<any[]> & __ArrayOptions<P>>;
|
13
19
|
//# sourceMappingURL=array.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src/lib/property/array.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src/lib/property/array.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,CAAC,CAAC;IAET;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,QAAQ,CACpC,aAAa,CAAC,GAAG,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CACzC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/property/array.ts"],"sourcesContent":["import { CommonOptions } from './common.js';\r\n\r\nexport type __ArrayOptions<P> = {\r\n type: 'array';\r\n items: P;\r\n
|
1
|
+
{"version":3,"sources":["../../../src/lib/property/array.ts"],"sourcesContent":["import { CommonOptions } from './common.js';\r\n\r\nexport type __ArrayOptions<P> = {\r\n type: 'array';\r\n items: P;\r\n\r\n /**\r\n * Maximumm allowed size of the array\r\n */\r\n minSize?: number;\r\n\r\n /**\r\n * Minimum allowed size of the array\r\n */\r\n maxSize?: number;\r\n\r\n /**\r\n * Check the array has unique items\r\n */\r\n uniqueItems?: boolean;\r\n};\r\n\r\nexport type ArrayOptions<P> = Readonly<\r\n CommonOptions<any[]> & __ArrayOptions<P>\r\n>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAsBA,WAEE"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"big-integer.d.ts","sourceRoot":"","sources":["../../../src/lib/property/big-integer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CACtC,aAAa,CAAC,MAAM,CAAC,GAAG,mBAAmB,CAC5C,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/property/big-integer.ts"],"sourcesContent":["import { CommonOptions } from './common.js';\r\n\r\nexport type __BigIntegerOptions = {\r\n type: 'bigint';\r\n};\r\n\r\nexport type BigIntegerOptions = Readonly<\r\n CommonOptions<BigInt> & __BigIntegerOptions\r\n>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAMA,WAEE"}
|
@@ -1,10 +1,6 @@
|
|
1
1
|
import { CommonOptions } from './common.js';
|
2
2
|
export type __BooleanOptions = {
|
3
3
|
type: 'boolean';
|
4
|
-
default: boolean;
|
5
|
-
example: boolean;
|
6
|
-
examples: boolean[];
|
7
|
-
isBooleanString?: boolean;
|
8
4
|
};
|
9
|
-
export type BooleanOptions = CommonOptions & __BooleanOptions
|
5
|
+
export type BooleanOptions = Readonly<CommonOptions<boolean> & __BooleanOptions>;
|
10
6
|
//# sourceMappingURL=boolean.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src/lib/property/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,SAAS,CAAC;
|
1
|
+
{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src/lib/property/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,QAAQ,CACnC,aAAa,CAAC,OAAO,CAAC,GAAG,gBAAgB,CAC1C,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/property/boolean.ts"],"sourcesContent":["import { CommonOptions } from './common.js';\r\n\r\nexport type __BooleanOptions = {\r\n type: 'boolean';\r\n
|
1
|
+
{"version":3,"sources":["../../../src/lib/property/boolean.ts"],"sourcesContent":["import { CommonOptions } from './common.js';\r\n\r\nexport type __BooleanOptions = {\r\n type: 'boolean';\r\n};\r\n\r\nexport type BooleanOptions = Readonly<\r\n CommonOptions<boolean> & __BooleanOptions\r\n>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAMA,WAEE"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
export type CommonNumberOptions = {
|
2
|
+
/**
|
3
|
+
* Minimum allowed number
|
4
|
+
*/
|
5
|
+
minimum?: number;
|
6
|
+
/**
|
7
|
+
* Maximum allowed number
|
8
|
+
*/
|
9
|
+
maximum?: number;
|
10
|
+
/**
|
11
|
+
* Allowed numbers
|
12
|
+
*/
|
13
|
+
enum?: number[];
|
14
|
+
/**
|
15
|
+
* Not allowed numbers
|
16
|
+
*/
|
17
|
+
notIn?: number[];
|
18
|
+
/**
|
19
|
+
* Check the value is more than the property's value
|
20
|
+
*/
|
21
|
+
moreThanProperty?: string;
|
22
|
+
/**
|
23
|
+
* Check the value is less than the property's value
|
24
|
+
*/
|
25
|
+
lessThanProperty?: string;
|
26
|
+
};
|
27
|
+
//# sourceMappingURL=common-number.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"common-number.d.ts","sourceRoot":"","sources":["../../../src/lib/property/common-number.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/property/common-number.ts"],"sourcesContent":["export type CommonNumberOptions = {\r\n /**\r\n * Minimum allowed number\r\n */\r\n minimum?: number;\r\n\r\n /**\r\n * Maximum allowed number\r\n */\r\n maximum?: number;\r\n\r\n /**\r\n * Allowed numbers\r\n */\r\n enum?: number[];\r\n\r\n /**\r\n * Not allowed numbers\r\n */\r\n notIn?: number[];\r\n\r\n /**\r\n * Check the value is more than the property's value\r\n */\r\n moreThanProperty?: string;\r\n\r\n /**\r\n * Check the value is less than the property's value\r\n */\r\n lessThanProperty?: string;\r\n};\r\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WA8BE"}
|
@@ -1,9 +1,59 @@
|
|
1
1
|
import { PropertyType } from './property-type.js';
|
2
|
-
|
2
|
+
/**
|
3
|
+
* Common property options
|
4
|
+
*/
|
5
|
+
export type CommonOptions<T> = {
|
6
|
+
/**
|
7
|
+
* Property type
|
8
|
+
*/
|
3
9
|
type: PropertyType;
|
10
|
+
/**
|
11
|
+
* Check the value is not undefined
|
12
|
+
*/
|
4
13
|
required?: boolean;
|
14
|
+
/**
|
15
|
+
* Check the property is unique or not
|
16
|
+
*/
|
5
17
|
unique?: boolean;
|
18
|
+
/**
|
19
|
+
* Property description
|
20
|
+
*/
|
6
21
|
description?: string;
|
7
|
-
|
22
|
+
/**
|
23
|
+
* If set false, the property is excluded.
|
24
|
+
*/
|
25
|
+
expose?: boolean;
|
26
|
+
/**
|
27
|
+
* Default value in case the input is undefined
|
28
|
+
*/
|
29
|
+
default?: T;
|
30
|
+
/**
|
31
|
+
* Example value
|
32
|
+
*/
|
33
|
+
example?: T;
|
34
|
+
/**
|
35
|
+
* Example values
|
36
|
+
*/
|
37
|
+
examples?: T[];
|
38
|
+
/**
|
39
|
+
* If ture, the string values are accepted and transformed
|
40
|
+
*/
|
41
|
+
acceptString?: boolean;
|
42
|
+
/**
|
43
|
+
* Check the value is equal to property
|
44
|
+
*/
|
45
|
+
equalToProperty?: string;
|
46
|
+
/**
|
47
|
+
* Check the value is not equal to property
|
48
|
+
*/
|
49
|
+
notEqual?: string;
|
50
|
+
/**
|
51
|
+
* If set, the value is ignored unless the target property is set
|
52
|
+
*/
|
53
|
+
dependOnProperty?: string;
|
54
|
+
/**
|
55
|
+
* If set, the property only exist if the provided property does not
|
56
|
+
*/
|
57
|
+
notWithProperty?: string;
|
8
58
|
};
|
9
59
|
//# sourceMappingURL=common.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/lib/property/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,MAAM,aAAa,
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/lib/property/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC7B;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC;IAEZ;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC;IAEZ;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/property/common.ts"],"sourcesContent":["import { PropertyType } from './property-type.js';\r\n\r\nexport type CommonOptions = {\r\n type: PropertyType;\r\n required?: boolean;\r\n unique?: boolean;\r\n description?: string;\r\n default?:
|
1
|
+
{"version":3,"sources":["../../../src/lib/property/common.ts"],"sourcesContent":["import { PropertyType } from './property-type.js';\r\n\r\n/**\r\n * Common property options\r\n */\r\nexport type CommonOptions<T> = {\r\n /**\r\n * Property type\r\n */\r\n type: PropertyType;\r\n\r\n /**\r\n * Check the value is not undefined\r\n */\r\n required?: boolean;\r\n\r\n /**\r\n * Check the property is unique or not\r\n */\r\n unique?: boolean;\r\n\r\n /**\r\n * Property description\r\n */\r\n description?: string;\r\n\r\n /**\r\n * If set false, the property is excluded.\r\n */\r\n expose?: boolean;\r\n\r\n /**\r\n * Default value in case the input is undefined\r\n */\r\n default?: T;\r\n\r\n /**\r\n * Example value\r\n */\r\n example?: T;\r\n\r\n /**\r\n * Example values\r\n */\r\n examples?: T[];\r\n\r\n /**\r\n * If ture, the string values are accepted and transformed\r\n */\r\n acceptString?: boolean;\r\n\r\n /**\r\n * Check the value is equal to property\r\n */\r\n equalToProperty?: string;\r\n\r\n /**\r\n * Check the value is not equal to property\r\n */\r\n notEqual?: string;\r\n\r\n /**\r\n * If set, the value is ignored unless the target property is set\r\n */\r\n dependOnProperty?: string;\r\n\r\n /**\r\n * If set, the property only exist if the provided property does not\r\n */\r\n notWithProperty?: string;\r\n};\r\n"],"names":[],"rangeMappings":";;","mappings":"AAEA;;CAEC,GACD,WAiEE"}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import { CommonOptions } from './common.js';
|
2
|
+
export type __DateOptions = {
|
3
|
+
type: 'date';
|
4
|
+
/**
|
5
|
+
* Check the date is after the date
|
6
|
+
*/
|
7
|
+
minDate?: Date;
|
8
|
+
/**
|
9
|
+
* Check the date is before the date
|
10
|
+
*/
|
11
|
+
maxDate?: Date;
|
12
|
+
/**
|
13
|
+
* Check the date is future date
|
14
|
+
*/
|
15
|
+
future?: boolean;
|
16
|
+
/**
|
17
|
+
* Check the date is past date
|
18
|
+
*/
|
19
|
+
past?: boolean;
|
20
|
+
/**
|
21
|
+
* Check the property comes before the target property
|
22
|
+
*/
|
23
|
+
beforeProperty?: string;
|
24
|
+
/**
|
25
|
+
* Check the property comes after the target property
|
26
|
+
*/
|
27
|
+
afterProperty?: string;
|
28
|
+
/**
|
29
|
+
* Check the property and targer property are in the same month
|
30
|
+
*/
|
31
|
+
sameMonthAsProperty?: string;
|
32
|
+
/**
|
33
|
+
* Check the property and targer property are in the same year
|
34
|
+
*/
|
35
|
+
sameWeekAsProperty?: string;
|
36
|
+
/**
|
37
|
+
* Check the date's year value is the same as the named property's year value
|
38
|
+
*/
|
39
|
+
sameYearAsProperty?: string;
|
40
|
+
/**
|
41
|
+
* Check the property and targer property are on the same day
|
42
|
+
*/
|
43
|
+
sameDayAsProperty?: string;
|
44
|
+
/**
|
45
|
+
* Check the property and the target property are weekend or week day
|
46
|
+
*/
|
47
|
+
sameDayTypeAsProperty?: string;
|
48
|
+
/**
|
49
|
+
* Check the property and targer property are in the same hour
|
50
|
+
*/
|
51
|
+
sameHourAsProperty?: string;
|
52
|
+
};
|
53
|
+
export type DateOptions = Readonly<CommonOptions<Date> & __DateOptions>;
|
54
|
+
//# sourceMappingURL=date.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../src/lib/property/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/property/date.ts"],"sourcesContent":["import { CommonOptions } from './common.js';\r\n\r\nexport type __DateOptions = {\r\n type: 'date';\r\n\r\n /**\r\n * Check the date is after the date\r\n */\r\n minDate?: Date;\r\n\r\n /**\r\n * Check the date is before the date\r\n */\r\n maxDate?: Date;\r\n\r\n /**\r\n * Check the date is future date\r\n */\r\n future?: boolean;\r\n\r\n /**\r\n * Check the date is past date\r\n */\r\n past?: boolean;\r\n\r\n /**\r\n * Check the property comes before the target property\r\n */\r\n beforeProperty?: string;\r\n\r\n /**\r\n * Check the property comes after the target property\r\n */\r\n afterProperty?: string;\r\n\r\n /**\r\n * Check the property and targer property are in the same month\r\n */\r\n sameMonthAsProperty?: string;\r\n\r\n /**\r\n * Check the property and targer property are in the same year\r\n */\r\n sameWeekAsProperty?: string;\r\n\r\n /**\r\n * Check the date's year value is the same as the named property's year value\r\n */\r\n sameYearAsProperty?: string;\r\n\r\n /**\r\n * Check the property and targer property are on the same day\r\n */\r\n sameDayAsProperty?: string;\r\n\r\n /**\r\n * Check the property and the target property are weekend or week day\r\n */\r\n sameDayTypeAsProperty?: string;\r\n\r\n /**\r\n * Check the property and targer property are in the same hour\r\n */\r\n sameHourAsProperty?: string;\r\n};\r\n\r\nexport type DateOptions = Readonly<CommonOptions<Date> & __DateOptions>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAkEA,WAAwE"}
|
@@ -1,16 +1,12 @@
|
|
1
|
+
import { CommonNumberOptions } from './common-number.js';
|
1
2
|
import { CommonOptions } from './common.js';
|
2
3
|
import { IntegerFormat } from './integer-format.js';
|
3
4
|
export type __IntegerOptions = {
|
4
5
|
type: 'integer';
|
5
|
-
|
6
|
-
|
6
|
+
/**
|
7
|
+
* Special integer format
|
8
|
+
*/
|
7
9
|
integerFormat?: IntegerFormat;
|
8
|
-
enum?: number[];
|
9
|
-
notIn?: number[];
|
10
|
-
default?: number;
|
11
|
-
example?: number;
|
12
|
-
examples?: number[];
|
13
|
-
isIntegerString?: boolean;
|
14
10
|
};
|
15
|
-
export type IntegerOptions = __IntegerOptions &
|
11
|
+
export type IntegerOptions = Readonly<CommonOptions<number> & __IntegerOptions & CommonNumberOptions>;
|
16
12
|
//# sourceMappingURL=integer.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["../../../src/lib/property/integer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,SAAS,CAAC;
|
1
|
+
{"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["../../../src/lib/property/integer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,SAAS,CAAC;IAEhB;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,QAAQ,CACnC,aAAa,CAAC,MAAM,CAAC,GAAG,gBAAgB,GAAG,mBAAmB,CAC/D,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/property/integer.ts"],"sourcesContent":["import { CommonOptions } from './common.js';\r\nimport { IntegerFormat } from './integer-format.js';\r\n\r\nexport type __IntegerOptions = {\r\n type: 'integer';\r\n
|
1
|
+
{"version":3,"sources":["../../../src/lib/property/integer.ts"],"sourcesContent":["import { CommonNumberOptions } from './common-number.js';\r\nimport { CommonOptions } from './common.js';\r\nimport { IntegerFormat } from './integer-format.js';\r\n\r\nexport type __IntegerOptions = {\r\n type: 'integer';\r\n\r\n /**\r\n * Special integer format\r\n */\r\n integerFormat?: IntegerFormat;\r\n};\r\n\r\nexport type IntegerOptions = Readonly<\r\n CommonOptions<number> & __IntegerOptions & CommonNumberOptions\r\n>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAaA,WAEE"}
|
@@ -1,16 +1,16 @@
|
|
1
|
+
import { CommonNumberOptions } from './common-number.js';
|
1
2
|
import { CommonOptions } from './common.js';
|
2
3
|
import { NumberFormat } from './number-format.js';
|
3
4
|
export type __NumberOptions = {
|
4
5
|
type: 'number';
|
5
|
-
|
6
|
-
|
6
|
+
/**
|
7
|
+
* Maximum allowed decimals
|
8
|
+
*/
|
9
|
+
maxDecimals?: number;
|
10
|
+
/**
|
11
|
+
* Special number format
|
12
|
+
*/
|
7
13
|
numberFormat?: NumberFormat;
|
8
|
-
enum?: number[];
|
9
|
-
notIn?: number[];
|
10
|
-
default?: number;
|
11
|
-
example?: number;
|
12
|
-
examples?: number[];
|
13
|
-
isNumberString?: boolean;
|
14
14
|
};
|
15
|
-
export type NumberOptions = CommonOptions & __NumberOptions
|
15
|
+
export type NumberOptions = Readonly<CommonOptions<number> & __NumberOptions & CommonNumberOptions>;
|
16
16
|
//# sourceMappingURL=number.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src/lib/property/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC;
|
1
|
+
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src/lib/property/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,QAAQ,CAClC,aAAa,CAAC,MAAM,CAAC,GAAG,eAAe,GAAG,mBAAmB,CAC9D,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/property/number.ts"],"sourcesContent":["import { CommonOptions } from './common.js';\r\nimport { NumberFormat } from './number-format.js';\r\n\r\nexport type __NumberOptions = {\r\n type: 'number';\r\n
|
1
|
+
{"version":3,"sources":["../../../src/lib/property/number.ts"],"sourcesContent":["import { CommonNumberOptions } from './common-number.js';\r\nimport { CommonOptions } from './common.js';\r\nimport { NumberFormat } from './number-format.js';\r\n\r\nexport type __NumberOptions = {\r\n type: 'number';\r\n\r\n /**\r\n * Maximum allowed decimals\r\n */\r\n maxDecimals?: number;\r\n\r\n /**\r\n * Special number format\r\n */\r\n numberFormat?: NumberFormat;\r\n};\r\n\r\nexport type NumberOptions = Readonly<\r\n CommonOptions<number> & __NumberOptions & CommonNumberOptions\r\n>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAkBA,WAEE"}
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { Type } from '../utils/type.js';
|
2
2
|
import { CommonOptions } from './common.js';
|
3
|
-
export type __ObjectOptions
|
3
|
+
export type __ObjectOptions = {
|
4
4
|
type: 'object';
|
5
|
+
/**
|
6
|
+
* Target DTO class
|
7
|
+
* @returns
|
8
|
+
*/
|
5
9
|
target: () => Type;
|
6
|
-
default?: T;
|
7
|
-
example?: T;
|
8
|
-
examples?: T[];
|
9
|
-
isJSON?: boolean;
|
10
10
|
};
|
11
|
-
export type ObjectOptions<T = any> = CommonOptions & __ObjectOptions
|
11
|
+
export type ObjectOptions<T = any> = Readonly<CommonOptions<T> & __ObjectOptions>;
|
12
12
|
//# sourceMappingURL=object.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../src/lib/property/object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,eAAe,
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../src/lib/property/object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC;IAEf;;;OAGG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,GAAG,IAAI,QAAQ,CAC3C,aAAa,CAAC,CAAC,CAAC,GAAG,eAAe,CACnC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/property/object.ts"],"sourcesContent":["import { Type } from '../utils/type.js';\r\nimport { CommonOptions } from './common.js';\r\n\r\nexport type __ObjectOptions
|
1
|
+
{"version":3,"sources":["../../../src/lib/property/object.ts"],"sourcesContent":["import { Type } from '../utils/type.js';\r\nimport { CommonOptions } from './common.js';\r\n\r\nexport type __ObjectOptions = {\r\n type: 'object';\r\n\r\n /**\r\n * Target DTO class\r\n * @returns\r\n */\r\n target: () => Type;\r\n};\r\n\r\nexport type ObjectOptions<T = any> = Readonly<\r\n CommonOptions<T> & __ObjectOptions\r\n>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAaA,WAEE"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export type PropertyType = 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
|
1
|
+
export type PropertyType = 'string' | 'number' | 'integer' | 'bigint' | 'date' | 'boolean' | 'array' | 'object';
|
2
2
|
//# sourceMappingURL=property-type.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"property-type.d.ts","sourceRoot":"","sources":["../../../src/lib/property/property-type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,SAAS,GACT,OAAO,GACP,QAAQ,CAAC"}
|
1
|
+
{"version":3,"file":"property-type.d.ts","sourceRoot":"","sources":["../../../src/lib/property/property-type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,MAAM,GACN,SAAS,GACT,OAAO,GACP,QAAQ,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/property/property-type.ts"],"sourcesContent":["export type PropertyType =\r\n | 'string'\r\n | 'number'\r\n | 'integer'\r\n | 'boolean'\r\n | 'array'\r\n | 'object';\r\n"],"names":[],"rangeMappings":"","mappings":"AAAA,
|
1
|
+
{"version":3,"sources":["../../../src/lib/property/property-type.ts"],"sourcesContent":["export type PropertyType =\r\n | 'string'\r\n | 'number'\r\n | 'integer'\r\n | 'bigint'\r\n | 'date'\r\n | 'boolean'\r\n | 'array'\r\n | 'object';\r\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAQa"}
|
@@ -1,9 +1,11 @@
|
|
1
1
|
import { ArrayOptions } from './array.js';
|
2
|
+
import { BigIntegerOptions } from './big-integer.js';
|
2
3
|
import { BooleanOptions } from './boolean.js';
|
4
|
+
import { DateOptions } from './date.js';
|
3
5
|
import { IntegerOptions } from './integer.js';
|
4
6
|
import { NumberOptions } from './number.js';
|
5
7
|
import { ObjectOptions } from './object.js';
|
6
8
|
import { StringOptions } from './string.js';
|
7
|
-
export type __PropertyOptions<T = any> = StringOptions | NumberOptions | IntegerOptions | BooleanOptions | ObjectOptions | ArrayOptions<T>;
|
8
|
-
export type PropertyOptions = __PropertyOptions<__PropertyOptions<__PropertyOptions
|
9
|
+
export type __PropertyOptions<T = any> = StringOptions | NumberOptions | IntegerOptions | BigIntegerOptions | BooleanOptions | ObjectOptions | DateOptions | ArrayOptions<T>;
|
10
|
+
export type PropertyOptions = Readonly<__PropertyOptions<__PropertyOptions<__PropertyOptions>>>;
|
9
11
|
//# sourceMappingURL=property.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../../src/lib/property/property.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,GAAG,IACjC,aAAa,GACb,aAAa,GACb,cAAc,GACd,cAAc,GACd,aAAa,GACb,YAAY,CAAC,CAAC,CAAC,CAAC;AAEpB,MAAM,MAAM,eAAe,GAAG,iBAAiB,
|
1
|
+
{"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../../src/lib/property/property.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,GAAG,IACjC,aAAa,GACb,aAAa,GACb,cAAc,GACd,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,WAAW,GACX,YAAY,CAAC,CAAC,CAAC,CAAC;AAEpB,MAAM,MAAM,eAAe,GAAG,QAAQ,CACpC,iBAAiB,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,CACxD,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/property/property.ts"],"sourcesContent":["import { ArrayOptions } from './array.js';\r\nimport { BooleanOptions } from './boolean.js';\r\nimport { IntegerOptions } from './integer.js';\r\nimport { NumberOptions } from './number.js';\r\nimport { ObjectOptions } from './object.js';\r\nimport { StringOptions } from './string.js';\r\n\r\nexport type __PropertyOptions<T = any> =\r\n | StringOptions\r\n | NumberOptions\r\n | IntegerOptions\r\n | BooleanOptions\r\n | ObjectOptions\r\n | ArrayOptions<T>;\r\n\r\nexport type PropertyOptions =
|
1
|
+
{"version":3,"sources":["../../../src/lib/property/property.ts"],"sourcesContent":["import { ArrayOptions } from './array.js';\r\nimport { BigIntegerOptions } from './big-integer.js';\r\nimport { BooleanOptions } from './boolean.js';\r\nimport { DateOptions } from './date.js';\r\nimport { IntegerOptions } from './integer.js';\r\nimport { NumberOptions } from './number.js';\r\nimport { ObjectOptions } from './object.js';\r\nimport { StringOptions } from './string.js';\r\n\r\nexport type __PropertyOptions<T = any> =\r\n | StringOptions\r\n | NumberOptions\r\n | IntegerOptions\r\n | BigIntegerOptions\r\n | BooleanOptions\r\n | ObjectOptions\r\n | DateOptions\r\n | ArrayOptions<T>;\r\n\r\nexport type PropertyOptions = Readonly<\r\n __PropertyOptions<__PropertyOptions<__PropertyOptions>>\r\n>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAmBA,WAEE"}
|
@@ -2,18 +2,42 @@ import { CommonOptions } from './common.js';
|
|
2
2
|
import { StringFormat } from './string-format.js';
|
3
3
|
export type __StringOptions = {
|
4
4
|
type: 'string';
|
5
|
+
/**
|
6
|
+
* Minimum allowed string length
|
7
|
+
*/
|
5
8
|
minLength?: number;
|
9
|
+
/**
|
10
|
+
* Maximum allowed string length
|
11
|
+
*/
|
6
12
|
maxLength?: number;
|
13
|
+
/**
|
14
|
+
* String format such as email, password.
|
15
|
+
*/
|
7
16
|
stringFormat?: StringFormat;
|
17
|
+
/**
|
18
|
+
* Allowed strings
|
19
|
+
*/
|
8
20
|
enum?: string[];
|
21
|
+
/**
|
22
|
+
* Not allowed strings
|
23
|
+
*/
|
9
24
|
notIn?: string[];
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
25
|
+
/**
|
26
|
+
* string starts with
|
27
|
+
*/
|
28
|
+
startWith?: string;
|
29
|
+
/**
|
30
|
+
* string ends with
|
31
|
+
*/
|
32
|
+
endWith?: string;
|
33
|
+
/**
|
34
|
+
* check the string contains
|
35
|
+
*/
|
36
|
+
contain?: string;
|
37
|
+
/**
|
38
|
+
* Check the string not contain
|
39
|
+
*/
|
40
|
+
notContain?: string;
|
17
41
|
};
|
18
|
-
export type StringOptions = CommonOptions & __StringOptions
|
42
|
+
export type StringOptions = Readonly<CommonOptions<string> & __StringOptions>;
|
19
43
|
//# sourceMappingURL=string.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/lib/property/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC;
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/lib/property/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/property/string.ts"],"sourcesContent":["import { CommonOptions } from './common.js';\r\nimport { StringFormat } from './string-format.js';\r\n\r\nexport type __StringOptions = {\r\n type: 'string';\r\n minLength?: number;\r\n maxLength?: number;\r\n stringFormat?: StringFormat;\r\n enum?: string[];\r\n notIn?: string[];\r\n
|
1
|
+
{"version":3,"sources":["../../../src/lib/property/string.ts"],"sourcesContent":["import { CommonOptions } from './common.js';\r\nimport { StringFormat } from './string-format.js';\r\n\r\nexport type __StringOptions = {\r\n type: 'string';\r\n\r\n /**\r\n * Minimum allowed string length\r\n */\r\n minLength?: number;\r\n /**\r\n * Maximum allowed string length\r\n */\r\n maxLength?: number;\r\n\r\n /**\r\n * String format such as email, password.\r\n */\r\n stringFormat?: StringFormat;\r\n\r\n /**\r\n * Allowed strings\r\n */\r\n enum?: string[];\r\n\r\n /**\r\n * Not allowed strings\r\n */\r\n notIn?: string[];\r\n\r\n /**\r\n * string starts with\r\n */\r\n startWith?: string;\r\n\r\n /**\r\n * string ends with\r\n */\r\n endWith?: string;\r\n\r\n /**\r\n * check the string contains\r\n */\r\n contain?: string;\r\n\r\n /**\r\n * Check the string not contain\r\n */\r\n notContain?: string;\r\n};\r\n\r\nexport type StringOptions = Readonly<CommonOptions<string> & __StringOptions>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAmDA,WAA8E"}
|