@puq/type 0.0.8 → 0.0.10

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 (89) hide show
  1. package/dist/index.d.ts +20 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +21 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/model/base.d.ts +4 -0
  6. package/dist/lib/model/base.d.ts.map +1 -0
  7. package/dist/lib/model/base.js +3 -0
  8. package/dist/lib/model/base.js.map +1 -0
  9. package/dist/lib/model/id.d.ts +4 -0
  10. package/dist/lib/model/id.d.ts.map +1 -0
  11. package/dist/lib/model/id.js +3 -0
  12. package/dist/lib/model/id.js.map +1 -0
  13. package/dist/lib/model/timestamp.d.ts +6 -0
  14. package/dist/lib/model/timestamp.d.ts.map +1 -0
  15. package/dist/lib/model/timestamp.js +3 -0
  16. package/dist/lib/model/timestamp.js.map +1 -0
  17. package/dist/lib/property/array.d.ts +13 -0
  18. package/dist/lib/property/array.d.ts.map +1 -0
  19. package/dist/lib/property/array.js +3 -0
  20. package/dist/lib/property/array.js.map +1 -0
  21. package/dist/lib/property/boolean.d.ts +10 -0
  22. package/dist/lib/property/boolean.d.ts.map +1 -0
  23. package/dist/lib/property/boolean.js +3 -0
  24. package/dist/lib/property/boolean.js.map +1 -0
  25. package/dist/lib/property/common.d.ts +9 -0
  26. package/dist/lib/property/common.d.ts.map +1 -0
  27. package/dist/lib/property/common.js +3 -0
  28. package/dist/lib/property/common.js.map +1 -0
  29. package/dist/lib/property/integer-format.d.ts +2 -0
  30. package/dist/lib/property/integer-format.d.ts.map +1 -0
  31. package/dist/lib/property/integer-format.js +3 -0
  32. package/dist/lib/property/integer-format.js.map +1 -0
  33. package/dist/lib/property/integer.d.ts +16 -0
  34. package/dist/lib/property/integer.d.ts.map +1 -0
  35. package/dist/lib/property/integer.js +3 -0
  36. package/dist/lib/property/integer.js.map +1 -0
  37. package/dist/lib/property/number-format.d.ts +2 -0
  38. package/dist/lib/property/number-format.d.ts.map +1 -0
  39. package/dist/lib/property/number-format.js +3 -0
  40. package/dist/lib/property/number-format.js.map +1 -0
  41. package/dist/lib/property/number.d.ts +16 -0
  42. package/dist/lib/property/number.d.ts.map +1 -0
  43. package/dist/lib/property/number.js +3 -0
  44. package/dist/lib/property/number.js.map +1 -0
  45. package/dist/lib/property/object.d.ts +12 -0
  46. package/dist/lib/property/object.d.ts.map +1 -0
  47. package/dist/lib/property/object.js +3 -0
  48. package/dist/lib/property/object.js.map +1 -0
  49. package/dist/lib/property/property-type.d.ts +2 -0
  50. package/dist/lib/property/property-type.d.ts.map +1 -0
  51. package/dist/lib/property/property-type.js +3 -0
  52. package/dist/lib/property/property-type.js.map +1 -0
  53. package/dist/lib/property/property.d.ts +9 -0
  54. package/dist/lib/property/property.d.ts.map +1 -0
  55. package/dist/lib/property/property.js +3 -0
  56. package/dist/lib/property/property.js.map +1 -0
  57. package/dist/lib/property/string-format.d.ts +2 -0
  58. package/dist/lib/property/string-format.d.ts.map +1 -0
  59. package/dist/lib/property/string-format.js +3 -0
  60. package/dist/lib/property/string-format.js.map +1 -0
  61. package/dist/lib/property/string.d.ts +19 -0
  62. package/dist/lib/property/string.d.ts.map +1 -0
  63. package/dist/lib/property/string.js +3 -0
  64. package/dist/lib/property/string.js.map +1 -0
  65. package/dist/lib/utils/key-of.d.ts +2 -0
  66. package/dist/lib/utils/key-of.d.ts.map +1 -0
  67. package/dist/lib/utils/key-of.js +3 -0
  68. package/dist/lib/utils/key-of.js.map +1 -0
  69. package/dist/lib/utils/keys.d.ts +3 -0
  70. package/dist/lib/utils/keys.d.ts.map +1 -0
  71. package/dist/lib/utils/keys.js +3 -0
  72. package/dist/lib/utils/keys.js.map +1 -0
  73. package/dist/lib/utils/pick-optional.d.ts +3 -0
  74. package/dist/lib/utils/pick-optional.d.ts.map +1 -0
  75. package/dist/lib/utils/pick-optional.js +3 -0
  76. package/dist/lib/utils/pick-optional.js.map +1 -0
  77. package/dist/lib/utils/pick-required.d.ts +3 -0
  78. package/dist/lib/utils/pick-required.d.ts.map +1 -0
  79. package/dist/lib/utils/pick-required.js +3 -0
  80. package/dist/lib/utils/pick-required.js.map +1 -0
  81. package/dist/lib/utils/type.d.ts +4 -0
  82. package/dist/lib/utils/type.d.ts.map +1 -0
  83. package/dist/lib/utils/type.js +3 -0
  84. package/dist/lib/utils/type.js.map +1 -0
  85. package/package.json +1 -1
  86. package/dist/lib/type.d.ts +0 -6
  87. package/dist/lib/type.d.ts.map +0 -1
  88. package/dist/lib/type.js +0 -8
  89. package/dist/lib/type.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,2 +1,21 @@
