@bemedev/typings 0.0.1 → 0.1.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 (114) hide show
  1. package/README.md +33 -30
  2. package/lib/constants.cjs +19 -18
  3. package/lib/constants.cjs.map +1 -1
  4. package/lib/constants.d.ts +1 -2
  5. package/lib/constants.js +17 -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 +0 -1
  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 +0 -1
  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 +25 -30
  23. package/lib/helpers/index.d.ts +1 -2
  24. package/lib/helpers/index.js +13 -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 +0 -1
  43. package/lib/helpers/partial.js +11 -10
  44. package/lib/helpers/partial.js.map +1 -1
  45. package/lib/helpers/record.cjs +8 -9
  46. package/lib/helpers/record.cjs.map +1 -1
  47. package/lib/helpers/record.d.ts +0 -1
  48. package/lib/helpers/record.js +8 -7
  49. package/lib/helpers/record.js.map +1 -1
  50. package/lib/helpers/soa.cjs +6 -7
  51. package/lib/helpers/soa.cjs.map +1 -1
  52. package/lib/helpers/soa.d.ts +0 -1
  53. package/lib/helpers/soa.js +6 -5
  54. package/lib/helpers/soa.js.map +1 -1
  55. package/lib/helpers/sv.cjs +4 -4
  56. package/lib/helpers/sv.cjs.map +1 -1
  57. package/lib/helpers/sv.d.ts +0 -1
  58. package/lib/helpers/sv.js +4 -2
  59. package/lib/helpers/sv.js.map +1 -1
  60. package/lib/helpers/tuple.cjs +4 -4
  61. package/lib/helpers/tuple.cjs.map +1 -1
  62. package/lib/helpers/tuple.d.ts +2 -3
  63. package/lib/helpers/tuple.js +4 -2
  64. package/lib/helpers/tuple.js.map +1 -1
  65. package/lib/helpers/union.cjs +7 -10
  66. package/lib/helpers/union.cjs.map +1 -1
  67. package/lib/helpers/union.d.ts +2 -3
  68. package/lib/helpers/union.js +7 -8
  69. package/lib/helpers/union.js.map +1 -1
  70. package/lib/index.cjs +38 -40
  71. package/lib/index.d.ts +1 -2
  72. package/lib/index.js +17 -15
  73. package/lib/type.d.ts +2 -0
  74. package/lib/{transform.types.d.ts → type.types.d.ts} +2 -3
  75. package/lib/types.d.ts +14 -10
  76. package/lib/utils/expandFn.cjs +8 -9
  77. package/lib/utils/expandFn.cjs.map +1 -1
  78. package/lib/utils/expandFn.d.ts +1 -4
  79. package/lib/utils/expandFn.js +7 -7
  80. package/lib/utils/expandFn.js.map +1 -1
  81. package/package.json +29 -29
  82. package/lib/constants.d.ts.map +0 -1
  83. package/lib/helpers/any.d.ts.map +0 -1
  84. package/lib/helpers/array.d.ts.map +0 -1
  85. package/lib/helpers/custom.d.ts.map +0 -1
  86. package/lib/helpers/index.cjs.map +0 -1
  87. package/lib/helpers/index.d.ts.map +0 -1
  88. package/lib/helpers/index.js.map +0 -1
  89. package/lib/helpers/intersection.d.ts.map +0 -1
  90. package/lib/helpers/litterals.d.ts.map +0 -1
  91. package/lib/helpers/maybe.cjs +0 -10
  92. package/lib/helpers/maybe.cjs.map +0 -1
  93. package/lib/helpers/maybe.d.ts +0 -4
  94. package/lib/helpers/maybe.d.ts.map +0 -1
  95. package/lib/helpers/maybe.js +0 -8
  96. package/lib/helpers/maybe.js.map +0 -1
  97. package/lib/helpers/partial.d.ts.map +0 -1
  98. package/lib/helpers/record.d.ts.map +0 -1
  99. package/lib/helpers/soa.d.ts.map +0 -1
  100. package/lib/helpers/sv.d.ts.map +0 -1
  101. package/lib/helpers/tuple.d.ts.map +0 -1
  102. package/lib/helpers/union.d.ts.map +0 -1
  103. package/lib/index.cjs.map +0 -1
  104. package/lib/index.d.ts.map +0 -1
  105. package/lib/index.js.map +0 -1
  106. package/lib/transform.cjs +0 -63
  107. package/lib/transform.cjs.map +0 -1
  108. package/lib/transform.d.ts +0 -3
  109. package/lib/transform.d.ts.map +0 -1
  110. package/lib/transform.js +0 -61
  111. package/lib/transform.js.map +0 -1
  112. package/lib/transform.types.d.ts.map +0 -1
  113. package/lib/types.d.ts.map +0 -1
  114. package/lib/utils/expandFn.d.ts.map +0 -1
@@ -1,15 +1,14 @@
1
- 'use strict';
2
-
3
- var constants = require('../constants.cjs');
4
-
1
+ const require_constants = require("../constants.cjs");
2
+ //#region src/helpers/partial.ts
5
3
  const partial = (value) => {
6
- const entries = Object.entries(value).filter(([key]) => key !== constants.PARTIAL);
7
- const out = {};
8
- entries.forEach(([key, value]) => {
9
- out[key] = value;
10
- });
11
- return out;
4
+ const entries = Object.entries(value).filter(([key]) => key !== require_constants.PARTIAL);
5
+ const out = {};
6
+ entries.forEach(([key, value]) => {
7
+ out[key] = value;
8
+ });
9
+ return out;
12
10
  };
13
-
11
+ //#endregion
14
12
  module.exports = partial;
