@puq/type 0.0.15 → 0.0.20

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.
Files changed (49) hide show
  1. package/dist/index.d.ts +5 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +5 -0
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/dto/count-result.d.ts +4 -0
  6. package/dist/lib/dto/count-result.d.ts.map +1 -0
  7. package/dist/lib/dto/count-result.js +3 -0
  8. package/dist/lib/dto/count-result.js.map +1 -0
  9. package/dist/lib/dto/delete-result.d.ts +4 -0
  10. package/dist/lib/dto/delete-result.d.ts.map +1 -0
  11. package/dist/lib/dto/delete-result.js +3 -0
  12. package/dist/lib/dto/delete-result.js.map +1 -0
  13. package/dist/lib/dto/relation-param.d.ts +10 -0
  14. package/dist/lib/dto/relation-param.d.ts.map +1 -0
  15. package/dist/lib/dto/relation-param.js +3 -0
  16. package/dist/lib/dto/relation-param.js.map +1 -0
  17. package/dist/lib/dto/update-result.d.ts +4 -0
  18. package/dist/lib/dto/update-result.d.ts.map +1 -0
  19. package/dist/lib/dto/update-result.js +3 -0
  20. package/dist/lib/dto/update-result.js.map +1 -0
  21. package/dist/lib/property/array.d.ts +4 -1
  22. package/dist/lib/property/array.d.ts.map +1 -1
  23. package/dist/lib/property/array.js.map +1 -1
  24. package/dist/lib/property/big-integer.d.ts +1 -1
  25. package/dist/lib/property/big-integer.js.map +1 -1
  26. package/dist/lib/property/common-number.d.ts +2 -2
  27. package/dist/lib/property/common-number.d.ts.map +1 -1
  28. package/dist/lib/property/common-number.js.map +1 -1
  29. package/dist/lib/property/common.d.ts +18 -1
  30. package/dist/lib/property/common.d.ts.map +1 -1
  31. package/dist/lib/property/common.js.map +1 -1
  32. package/dist/lib/property/database-type.d.ts +6 -0
  33. package/dist/lib/property/database-type.d.ts.map +1 -0
  34. package/dist/lib/property/database-type.js +6 -0
  35. package/dist/lib/property/database-type.js.map +1 -0
  36. package/dist/lib/property/date.d.ts +1 -1
  37. package/dist/lib/property/date.d.ts.map +1 -1
  38. package/dist/lib/property/date.js.map +1 -1
  39. package/dist/lib/property/string.d.ts +2 -2
  40. package/dist/lib/property/string.d.ts.map +1 -1
  41. package/dist/lib/property/string.js.map +1 -1
  42. package/dist/lib/utils/keys.d.ts +4 -1
  43. package/dist/lib/utils/keys.d.ts.map +1 -1
  44. package/dist/lib/utils/keys.js +3 -1
  45. package/dist/lib/utils/keys.js.map +1 -1
  46. package/dist/lib/utils/type.d.ts.map +1 -1
  47. package/dist/lib/utils/type.js +1 -0
  48. package/dist/lib/utils/type.js.map +1 -1
  49. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,9 +1,14 @@
1
+ export * from './lib/dto/count-result.js';
2
+ export * from './lib/dto/delete-result.js';
3
+ export * from './lib/dto/relation-param.js';
4
+ export * from './lib/dto/update-result.js';
1
5
  export * from './lib/model/base.js';
2
6
  export * from './lib/model/id.js';
3
7
  export * from './lib/model/timestamp.js';
4
8
  export * from './lib/property/array.js';
5
9
  export * from './lib/property/big-integer.js';
6
10
  export * from './lib/property/boolean.js';
11
+ export * from './lib/property/common-number.js';
7
12
  export * from './lib/property/common.js';
8
13
  export * from './lib/property/date.js';
9
14
  export * from './lib/property/integer-format.js';
@@ -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,+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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,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,iCAAiC,CAAC;AAChD,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
@@ -1,10 +1,15 @@
1
1
  // @index('./**/*.ts', f => `export * from '${f.path}.js'`)
2
+ export * from './lib/dto/count-result.js';
3
+ export * from './lib/dto/delete-result.js';
4
+ export * from './lib/dto/relation-param.js';
5
+ export * from './lib/dto/update-result.js';
2
6
  export * from './lib/model/base.js';
3
7
  export * from './lib/model/id.js';
4
8
  export * from './lib/model/timestamp.js';
5
9
  export * from './lib/property/array.js';
6
10
  export * from './lib/property/big-integer.js';
7
11
  export * from './lib/property/boolean.js';
12
+ export * from './lib/property/common-number.js';
8
13
  export * from './lib/property/common.js';
