@bemedev/typings 0.0.2 → 0.2.0

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 (120) hide show
  1. package/README.md +12 -11
  2. package/lib/constants.cjs +26 -18
  3. package/lib/constants.cjs.map +1 -1
  4. package/lib/constants.d.ts +3 -4
  5. package/lib/constants.js +24 -15
  6. package/lib/constants.js.map +1 -1
  7. package/lib/helpers/any.cjs +4 -4
  8. package/lib/helpers/any.cjs.map +1 -1
  9. package/lib/helpers/any.d.ts +2 -3
  10. package/lib/helpers/any.js +4 -2
  11. package/lib/helpers/any.js.map +1 -1
  12. package/lib/helpers/array.cjs +6 -7
  13. package/lib/helpers/array.cjs.map +1 -1
  14. package/lib/helpers/array.d.ts +2 -3
  15. package/lib/helpers/array.js +6 -5
  16. package/lib/helpers/array.js.map +1 -1
  17. package/lib/helpers/custom.cjs +6 -9
  18. package/lib/helpers/custom.cjs.map +1 -1
  19. package/lib/helpers/custom.d.ts +0 -1
  20. package/lib/helpers/custom.js +6 -7
  21. package/lib/helpers/custom.js.map +1 -1
  22. package/lib/helpers/index.cjs +27 -30
  23. package/lib/helpers/index.d.ts +13 -13
  24. package/lib/helpers/index.js +14 -13
  25. package/lib/helpers/intersection.cjs +10 -11
  26. package/lib/helpers/intersection.cjs.map +1 -1
  27. package/lib/helpers/intersection.d.ts +0 -1
  28. package/lib/helpers/intersection.js +10 -9
  29. package/lib/helpers/intersection.js.map +1 -1
  30. package/lib/helpers/litterals.cjs +4 -4
  31. package/lib/helpers/litterals.cjs.map +1 -1
  32. package/lib/helpers/litterals.d.ts +0 -1
  33. package/lib/helpers/litterals.js +4 -2
  34. package/lib/helpers/litterals.js.map +1 -1
  35. package/lib/helpers/optional.cjs +7 -0
  36. package/lib/helpers/optional.cjs.map +1 -0
  37. package/lib/helpers/optional.d.ts +3 -0
  38. package/lib/helpers/optional.js +7 -0
  39. package/lib/helpers/optional.js.map +1 -0
  40. package/lib/helpers/partial.cjs +11 -12
  41. package/lib/helpers/partial.cjs.map +1 -1
  42. package/lib/helpers/partial.d.ts +2 -3
  43. package/lib/helpers/partial.js +11 -10
  44. package/lib/helpers/partial.js.map +1 -1
  45. package/lib/helpers/primitiveObject.cjs +10 -0
  46. package/lib/helpers/primitiveObject.cjs.map +1 -0
  47. package/lib/helpers/primitiveObject.d.ts +5 -0
  48. package/lib/helpers/primitiveObject.js +11 -0
  49. package/lib/helpers/primitiveObject.js.map +1 -0
  50. package/lib/helpers/record.cjs +8 -9
  51. package/lib/helpers/record.cjs.map +1 -1
  52. package/lib/helpers/record.d.ts +2 -3
  53. package/lib/helpers/record.js +8 -7
  54. package/lib/helpers/record.js.map +1 -1
  55. package/lib/helpers/soa.cjs +6 -7
  56. package/lib/helpers/soa.cjs.map +1 -1
  57. package/lib/helpers/soa.d.ts +2 -3
  58. package/lib/helpers/soa.js +6 -5
  59. package/lib/helpers/soa.js.map +1 -1
  60. package/lib/helpers/sv.cjs +4 -4
  61. package/lib/helpers/sv.cjs.map +1 -1
  62. package/lib/helpers/sv.d.ts +0 -1
  63. package/lib/helpers/sv.js +4 -2
  64. package/lib/helpers/sv.js.map +1 -1
  65. package/lib/helpers/tuple.cjs +4 -4
  66. package/lib/helpers/tuple.cjs.map +1 -1
  67. package/lib/helpers/tuple.d.ts +2 -3
  68. package/lib/helpers/tuple.js +4 -2
  69. package/lib/helpers/tuple.js.map +1 -1
  70. package/lib/helpers/union.cjs +7 -10
  71. package/lib/helpers/union.cjs.map +1 -1
  72. package/lib/helpers/union.d.ts +4 -5
  73. package/lib/helpers/union.js +7 -8
  74. package/lib/helpers/union.js.map +1 -1
  75. package/lib/index.cjs +40 -40
  76. package/lib/index.d.ts +1 -2
  77. package/lib/index.js +18 -15
  78. package/lib/type.d.ts +2 -0
  79. package/lib/type.types.d.ts +18 -0
  80. package/lib/types.d.ts +34 -25
  81. package/lib/utils/expandFn.cjs +10 -9
  82. package/lib/utils/expandFn.cjs.map +1 -1
  83. package/lib/utils/expandFn.d.ts +1 -4
  84. package/lib/utils/expandFn.js +9 -7
  85. package/lib/utils/expandFn.js.map +1 -1
  86. package/package.json +31 -32
  87. package/lib/constants.d.ts.map +0 -1
  88. package/lib/helpers/any.d.ts.map +0 -1
  89. package/lib/helpers/array.d.ts.map +0 -1
  90. package/lib/helpers/custom.d.ts.map +0 -1
  91. package/lib/helpers/index.cjs.map +0 -1
  92. package/lib/helpers/index.d.ts.map +0 -1
  93. package/lib/helpers/index.js.map +0 -1
  94. package/lib/helpers/intersection.d.ts.map +0 -1
  95. package/lib/helpers/litterals.d.ts.map +0 -1
  96. package/lib/helpers/maybe.cjs +0 -10
  97. package/lib/helpers/maybe.cjs.map +0 -1
  98. package/lib/helpers/maybe.d.ts +0 -4
  99. package/lib/helpers/maybe.d.ts.map +0 -1
  100. package/lib/helpers/maybe.js +0 -8
  101. package/lib/helpers/maybe.js.map +0 -1
  102. package/lib/helpers/partial.d.ts.map +0 -1
  103. package/lib/helpers/record.d.ts.map +0 -1
  104. package/lib/helpers/soa.d.ts.map +0 -1
  105. package/lib/helpers/sv.d.ts.map +0 -1
  106. package/lib/helpers/tuple.d.ts.map +0 -1
  107. package/lib/helpers/union.d.ts.map +0 -1
  108. package/lib/index.cjs.map +0 -1
  109. package/lib/index.d.ts.map +0 -1
  110. package/lib/index.js.map +0 -1
  111. package/lib/transform.cjs +0 -63
  112. package/lib/transform.cjs.map +0 -1
  113. package/lib/transform.d.ts +0 -3
  114. package/lib/transform.d.ts.map +0 -1
  115. package/lib/transform.js +0 -61
  116. package/lib/transform.js.map +0 -1
  117. package/lib/transform.types.d.ts +0 -18
  118. package/lib/transform.types.d.ts.map +0 -1
  119. package/lib/types.d.ts.map +0 -1
  120. package/lib/utils/expandFn.d.ts.map +0 -1