15
- //# sourceMappingURL=partial.cjs.map
13
+
14
+ //# sourceMappingURL=partial.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"partial.cjs","sources":["../../src/helpers/partial.ts"],"sourcesContent":["import { PARTIAL } from '../constants';\nimport type { ObjectS, PartialCustom } from '../types';\n\nconst partial = <T extends ObjectS>(value: T): T & PartialCustom => {\n const entries = Object.entries(value).filter(([key]) => key !== PARTIAL);\n const out: any = {};\n\n entries.forEach(([key, value]) => {\n out[key] = value;\n });\n\n return out;\n};\n\nexport default partial;\n"],"names":["PARTIAL"],"mappings":";;;;AAGA,MAAM,OAAO,GAAG,CAAoB,KAAQ,KAAuB;IACjE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,KAAKA,iBAAO,CAAC;IACxE,MAAM,GAAG,GAAQ,EAAE;IAEnB,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAI;AAC/B,QAAA,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;AAClB,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,GAAG;AACZ;;;;"}
1
+ {"version":3,"file":"partial.cjs","names":["PARTIAL"],"sources":["../../src/helpers/partial.ts"],"sourcesContent":["import { PARTIAL } from '../constants';\nimport type { ObjectS, PartialCustom } from '../types';\n\nconst partial = <T extends ObjectS>(value: T): T & PartialCustom => {\n const entries = Object.entries(value).filter(([key]) => key !== PARTIAL);\n const out: any = {};\n\n entries.forEach(([key, value]) => {\n out[key] = value;\n });\n\n return out;\n};\n\nexport default partial;\n"],"mappings":";;AAGA,MAAM,WAA8B,UAAgC;CAClE,MAAM,UAAU,OAAO,QAAQ,MAAM,CAAC,QAAQ,CAAC,SAAS,QAAQA,kBAAAA,QAAQ;CACxE,MAAM,MAAW,EAAE;AAEnB,SAAQ,SAAS,CAAC,KAAK,WAAW;AAChC,MAAI,OAAO;GACX;AAEF,QAAO"}
@@ -1,4 +1,3 @@
1
1
  import type { ObjectS, PartialCustom } from '../types';
2
2
  declare const partial: <T extends ObjectS>(value: T) => T & PartialCustom;
3
3
  export default partial;
4
- //# sourceMappingURL=partial.d.ts.map
@@ -1,13 +1,14 @@
1
- import { PARTIAL } from '../constants.js';
2
-
1
+ import { PARTIAL } from "../constants.js";
2
+ //#region src/helpers/partial.ts
3
3
  const partial = (value) => {
4
- const entries = Object.entries(value).filter(([key]) => key !== PARTIAL);
5
- const out = {};
6
- entries.forEach(([key, value]) => {
7
- out[key] = value;
8
- });
9
- return out;
4
+ const entries = Object.entries(value).filter(([key]) => key !== PARTIAL);
5
+ const out = {};
6
+ entries.forEach(([key, value]) => {
7
+ out[key] = value;
8
+ });
9
+ return out;
10
10
  };
11
-
11
+ //#endregion
12
12
  export { partial as default };
13
- //# sourceMappingURL=partial.js.map
13
+
14
+ //# sourceMappingURL=partial.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"partial.js","sources":["../../src/helpers/partial.ts"],"sourcesContent":["import { PARTIAL } from '../constants';\nimport type { ObjectS, PartialCustom } from '../types';\n\nconst partial = <T extends ObjectS>(value: T): T & PartialCustom => {\n const entries = Object.entries(value).filter(([key]) => key !== PARTIAL);\n const out: any = {};\n\n entries.forEach(([key, value]) => {\n out[key] = value;\n });\n\n return out;\n};\n\nexport default partial;\n"],"names":[],"mappings":";;AAGA,MAAM,OAAO,GAAG,CAAoB,KAAQ,KAAuB;IACjE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,OAAO,CAAC;IACxE,MAAM,GAAG,GAAQ,EAAE;IAEnB,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAI;AAC/B,QAAA,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;AAClB,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,GAAG;AACZ;;;;"}
1
+ {"version":3,"file":"partial.js","names":[],"sources":["../../src/helpers/partial.ts"],"sourcesContent":["import { PARTIAL } from '../constants';\nimport type { ObjectS, PartialCustom } from '../types';\n\nconst partial = <T extends ObjectS>(value: T): T & PartialCustom => {\n const entries = Object.entries(value).filter(([key]) => key !== PARTIAL);\n const out: any = {};\n\n entries.forEach(([key, value]) => {\n out[key] = value;\n });\n\n return out;\n};\n\nexport default partial;\n"],"mappings":";;AAGA,MAAM,WAA8B,UAAgC;CAClE,MAAM,UAAU,OAAO,QAAQ,MAAM,CAAC,QAAQ,CAAC,SAAS,QAAQ,QAAQ;CACxE,MAAM,MAAW,EAAE;AAEnB,SAAQ,SAAS,CAAC,KAAK,WAAW;AAChC,MAAI,OAAO;GACX;AAEF,QAAO"}
@@ -1,12 +1,11 @@
1
- 'use strict';
2
-
1
+ //#region src/helpers/record.ts
3
2
  const record = (value, ...keys) => {
4
- const object = keys.reduce((acc, key) => {
5
- acc[key] = value;
6
- return acc;
7
- }, {});
8
- return object;
3
+ return keys.reduce((acc, key) => {
4
+ acc[key] = value;
5
+ return acc;
6
+ }, {});
9
7
  };
10
-
8
+ //#endregion
11
9
  module.exports = record;
12
- //# sourceMappingURL=record.cjs.map
10
+
11
+ //# sourceMappingURL=record.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"record.cjs","sources":["../../src/helpers/record.ts"],"sourcesContent":["import type { Keys, ObjectS } from '../types';\n\nconst record = <const K extends Keys[], V extends ObjectS>(\n value: V,\n ...keys: K\n) => {\n const object = keys.reduce((acc, key) => {\n acc[key] = value;\n return acc;\n }, {} as any);\n\n return object as Record<K[number] extends never ? Keys : K[number], V>;\n};\n\nexport default record;\n"],"names":[],"mappings":";;AAEA,MAAM,MAAM,GAAG,CACb,KAAQ,EACR,GAAG,IAAO,KACR;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;AACtC,QAAA,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;AAChB,QAAA,OAAO,GAAG;IACZ,CAAC,EAAE,EAAS,CAAC;AAEb,IAAA,OAAO,MAA+D;AACxE;;;;"}
1
+ {"version":3,"file":"record.cjs","names":[],"sources":["../../src/helpers/record.ts"],"sourcesContent":["import type { Keys, ObjectS } from '../types';\n\nconst record = <const K extends Keys[], V extends ObjectS>(\n value: V,\n ...keys: K\n) => {\n const object = keys.reduce((acc, key) => {\n acc[key] = value;\n return acc;\n }, {} as any);\n\n return object as Record<K[number] extends never ? Keys : K[number], V>;\n};\n\nexport default record;\n"],"mappings":";AAEA,MAAM,UACJ,OACA,GAAG,SACA;AAMH,QALe,KAAK,QAAQ,KAAK,QAAQ;AACvC,MAAI,OAAO;AACX,SAAO;IACN,EAAE,CAAQ"}
@@ -1,4 +1,3 @@
1
1
  import type { Keys, ObjectS } from '../types';