9
14
  export * from './lib/property/date.js';
10
15
  export * from './lib/property/integer-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/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"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @index('./**/*.ts', f => `export * from '${f.path}.js'`)\nexport * from './lib/dto/count-result.js';\nexport * from './lib/dto/delete-result.js';\nexport * from './lib/dto/relation-param.js';\nexport * from './lib/dto/update-result.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-number.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,4BAA4B;AAC1C,cAAc,6BAA6B;AAC3C,cAAc,8BAA8B;AAC5C,cAAc,6BAA6B;AAC3C,cAAc,sBAAsB;AACpC,cAAc,oBAAoB;AAClC,cAAc,2BAA2B;AACzC,cAAc,0BAA0B;AACxC,cAAc,gCAAgC;AAC9C,cAAc,4BAA4B;AAC1C,cAAc,kCAAkC;AAChD,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"}
@@ -0,0 +1,4 @@
1
+ export type CountResult = {
2
+ count: number;
3
+ };
4
+ //# sourceMappingURL=count-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"count-result.d.ts","sourceRoot":"","sources":["../../../src/lib/dto/count-result.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=count-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/dto/count-result.ts"],"sourcesContent":["export type CountResult = {\r\n count: number;\r\n};\r\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAEE"}
@@ -0,0 +1,4 @@
1
+ export type DeleteResult = {
2
+ affected: number;
3
+ };
4
+ //# sourceMappingURL=delete-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-result.d.ts","sourceRoot":"","sources":["../../../src/lib/dto/delete-result.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=delete-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/dto/delete-result.ts"],"sourcesContent":["export type DeleteResult = {\r\n affected: number;\r\n};\r\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAEE"}
@@ -0,0 +1,10 @@
1
+ export type RelationParam = {
2
+ rid: number;
3
+ rn: string;
4
+ id: number;
5
+ };
6
+ export type UnsetRelationParam = {
7
+ id: number;
8
+ rn: string;
9
+ };
10
+ //# sourceMappingURL=relation-param.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation-param.d.ts","sourceRoot":"","sources":["../../../src/lib/dto/relation-param.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=relation-param.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/dto/relation-param.ts"],"sourcesContent":["export type RelationParam = {\r\n rid: number;\r\n rn: string;\r\n id: number;\r\n};\r\n\r\nexport type UnsetRelationParam = {\r\n id: number;\r\n rn: string;\r\n};\r\n"],"names":[],"rangeMappings":"","mappings":"AAMA,WAGE"}
@@ -0,0 +1,4 @@
1
+ export type UpdateResult = {
2
+ affected: number;
3
+ };
4
+ //# sourceMappingURL=update-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-result.d.ts","sourceRoot":"","sources":["../../../src/lib/dto/update-result.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=update-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/dto/update-result.ts"],"sourcesContent":["export type UpdateResult = {\r\n affected: number;\r\n};\r\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAEE"}
@@ -1,7 +1,10 @@
1
1
  import { CommonOptions } from './common.js';