package/README.md CHANGED
@@ -5,24 +5,24 @@ Typings by variables
5
5
  ## Usage
6
6
 
7
7
  ```ts
8
- import { transform } from '@bemedev/typings';
8
+ import { type } from "@bemedev/typings";
9
9
 
10
- const result = transform(({ array, maybe, intersection }) => ({
11
- nodes: maybe(
10
+ const result = type(({ array, optional, intersection }) => ({
11
+ nodes: optional(
12
12
  array(
13
13
  intersection(
14
14
  {
15
15
  position: {
16
- x: 'number',
17
- y: 'number',
16
+ x: "number",
17
+ y: "number",
18
18
  },
19
19
  data: {
20
- label: maybe('string'),
21
- content: 'string',
20
+ label: optional("string"),
21
+ content: "string",
22
22
  },
23
- input: 'boolean',
23
+ input: "boolean",
24
24
  },
25
- { id: 'string' },
25
+ { id: "string" },
26
26
  ),
27
27
  ),
28
28
  ),
@@ -47,8 +47,9 @@ expectTypeOf(result).toEqualTypeOf<{
47
47
  - `custom`: Custom type
48
48
  - `intersection`: Intersection of types
49
49
  - `litterals`: Literal types
50
- - `maybe`: Optional types
50
+ - `optional`: Optional types
51
51
  - `partial`: Partial types
52
+ - `primitiveObject`: Primitive object schema
52
53
  - `record`: Record types
53
54
  - `soa`: Single or Array types
54
55
  - `sv`: State Value
@@ -61,7 +62,7 @@ expectTypeOf(result).toEqualTypeOf<{
61
62
 
62
63
  MIT
63
64
 
64
- ## [CHANGE_LOG](CHANGE_LOG.md)
65
+ ## [CHANGELOG](CHANGELOG.md)
65
66
 
66
67
  ## Auteur
67
68
 
package/lib/constants.cjs CHANGED
@@ -1,26 +1,34 @@
1
- 'use strict';
2
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/constants.ts
3
3
  const PRIMITIVES = [
4
- 'string',
5
- 'number',
6
- 'boolean',
7
- 'bigint',
8
- 'symbol',
9
- 'undefined',
10
- 'null',
4
+ "string",
5
+ "number",
6
+ "boolean",
7
+ "bigint",
8
+ "symbol",
9
+ "undefined",
10
+ "null",
11
+ "unknown",
12
+ "never",
13
+ "primitive"
11
14
  ];
12
- const PRIMITIVE_OBJECTS = ['date', 'primitive'];
13
- const MAYBE = '$$app-ts => maybe$$';
14
- const CUSTOM = '$$app-ts => custom$$';
15
- const PARTIAL = '$$app-ts => partial$$';
16
- const ARRAY = '$$app-ts => array$$';
17
- const SOA = '$$app-ts => soa$$';
18
-
15
+ const PRIMITIVE_OBJECTS = [
16
+ "date",
17
+ "any",
18
+ "object"
19
+ ];
20
+ const OPTIONAL = "$$app-ts => optional$$";
21
+ const CUSTOM = "$$app-ts => custom$$";
22
+ const PARTIAL = "$$app-ts => partial$$";
23
+ const ARRAY = "$$app-ts => array$$";
24
+ const SOA = "$$app-ts => soa$$";
25
+ //#endregion
19
26
  exports.ARRAY = ARRAY;
20
27
  exports.CUSTOM = CUSTOM;
21
- exports.MAYBE = MAYBE;
28
+ exports.OPTIONAL = OPTIONAL;
22
29
  exports.PARTIAL = PARTIAL;
23
30
  exports.PRIMITIVES = PRIMITIVES;
24
31
  exports.PRIMITIVE_OBJECTS = PRIMITIVE_OBJECTS;
25
32
  exports.SOA = SOA;
26
- //# sourceMappingURL=constants.cjs.map
33
+
34
+ //# sourceMappingURL=constants.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs","sources":["../src/constants.ts"],"sourcesContent":["export const PRIMITIVES = [\n 'string',\n 'number',\n 'boolean',\n 'bigint',\n 'symbol',\n 'undefined',\n 'null',\n] as const;\n\nexport const PRIMITIVE_OBJECTS = ['date', 'primitive'] as const;\nexport const MAYBE = '$$app-ts => maybe$$' as const;\nexport const CUSTOM = '$$app-ts => custom$$' as const;\nexport const PARTIAL = '$$app-ts => partial$$' as const;\nexport const ARRAY = '$$app-ts => array$$' as const;\nexport const SOA = '$$app-ts => soa$$' as const;\n"],"names":[],"mappings":";;AAAO,MAAM,UAAU,GAAG;IACxB,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,MAAM;;MAGK,iBAAiB,GAAG,CAAC,MAAM,EAAE,WAAW;AAC9C,MAAM,KAAK,GAAG;AACd,MAAM,MAAM,GAAG;AACf,MAAM,OAAO,GAAG;AAChB,MAAM,KAAK,GAAG;AACd,MAAM,GAAG,GAAG;;;;;;;;;;"}
1
+ {"version":3,"file":"constants.cjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["export const PRIMITIVES = [\n \"string\",\n \"number\",\n \"boolean\",\n \"bigint\",\n \"symbol\",\n \"undefined\",\n \"null\",\n \"unknown\",\n \"never\",\n \"primitive\",\n] as const;\n\nexport const PRIMITIVE_OBJECTS = [\"date\", \"any\", \"object\"] as const;\nexport const OPTIONAL = \"$$app-ts => optional$$\" as const;\nexport const CUSTOM = \"$$app-ts => custom$$\" as const;\nexport const PARTIAL = \"$$app-ts => partial$$\" as const;\nexport const ARRAY = \"$$app-ts => array$$\" as const;\nexport const SOA = \"$$app-ts => soa$$\" as const;\n"],"mappings":";;AAAA,MAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,oBAAoB;CAAC;CAAQ;CAAO;CAAS;AAC1D,MAAa,WAAW;AACxB,MAAa,SAAS;AACtB,MAAa,UAAU;AACvB,MAAa,QAAQ;AACrB,MAAa,MAAM"}
@@ -1,8 +1,7 @@
1
- export declare const PRIMITIVES: readonly ["string", "number", "boolean", "bigint", "symbol", "undefined", "null"];
2
- export declare const PRIMITIVE_OBJECTS: readonly ["date", "primitive"];
3
- export declare const MAYBE: "$$app-ts => maybe$$";
1
+ export declare const PRIMITIVES: readonly ["string", "number", "boolean", "bigint", "symbol", "undefined", "null", "unknown", "never", "primitive"];
2
+ export declare const PRIMITIVE_OBJECTS: readonly ["date", "any", "object"];
3
+ export declare const OPTIONAL: "$$app-ts => optional$$";
4
4
  export declare const CUSTOM: "$$app-ts => custom$$";
5
5
  export declare const PARTIAL: "$$app-ts => partial$$";
6
6
  export declare const ARRAY: "$$app-ts => array$$";
7
7
  export declare const SOA: "$$app-ts => soa$$";
8
- //# sourceMappingURL=constants.d.ts.map
package/lib/constants.js CHANGED
@@ -1,18 +1,27 @@
1
+ //#region src/constants.ts
1
2
  const PRIMITIVES = [
2
- 'string',
3
- 'number',
4
- 'boolean',
5
- 'bigint',
6
- 'symbol',
7
- 'undefined',
8
- 'null',
3
+ "string",
4
+ "number",
5
+ "boolean",
6
+ "bigint",
7
+ "symbol",
8
+ "undefined",
9
+ "null",
10
+ "unknown",
11
+ "never",
12
+ "primitive"
9
13
  ];
10
- const PRIMITIVE_OBJECTS = ['date', 'primitive'];
11
- const MAYBE = '$$app-ts => maybe$$';
12
- const CUSTOM = '$$app-ts => custom$$';
13
- const PARTIAL = '$$app-ts => partial$$';
14
- const ARRAY = '$$app-ts => array$$';
15
- const SOA = '$$app-ts => soa$$';
14
+ const PRIMITIVE_OBJECTS = [
15
+ "date",
16
+ "any",
17
+ "object"
18
+ ];
19
+ const OPTIONAL = "$$app-ts => optional$$";
20
+ const CUSTOM = "$$app-ts => custom$$";
21
+ const PARTIAL = "$$app-ts => partial$$";
22
+ const ARRAY = "$$app-ts => array$$";
23
+ const SOA = "$$app-ts => soa$$";
24
+ //#endregion
25
+ export { ARRAY, CUSTOM, OPTIONAL, PARTIAL, PRIMITIVES, PRIMITIVE_OBJECTS, SOA };
16
26
 
17
- export { ARRAY, CUSTOM, MAYBE, PARTIAL, PRIMITIVES, PRIMITIVE_OBJECTS, SOA };
18
- //# sourceMappingURL=constants.js.map
27
+ //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["export const PRIMITIVES = [\n 'string',\n 'number',\n 'boolean',\n 'bigint',\n 'symbol',\n 'undefined',\n 'null',\n] as const;\n\nexport const PRIMITIVE_OBJECTS = ['date', 'primitive'] as const;\nexport const MAYBE = '$$app-ts => maybe$$' as const;\nexport const CUSTOM = '$$app-ts => custom$$' as const;\nexport const PARTIAL = '$$app-ts => partial$$' as const;\nexport const ARRAY = '$$app-ts => array$$' as const;\nexport const SOA = '$$app-ts => soa$$' as const;\n"],"names":[],"mappings":"AAAO,MAAM,UAAU,GAAG;IACxB,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,MAAM;;MAGK,iBAAiB,GAAG,CAAC,MAAM,EAAE,WAAW;AAC9C,MAAM,KAAK,GAAG;AACd,MAAM,MAAM,GAAG;AACf,MAAM,OAAO,GAAG;AAChB,MAAM,KAAK,GAAG;AACd,MAAM,GAAG,GAAG;;;;"}
1
+ {"version":3,"file":"constants.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["export const PRIMITIVES = [\n \"string\",\n \"number\",\n \"boolean\",\n \"bigint\",\n \"symbol\",\n \"undefined\",\n \"null\",\n \"unknown\",\n \"never\",\n \"primitive\",\n] as const;\n\nexport const PRIMITIVE_OBJECTS = [\"date\", \"any\", \"object\"] as const;\nexport const OPTIONAL = \"$$app-ts => optional$$\" as const;\nexport const CUSTOM = \"$$app-ts => custom$$\" as const;\nexport const PARTIAL = \"$$app-ts => partial$$\" as const;\nexport const ARRAY = \"$$app-ts => array$$\" as const;\nexport const SOA = \"$$app-ts => soa$$\" as const;\n"],"mappings":";AAAA,MAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,oBAAoB;CAAC;CAAQ;CAAO;CAAS;AAC1D,MAAa,WAAW;AACxB,MAAa,SAAS;AACtB,MAAa,UAAU;AACvB,MAAa,QAAQ;AACrB,MAAa,MAAM"}
@@ -1,6 +1,6 @@
1
- 'use strict';
2
-
1
+ //#region src/helpers/any.ts
3
2
  const any = (value) => value;
4
-
3
+ //#endregion
5
4
  module.exports = any;
6
- //# sourceMappingURL=any.cjs.map
5
+
6
+ //# sourceMappingURL=any.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"any.cjs","sources":["../../src/helpers/any.ts"],"sourcesContent":["import type { ObjectS } from '../types';\n\nconst any = <T extends ObjectS = ObjectS>(value?: T) => value as T;\nexport default any;\n"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG,CAA8B,KAAS,KAAK;;;;"}
1
+ {"version":3,"file":"any.cjs","names":[],"sources":["../../src/helpers/any.ts"],"sourcesContent":["import type { ObjectT } from \"../types\";\n\nconst any = <T extends ObjectT = ObjectT>(value?: T) =>\n value as ObjectT extends T ? \"any\" : T;\nexport default any;\n"],"mappings":";AAEA,MAAM,OAAoC,UACxC"}
@@ -1,4 +1,3 @@
1
- import type { ObjectS } from '../types';
2
- declare const any: <T extends ObjectS = ObjectS>(value?: T) => T;
1
+ import type { ObjectT } from "../types";
2
+ declare const any: <T extends ObjectT = ObjectT>(value?: T) => ObjectT extends T ? "any" : T;
3
3
  export default any;
4
- //# sourceMappingURL=any.d.ts.map
@@ -1,4 +1,6 @@
1
+ //#region src/helpers/any.ts
1
2
  const any = (value) => value;
2
-
3
+ //#endregion
3
4
  export { any as default };
4
- //# sourceMappingURL=any.js.map
5
+
6
+ //# sourceMappingURL=any.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"any.js","sources":["../../src/helpers/any.ts"],"sourcesContent":["import type { ObjectS } from '../types';\n\nconst any = <T extends ObjectS = ObjectS>(value?: T) => value as T;\nexport default any;\n"],"names":[],"mappings":"AAEA,MAAM,GAAG,GAAG,CAA8B,KAAS,KAAK;;;;"}
1
+ {"version":3,"file":"any.js","names":[],"sources":["../../src/helpers/any.ts"],"sourcesContent":["import type { ObjectT } from \"../types\";\n\nconst any = <T extends ObjectT = ObjectT>(value?: T) =>\n value as ObjectT extends T ? \"any\" : T;\nexport default any;\n"],"mappings":";AAEA,MAAM,OAAoC,UACxC"}
@@ -1,10 +1,9 @@
1
- 'use strict';
2
-
3
- var constants = require('../constants.cjs');
4
-
1
+ const require_constants = require("../constants.cjs");
2
+ //#region src/helpers/array.ts
5
3
  const array = (value) => {
6
- return { [constants.ARRAY]: value };
4
+ return { [require_constants.ARRAY]: value };
7
5
  };
8
-
6
+ //#endregion
9
7
  module.exports = array;
10
- //# sourceMappingURL=array.cjs.map
8
+
9
+ //# sourceMappingURL=array.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"array.cjs","sources":["../../src/helpers/array.ts"],"sourcesContent":["import { ARRAY } from '../constants';\nimport type { ArrayCustom, NotReadonly, ObjectS } from '../types';\n\nconst array = <const T extends ObjectS>(value: T) => {\n type Out = ArrayCustom<Extract<NotReadonly<T>, ObjectS>>;\n\n return { [ARRAY]: value } as Out;\n};\n\nexport default array;\n"],"names":["ARRAY"],"mappings":";;;;AAGA,MAAM,KAAK,GAAG,CAA0B,KAAQ,KAAI;AAGlD,IAAA,OAAO,EAAE,CAACA,eAAK,GAAG,KAAK,EAAS;AAClC;;;;"}
1
+ {"version":3,"file":"array.cjs","names":["ARRAY"],"sources":["../../src/helpers/array.ts"],"sourcesContent":["import { ARRAY } from \"../constants\";\nimport type { ArrayCustom, NotReadonly, ObjectT } from \"../types\";\n\nconst array = <const T extends ObjectT>(value: T) => {\n type Out = ArrayCustom<Extract<NotReadonly<T>, ObjectT>>;\n\n return { [ARRAY]: value } as Out;\n};\n\nexport default array;\n"],"mappings":";;AAGA,MAAM,SAAkC,UAAa;AAGnD,QAAO,GAAGA,kBAAAA,QAAQ,OAAO"}
@@ -1,4 +1,3 @@
1
- import type { ArrayCustom, NotReadonly, ObjectS } from '../types';
2
- declare const array: <const T extends ObjectS>(value: T) => ArrayCustom<Extract<NotReadonly<T>, ObjectS>>;
1
+ import type { ArrayCustom, NotReadonly, ObjectT } from "../types";
2
+ declare const array: <const T extends ObjectT>(value: T) => ArrayCustom<Extract<NotReadonly<T>, ObjectT>>;
3
3
  export default array;
4
- //# sourceMappingURL=array.d.ts.map
@@ -1,8 +1,9 @@
1
- import { ARRAY } from '../constants.js';
2
-
1
+ import { ARRAY } from "../constants.js";
2
+ //#region src/helpers/array.ts
3
3
  const array = (value) => {
4
- return { [ARRAY]: value };
4
+ return { [ARRAY]: value };
5
5
  };
6
-
6
+ //#endregion
7
7
  export { array as default };
8
- //# sourceMappingURL=array.js.map
8
+
9
+ //# sourceMappingURL=array.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"array.js","sources":["../../src/helpers/array.ts"],"sourcesContent":["import { ARRAY } from '../constants';\nimport type { ArrayCustom, NotReadonly, ObjectS } from '../types';\n\nconst array = <const T extends ObjectS>(value: T) => {\n type Out = ArrayCustom<Extract<NotReadonly<T>, ObjectS>>;\n\n return { [ARRAY]: value } as Out;\n};\n\nexport default array;\n"],"names":[],"mappings":";;AAGA,MAAM,KAAK,GAAG,CAA0B,KAAQ,KAAI;AAGlD,IAAA,OAAO,EAAE,CAAC,KAAK,GAAG,KAAK,EAAS;AAClC;;;;"}
1
+ {"version":3,"file":"array.js","names":[],"sources":["../../src/helpers/array.ts"],"sourcesContent":["import { ARRAY } from \"../constants\";\nimport type { ArrayCustom, NotReadonly, ObjectT } from \"../types\";\n\nconst array = <const T extends ObjectT>(value: T) => {\n type Out = ArrayCustom<Extract<NotReadonly<T>, ObjectT>>;\n\n return { [ARRAY]: value } as Out;\n};\n\nexport default array;\n"],"mappings":";;AAGA,MAAM,SAAkC,UAAa;AAGnD,QAAO,GAAG,QAAQ,OAAO"}
@@ -1,10 +1,7 @@
1
- 'use strict';
2
-
3
- var constants = require('../constants.cjs');
4
-
5
- const custom = (value) => ({
6
- [constants.CUSTOM]: value,
7
- });
8
-
1
+ const require_constants = require("../constants.cjs");
2
+ //#region src/helpers/custom.ts
3
+ const custom = (value) => ({ [require_constants.CUSTOM]: value });
4
+ //#endregion
9
5
  module.exports = custom;
10
- //# sourceMappingURL=custom.cjs.map
6
+
7
+ //# sourceMappingURL=custom.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom.cjs","sources":["../../src/helpers/custom.ts"],"sourcesContent":["import { CUSTOM } from '../constants';\nimport type { Custom } from '../types';\n\nconst custom = <T = any>(value?: T) =>\n ({\n [CUSTOM]: value,\n }) as Custom<T>;\n\nexport default custom;\n"],"names":["CUSTOM"],"mappings":";;;;AAGA,MAAM,MAAM,GAAG,CAAU,KAAS,MAC/B;IACC,CAACA,gBAAM,GAAG,KAAK;AAChB,CAAA;;;;"}
1
+ {"version":3,"file":"custom.cjs","names":["CUSTOM"],"sources":["../../src/helpers/custom.ts"],"sourcesContent":["import { CUSTOM } from '../constants';\nimport type { Custom } from '../types';\n\nconst custom = <T = any>(value?: T) =>\n ({\n [CUSTOM]: value,\n }) as Custom<T>;\n\nexport default custom;\n"],"mappings":";;AAGA,MAAM,UAAmB,WACtB,GACEA,kBAAAA,SAAS,OACX"}
@@ -1,4 +1,3 @@
1
1
  import type { Custom } from '../types';
2
2
  declare const custom: <T = any>(value?: T) => Custom<T>;
3
3
  export default custom;
4
- //# sourceMappingURL=custom.d.ts.map
@@ -1,8 +1,7 @@
1
- import { CUSTOM } from '../constants.js';
2
-
3
- const custom = (value) => ({
4
- [CUSTOM]: value,
5
- });
6
-
1
+ import { CUSTOM } from "../constants.js";
2
+ //#region src/helpers/custom.ts
3
+ const custom = (value) => ({ [CUSTOM]: value });
4
+ //#endregion
7
5
  export { custom as default };
8
- //# sourceMappingURL=custom.js.map
6
+
7
+ //# sourceMappingURL=custom.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom.js","sources":["../../src/helpers/custom.ts"],"sourcesContent":["import { CUSTOM } from '../constants';\nimport type { Custom } from '../types';\n\nconst custom = <T = any>(value?: T) =>\n ({\n [CUSTOM]: value,\n }) as Custom<T>;\n\nexport default custom;\n"],"names":[],"mappings":";;AAGA,MAAM,MAAM,GAAG,CAAU,KAAS,MAC/B;IACC,CAAC,MAAM,GAAG,KAAK;AAChB,CAAA;;;;"}
1
+ {"version":3,"file":"custom.js","names":[],"sources":["../../src/helpers/custom.ts"],"sourcesContent":["import { CUSTOM } from '../constants';\nimport type { Custom } from '../types';\n\nconst custom = <T = any>(value?: T) =>\n ({\n [CUSTOM]: value,\n }) as Custom<T>;\n\nexport default custom;\n"],"mappings":";;AAGA,MAAM,UAAmB,WACtB,GACE,SAAS,OACX"}
@@ -1,30 +1,27 @@
1
- 'use strict';
2
-
3
- var helpers_any = require('./any.cjs');
4
- var helpers_array = require('./array.cjs');
5
- var helpers_custom = require('./custom.cjs');
6
- var helpers_intersection = require('./intersection.cjs');
7
- var helpers_litterals = require('./litterals.cjs');
8
- var helpers_maybe = require('./maybe.cjs');
9
- var helpers_partial = require('./partial.cjs');
10
- var helpers_record = require('./record.cjs');
11
- var helpers_soa = require('./soa.cjs');
12
- var helpers_sv = require('./sv.cjs');
13
- var helpers_tuple = require('./tuple.cjs');
14
- var helpers_union = require('./union.cjs');
15
-
16
-
17
-
18
- exports.any = helpers_any;
19
- exports.array = helpers_array;
20
- exports.custom = helpers_custom;
21
- exports.intersection = helpers_intersection;
22
- exports.litterals = helpers_litterals;
23
- exports.maybe = helpers_maybe;
24
- exports.partial = helpers_partial;
25
- exports.record = helpers_record;
26
- exports.soa = helpers_soa;
27
- exports.sv = helpers_sv;
28
- exports.tuple = helpers_tuple;
29
- exports.union = helpers_union;
30
- //# sourceMappingURL=index.cjs.map
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_helpers_any = require("./any.cjs");
3
+ const require_helpers_array = require("./array.cjs");
4
+ const require_helpers_custom = require("./custom.cjs");
5
+ const require_helpers_intersection = require("./intersection.cjs");
6
+ const require_helpers_litterals = require("./litterals.cjs");
7
+ const require_helpers_optional = require("./optional.cjs");
8
+ const require_helpers_partial = require("./partial.cjs");
9
+ const require_helpers_record = require("./record.cjs");
10
+ const require_helpers_soa = require("./soa.cjs");
11
+ const require_helpers_sv = require("./sv.cjs");
12
+ const require_helpers_tuple = require("./tuple.cjs");
13
+ const require_helpers_union = require("./union.cjs");
14
+ const require_helpers_primitiveObject = require("./primitiveObject.cjs");
15
+ exports.any = require_helpers_any;
16
+ exports.array = require_helpers_array;
17
+ exports.custom = require_helpers_custom;
18
+ exports.intersection = require_helpers_intersection;
19
+ exports.litterals = require_helpers_litterals;
20
+ exports.optional = require_helpers_optional;
21
+ exports.partial = require_helpers_partial;
22
+ exports.primitiveObject = require_helpers_primitiveObject;
23
+ exports.record = require_helpers_record;
24
+ exports.soa = require_helpers_soa;
25
+ exports.sv = require_helpers_sv;
26
+ exports.tuple = require_helpers_tuple;
27
+ exports.union = require_helpers_union;
@@ -1,13 +1,13 @@
1
- export { default as any } from './any';
2
- export { default as array } from './array';
3
- export { default as custom } from './custom';
4
- export { default as intersection } from './intersection';
5
- export { default as litterals } from './litterals';
6
- export { default as maybe } from './maybe';
7
- export { default as partial } from './partial';
8
- export { default as record } from './record';
9
- export { default as soa } from './soa';
10
- export { default as sv } from './sv';
11
- export { default as tuple } from './tuple';
12
- export { default as union } from './union';
13
- //# sourceMappingURL=index.d.ts.map
1
+ export { default as any } from "./any";
2
+ export { default as array } from "./array";
3
+ export { default as custom } from "./custom";
4
+ export { default as intersection } from "./intersection";
5
+ export { default as litterals } from "./litterals";
6
+ export { default as optional } from "./optional";
7
+ export { default as partial } from "./partial";
8
+ export { default as record } from "./record";
9
+ export { default as soa } from "./soa";
10
+ export { default as sv } from "./sv";
11
+ export { default as tuple } from "./tuple";
12
+ export { default as union } from "./union";
13
+ export { default as primitiveObject } from "./primitiveObject";
@@ -1,13 +1,14 @@
1
- export { default as any } from './any.js';
2
- export { default as array } from './array.js';
3
- export { default as custom } from './custom.js';
4
- export { default as intersection } from './intersection.js';
5
- export { default as litterals } from './litterals.js';
6
- export { default as maybe } from './maybe.js';
7
- export { default as partial } from './partial.js';
8
- export { default as record } from './record.js';
9
- export { default as soa } from './soa.js';
10
- export { default as sv } from './sv.js';
11
- export { default as tuple } from './tuple.js';
12
- export { default as union } from './union.js';
13
- //# sourceMappingURL=index.js.map
1
+ import any from "./any.js";
2
+ import array from "./array.js";
3
+ import custom from "./custom.js";
4
+ import intersection from "./intersection.js";
5
+ import litterals from "./litterals.js";
6
+ import optional from "./optional.js";
7
+ import partial from "./partial.js";
8
+ import record from "./record.js";
9
+ import soa from "./soa.js";
10
+ import sv from "./sv.js";
11
+ import tuple from "./tuple.js";
12
+ import fn from "./union.js";
13
+ import primitiveObject from "./primitiveObject.js";
14
+ export { any, array, custom, intersection, litterals, optional, partial, primitiveObject, record, soa, sv, tuple, fn as union };
@@ -1,14 +1,13 @@
1
- 'use strict';
2
-
1
+ //#region src/helpers/intersection.ts
3
2
  const intersection = (...values) => {
4
- const out = values.reduce((acc, curr) => {
5
- Object.entries(curr).forEach(([key, value]) => {
6
- acc[key] = value;
7
- });
8
- return acc;
9
- }, {});
10
- return out;
3
+ return values.reduce((acc, curr) => {
4
+ Object.entries(curr).forEach(([key, value]) => {
5
+ acc[key] = value;
6
+ });
7
+ return acc;
8
+ }, {});
11
9
  };
12
-
10
+ //#endregion
13
11
  module.exports = intersection;
14
- //# sourceMappingURL=intersection.cjs.map
12
+
13
+ //# sourceMappingURL=intersection.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"intersection.cjs","sources":["../../src/helpers/intersection.ts"],"sourcesContent":["import type { ObjectMapS } from '../types';\n\ntype _IntersectionCustom<T extends ObjectMapS[]> = T extends [\n infer First extends ObjectMapS,\n ...infer Rest extends ObjectMapS[],\n]\n ? First & IntersectionCustom<Rest>\n : unknown;\n\nexport type IntersectionCustom<T extends ObjectMapS[]> =\n _IntersectionCustom<T> extends infer R\n ? {\n [K in keyof R]: R[K];\n }\n : never;\n\nconst intersection = <T extends [ObjectMapS, ObjectMapS, ...ObjectMapS[]]>(\n ...values: T\n) => {\n const out = values.reduce((acc, curr) => {\n Object.entries(curr).forEach(([key, value]) => {\n acc[key] = value;\n });\n return acc;\n }, {} as any);\n return out as IntersectionCustom<T>;\n};\n\nexport default intersection;\n"],"names":[],"mappings":";;AAgBA,MAAM,YAAY,GAAG,CACnB,GAAG,MAAS,KACV;IACF,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAI;AACtC,QAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAI;AAC5C,YAAA,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;AAClB,QAAA,CAAC,CAAC;AACF,QAAA,OAAO,GAAG;IACZ,CAAC,EAAE,EAAS,CAAC;AACb,IAAA,OAAO,GAA4B;AACrC;;;;"}
1
+ {"version":3,"file":"intersection.cjs","names":[],"sources":["../../src/helpers/intersection.ts"],"sourcesContent":["import type { ObjectMapS } from '../types';\n\ntype _IntersectionCustom<T extends ObjectMapS[]> = T extends [\n infer First extends ObjectMapS,\n ...infer Rest extends ObjectMapS[],\n]\n ? First & IntersectionCustom<Rest>\n : unknown;\n\nexport type IntersectionCustom<T extends ObjectMapS[]> =\n _IntersectionCustom<T> extends infer R\n ? {\n [K in keyof R]: R[K];\n }\n : never;\n\nconst intersection = <T extends [ObjectMapS, ObjectMapS, ...ObjectMapS[]]>(\n ...values: T\n) => {\n const out = values.reduce((acc, curr) => {\n Object.entries(curr).forEach(([key, value]) => {\n acc[key] = value;\n });\n return acc;\n }, {} as any);\n return out as IntersectionCustom<T>;\n};\n\nexport default intersection;\n"],"mappings":";AAgBA,MAAM,gBACJ,GAAG,WACA;AAOH,QANY,OAAO,QAAQ,KAAK,SAAS;AACvC,SAAO,QAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,WAAW;AAC7C,OAAI,OAAO;IACX;AACF,SAAO;IACN,EAAE,CAAQ"}
@@ -8,4 +8,3 @@ export type IntersectionCustom<T extends ObjectMapS[]> = _IntersectionCustom<T>
8
8
  } : never;
9
9
  declare const intersection: <T extends [ObjectMapS, ObjectMapS, ...ObjectMapS[]]>(...values: T) => IntersectionCustom<T>;
10
10
  export default intersection;
11
- //# sourceMappingURL=intersection.d.ts.map
@@ -1,12 +1,13 @@
1
+ //#region src/helpers/intersection.ts
1
2
  const intersection = (...values) => {
2
- const out = values.reduce((acc, curr) => {
3
- Object.entries(curr).forEach(([key, value]) => {
4
- acc[key] = value;
5
- });
6
- return acc;
7
- }, {});
8
- return out;
3
+ return values.reduce((acc, curr) => {
4
+ Object.entries(curr).forEach(([key, value]) => {
5
+ acc[key] = value;
6
+ });
7
+ return acc;
8
+ }, {});
9
9
  };
10
-
10
+ //#endregion
11
11
  export { intersection as default };
12
- //# sourceMappingURL=intersection.js.map
12
+
13
+ //# sourceMappingURL=intersection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"intersection.js","sources":["../../src/helpers/intersection.ts"],"sourcesContent":["import type { ObjectMapS } from '../types';\n\ntype _IntersectionCustom<T extends ObjectMapS[]> = T extends [\n infer First extends ObjectMapS,\n ...infer Rest extends ObjectMapS[],\n]\n ? First & IntersectionCustom<Rest>\n : unknown;\n\nexport type IntersectionCustom<T extends ObjectMapS[]> =\n _IntersectionCustom<T> extends infer R\n ? {\n [K in keyof R]: R[K];\n }\n : never;\n\nconst intersection = <T extends [ObjectMapS, ObjectMapS, ...ObjectMapS[]]>(\n ...values: T\n) => {\n const out = values.reduce((acc, curr) => {\n Object.entries(curr).forEach(([key, value]) => {\n acc[key] = value;\n });\n return acc;\n }, {} as any);\n return out as IntersectionCustom<T>;\n};\n\nexport default intersection;\n"],"names":[],"mappings":"AAgBA,MAAM,YAAY,GAAG,CACnB,GAAG,MAAS,KACV;IACF,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAI;AACtC,QAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAI;AAC5C,YAAA,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;AAClB,QAAA,CAAC,CAAC;AACF,QAAA,OAAO,GAAG;IACZ,CAAC,EAAE,EAAS,CAAC;AACb,IAAA,OAAO,GAA4B;AACrC;;;;"}
1
+ {"version":3,"file":"intersection.js","names":[],"sources":["../../src/helpers/intersection.ts"],"sourcesContent":["import type { ObjectMapS } from '../types';\n\ntype _IntersectionCustom<T extends ObjectMapS[]> = T extends [\n infer First extends ObjectMapS,\n ...infer Rest extends ObjectMapS[],\n]\n ? First & IntersectionCustom<Rest>\n : unknown;\n\nexport type IntersectionCustom<T extends ObjectMapS[]> =\n _IntersectionCustom<T> extends infer R\n ? {\n [K in keyof R]: R[K];\n }\n : never;\n\nconst intersection = <T extends [ObjectMapS, ObjectMapS, ...ObjectMapS[]]>(\n ...values: T\n) => {\n const out = values.reduce((acc, curr) => {\n Object.entries(curr).forEach(([key, value]) => {\n acc[key] = value;\n });\n return acc;\n }, {} as any);\n return out as IntersectionCustom<T>;\n};\n\nexport default intersection;\n"],"mappings":";AAgBA,MAAM,gBACJ,GAAG,WACA;AAOH,QANY,OAAO,QAAQ,KAAK,SAAS;AACvC,SAAO,QAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,WAAW;AAC7C,OAAI,OAAO;IACX;AACF,SAAO;IACN,EAAE,CAAQ"}
@@ -1,6 +1,6 @@
1
- 'use strict';
2
-
1
+ //#region src/helpers/litterals.ts
3
2
  const litterals = (...values) => values[0];
4
-
3
+ //#endregion
5
4
  module.exports = litterals;
6
- //# sourceMappingURL=litterals.cjs.map
5
+
6
+ //# sourceMappingURL=litterals.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"litterals.cjs","sources":["../../src/helpers/litterals.ts"],"sourcesContent":["import type { Custom } from '../types';\n\nconst litterals = <const T extends (string | number | boolean)[]>(\n ...values: T\n) => values[0] as unknown as Custom<T[number]>;\n\nexport default litterals;\n"],"names":[],"mappings":";;AAEA,MAAM,SAAS,GAAG,CAChB,GAAG,MAAS,KACT,MAAM,CAAC,CAAC;;;;"}
1
+ {"version":3,"file":"litterals.cjs","names":[],"sources":["../../src/helpers/litterals.ts"],"sourcesContent":["import type { Custom } from '../types';\n\nconst litterals = <const T extends (string | number | boolean)[]>(\n ...values: T\n) => values[0] as unknown as Custom<T[number]>;\n\nexport default litterals;\n"],"mappings":";AAEA,MAAM,aACJ,GAAG,WACA,OAAO"}
@@ -1,4 +1,3 @@
1
1
  import type { Custom } from '../types';
2
2
  declare const litterals: <const T extends (string | number | boolean)[]>(...values: T) => Custom<T[number]>;
3
3
  export default litterals;
4
- //# sourceMappingURL=litterals.d.ts.map
@@ -1,4 +1,6 @@
1
+ //#region src/helpers/litterals.ts
1
2
  const litterals = (...values) => values[0];
2
-
3
+ //#endregion
3
4
  export { litterals as default };
4
- //# sourceMappingURL=litterals.js.map
5
+
6
+ //# sourceMappingURL=litterals.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"litterals.js","sources":["../../src/helpers/litterals.ts"],"sourcesContent":["import type { Custom } from '../types';\n\nconst litterals = <const T extends (string | number | boolean)[]>(\n ...values: T\n) => values[0] as unknown as Custom<T[number]>;\n\nexport default litterals;\n"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,CAChB,GAAG,MAAS,KACT,MAAM,CAAC,CAAC;;;;"}
1
+ {"version":3,"file":"litterals.js","names":[],"sources":["../../src/helpers/litterals.ts"],"sourcesContent":["import type { Custom } from '../types';\n\nconst litterals = <const T extends (string | number | boolean)[]>(\n ...values: T\n) => values[0] as unknown as Custom<T[number]>;\n\nexport default litterals;\n"],"mappings":";AAEA,MAAM,aACJ,GAAG,WACA,OAAO"}
@@ -0,0 +1,7 @@
1
+ const require_constants = require("../constants.cjs");
2
+ //#region src/helpers/optional.ts
3
+ const optional = (value) => ({ [require_constants.OPTIONAL]: value });
4
+ //#endregion
5
+ module.exports = optional;
6
+
7
+ //# sourceMappingURL=optional.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional.cjs","names":["OPTIONAL"],"sources":["../../src/helpers/optional.ts"],"sourcesContent":["import { OPTIONAL } from \"../constants\";\nimport type { __ObjectT, AnyArray, ArrayCustom, Optional } from \"../types\";\n\nconst optional = <T extends __ObjectT | ArrayCustom | AnyArray<__ObjectT>>(\n value?: T,\n) =>\n ({\n [OPTIONAL]: value,\n }) as Optional<T>;\n\nexport default optional;\n"],"mappings":";;AAGA,MAAM,YACJ,WAEC,GACEA,kBAAAA,WAAW,OACb"}
@@ -0,0 +1,3 @@
1
+ import type { __ObjectT, AnyArray, ArrayCustom, Optional } from "../types";
2
+ declare const optional: <T extends __ObjectT | ArrayCustom | AnyArray<__ObjectT>>(value?: T) => Optional<T>;
3
+ export default optional;
@@ -0,0 +1,7 @@
1
+ import { OPTIONAL } from "../constants.js";
2
+ //#region src/helpers/optional.ts
3
+ const optional = (value) => ({ [OPTIONAL]: value });
4
+ //#endregion
5
+ export { optional as default };
6
+
7
+ //# sourceMappingURL=optional.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional.js","names":[],"sources":["../../src/helpers/optional.ts"],"sourcesContent":["import { OPTIONAL } from \"../constants\";\nimport type { __ObjectT, AnyArray, ArrayCustom, Optional } from \"../types\";\n\nconst optional = <T extends __ObjectT | ArrayCustom | AnyArray<__ObjectT>>(\n value?: T,\n) =>\n ({\n [OPTIONAL]: value,\n }) as Optional<T>;\n\nexport default optional;\n"],"mappings":";;AAGA,MAAM,YACJ,WAEC,GACE,WAAW,OACb"}