2
2
  declare const record: <const K extends Keys[], V extends ObjectS>(value: V, ...keys: K) => Record<K[number] extends never ? Keys : K[number], V>;
3
3
  export default record;
4
- //# sourceMappingURL=record.d.ts.map
@@ -1,10 +1,11 @@
1
+ //#region src/helpers/record.ts
1
2
  const record = (value, ...keys) => {
2
- const object = keys.reduce((acc, key) => {
3
- acc[key] = value;
4
- return acc;
5
- }, {});
6
- return object;
3
+ return keys.reduce((acc, key) => {
4
+ acc[key] = value;
5
+ return acc;
6
+ }, {});
7
7
  };
8
-
8
+ //#endregion
9
9
  export { record as default };
10
- //# sourceMappingURL=record.js.map
10
+
11
+ //# sourceMappingURL=record.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"record.js","sources":["../../src/helpers/record.ts"],"sourcesContent":["import type { Keys, ObjectS } from '../types';\n\nconst record = <const K extends Keys[], V extends ObjectS>(\n value: V,\n ...keys: K\n) => {\n const object = keys.reduce((acc, key) => {\n acc[key] = value;\n return acc;\n }, {} as any);\n\n return object as Record<K[number] extends never ? Keys : K[number], V>;\n};\n\nexport default record;\n"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,CACb,KAAQ,EACR,GAAG,IAAO,KACR;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;AACtC,QAAA,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;AAChB,QAAA,OAAO,GAAG;IACZ,CAAC,EAAE,EAAS,CAAC;AAEb,IAAA,OAAO,MAA+D;AACxE;;;;"}
1
+ {"version":3,"file":"record.js","names":[],"sources":["../../src/helpers/record.ts"],"sourcesContent":["import type { Keys, ObjectS } from '../types';\n\nconst record = <const K extends Keys[], V extends ObjectS>(\n value: V,\n ...keys: K\n) => {\n const object = keys.reduce((acc, key) => {\n acc[key] = value;\n return acc;\n }, {} as any);\n\n return object as Record<K[number] extends never ? Keys : K[number], V>;\n};\n\nexport default record;\n"],"mappings":";AAEA,MAAM,UACJ,OACA,GAAG,SACA;AAMH,QALe,KAAK,QAAQ,KAAK,QAAQ;AACvC,MAAI,OAAO;AACX,SAAO;IACN,EAAE,CAAQ"}
@@ -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/soa.ts
5
3
  const soa = (value) => {
6
- return { [constants.SOA]: value };
4
+ return { [require_constants.SOA]: value };
7
5
  };
8
-
6
+ //#endregion
9
7
  module.exports = soa;
10
- //# sourceMappingURL=soa.cjs.map
8
+
9
+ //# sourceMappingURL=soa.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"soa.cjs","sources":["../../src/helpers/soa.ts"],"sourcesContent":["import { SOA } from '../constants';\nimport type { NotReadonly, ObjectS, SoaCustom } from '../types';\n\nconst soa = <const T extends ObjectS>(value: T) => {\n type Out = SoaCustom<Extract<NotReadonly<T>, ObjectS>>;\n return { [SOA]: value } as Out;\n};\n\nexport default soa;\n"],"names":["SOA"],"mappings":";;;;AAGA,MAAM,GAAG,GAAG,CAA0B,KAAQ,KAAI;AAEhD,IAAA,OAAO,EAAE,CAACA,aAAG,GAAG,KAAK,EAAS;AAChC;;;;"}
1
+ {"version":3,"file":"soa.cjs","names":["SOA"],"sources":["../../src/helpers/soa.ts"],"sourcesContent":["import { SOA } from '../constants';\nimport type { NotReadonly, ObjectS, SoaCustom } from '../types';\n\nconst soa = <const T extends ObjectS>(value: T) => {\n type Out = SoaCustom<Extract<NotReadonly<T>, ObjectS>>;\n return { [SOA]: value } as Out;\n};\n\nexport default soa;\n"],"mappings":";;AAGA,MAAM,OAAgC,UAAa;AAEjD,QAAO,GAAGA,kBAAAA,MAAM,OAAO"}
@@ -1,4 +1,3 @@
1
1
  import type { NotReadonly, ObjectS, SoaCustom } from '../types';
2
2
  declare const soa: <const T extends ObjectS>(value: T) => SoaCustom<Extract<NotReadonly<T>, ObjectS>>;
3
3
  export default soa;
4
- //# sourceMappingURL=soa.d.ts.map
@@ -1,8 +1,9 @@
1
- import { SOA } from '../constants.js';
2
-
1
+ import { SOA } from "../constants.js";
2
+ //#region src/helpers/soa.ts
3
3
  const soa = (value) => {
4
- return { [SOA]: value };
4
+ return { [SOA]: value };
5
5
  };
6
-
6
+ //#endregion
7
7
  export { soa as default };
8
- //# sourceMappingURL=soa.js.map
8
+
9
+ //# sourceMappingURL=soa.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"soa.js","sources":["../../src/helpers/soa.ts"],"sourcesContent":["import { SOA } from '../constants';\nimport type { NotReadonly, ObjectS, SoaCustom } from '../types';\n\nconst soa = <const T extends ObjectS>(value: T) => {\n type Out = SoaCustom<Extract<NotReadonly<T>, ObjectS>>;\n return { [SOA]: value } as Out;\n};\n\nexport default soa;\n"],"names":[],"mappings":";;AAGA,MAAM,GAAG,GAAG,CAA0B,KAAQ,KAAI;AAEhD,IAAA,OAAO,EAAE,CAAC,GAAG,GAAG,KAAK,EAAS;AAChC;;;;"}
1
+ {"version":3,"file":"soa.js","names":[],"sources":["../../src/helpers/soa.ts"],"sourcesContent":["import { SOA } from '../constants';\nimport type { NotReadonly, ObjectS, SoaCustom } from '../types';\n\nconst soa = <const T extends ObjectS>(value: T) => {\n type Out = SoaCustom<Extract<NotReadonly<T>, ObjectS>>;\n return { [SOA]: value } as Out;\n};\n\nexport default soa;\n"],"mappings":";;AAGA,MAAM,OAAgC,UAAa;AAEjD,QAAO,GAAG,MAAM,OAAO"}
@@ -1,6 +1,6 @@
1
- 'use strict';
2
-
1
+ //#region src/helpers/sv.ts
3
2
  const sv = {};