1
- export * from './lib/type.js';
1
+ export * from './lib/model/base.js';
2
+ export * from './lib/model/id.js';
3
+ export * from './lib/model/timestamp.js';
4
+ export * from './lib/property/array.js';
5
+ export * from './lib/property/boolean.js';
6
+ export * from './lib/property/common.js';
7
+ export * from './lib/property/integer-format.js';
8
+ export * from './lib/property/integer.js';
9
+ export * from './lib/property/number-format.js';
10
+ export * from './lib/property/number.js';
11
+ export * from './lib/property/object.js';
12
+ export * from './lib/property/property-type.js';
13
+ export * from './lib/property/property.js';
14
+ export * from './lib/property/string-format.js';
15
+ export * from './lib/property/string.js';
16
+ export * from './lib/utils/key-of.js';
17
+ export * from './lib/utils/keys.js';
18
+ export * from './lib/utils/pick-optional.js';
19
+ export * from './lib/utils/pick-required.js';
20
+ export * from './lib/utils/type.js';
2
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,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,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"}
package/dist/index.js CHANGED
@@ -1,3 +1,23 @@
1
- export * from './lib/type.js';
1
+ // @index('./**/*.ts', f => `export * from '${f.path}.js'`)
2
+ export * from './lib/model/base.js';
3
+ export * from './lib/model/id.js';
4
+ export * from './lib/model/timestamp.js';
5
+ export * from './lib/property/array.js';
6
+ export * from './lib/property/boolean.js';
7
+ export * from './lib/property/common.js';
8
+ export * from './lib/property/integer-format.js';
9
+ export * from './lib/property/integer.js';
10
+ export * from './lib/property/number-format.js';
11
+ export * from './lib/property/number.js';
12
+ export * from './lib/property/object.js';
13
+ export * from './lib/property/property-type.js';
14
+ export * from './lib/property/property.js';
15
+ export * from './lib/property/string-format.js';
16
+ export * from './lib/property/string.js';
17
+ export * from './lib/utils/key-of.js';
18
+ export * from './lib/utils/keys.js';
19
+ export * from './lib/utils/pick-optional.js';
20
+ export * from './lib/utils/pick-required.js';
21
+ export * from './lib/utils/type.js';
2
22
 