2
2
  export type __ArrayOptions<P> = {
3
3
  type: 'array';
4
- items: P;
4
+ /**
5
+ * Items options
6
+ */
7
+ items: Readonly<P>;
5
8
  /**
6
9
  * Maximumm allowed size of the array
7
10
  */
@@ -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;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
+ {"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;IAEd;;OAEG;IACH,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEnB;;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\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"}
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\r\n /**\r\n * Items options\r\n */\r\n items: Readonly<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":"AA0BA,WAEE"}
@@ -2,5 +2,5 @@ import { CommonOptions } from './common.js';
2
2
  export type __BigIntegerOptions = {
3
3
  type: 'bigint';
4
4
  };
5
- export type BigIntegerOptions = Readonly<CommonOptions<BigInt> & __BigIntegerOptions>;
5
+ export type BigIntegerOptions = Readonly<CommonOptions<bigint> & __BigIntegerOptions>;
6
6
  //# sourceMappingURL=big-integer.d.ts.map
@@ -1 +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
+ {"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"}
@@ -10,11 +10,11 @@ export type CommonNumberOptions = {
10
10
  /**
11
11
  * Allowed numbers
12
12
  */
13
- enum?: number[];
13
+ enum?: Readonly<number[] | Record<string, unknown>>;
14
14
  /**
15
15
  * Not allowed numbers
16
16
  */
17
- notIn?: number[];
17
+ notIn?: Readonly<number[]>;
18
18
  /**
19
19
  * Check the value is more than the property's value
20
20
  */
@@ -1 +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"}
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,QAAQ,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEpD;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAE3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC"}
@@ -1 +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
+ {"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?: Readonly<number[] | Record<string, unknown>>;\r\n\r\n /**\r\n * Not allowed numbers\r\n */\r\n notIn?: Readonly<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,3 +1,4 @@
1
+ import { DatabaseType } from './database-type.js';
1
2
  import { PropertyType } from './property-type.js';
2
3
  /**
3
4
  * Common property options
@@ -15,6 +16,10 @@ export type CommonOptions<T> = {
15
16
  * Check the property is unique or not
16
17
  */
17
18
  unique?: boolean;
19
+ /**
20
+ *
21
+ */
22
+ readonly?: boolean;
18
23
  /**
19
24
  * Property description
20
25
  */
@@ -34,7 +39,7 @@ export type CommonOptions<T> = {
34
39
  /**
35
40
  * Example values
36
41
  */
37
- examples?: T[];
42
+ examples?: Readonly<T[]>;
38
43
  /**
39
44
  * If ture, the string values are accepted and transformed
40
45
  */
@@ -55,5 +60,17 @@ export type CommonOptions<T> = {
55
60
  * If set, the property only exist if the provided property does not
56
61
  */
57
62
  notWithProperty?: string;
63
+ /**
64
+ * Hash the data
65
+ */
66
+ hash?: boolean;
67
+ /**
68
+ * Encrypt the data
69
+ */
70
+ encrypt?: boolean;
71
+ /**
72
+ * Allows us to pick the right column type for the data
73
+ */
74
+ databaseType?: DatabaseType;
58
75
  };
59
76
  //# 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;;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
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/lib/property/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,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,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;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,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;IAEzB;;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;IAEzB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC"}
@@ -1 +1 @@
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"}
1
+ {"version":3,"sources":["../../../src/lib/property/common.ts"],"sourcesContent":["import { DatabaseType } from './database-type.js';\r\nimport { 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 *\r\n */\r\n readonly?: 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?: Readonly<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 /**\r\n * Hash the data\r\n */\r\n hash?: boolean;\r\n\r\n /**\r\n * Encrypt the data\r\n */\r\n encrypt?: boolean;\r\n\r\n /**\r\n * Allows us to pick the right column type for the data\r\n */\r\n databaseType?: DatabaseType;\r\n};\r\n"],"names":[],"rangeMappings":";;","mappings":"AAGA;;CAEC,GACD,WAqFE"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Represents the database driver types supported by TypeORM.
3
+ * Used in the `type` field of a TypeORM connection configuration.
4
+ */
5
+ export type DatabaseType = 'postgres' | 'mysql' | 'mariadb' | 'sqlite' | 'better-sqlite3' | 'oracle' | 'mssql' | 'cockroachdb' | 'mongodb' | 'sqljs' | 'cordova' | 'react-native' | 'expo' | 'aurora-data-api' | 'aurora-data-api-pg' | 'sap' | 'spanner';
6
+ //# sourceMappingURL=database-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database-type.d.ts","sourceRoot":"","sources":["../../../src/lib/property/database-type.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,YAAY,GAEpB,UAAU,GACV,OAAO,GACP,SAAS,GACT,QAAQ,GACR,gBAAgB,GAChB,QAAQ,GACR,OAAO,GACP,aAAa,GAGb,SAAS,GAGT,OAAO,GACP,SAAS,GACT,cAAc,GACd,MAAM,GACN,iBAAiB,GACjB,oBAAoB,GACpB,KAAK,GACL,SAAS,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Represents the database driver types supported by TypeORM.
3
+ * Used in the `type` field of a TypeORM connection configuration.
4
+ */ export { }; // Google Cloud Spanner using `@google-cloud/spanner`
5
+
6
+ //# sourceMappingURL=database-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/property/database-type.ts"],"sourcesContent":["/**\r\n * Represents the database driver types supported by TypeORM.\r\n * Used in the `type` field of a TypeORM connection configuration.\r\n */\r\nexport type DatabaseType =\r\n // Relational Databases\r\n | 'postgres' // PostgreSQL using `pg`\r\n | 'mysql' // MySQL using `mysql` or `mysql2`\r\n | 'mariadb' // MariaDB using `mysql` or `mysql2`\r\n | 'sqlite' // SQLite using `sqlite3`\r\n | 'better-sqlite3' // SQLite using `better-sqlite3`\r\n | 'oracle' // Oracle using `oracledb`\r\n | 'mssql' // Microsoft SQL Server using `mssql`\r\n | 'cockroachdb' // CockroachDB using `pg` (PostgreSQL-compatible)\r\n\r\n // NoSQL Databases\r\n | 'mongodb' // MongoDB using `mongodb`\r\n\r\n // Other/Experimental\r\n | 'sqljs' // SQL.js (SQLite in JavaScript)\r\n | 'cordova' // Cordova SQLite plugin\r\n | 'react-native' // React Native SQLite plugin\r\n | 'expo' // Expo SQLite plugin\r\n | 'aurora-data-api' // AWS Aurora Data API (MySQL/PostgreSQL)\r\n | 'aurora-data-api-pg' // AWS Aurora Data API (PostgreSQL-specific)\r\n | 'sap' // SAP HANA using `@sap/hana-client`\r\n | 'spanner'; // Google Cloud Spanner using `@google-cloud/spanner`\r\n"],"names":[],"rangeMappings":";;;","mappings":"AAAA;;;CAGC,GACD,WAsBc,CAAC,qDAAqD"}
@@ -50,5 +50,5 @@ export type __DateOptions = {
50
50
  */
51
51
  sameHourAsProperty?: string;
52
52
  };
53
- export type DateOptions = Readonly<CommonOptions<Date> & __DateOptions>;
53
+ export type DateOptions = Readonly<CommonOptions<string> & __DateOptions>;
54
54
  //# sourceMappingURL=date.d.ts.map
@@ -1 +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"}
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,MAAM,CAAC,GAAG,aAAa,CAAC,CAAC"}
@@ -1 +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
+ {"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<string> & __DateOptions>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAkEA,WAA0E"}
@@ -17,11 +17,11 @@ export type __StringOptions = {
17
17
  /**
18
18
  * Allowed strings
19
19
  */
20
- enum?: string[];
20
+ enum?: Readonly<unknown[] | Record<string, unknown>>;
21
21
  /**
22
22
  * Not allowed strings
23
23
  */
24
- notIn?: string[];
24
+ notIn?: Readonly<string[]>;
25
25
  /**
26
26
  * string starts with
27
27
  */
@@ -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;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
+ {"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,QAAQ,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAErD;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAE3B;;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\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"}
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?: Readonly<unknown[] | Record<string, unknown>>;\r\n\r\n /**\r\n * Not allowed strings\r\n */\r\n notIn?: Readonly<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"}
@@ -1,3 +1,6 @@
1
1
  import { KeyOf } from './key-of.js';
2
- export type Keys<T> = KeyOf<T>[];
2
+ export type Keys<T = any> = KeyOf<T>[];
3
+ export declare function keys<T extends {
4
+ [key: string]: any;
5
+ }>(instance: T): Keys<T>;
3
6
  //# sourceMappingURL=keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC"}
1
+ {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/keys.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,MAAM,IAAI,CAAC,CAAC,GAAG,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAEvC,wBAAgB,IAAI,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAE3E"}
@@ -1,3 +1,5 @@
1
- export { };
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */ export function keys(instance) {
2
+ return Object.keys(instance);
3
+ }
2
4
 
3
5
  //# sourceMappingURL=keys.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/utils/keys.ts"],"sourcesContent":["import { KeyOf } from './key-of.js';\r\n\r\nexport type Keys<T> = KeyOf<T>[];\r\n"],"names":[],"rangeMappings":"","mappings":"AAEA,WAAiC"}
1
+ {"version":3,"sources":["../../../src/lib/utils/keys.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { KeyOf } from './key-of.js';\r\n\r\nexport type Keys<T = any> = KeyOf<T>[];\r\n\r\nexport function keys<T extends { [key: string]: any }>(instance: T): Keys<T> {\r\n return Object.keys(instance) as Keys<T>;\r\n}\r\n"],"names":["keys","instance","Object"],"rangeMappings":";;","mappings":"AAAA,qDAAqD,GAKrD,OAAO,SAASA,KAAuCC,QAAW;IAChE,OAAOC,OAAOF,IAAI,CAACC;AACrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,QAAQ;IAC7C,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACzB"}
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/type.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,IAAI,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,QAAQ;IAC7C,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACzB"}
@@ -1,3 +1,4 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
1
2
  export { };
2
3
 
3
4
  //# sourceMappingURL=type.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/utils/type.ts"],"sourcesContent":["export interface Type<T = any> extends Function {\r\n new (...args: any[]): T;\r\n}\r\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAEC"}
1
+ {"version":3,"sources":["../../../src/lib/utils/type.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\r\nexport interface Type<T = any> extends Function {\r\n new (...args: any[]): T;\r\n}\r\n"],"names":[],"rangeMappings":";","mappings":"AAAA,sEAAsE;AACtE,WAEC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puq/type",
3
- "version": "0.0.15",
3
+ "version": "0.0.20",
4
4
  "displayName": "@puq/type",
5
5
  "license": "MIT",
6
6
  "publishConfig": {