4
-
3
+ //#endregion
5
4
  module.exports = sv;
6
- //# sourceMappingURL=sv.cjs.map
5
+
6
+ //# sourceMappingURL=sv.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sv.cjs","sources":["../../src/helpers/sv.ts"],"sourcesContent":["import type { Custom, StateValue } from '../types';\n\nconst sv = {} as Custom<StateValue>;\nexport default sv;\n"],"names":[],"mappings":";;AAEA,MAAM,EAAE,GAAG;;;;"}
1
+ {"version":3,"file":"sv.cjs","names":[],"sources":["../../src/helpers/sv.ts"],"sourcesContent":["import type { Custom, StateValue } from '../types';\n\nconst sv = {} as Custom<StateValue>;\nexport default sv;\n"],"mappings":";AAEA,MAAM,KAAK,EAAE"}
@@ -1,4 +1,3 @@
1
1
  import type { Custom, StateValue } from '../types';
2
2
  declare const sv: Custom<StateValue>;
3
3
  export default sv;
4
- //# sourceMappingURL=sv.d.ts.map
package/lib/helpers/sv.js CHANGED
@@ -1,4 +1,6 @@
1
+ //#region src/helpers/sv.ts
1
2
  const sv = {};
2
-
3
+ //#endregion
3
4
  export { sv as default };
4
- //# sourceMappingURL=sv.js.map
5
+
6
+ //# sourceMappingURL=sv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sv.js","sources":["../../src/helpers/sv.ts"],"sourcesContent":["import type { Custom, StateValue } from '../types';\n\nconst sv = {} as Custom<StateValue>;\nexport default sv;\n"],"names":[],"mappings":"AAEA,MAAM,EAAE,GAAG;;;;"}
1
+ {"version":3,"file":"sv.js","names":[],"sources":["../../src/helpers/sv.ts"],"sourcesContent":["import type { Custom, StateValue } from '../types';\n\nconst sv = {} as Custom<StateValue>;\nexport default sv;\n"],"mappings":";AAEA,MAAM,KAAK,EAAE"}
@@ -1,6 +1,6 @@
1
- 'use strict';
2
-
1
+ //#region src/helpers/tuple.ts
3
2
  const tuple = (...values) => values;
4
-
3
+ //#endregion
5
4
  module.exports = tuple;
6
- //# sourceMappingURL=tuple.cjs.map
5
+
6
+ //# sourceMappingURL=tuple.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tuple.cjs","sources":["../../src/helpers/tuple.ts"],"sourcesContent":["import type { __ObjectS, ArrayCustom, NotReadonly, Maybe } from '../types';\n\nconst tuple = <\n const T extends [\n __ObjectS | Maybe | ArrayCustom,\n __ObjectS | Maybe | ArrayCustom,\n ...(__ObjectS | Maybe | ArrayCustom)[],\n ],\n>(\n ...values: T\n) => values as NotReadonly<T>;\n\nexport default tuple;\n"],"names":[],"mappings":";;AAEA,MAAM,KAAK,GAAG,CAOZ,GAAG,MAAS,KACT;;;;"}
1
+ {"version":3,"file":"tuple.cjs","names":[],"sources":["../../src/helpers/tuple.ts"],"sourcesContent":["import type {\n __ObjectS,\n ArrayCustom,\n NotReadonly,\n Optional,\n} from '../types';\n\nconst tuple = <\n const T extends [\n __ObjectS | Optional | ArrayCustom,\n __ObjectS | Optional | ArrayCustom,\n ...(__ObjectS | Optional | ArrayCustom)[],\n ],\n>(\n ...values: T\n) => values as NotReadonly<T>;\n\nexport default tuple;\n"],"mappings":";AAOA,MAAM,SAOJ,GAAG,WACA"}
@@ -1,4 +1,3 @@
1
- import type { __ObjectS, ArrayCustom, NotReadonly, Maybe } from '../types';
2
- declare const tuple: <const T extends [__ObjectS | Maybe | ArrayCustom, __ObjectS | Maybe | ArrayCustom, ...(__ObjectS | Maybe | ArrayCustom)[]]>(...values: T) => NotReadonly<T>;
1
+ import type { __ObjectS, ArrayCustom, NotReadonly, Optional } from '../types';
2
+ declare const tuple: <const T extends [__ObjectS | Optional | ArrayCustom, __ObjectS | Optional | ArrayCustom, ...(__ObjectS | Optional | ArrayCustom)[]]>(...values: T) => NotReadonly<T>;
3
3
  export default tuple;
4
- //# sourceMappingURL=tuple.d.ts.map
@@ -1,4 +1,6 @@
1
+ //#region src/helpers/tuple.ts
1
2
  const tuple = (...values) => values;
2
-
3
+ //#endregion
3
4
  export { tuple as default };