3
23
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './lib/type.js';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,gBAAgB"}
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":";;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,2DAA2D;AAC3D,cAAc,sBAAsB;AACpC,cAAc,oBAAoB;AAClC,cAAc,2BAA2B;AACzC,cAAc,0BAA0B;AACxC,cAAc,4BAA4B;AAC1C,cAAc,2BAA2B;AACzC,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
+ import { IDModel } from './id.js';
2
+ import { TimestampModel } from './timestamp.js';
3
+ export type BaseModel = IDModel & TimestampModel;
4
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/lib/model/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/model/base.ts"],"sourcesContent":["import { IDModel } from './id.js';\r\nimport { TimestampModel } from './timestamp.js';\r\n\r\nexport type BaseModel = IDModel & TimestampModel;\r\n"],"names":[],"rangeMappings":"","mappings":"AAGA,WAAiD"}
@@ -0,0 +1,4 @@
1
+ export type IDModel = {
2
+ id: number;
3
+ };
4
+ //# sourceMappingURL=id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../src/lib/model/id.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/model/id.ts"],"sourcesContent":["export type IDModel = {\r\n id: number;\r\n};\r\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAEE"}
@@ -0,0 +1,6 @@
1
+ export type TimestampModel = {
2
+ createdAt: Date;
3
+ updatedAt: Date;
4
+ deletedAt: Date;
5
+ };
6
+ //# sourceMappingURL=timestamp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../../../src/lib/model/timestamp.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=timestamp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/model/timestamp.ts"],"sourcesContent":["export type TimestampModel = {\r\n createdAt: Date;\r\n updatedAt: Date;\r\n deletedAt: Date;\r\n};\r\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAIE"}
@@ -0,0 +1,13 @@
1
+ import { CommonOptions } from './common.js';
2
+ export type __ArrayOptions<P> = {
3
+ type: 'array';
4
+ items: P;
5
+ minSize?: number;
6
+ maxSize?: number;
7
+ default?: any[];
8
+ example?: any[];
9
+ examples?: any[][];
10
+ isJSON?: boolean;
11
+ };
12
+ export type ArrayOptions<P> = CommonOptions & __ArrayOptions<P>;
13
+ //# sourceMappingURL=array.d.ts.map
@@ -0,0 +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;IACT,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,aAAa,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=array.js.map
@@ -0,0 +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 minSize?: number;\r\n maxSize?: number;\r\n default?: any[];\r\n example?: any[];\r\n examples?: any[][];\r\n isJSON?: boolean;\r\n};\r\n\r\nexport type ArrayOptions<P> = CommonOptions & __ArrayOptions<P>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAaA,WAAgE"}
@@ -0,0 +1,10 @@
1
+ import { CommonOptions } from './common.js';
2
+ export type __BooleanOptions = {
3
+ type: 'boolean';
4
+ default: boolean;
5
+ example: boolean;
6
+ examples: boolean[];
7
+ isBooleanString?: boolean;
8
+ };
9
+ export type BooleanOptions = CommonOptions & __BooleanOptions;
10
+ //# sourceMappingURL=boolean.d.ts.map
@@ -0,0 +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;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=boolean.js.map
@@ -0,0 +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 default: boolean;\r\n example: boolean;\r\n examples: boolean[];\r\n isBooleanString?: boolean;\r\n};\r\n\r\nexport type BooleanOptions = CommonOptions & __BooleanOptions;\r\n"],"names":[],"rangeMappings":"","mappings":"AAUA,WAA8D"}
@@ -0,0 +1,9 @@
1
+ import { PropertyType } from './property-type.js';
2
+ export type CommonOptions = {
3
+ type: PropertyType;
4
+ required?: boolean;
5
+ unique?: boolean;
6
+ description?: string;
7
+ default?: any;
8
+ };
9
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +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,GAAG;IAC1B,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,GAAG,CAAC;CACf,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=common.js.map
@@ -0,0 +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?: any;\r\n};\r\n"],"names":[],"rangeMappings":"","mappings":"AAEA,WAME"}
@@ -0,0 +1,2 @@
1
+ export type IntegerFormat = 'positive' | 'percent' | 'rate' | 'digit';
2
+ //# sourceMappingURL=integer-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integer-format.d.ts","sourceRoot":"","sources":["../../../src/lib/property/integer-format.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=integer-format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/property/integer-format.ts"],"sourcesContent":["export type IntegerFormat = 'positive' | 'percent' | 'rate' | 'digit';\r\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAAsE"}
@@ -0,0 +1,16 @@
1
+ import { CommonOptions } from './common.js';
2
+ import { IntegerFormat } from './integer-format.js';
3
+ export type __IntegerOptions = {
4
+ type: 'integer';
5
+ minimum?: number;
6
+ maximum?: number;
7
+ integerFormat?: IntegerFormat;
8
+ enum?: number[];
9
+ notIn?: number[];
10
+ default?: number;
11
+ example?: number;
12
+ examples?: number[];
13
+ isIntegerString?: boolean;
14
+ };
15
+ export type IntegerOptions = __IntegerOptions & CommonOptions;
16
+ //# sourceMappingURL=integer.d.ts.map
@@ -0,0 +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;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=integer.js.map
@@ -0,0 +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 minimum?: number;\r\n maximum?: number;\r\n integerFormat?: IntegerFormat;\r\n enum?: number[];\r\n notIn?: number[];\r\n default?: number;\r\n example?: number;\r\n examples?: number[];\r\n isIntegerString?: boolean;\r\n};\r\n\r\nexport type IntegerOptions = __IntegerOptions & CommonOptions;\r\n"],"names":[],"rangeMappings":"","mappings":"AAgBA,WAA8D"}
@@ -0,0 +1,2 @@
1
+ export type NumberFormat = 'positive' | 'percent' | 'rate' | 'digit' | 'fraction';
2
+ //# sourceMappingURL=number-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-format.d.ts","sourceRoot":"","sources":["../../../src/lib/property/number-format.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GACpB,UAAU,GACV,SAAS,GACT,MAAM,GACN,OAAO,GACP,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=number-format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/property/number-format.ts"],"sourcesContent":["export type NumberFormat =\r\n | 'positive'\r\n | 'percent'\r\n | 'rate'\r\n | 'digit'\r\n | 'fraction';\r\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAKe"}
@@ -0,0 +1,16 @@
1
+ import { CommonOptions } from './common.js';
2
+ import { NumberFormat } from './number-format.js';
3
+ export type __NumberOptions = {
4
+ type: 'number';
5
+ minimum?: number;
6
+ maximum?: number;
7
+ numberFormat?: NumberFormat;
8
+ enum?: number[];
9
+ notIn?: number[];
10
+ default?: number;
11
+ example?: number;
12
+ examples?: number[];
13
+ isNumberString?: boolean;
14
+ };
15
+ export type NumberOptions = CommonOptions & __NumberOptions;
16
+ //# sourceMappingURL=number.d.ts.map
@@ -0,0 +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;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=number.js.map
@@ -0,0 +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 minimum?: number;\r\n maximum?: number;\r\n numberFormat?: NumberFormat;\r\n enum?: number[];\r\n notIn?: number[];\r\n default?: number;\r\n example?: number;\r\n examples?: number[];\r\n isNumberString?: boolean;\r\n};\r\n\r\nexport type NumberOptions = CommonOptions & __NumberOptions;\r\n"],"names":[],"rangeMappings":"","mappings":"AAgBA,WAA4D"}
@@ -0,0 +1,12 @@
1
+ import { Type } from '../utils/type.js';
2
+ import { CommonOptions } from './common.js';
3
+ export type __ObjectOptions<T = any> = {
4
+ type: 'object';
5
+ target: () => Type;
6
+ default?: T;
7
+ example?: T;
8
+ examples?: T[];
9
+ isJSON?: boolean;
10
+ };
11
+ export type ObjectOptions<T = any> = CommonOptions & __ObjectOptions<T>;
12
+ //# sourceMappingURL=object.d.ts.map
@@ -0,0 +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,CAAC,CAAC,GAAG,GAAG,IAAI;IACrC,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,CAAC;IACZ,OAAO,CAAC,EAAE,CAAC,CAAC;IACZ,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,GAAG,IAAI,aAAa,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=object.js.map
@@ -0,0 +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<T = any> = {\r\n type: 'object';\r\n target: () => Type;\r\n default?: T;\r\n example?: T;\r\n examples?: T[];\r\n isJSON?: boolean;\r\n};\r\n\r\nexport type ObjectOptions<T = any> = CommonOptions & __ObjectOptions<T>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAYA,WAAwE"}
@@ -0,0 +1,2 @@
1
+ export type PropertyType = 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
2
+ //# sourceMappingURL=property-type.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=property-type.js.map
@@ -0,0 +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,WAMa"}
@@ -0,0 +1,9 @@
1
+ import { ArrayOptions } from './array.js';
2
+ import { BooleanOptions } from './boolean.js';
3
+ import { IntegerOptions } from './integer.js';
4
+ import { NumberOptions } from './number.js';
5
+ import { ObjectOptions } from './object.js';
6
+ 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
+ //# sourceMappingURL=property.d.ts.map
@@ -0,0 +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,CAC7C,iBAAiB,CAAC,iBAAiB,CAAC,CACrC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=property.js.map
@@ -0,0 +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 = __PropertyOptions<\r\n __PropertyOptions<__PropertyOptions>\r\n>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAeA,WAEE"}
@@ -0,0 +1,2 @@
1
+ export type StringFormat = 'email' | 'phone' | 'password' | 'uuid' | 'ip4' | 'ip6';
2
+ //# sourceMappingURL=string-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-format.d.ts","sourceRoot":"","sources":["../../../src/lib/property/string-format.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GACpB,OAAO,GACP,OAAO,GACP,UAAU,GACV,MAAM,GACN,KAAK,GACL,KAAK,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=string-format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/property/string-format.ts"],"sourcesContent":["export type StringFormat =\r\n | 'email'\r\n | 'phone'\r\n | 'password'\r\n | 'uuid'\r\n | 'ip4'\r\n | 'ip6';\r\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAMU"}
@@ -0,0 +1,19 @@
1
+ import { CommonOptions } from './common.js';
2
+ import { StringFormat } from './string-format.js';
3
+ export type __StringOptions = {
4
+ type: 'string';
5
+ minLength?: number;
6
+ maxLength?: number;
7
+ stringFormat?: StringFormat;
8
+ enum?: string[];
9
+ notIn?: string[];
10
+ startsWith?: string;
11
+ endsWith?: string;
12
+ contains?: string;
13
+ notContains?: string;
14
+ default?: string;
15
+ example?: string;
16
+ examples?: string[];
17
+ };
18
+ export type StringOptions = CommonOptions & __StringOptions;
19
+ //# sourceMappingURL=string.d.ts.map
@@ -0,0 +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;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=string.js.map
@@ -0,0 +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 startsWith?: string;\r\n endsWith?: string;\r\n contains?: string;\r\n notContains?: string;\r\n default?: string;\r\n example?: string;\r\n examples?: string[];\r\n};\r\n\r\nexport type StringOptions = CommonOptions & __StringOptions;\r\n"],"names":[],"rangeMappings":"","mappings":"AAmBA,WAA4D"}
@@ -0,0 +1,2 @@
1
+ export type KeyOf<T> = keyof T;
2
+ //# sourceMappingURL=key-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-of.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/key-of.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=key-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/utils/key-of.ts"],"sourcesContent":["export type KeyOf<T> = keyof T;\r\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAA+B"}
@@ -0,0 +1,3 @@
1
+ import { KeyOf } from './key-of.js';
2
+ export type Keys<T> = KeyOf<T>[];
3
+ //# sourceMappingURL=keys.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=keys.js.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ import { KeyOf } from './key-of.js';
2
+ export type PickOptional<T, R extends KeyOf<T>> = Omit<T, R> & Partial<Pick<T, R>>;
3
+ //# sourceMappingURL=pick-optional.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pick-optional.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/pick-optional.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=pick-optional.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/utils/pick-optional.ts"],"sourcesContent":["import { KeyOf } from './key-of.js';\r\n\r\nexport type PickOptional<T, R extends KeyOf<T>> = Omit<T, R> &\r\n Partial<Pick<T, R>>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAEA,WACsB"}
@@ -0,0 +1,3 @@
1
+ import { KeyOf } from './key-of.js';
2
+ export type PickRequired<T, R extends KeyOf<T>> = Omit<T, R> & Required<Pick<T, R>>;
3
+ //# sourceMappingURL=pick-required.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pick-required.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/pick-required.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1D,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=pick-required.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/utils/pick-required.ts"],"sourcesContent":["import { KeyOf } from './key-of.js';\r\n\r\nexport type PickRequired<T, R extends KeyOf<T>> = Omit<T, R> &\r\n Required<Pick<T, R>>;\r\n"],"names":[],"rangeMappings":"","mappings":"AAEA,WACuB"}
@@ -0,0 +1,4 @@
1
+ export interface Type<T = any> extends Function {
2
+ new (...args: any[]): T;
3
+ }
4
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=type.js.map
@@ -0,0 +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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puq/type",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "displayName": "@puq/type",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -1,6 +0,0 @@
1
- /**
2
- * Return the text `type`
3
- * @returns
4
- */
5
- export declare function type(): string;
6
- //# sourceMappingURL=type.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/lib/type.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,IAAI,IAAI,MAAM,CAE7B"}
package/dist/lib/type.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * Return the text `type`
3
- * @returns
4
- */ export function type() {
5
- return 'type';
6
- }
7
-
8
- //# sourceMappingURL=type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/type.ts"],"sourcesContent":["/**\n * Return the text `type`\n * @returns\n */\nexport function type(): string {\n return 'type';\n}\n"],"names":["type"],"rangeMappings":";;;;;","mappings":"AAAA;;;CAGC,GACD,OAAO,SAASA;IACd,OAAO;AACT"}