4
- //# sourceMappingURL=tuple.js.map
5
+
6
+ //# sourceMappingURL=tuple.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tuple.js","sources":["../../src/helpers/tuple.ts"],"sourcesContent":["import type { __ObjectS, ArrayCustom, NotReadonly, Maybe } from '../types';\n\nconst tuple = <\n const T extends [\n __ObjectS | Maybe | ArrayCustom,\n __ObjectS | Maybe | ArrayCustom,\n ...(__ObjectS | Maybe | ArrayCustom)[],\n ],\n>(\n ...values: T\n) => values as NotReadonly<T>;\n\nexport default tuple;\n"],"names":[],"mappings":"AAEA,MAAM,KAAK,GAAG,CAOZ,GAAG,MAAS,KACT;;;;"}
1
+ {"version":3,"file":"tuple.js","names":[],"sources":["../../src/helpers/tuple.ts"],"sourcesContent":["import type {\n __ObjectS,\n ArrayCustom,\n NotReadonly,\n Optional,\n} from '../types';\n\nconst tuple = <\n const T extends [\n __ObjectS | Optional | ArrayCustom,\n __ObjectS | Optional | ArrayCustom,\n ...(__ObjectS | Optional | ArrayCustom)[],\n ],\n>(\n ...values: T\n) => values as NotReadonly<T>;\n\nexport default tuple;\n"],"mappings":";AAOA,MAAM,SAOJ,GAAG,WACA"}
@@ -1,13 +1,10 @@
1
- 'use strict';
2
-
3
- var utils_expandFn = require('../utils/expandFn.cjs');
4
-
1
+ const require_utils_expandFn = require("../utils/expandFn.cjs");
2
+ //#region src/helpers/union.ts
5
3
  const union = (...values) => {
6
- return values[0];
4
+ return values[0];
7
5
  };
8
- const fn = utils_expandFn.expandFn(union, {
9
- discriminated: (_key, ...values) => union(...values),
10
- });
11
-
6
+ const fn = require_utils_expandFn.expandFn(union, { discriminated: (_key, ...values) => union(...values) });
7
+ //#endregion
12
8
  module.exports = fn;
13
- //# sourceMappingURL=union.cjs.map
9
+
10
+ //# sourceMappingURL=union.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"union.cjs","sources":["../../src/helpers/union.ts"],"sourcesContent":["import type { Keys, ObjectMapS, ObjectS } from '../types';\nimport { expandFn } from '../utils/expandFn';\n\nconst union = <T extends [ObjectS, ObjectS, ...ObjectS[]]>(\n ...values: T\n) => {\n return values[0] as T[number];\n};\n\ntype Discriminated<K extends Keys> = ObjectMapS & Record<K, ObjectS>;\n\nconst fn = expandFn(union, {\n discriminated: <\n const K extends Keys,\n T extends [Discriminated<K>, Discriminated<K>, ...Discriminated<K>[]],\n >(\n _key: K,\n ...values: T\n ) => union(...values),\n});\n\nexport default fn;\n"],"names":["expandFn"],"mappings":";;;;AAGA,MAAM,KAAK,GAAG,CACZ,GAAG,MAAS,KACV;AACF,IAAA,OAAO,MAAM,CAAC,CAAC,CAAc;AAC/B,CAAC;AAID,MAAM,EAAE,GAAGA,uBAAQ,CAAC,KAAK,EAAE;AACzB,IAAA,aAAa,EAAE,CAIb,IAAO,EACP,GAAG,MAAS,KACT,KAAK,CAAC,GAAG,MAAM,CAAC;AACtB,CAAA;;;;"}
1
+ {"version":3,"file":"union.cjs","names":["expandFn"],"sources":["../../src/helpers/union.ts"],"sourcesContent":["import type { Keys, ObjectMapS, ObjectS } from '../types';\nimport { expandFn } from '../utils/expandFn';\n\nconst union = <T extends [ObjectS, ObjectS, ...ObjectS[]]>(\n ...values: T\n) => {\n return values[0] as T[number];\n};\n\ntype Discriminated<K extends Keys> = ObjectMapS & Record<K, ObjectS>;\n\nconst fn = expandFn(union, {\n discriminated: <\n const K extends Keys,\n T extends [Discriminated<K>, Discriminated<K>, ...Discriminated<K>[]],\n >(\n _key: K,\n ...values: T\n ) => union(...values),\n});\n\nexport default fn;\n"],"mappings":";;AAGA,MAAM,SACJ,GAAG,WACA;AACH,QAAO,OAAO;;AAKhB,MAAM,KAAKA,uBAAAA,SAAS,OAAO,EACzB,gBAIE,MACA,GAAG,WACA,MAAM,GAAG,OAAO,EACtB,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import type { Keys, ObjectMapS, ObjectS } from '../types';
2
2
  type Discriminated<K extends Keys> = ObjectMapS & Record<K, ObjectS>;
3
- declare const fn: {
3
+ declare const fn: import("..").FnBasic<(<T extends [ObjectS, ObjectS, ...ObjectS[]]>(...values: T) => T[number]), {
4
4
  readonly discriminated: <const K extends Keys, T extends [Discriminated<K>, Discriminated<K>, ...Discriminated<K>[]]>(_key: K, ...values: T) => T[number];
5
- } & (<T extends [ObjectS, ObjectS, ...ObjectS[]]>(...values: T) => T[number]);
5
+ }>;
6
6
  export default fn;
7
- //# sourceMappingURL=union.d.ts.map
@@ -1,11 +1,10 @@
1
- import { expandFn } from '../utils/expandFn.js';
2
-
1
+ import { expandFn } from "../utils/expandFn.js";
2
+ //#region src/helpers/union.ts
3
3
  const union = (...values) => {
4
- return values[0];
4
+ return values[0];
5
5
  };
6
- const fn = expandFn(union, {
7
- discriminated: (_key, ...values) => union(...values),
8
- });
9
-
6
+ const fn = expandFn(union, { discriminated: (_key, ...values) => union(...values) });
7
+ //#endregion
10
8
  export { fn as default };
11
- //# sourceMappingURL=union.js.map
9
+
10
+ //# sourceMappingURL=union.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"union.js","sources":["../../src/helpers/union.ts"],"sourcesContent":["import type { Keys, ObjectMapS, ObjectS } from '../types';\nimport { expandFn } from '../utils/expandFn';\n\nconst union = <T extends [ObjectS, ObjectS, ...ObjectS[]]>(\n ...values: T\n) => {\n return values[0] as T[number];\n};\n\ntype Discriminated<K extends Keys> = ObjectMapS & Record<K, ObjectS>;\n\nconst fn = expandFn(union, {\n discriminated: <\n const K extends Keys,\n T extends [Discriminated<K>, Discriminated<K>, ...Discriminated<K>[]],\n >(\n _key: K,\n ...values: T\n ) => union(...values),\n});\n\nexport default fn;\n"],"names":[],"mappings":";;AAGA,MAAM,KAAK,GAAG,CACZ,GAAG,MAAS,KACV;AACF,IAAA,OAAO,MAAM,CAAC,CAAC,CAAc;AAC/B,CAAC;AAID,MAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,EAAE;AACzB,IAAA,aAAa,EAAE,CAIb,IAAO,EACP,GAAG,MAAS,KACT,KAAK,CAAC,GAAG,MAAM,CAAC;AACtB,CAAA;;;;"}
1
+ {"version":3,"file":"union.js","names":[],"sources":["../../src/helpers/union.ts"],"sourcesContent":["import type { Keys, ObjectMapS, ObjectS } from '../types';\nimport { expandFn } from '../utils/expandFn';\n\nconst union = <T extends [ObjectS, ObjectS, ...ObjectS[]]>(\n ...values: T\n) => {\n return values[0] as T[number];\n};\n\ntype Discriminated<K extends Keys> = ObjectMapS & Record<K, ObjectS>;\n\nconst fn = expandFn(union, {\n discriminated: <\n const K extends Keys,\n T extends [Discriminated<K>, Discriminated<K>, ...Discriminated<K>[]],\n >(\n _key: K,\n ...values: T\n ) => union(...values),\n});\n\nexport default fn;\n"],"mappings":";;AAGA,MAAM,SACJ,GAAG,WACA;AACH,QAAO,OAAO;;AAKhB,MAAM,KAAK,SAAS,OAAO,EACzB,gBAIE,MACA,GAAG,WACA,MAAM,GAAG,OAAO,EACtB,CAAC"}
package/lib/index.cjs CHANGED
@@ -1,40 +1,38 @@
1
- 'use strict';
2
-
3
- var constants = require('./constants.cjs');
4
- var helpers_any = require('./helpers/any.cjs');
5
- var helpers_array = require('./helpers/array.cjs');
6
- var helpers_custom = require('./helpers/custom.cjs');
7
- var helpers_intersection = require('./helpers/intersection.cjs');
8
- var helpers_litterals = require('./helpers/litterals.cjs');
9
- var helpers_maybe = require('./helpers/maybe.cjs');
10
- var helpers_partial = require('./helpers/partial.cjs');
11
- var helpers_record = require('./helpers/record.cjs');
12
- var helpers_soa = require('./helpers/soa.cjs');
13
- var helpers_sv = require('./helpers/sv.cjs');
14
- var helpers_tuple = require('./helpers/tuple.cjs');
15
- var helpers_union = require('./helpers/union.cjs');
16
- var transform = require('./transform.cjs');
17
-
18
-
19
-
20
- exports.ARRAY = constants.ARRAY;
21
- exports.CUSTOM = constants.CUSTOM;
22
- exports.MAYBE = constants.MAYBE;
23
- exports.PARTIAL = constants.PARTIAL;
24
- exports.PRIMITIVES = constants.PRIMITIVES;
25
- exports.PRIMITIVE_OBJECTS = constants.PRIMITIVE_OBJECTS;
26
- exports.SOA = constants.SOA;
27
- exports.any = helpers_any;
28
- exports.array = helpers_array;
29
- exports.custom = helpers_custom;
30
- exports.intersection = helpers_intersection;
31
- exports.litterals = helpers_litterals;
32
- exports.maybe = helpers_maybe;
33
- exports.partial = helpers_partial;
34
- exports.record = helpers_record;
35
- exports.soa = helpers_soa;
36
- exports.sv = helpers_sv;
37
- exports.tuple = helpers_tuple;
38
- exports.union = helpers_union;
39
- exports.transform = transform.transform;
40
- //# sourceMappingURL=index.cjs.map
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_types = require("./types.cjs");
3
+ const require_constants = require("./constants.cjs");
4
+ const require_helpers_any = require("./helpers/any.cjs");
5
+ const require_helpers_array = require("./helpers/array.cjs");
6
+ const require_helpers_custom = require("./helpers/custom.cjs");
7
+ const require_helpers_intersection = require("./helpers/intersection.cjs");
8
+ const require_helpers_litterals = require("./helpers/litterals.cjs");
9
+ const require_helpers_optional = require("./helpers/optional.cjs");
10
+ const require_helpers_partial = require("./helpers/partial.cjs");
11
+ const require_helpers_record = require("./helpers/record.cjs");
12
+ const require_helpers_soa = require("./helpers/soa.cjs");
13
+ const require_helpers_sv = require("./helpers/sv.cjs");
14
+ const require_helpers_tuple = require("./helpers/tuple.cjs");
15
+ const require_helpers_union = require("./helpers/union.cjs");
16
+ require("./helpers/index.cjs");
17
+ const require_type = require("./type.cjs");
18
+ exports.ARRAY = require_constants.ARRAY;
19
+ exports.CUSTOM = require_constants.CUSTOM;
20
+ exports.OPTIONAL = require_constants.OPTIONAL;
21
+ exports.OptionalHelperClass = require_types.OptionalHelperClass;
22
+ exports.PARTIAL = require_constants.PARTIAL;
23
+ exports.PRIMITIVES = require_constants.PRIMITIVES;
24
+ exports.PRIMITIVE_OBJECTS = require_constants.PRIMITIVE_OBJECTS;
25
+ exports.SOA = require_constants.SOA;
26
+ exports.any = require_helpers_any;
27
+ exports.array = require_helpers_array;
28
+ exports.custom = require_helpers_custom;
29
+ exports.intersection = require_helpers_intersection;
30
+ exports.litterals = require_helpers_litterals;
31
+ exports.optional = require_helpers_optional;
32
+ exports.partial = require_helpers_partial;
33
+ exports.record = require_helpers_record;
34
+ exports.soa = require_helpers_soa;
35
+ exports.sv = require_helpers_sv;
36
+ exports.tuple = require_helpers_tuple;
37
+ exports.type = require_type.type;
38
+ exports.union = require_helpers_union;
package/lib/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export * from './constants';
2
2
  export * from './helpers';
3
- export * from './transform';
3
+ export * from './type';
4
4
  export * from './types';
5
- //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -1,15 +1,17 @@
1
- export { ARRAY, CUSTOM, MAYBE, PARTIAL, PRIMITIVES, PRIMITIVE_OBJECTS, SOA } from './constants.js';
2
- export { default as any } from './helpers/any.js';
3
- export { default as array } from './helpers/array.js';
4
- export { default as custom } from './helpers/custom.js';
5
- export { default as intersection } from './helpers/intersection.js';
6
- export { default as litterals } from './helpers/litterals.js';
7
- export { default as maybe } from './helpers/maybe.js';
8
- export { default as partial } from './helpers/partial.js';
9
- export { default as record } from './helpers/record.js';
10
- export { default as soa } from './helpers/soa.js';
11
- export { default as sv } from './helpers/sv.js';
12
- export { default as tuple } from './helpers/tuple.js';
13
- export { default as union } from './helpers/union.js';
14
- export { transform } from './transform.js';
15
- //# sourceMappingURL=index.js.map
1
+ import { OptionalHelperClass } from "./types.js";
2
+ import { ARRAY, CUSTOM, OPTIONAL, PARTIAL, PRIMITIVES, PRIMITIVE_OBJECTS, SOA } from "./constants.js";
3
+ import any from "./helpers/any.js";
4
+ import array from "./helpers/array.js";
5
+ import custom from "./helpers/custom.js";
6
+ import intersection from "./helpers/intersection.js";
7
+ import litterals from "./helpers/litterals.js";
8
+ import optional from "./helpers/optional.js";
9
+ import partial from "./helpers/partial.js";
10
+ import record from "./helpers/record.js";
11
+ import soa from "./helpers/soa.js";
12
+ import sv from "./helpers/sv.js";
13
+ import tuple from "./helpers/tuple.js";
14
+ import fn from "./helpers/union.js";
15
+ import "./helpers/index.js";
16
+ import { type } from "./type.js";
17
+ export { ARRAY, CUSTOM, OPTIONAL, OptionalHelperClass, PARTIAL, PRIMITIVES, PRIMITIVE_OBJECTS, SOA, any, array, custom, intersection, litterals, optional, partial, record, soa, sv, tuple, type, fn as union };
package/lib/type.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import type { Transform_F } from './type.types';
2
+ export declare const type: Transform_F;
@@ -1,11 +1,11 @@
1
- import type { any, custom, intersection, litterals, maybe, partial, record, soa, sv, union, array, tuple } from './helpers';
1
+ import type { any, custom, intersection, litterals, optional, partial, record, soa, sv, union, array, tuple } from './helpers';
2
2
  import type { ObjectS, TransformS } from './types';
3
3
  export type Helpers = {
4
4
  any: typeof any;
5
5
  custom: typeof custom;
6
6
  intersection: typeof intersection;
7
7
  litterals: typeof litterals;
8
- maybe: typeof maybe;
8
+ optional: typeof optional;
9
9
  partial: typeof partial;
10
10
  record: typeof record;
11
11
  soa: typeof soa;
@@ -15,4 +15,3 @@ export type Helpers = {
15
15
  tuple: typeof tuple;
16
16
  };
17
17
  export type Transform_F = <T extends ObjectS = ObjectS>(option: (helpers: Helpers) => T) => TransformS<T>;
18
- //# sourceMappingURL=transform.types.d.ts.map
package/lib/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ARRAY, CUSTOM, MAYBE, PARTIAL, PRIMITIVES, PRIMITIVE_OBJECTS, SOA } from './constants';
1
+ import type { ARRAY, CUSTOM, OPTIONAL, PARTIAL, PRIMITIVES, PRIMITIVE_OBJECTS, SOA } from './constants';
2
2
  export type Ru = Record<Keys, unknown>;
3
3
  export type TrueObject = Ru & {
4
4
  [Symbol.iterator]?: never;
@@ -25,7 +25,7 @@ type _SingleOrRecursiveArrayOf<T> = T | RecursiveArrayOf<T>;
25
25
  export type SingleOrRecursiveArrayOf<T> = T | RecursiveArrayOf<T>;
26
26
  export type SoRa<T> = SingleOrRecursiveArrayOf<T>;
27
27
  export type PrimitiveS = (typeof PRIMITIVES)[number];
28
- type TransformPrimitiveS<T extends PrimitiveS> = T extends 'string' ? string : T extends 'number' ? number : T extends 'boolean' ? boolean : T extends 'null' ? null : T extends 'undefined' ? undefined : T extends 'symbol' ? symbol : never;
28
+ type TransformPrimitiveS<T extends PrimitiveS> = T extends 'string' ? string : T extends 'number' ? number : T extends 'boolean' ? boolean : T extends 'bigint' ? bigint : T extends 'null' ? null : T extends 'undefined' ? undefined : T extends 'symbol' ? symbol : never;
29
29
  export type Types = PrimitiveS | (typeof PRIMITIVE_OBJECTS)[number];
30
30
  export type TransformTypes<T extends Types> = T extends PrimitiveS ? TransformPrimitiveS<T> : T extends 'date' ? Date : {};
31
31
  export type Custom<T = any> = {
@@ -38,8 +38,8 @@ export type PartialCustom = {
38
38
  [PARTIAL]: undefined;
39
39
  };
40
40
  export type __ObjectS = Types | ObjectMapS | Custom | PartialCustom;
41
- export type Maybe<T extends __ObjectS | ArrayCustom | __ObjectS[] = __ObjectS> = {
42
- [MAYBE]: T;
41
+ export type Optional<T extends __ObjectS | ArrayCustom | AnyArray<__ObjectS> = __ObjectS> = {
42
+ [OPTIONAL]: T;
43
43
  };
44
44
  export type ArrayCustom<T extends ObjectS = any> = {
45
45
  [ARRAY]: T;
@@ -47,7 +47,11 @@ export type ArrayCustom<T extends ObjectS = any> = {
47
47
  export type ObjectMapS = {
48
48
  [key: Keys]: SoRa<_ObjectS>;
49
49
  };
50
- type _ObjectS = __ObjectS | Maybe | ArrayCustom;
50
+ export declare class OptionalHelperClass {
51
+ readonly __NO_TYPE__ = "@bemedev/addons/NO_TYPE";
52
+ private constructor();
53
+ }
54
+ type _ObjectS = __ObjectS | Optional | ArrayCustom;
51
55
  /**
52
56
  * A type that represents a primitive object, which can be a primitive value or an object
53
57
  *
@@ -59,23 +63,23 @@ type ReduceTuple2<T extends AnyArray<ObjectS>> = T extends [
59
63
  infer First,
60
64
  ...infer Rest extends AnyArray<ObjectS>
61
65
  ] ? [TransformS<First>, ...ReduceTuple2<Rest>] : T extends AnyArray<infer A extends ObjectS> ? TransformS<A>[] : [];
62
- type __TransformPrimitiveObject<T> = T extends Types ? TransformTypes<T> : T extends ArrayCustom<infer A> ? TransformS<A>[] : T extends SoaCustom<infer TSoA> ? SoA<__TransformPrimitiveObject<TSoA>> : T extends Custom<infer TCustom> ? TCustom : T extends AnyArray<ObjectS> ? ReduceTuple2<T> : T extends PartialCustom ? Partial<__TransformPrimitiveObject<NOmit<T, typeof PARTIAL>>> : T extends Maybe<infer TMaybe> ? __TransformPrimitiveObject<TMaybe> | undefined : {
66
+ type __TransformPrimitiveObject<T> = T extends Types ? TransformTypes<T> : T extends ArrayCustom<infer A> ? TransformS<A>[] : T extends SoaCustom<infer TSoA> ? SoA<__TransformPrimitiveObject<TSoA>> : T extends Custom<infer TCustom> ? TCustom : T extends AnyArray<ObjectS> ? ReduceTuple2<T> : T extends PartialCustom ? Partial<__TransformPrimitiveObject<NOmit<T, typeof PARTIAL>>> : T extends Optional<infer TOptional> ? __TransformPrimitiveObject<TOptional> | OptionalHelperClass : {
63
67
  [K in keyof T]: __TransformPrimitiveObject<T[K]>;
64
68
  };
65
69
  type ReduceTupleU<T extends AnyArray> = T extends [
66
70
  infer First,
67
71
  ...infer Rest extends AnyArray
68
72
  ] ? [Undefiny<First>, ...ReduceTupleU<Rest>] : T[number] extends never ? [] : T['length'] extends 0 ? [] : number extends T['length'] ? T : Undefiny<T[number]>[];
69
- type HasUndefined<T> = undefined extends T ? true : false;
73
+ type HasUndefined<T> = OptionalHelperClass extends T ? true : false;
70
74
  type UndefinyObject<T extends object> = {
71
75
  [K in keyof T as HasUndefined<T[K]> extends true ? never : K]: Undefiny<T[K]>;
72
76
  } & {
73
- [K in keyof T as HasUndefined<T[K]> extends true ? K : never]?: Undefiny<Exclude<T[K], undefined>>;
77
+ [K in keyof T as HasUndefined<T[K]> extends true ? K : never]?: Undefiny<T[K]>;
74
78
  } extends infer F ? {
75
79
  [K in keyof F]: F[K];
76
80
  } : never;
77
- type Undefiny<T> = T extends AnyArray ? ReduceTupleU<T> : T extends Ru ? UndefinyObject<T> : T;
81
+ type Undefiny<T, U = Exclude<T, OptionalHelperClass>> = U extends AnyArray ? ReduceTupleU<U> : U extends Ru ? UndefinyObject<U> : U;
78
82
  export type TransformS<T> = Undefiny<__TransformPrimitiveObject<T>>;
79
83
  export type inferT<T extends ObjectS> = TransformS<T>;
84
+ export type FnBasic<Main extends Fn, Tr extends object> = Tr & Main;
80
85
  export {};
81
- //# sourceMappingURL=types.d.ts.map
@@ -1,12 +1,11 @@
1
- 'use strict';
2
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/utils/expandFn.ts
3
3
  const expandFn = (main, extensions) => {
4
- const out = main;
5
- if (extensions) {
6
- Object.assign(out, extensions);
7
- }
8
- return out;
4
+ const out = main;
5
+ if (extensions) Object.assign(out, extensions);
6
+ return out;
9
7
  };
10
-
8
+ //#endregion
11
9
  exports.expandFn = expandFn;
12
- //# sourceMappingURL=expandFn.cjs.map
10
+
11
+ //# sourceMappingURL=expandFn.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"expandFn.cjs","sources":["../../src/utils/expandFn.ts"],"sourcesContent":["type Fn<Args extends any[] = any[], R = any> = (...args: Args) => R;\n\ntype FnBasic<Main extends Fn, Tr extends object> = Tr & Main;\n\nexport const expandFn = <\n Main extends Fn,\n const Tr extends object = object,\n>(\n main: Main,\n extensions?: Tr,\n): FnBasic<Main, Tr> => {\n const out: any = main;\n\n if (extensions) {\n Object.assign(out, extensions);\n }\n\n return out;\n};\n"],"names":[],"mappings":";;MAIa,QAAQ,GAAG,CAItB,IAAU,EACV,UAAe,KACM;IACrB,MAAM,GAAG,GAAQ,IAAI;IAErB,IAAI,UAAU,EAAE;AACd,QAAA,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,UAAU,CAAC;IAChC;AAEA,IAAA,OAAO,GAAG;AACZ;;;;"}
1
+ {"version":3,"file":"expandFn.cjs","names":[],"sources":["../../src/utils/expandFn.ts"],"sourcesContent":["import type { Fn, FnBasic } from '../types';\n\nexport const expandFn = <\n Main extends Fn,\n const Tr extends object = object,\n>(\n main: Main,\n extensions?: Tr,\n): FnBasic<Main, Tr> => {\n const out: any = main;\n\n if (extensions) {\n Object.assign(out, extensions);\n }\n\n return out;\n};\n"],"mappings":";;AAEA,MAAa,YAIX,MACA,eACsB;CACtB,MAAM,MAAW;AAEjB,KAAI,WACF,QAAO,OAAO,KAAK,WAAW;AAGhC,QAAO"}
@@ -1,5 +1,2 @@
1
- type Fn<Args extends any[] = any[], R = any> = (...args: Args) => R;
2
- type FnBasic<Main extends Fn, Tr extends object> = Tr & Main;
1
+ import type { Fn, FnBasic } from '../types';
3
2
  export declare const expandFn: <Main extends Fn, const Tr extends object = object>(main: Main, extensions?: Tr) => FnBasic<Main, Tr>;
4
- export {};
5
- //# sourceMappingURL=expandFn.d.ts.map