@bemedev/typings 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_virtual/_rolldown/runtime.cjs +13 -0
- package/lib/_virtual/_rolldown/runtime.js +13 -0
- package/lib/helpers/any.cjs +2 -1
- package/lib/helpers/any.cjs.map +1 -1
- package/lib/helpers/any.d.ts +1 -1
- package/lib/helpers/any.js +1 -1
- package/lib/helpers/any.js.map +1 -1
- package/lib/helpers/array.cjs +2 -1
- package/lib/helpers/array.cjs.map +1 -1
- package/lib/helpers/array.d.ts +1 -1
- package/lib/helpers/array.js +1 -1
- package/lib/helpers/array.js.map +1 -1
- package/lib/helpers/custom.cjs +2 -1
- package/lib/helpers/custom.cjs.map +1 -1
- package/lib/helpers/custom.d.ts +2 -2
- package/lib/helpers/custom.js +1 -1
- package/lib/helpers/custom.js.map +1 -1
- package/lib/helpers/index.cjs +39 -13
- package/lib/helpers/index.cjs.map +1 -0
- package/lib/helpers/index.d.ts +13 -13
- package/lib/helpers/index.js +34 -14
- package/lib/helpers/index.js.map +1 -0
- package/lib/helpers/intersection.cjs +2 -1
- package/lib/helpers/intersection.cjs.map +1 -1
- package/lib/helpers/intersection.d.ts +2 -2
- package/lib/helpers/intersection.js +1 -1
- package/lib/helpers/intersection.js.map +1 -1
- package/lib/helpers/litterals.cjs +2 -1
- package/lib/helpers/litterals.cjs.map +1 -1
- package/lib/helpers/litterals.d.ts +2 -2
- package/lib/helpers/litterals.js +1 -1
- package/lib/helpers/litterals.js.map +1 -1
- package/lib/helpers/optional.cjs +2 -1
- package/lib/helpers/optional.cjs.map +1 -1
- package/lib/helpers/optional.d.ts +1 -1
- package/lib/helpers/optional.js +1 -1
- package/lib/helpers/optional.js.map +1 -1
- package/lib/helpers/partial.cjs +2 -1
- package/lib/helpers/partial.cjs.map +1 -1
- package/lib/helpers/partial.d.ts +1 -1
- package/lib/helpers/partial.js +1 -1
- package/lib/helpers/partial.js.map +1 -1
- package/lib/helpers/primitiveObject.cjs +2 -1
- package/lib/helpers/primitiveObject.cjs.map +1 -1
- package/lib/helpers/primitiveObject.d.ts +1 -1
- package/lib/helpers/primitiveObject.js +1 -1
- package/lib/helpers/primitiveObject.js.map +1 -1
- package/lib/helpers/record.cjs +2 -1
- package/lib/helpers/record.cjs.map +1 -1
- package/lib/helpers/record.d.ts +1 -1
- package/lib/helpers/record.js +1 -1
- package/lib/helpers/record.js.map +1 -1
- package/lib/helpers/soa.cjs +2 -1
- package/lib/helpers/soa.cjs.map +1 -1
- package/lib/helpers/soa.d.ts +1 -1
- package/lib/helpers/soa.js +1 -1
- package/lib/helpers/soa.js.map +1 -1
- package/lib/helpers/sv.cjs +2 -1
- package/lib/helpers/sv.cjs.map +1 -1
- package/lib/helpers/sv.d.ts +2 -2
- package/lib/helpers/sv.js +1 -1
- package/lib/helpers/sv.js.map +1 -1
- package/lib/helpers/tuple.cjs +2 -1
- package/lib/helpers/tuple.cjs.map +1 -1
- package/lib/helpers/tuple.d.ts +1 -1
- package/lib/helpers/tuple.js +1 -1
- package/lib/helpers/tuple.js.map +1 -1
- package/lib/helpers/union.cjs +4 -3
- package/lib/helpers/union.cjs.map +1 -1
- package/lib/helpers/union.d.ts +2 -2
- package/lib/helpers/union.js +3 -3
- package/lib/helpers/union.js.map +1 -1
- package/lib/index.cjs +7 -27
- package/lib/index.d.ts +4 -4
- package/lib/index.js +2 -15
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
exports.__exportAll = __exportAll;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll };
|
package/lib/helpers/any.cjs
CHANGED
package/lib/helpers/any.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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 { any };\n"],"mappings":";;AAEA,MAAM,OAAoC,UACxC"}
|
package/lib/helpers/any.d.ts
CHANGED
package/lib/helpers/any.js
CHANGED
package/lib/helpers/any.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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 { any };\n"],"mappings":";AAEA,MAAM,OAAoC,UACxC"}
|
package/lib/helpers/array.cjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
const require_constants = require("../constants.cjs");
|
|
2
3
|
//#region src/helpers/array.ts
|
|
3
4
|
const array = (value) => {
|
|
4
5
|
return { [require_constants.ARRAY]: value };
|
|
5
6
|
};
|
|
6
7
|
//#endregion
|
|
7
|
-
|
|
8
|
+
exports.array = array;
|
|
8
9
|
|
|
9
10
|
//# sourceMappingURL=array.cjs.map
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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 { array };\n"],"mappings":";;;AAGA,MAAM,SAAkC,UAAa;AAGnD,QAAO,GAAGA,kBAAAA,QAAQ,OAAO"}
|
package/lib/helpers/array.d.ts
CHANGED
package/lib/helpers/array.js
CHANGED
package/lib/helpers/array.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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 { array };\n"],"mappings":";;AAGA,MAAM,SAAkC,UAAa;AAGnD,QAAO,GAAG,QAAQ,OAAO"}
|
package/lib/helpers/custom.cjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
const require_constants = require("../constants.cjs");
|
|
2
3
|
//#region src/helpers/custom.ts
|
|
3
4
|
const custom = (value) => ({ [require_constants.CUSTOM]: value });
|
|
4
5
|
//#endregion
|
|
5
|
-
|
|
6
|
+
exports.custom = custom;
|
|
6
7
|
|
|
7
8
|
//# sourceMappingURL=custom.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.cjs","names":["CUSTOM"],"sources":["../../src/helpers/custom.ts"],"sourcesContent":["import { CUSTOM } from
|
|
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 { custom };\n"],"mappings":";;;AAGA,MAAM,UAAmB,WACtB,GACEA,kBAAAA,SAAS,OACX"}
|
package/lib/helpers/custom.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Custom } from
|
|
1
|
+
import type { Custom } from "../types";
|
|
2
2
|
declare const custom: <T = any>(value?: T) => Custom<T>;
|
|
3
|
-
export
|
|
3
|
+
export { custom };
|
package/lib/helpers/custom.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.js","names":[],"sources":["../../src/helpers/custom.ts"],"sourcesContent":["import { CUSTOM } from
|
|
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 { custom };\n"],"mappings":";;AAGA,MAAM,UAAmB,WACtB,GACE,SAAS,OACX"}
|
package/lib/helpers/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
2
3
|
const require_helpers_any = require("./any.cjs");
|
|
3
4
|
const require_helpers_array = require("./array.cjs");
|
|
4
5
|
const require_helpers_custom = require("./custom.cjs");
|
|
@@ -12,16 +13,41 @@ const require_helpers_sv = require("./sv.cjs");
|
|
|
12
13
|
const require_helpers_tuple = require("./tuple.cjs");
|
|
13
14
|
const require_helpers_union = require("./union.cjs");
|
|
14
15
|
const require_helpers_primitiveObject = require("./primitiveObject.cjs");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
//#region src/helpers/index.ts
|
|
17
|
+
var helpers_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
18
|
+
any: () => require_helpers_any.any,
|
|
19
|
+
array: () => require_helpers_array.array,
|
|
20
|
+
custom: () => require_helpers_custom.custom,
|
|
21
|
+
intersection: () => require_helpers_intersection.intersection,
|
|
22
|
+
litterals: () => require_helpers_litterals.litterals,
|
|
23
|
+
optional: () => require_helpers_optional.optional,
|
|
24
|
+
partial: () => require_helpers_partial.partial,
|
|
25
|
+
primitiveObject: () => require_helpers_primitiveObject.primitiveObject,
|
|
26
|
+
record: () => require_helpers_record.record,
|
|
27
|
+
soa: () => require_helpers_soa.soa,
|
|
28
|
+
sv: () => require_helpers_sv.sv,
|
|
29
|
+
tuple: () => require_helpers_tuple.tuple,
|
|
30
|
+
union: () => require_helpers_union.union
|
|
31
|
+
});
|
|
32
|
+
//#endregion
|
|
33
|
+
exports.any = require_helpers_any.any;
|
|
34
|
+
exports.array = require_helpers_array.array;
|
|
35
|
+
exports.custom = require_helpers_custom.custom;
|
|
36
|
+
Object.defineProperty(exports, "helpers_exports", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function() {
|
|
39
|
+
return helpers_exports;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
exports.intersection = require_helpers_intersection.intersection;
|
|
43
|
+
exports.litterals = require_helpers_litterals.litterals;
|
|
44
|
+
exports.optional = require_helpers_optional.optional;
|
|
45
|
+
exports.partial = require_helpers_partial.partial;
|
|
46
|
+
exports.primitiveObject = require_helpers_primitiveObject.primitiveObject;
|
|
47
|
+
exports.record = require_helpers_record.record;
|
|
48
|
+
exports.soa = require_helpers_soa.soa;
|
|
49
|
+
exports.sv = require_helpers_sv.sv;
|
|
50
|
+
exports.tuple = require_helpers_tuple.tuple;
|
|
51
|
+
exports.union = require_helpers_union.union;
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/helpers/index.ts"],"sourcesContent":["export * from \"./any\";\nexport * from \"./array\";\nexport * from \"./custom\";\nexport * from \"./intersection\";\nexport * from \"./litterals\";\nexport * from \"./optional\";\nexport * from \"./partial\";\nexport * from \"./record\";\nexport * from \"./soa\";\nexport * from \"./sv\";\nexport * from \"./tuple\";\nexport * from \"./union\";\nexport * from \"./primitiveObject\";\n"],"mappings":""}
|
package/lib/helpers/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
1
|
+
export * from "./any";
|
|
2
|
+
export * from "./array";
|
|
3
|
+
export * from "./custom";
|
|
4
|
+
export * from "./intersection";
|
|
5
|
+
export * from "./litterals";
|
|
6
|
+
export * from "./optional";
|
|
7
|
+
export * from "./partial";
|
|
8
|
+
export * from "./record";
|
|
9
|
+
export * from "./soa";
|
|
10
|
+
export * from "./sv";
|
|
11
|
+
export * from "./tuple";
|
|
12
|
+
export * from "./union";
|
|
13
|
+
export * from "./primitiveObject";
|
package/lib/helpers/index.js
CHANGED
|
@@ -1,14 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { any } from "./any.js";
|
|
3
|
+
import { array } from "./array.js";
|
|
4
|
+
import { custom } from "./custom.js";
|
|
5
|
+
import { intersection } from "./intersection.js";
|
|
6
|
+
import { litterals } from "./litterals.js";
|
|
7
|
+
import { optional } from "./optional.js";
|
|
8
|
+
import { partial } from "./partial.js";
|
|
9
|
+
import { record } from "./record.js";
|
|
10
|
+
import { soa } from "./soa.js";
|
|
11
|
+
import { sv } from "./sv.js";
|
|
12
|
+
import { tuple } from "./tuple.js";
|
|
13
|
+
import { union } from "./union.js";
|
|
14
|
+
import { primitiveObject } from "./primitiveObject.js";
|
|
15
|
+
//#region src/helpers/index.ts
|
|
16
|
+
var helpers_exports = /* @__PURE__ */ __exportAll({
|
|
17
|
+
any: () => any,
|
|
18
|
+
array: () => array,
|
|
19
|
+
custom: () => custom,
|
|
20
|
+
intersection: () => intersection,
|
|
21
|
+
litterals: () => litterals,
|
|
22
|
+
optional: () => optional,
|
|
23
|
+
partial: () => partial,
|
|
24
|
+
primitiveObject: () => primitiveObject,
|
|
25
|
+
record: () => record,
|
|
26
|
+
soa: () => soa,
|
|
27
|
+
sv: () => sv,
|
|
28
|
+
tuple: () => tuple,
|
|
29
|
+
union: () => union
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
export { any, array, custom, helpers_exports, intersection, litterals, optional, partial, primitiveObject, record, soa, sv, tuple, union };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/helpers/index.ts"],"sourcesContent":["export * from \"./any\";\nexport * from \"./array\";\nexport * from \"./custom\";\nexport * from \"./intersection\";\nexport * from \"./litterals\";\nexport * from \"./optional\";\nexport * from \"./partial\";\nexport * from \"./record\";\nexport * from \"./soa\";\nexport * from \"./sv\";\nexport * from \"./tuple\";\nexport * from \"./union\";\nexport * from \"./primitiveObject\";\n"],"mappings":""}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
//#region src/helpers/intersection.ts
|
|
2
3
|
const intersection = (...values) => {
|
|
3
4
|
return values.reduce((acc, curr) => {
|
|
@@ -8,6 +9,6 @@ const intersection = (...values) => {
|
|
|
8
9
|
}, {});
|
|
9
10
|
};
|
|
10
11
|
//#endregion
|
|
11
|
-
|
|
12
|
+
exports.intersection = intersection;
|
|
12
13
|
|
|
13
14
|
//# sourceMappingURL=intersection.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intersection.cjs","names":[],"sources":["../../src/helpers/intersection.ts"],"sourcesContent":["import type { ObjectMapS } from
|
|
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 { 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,4 +1,4 @@
|
|
|
1
|
-
import type { ObjectMapS } from
|
|
1
|
+
import type { ObjectMapS } from "../types";
|
|
2
2
|
type _IntersectionCustom<T extends ObjectMapS[]> = T extends [
|
|
3
3
|
infer First extends ObjectMapS,
|
|
4
4
|
...infer Rest extends ObjectMapS[]
|
|
@@ -7,4 +7,4 @@ export type IntersectionCustom<T extends ObjectMapS[]> = _IntersectionCustom<T>
|
|
|
7
7
|
[K in keyof R]: R[K];
|
|
8
8
|
} : never;
|
|
9
9
|
declare const intersection: <T extends [ObjectMapS, ObjectMapS, ...ObjectMapS[]]>(...values: T) => IntersectionCustom<T>;
|
|
10
|
-
export
|
|
10
|
+
export { intersection };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intersection.js","names":[],"sources":["../../src/helpers/intersection.ts"],"sourcesContent":["import type { ObjectMapS } from
|
|
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 { 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,7 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
//#region src/helpers/litterals.ts
|
|
2
3
|
const litterals = (...values) => values[0];
|
|
3
4
|
//#endregion
|
|
4
|
-
|
|
5
|
+
exports.litterals = litterals;
|
|
5
6
|
|
|
6
7
|
//# sourceMappingURL=litterals.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"litterals.cjs","names":[],"sources":["../../src/helpers/litterals.ts"],"sourcesContent":["import type { Custom } from
|
|
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 { litterals };\n"],"mappings":";;AAEA,MAAM,aACJ,GAAG,WACA,OAAO"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Custom } from
|
|
1
|
+
import type { Custom } from "../types";
|
|
2
2
|
declare const litterals: <const T extends (string | number | boolean)[]>(...values: T) => Custom<T[number]>;
|
|
3
|
-
export
|
|
3
|
+
export { litterals };
|
package/lib/helpers/litterals.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"litterals.js","names":[],"sources":["../../src/helpers/litterals.ts"],"sourcesContent":["import type { Custom } from
|
|
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 { litterals };\n"],"mappings":";AAEA,MAAM,aACJ,GAAG,WACA,OAAO"}
|
package/lib/helpers/optional.cjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
const require_constants = require("../constants.cjs");
|
|
2
3
|
//#region src/helpers/optional.ts
|
|
3
4
|
const optional = (value) => ({ [require_constants.OPTIONAL]: value });
|
|
4
5
|
//#endregion
|
|
5
|
-
|
|
6
|
+
exports.optional = optional;
|
|
6
7
|
|
|
7
8
|
//# sourceMappingURL=optional.cjs.map
|
|
@@ -1 +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
|
|
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 { optional };\n"],"mappings":";;;AAGA,MAAM,YACJ,WAEC,GACEA,kBAAAA,WAAW,OACb"}
|
package/lib/helpers/optional.js
CHANGED
|
@@ -1 +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
|
|
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 { optional };\n"],"mappings":";;AAGA,MAAM,YACJ,WAEC,GACE,WAAW,OACb"}
|
package/lib/helpers/partial.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
const require_constants = require("../constants.cjs");
|
|
2
3
|
//#region src/helpers/partial.ts
|
|
3
4
|
const partial = (value) => {
|
|
@@ -9,6 +10,6 @@ const partial = (value) => {
|
|
|
9
10
|
return out;
|
|
10
11
|
};
|
|
11
12
|
//#endregion
|
|
12
|
-
|
|
13
|
+
exports.partial = partial;
|
|
13
14
|
|
|
14
15
|
//# sourceMappingURL=partial.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partial.cjs","names":["PARTIAL"],"sources":["../../src/helpers/partial.ts"],"sourcesContent":["import { PARTIAL } from \"../constants\";\nimport type { ObjectT, PartialCustom } from \"../types\";\n\nconst partial = <T extends ObjectT>(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
|
|
1
|
+
{"version":3,"file":"partial.cjs","names":["PARTIAL"],"sources":["../../src/helpers/partial.ts"],"sourcesContent":["import { PARTIAL } from \"../constants\";\nimport type { ObjectT, PartialCustom } from \"../types\";\n\nconst partial = <T extends ObjectT>(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 { 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"}
|
package/lib/helpers/partial.d.ts
CHANGED
package/lib/helpers/partial.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partial.js","names":[],"sources":["../../src/helpers/partial.ts"],"sourcesContent":["import { PARTIAL } from \"../constants\";\nimport type { ObjectT, PartialCustom } from \"../types\";\n\nconst partial = <T extends ObjectT>(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
|
|
1
|
+
{"version":3,"file":"partial.js","names":[],"sources":["../../src/helpers/partial.ts"],"sourcesContent":["import { PARTIAL } from \"../constants\";\nimport type { ObjectT, PartialCustom } from \"../types\";\n\nconst partial = <T extends ObjectT>(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 { 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,3 +1,4 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
//#region src/helpers/primitiveObject.ts
|
|
2
3
|
const primitiveObject = require("../utils/expandFn.cjs").expandFn((value) => {
|
|
3
4
|
return value || {};
|
|
@@ -5,6 +6,6 @@ const primitiveObject = require("../utils/expandFn.cjs").expandFn((value) => {
|
|
|
5
6
|
return value || {};
|
|
6
7
|
} });
|
|
7
8
|
//#endregion
|
|
8
|
-
|
|
9
|
+
exports.primitiveObject = primitiveObject;
|
|
9
10
|
|
|
10
11
|
//# sourceMappingURL=primitiveObject.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitiveObject.cjs","names":["expandFn"],"sources":["../../src/helpers/primitiveObject.ts"],"sourcesContent":["import type {\n NotReadonly,\n PrimitiveObjectMapS,\n PrimitiveObjectT,\n} from \"../types\";\nimport { expandFn } from \"../utils/expandFn\";\n\nconst primitiveObject = expandFn(\n <const T extends PrimitiveObjectT = PrimitiveObjectT>(\n value?: T,\n ): Exclude<NotReadonly<T>, undefined> => {\n return (value || {}) as any;\n },\n {\n map: <const T extends PrimitiveObjectMapS = PrimitiveObjectMapS>(\n value?: T,\n ): Exclude<NotReadonly<T>, undefined> => {\n return (value || {}) as any;\n },\n },\n);\n\nexport
|
|
1
|
+
{"version":3,"file":"primitiveObject.cjs","names":["expandFn"],"sources":["../../src/helpers/primitiveObject.ts"],"sourcesContent":["import type {\n NotReadonly,\n PrimitiveObjectMapS,\n PrimitiveObjectT,\n} from \"../types\";\nimport { expandFn } from \"../utils/expandFn\";\n\nconst primitiveObject = expandFn(\n <const T extends PrimitiveObjectT = PrimitiveObjectT>(\n value?: T,\n ): Exclude<NotReadonly<T>, undefined> => {\n return (value || {}) as any;\n },\n {\n map: <const T extends PrimitiveObjectMapS = PrimitiveObjectMapS>(\n value?: T,\n ): Exclude<NotReadonly<T>, undefined> => {\n return (value || {}) as any;\n },\n },\n);\n\nexport { primitiveObject };\n"],"mappings":";;AAOA,MAAM,mDAAkBA,UAEpB,UACuC;AACvC,QAAQ,SAAS,EAAE;GAErB,EACE,MACE,UACuC;AACvC,QAAQ,SAAS,EAAE;GAEtB,CACF"}
|
|
@@ -2,4 +2,4 @@ import type { NotReadonly, PrimitiveObjectMapS, PrimitiveObjectT } from "../type
|
|
|
2
2
|
declare const primitiveObject: import("..").FnBasic<(<const T extends PrimitiveObjectT = PrimitiveObjectT>(value?: T) => Exclude<NotReadonly<T>, undefined>), {
|
|
3
3
|
readonly map: <const T extends PrimitiveObjectMapS = PrimitiveObjectMapS>(value?: T) => Exclude<NotReadonly<T>, undefined>;
|
|
4
4
|
}>;
|
|
5
|
-
export
|
|
5
|
+
export { primitiveObject };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitiveObject.js","names":[],"sources":["../../src/helpers/primitiveObject.ts"],"sourcesContent":["import type {\n NotReadonly,\n PrimitiveObjectMapS,\n PrimitiveObjectT,\n} from \"../types\";\nimport { expandFn } from \"../utils/expandFn\";\n\nconst primitiveObject = expandFn(\n <const T extends PrimitiveObjectT = PrimitiveObjectT>(\n value?: T,\n ): Exclude<NotReadonly<T>, undefined> => {\n return (value || {}) as any;\n },\n {\n map: <const T extends PrimitiveObjectMapS = PrimitiveObjectMapS>(\n value?: T,\n ): Exclude<NotReadonly<T>, undefined> => {\n return (value || {}) as any;\n },\n },\n);\n\nexport
|
|
1
|
+
{"version":3,"file":"primitiveObject.js","names":[],"sources":["../../src/helpers/primitiveObject.ts"],"sourcesContent":["import type {\n NotReadonly,\n PrimitiveObjectMapS,\n PrimitiveObjectT,\n} from \"../types\";\nimport { expandFn } from \"../utils/expandFn\";\n\nconst primitiveObject = expandFn(\n <const T extends PrimitiveObjectT = PrimitiveObjectT>(\n value?: T,\n ): Exclude<NotReadonly<T>, undefined> => {\n return (value || {}) as any;\n },\n {\n map: <const T extends PrimitiveObjectMapS = PrimitiveObjectMapS>(\n value?: T,\n ): Exclude<NotReadonly<T>, undefined> => {\n return (value || {}) as any;\n },\n },\n);\n\nexport { primitiveObject };\n"],"mappings":";;AAOA,MAAM,kBAAkB,UAEpB,UACuC;AACvC,QAAQ,SAAS,EAAE;GAErB,EACE,MACE,UACuC;AACvC,QAAQ,SAAS,EAAE;GAEtB,CACF"}
|
package/lib/helpers/record.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
//#region src/helpers/record.ts
|
|
2
3
|
const record = (value, ...keys) => {
|
|
3
4
|
return keys.reduce((acc, key) => {
|
|
@@ -6,6 +7,6 @@ const record = (value, ...keys) => {
|
|
|
6
7
|
}, {});
|
|
7
8
|
};
|
|
8
9
|
//#endregion
|
|
9
|
-
|
|
10
|
+
exports.record = record;
|
|
10
11
|
|
|
11
12
|
//# sourceMappingURL=record.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.cjs","names":[],"sources":["../../src/helpers/record.ts"],"sourcesContent":["import type { Keys, ObjectT } from \"../types\";\n\nconst record = <const K extends Keys[], V extends ObjectT>(\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
|
|
1
|
+
{"version":3,"file":"record.cjs","names":[],"sources":["../../src/helpers/record.ts"],"sourcesContent":["import type { Keys, ObjectT } from \"../types\";\n\nconst record = <const K extends Keys[], V extends ObjectT>(\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 { record };\n"],"mappings":";;AAEA,MAAM,UACJ,OACA,GAAG,SACA;AAMH,QALe,KAAK,QAAQ,KAAK,QAAQ;AACvC,MAAI,OAAO;AACX,SAAO;IACN,EAAE,CAAQ"}
|
package/lib/helpers/record.d.ts
CHANGED
package/lib/helpers/record.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","names":[],"sources":["../../src/helpers/record.ts"],"sourcesContent":["import type { Keys, ObjectT } from \"../types\";\n\nconst record = <const K extends Keys[], V extends ObjectT>(\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
|
|
1
|
+
{"version":3,"file":"record.js","names":[],"sources":["../../src/helpers/record.ts"],"sourcesContent":["import type { Keys, ObjectT } from \"../types\";\n\nconst record = <const K extends Keys[], V extends ObjectT>(\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 { record };\n"],"mappings":";AAEA,MAAM,UACJ,OACA,GAAG,SACA;AAMH,QALe,KAAK,QAAQ,KAAK,QAAQ;AACvC,MAAI,OAAO;AACX,SAAO;IACN,EAAE,CAAQ"}
|
package/lib/helpers/soa.cjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
const require_constants = require("../constants.cjs");
|
|
2
3
|
//#region src/helpers/soa.ts
|
|
3
4
|
const soa = (value) => {
|
|
4
5
|
return { [require_constants.SOA]: value };
|
|
5
6
|
};
|
|
6
7
|
//#endregion
|
|
7
|
-
|
|
8
|
+
exports.soa = soa;
|
|
8
9
|
|
|
9
10
|
//# sourceMappingURL=soa.cjs.map
|
package/lib/helpers/soa.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"soa.cjs","names":["SOA"],"sources":["../../src/helpers/soa.ts"],"sourcesContent":["import { SOA } from \"../constants\";\nimport type { NotReadonly, ObjectT, SoaCustom } from \"../types\";\n\nconst soa = <const T extends ObjectT>(value: T) => {\n type Out = SoaCustom<Extract<NotReadonly<T>, ObjectT>>;\n return { [SOA]: value } as Out;\n};\n\nexport
|
|
1
|
+
{"version":3,"file":"soa.cjs","names":["SOA"],"sources":["../../src/helpers/soa.ts"],"sourcesContent":["import { SOA } from \"../constants\";\nimport type { NotReadonly, ObjectT, SoaCustom } from \"../types\";\n\nconst soa = <const T extends ObjectT>(value: T) => {\n type Out = SoaCustom<Extract<NotReadonly<T>, ObjectT>>;\n return { [SOA]: value } as Out;\n};\n\nexport { soa };\n"],"mappings":";;;AAGA,MAAM,OAAgC,UAAa;AAEjD,QAAO,GAAGA,kBAAAA,MAAM,OAAO"}
|
package/lib/helpers/soa.d.ts
CHANGED
package/lib/helpers/soa.js
CHANGED
package/lib/helpers/soa.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"soa.js","names":[],"sources":["../../src/helpers/soa.ts"],"sourcesContent":["import { SOA } from \"../constants\";\nimport type { NotReadonly, ObjectT, SoaCustom } from \"../types\";\n\nconst soa = <const T extends ObjectT>(value: T) => {\n type Out = SoaCustom<Extract<NotReadonly<T>, ObjectT>>;\n return { [SOA]: value } as Out;\n};\n\nexport
|
|
1
|
+
{"version":3,"file":"soa.js","names":[],"sources":["../../src/helpers/soa.ts"],"sourcesContent":["import { SOA } from \"../constants\";\nimport type { NotReadonly, ObjectT, SoaCustom } from \"../types\";\n\nconst soa = <const T extends ObjectT>(value: T) => {\n type Out = SoaCustom<Extract<NotReadonly<T>, ObjectT>>;\n return { [SOA]: value } as Out;\n};\n\nexport { soa };\n"],"mappings":";;AAGA,MAAM,OAAgC,UAAa;AAEjD,QAAO,GAAG,MAAM,OAAO"}
|
package/lib/helpers/sv.cjs
CHANGED
package/lib/helpers/sv.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sv.cjs","names":[],"sources":["../../src/helpers/sv.ts"],"sourcesContent":["import type { Custom, StateValue } from
|
|
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 { sv };\n"],"mappings":";;AAEA,MAAM,KAAK,EAAE"}
|
package/lib/helpers/sv.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Custom, StateValue } from
|
|
1
|
+
import type { Custom, StateValue } from "../types";
|
|
2
2
|
declare const sv: Custom<StateValue>;
|
|
3
|
-
export
|
|
3
|
+
export { sv };
|
package/lib/helpers/sv.js
CHANGED
package/lib/helpers/sv.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sv.js","names":[],"sources":["../../src/helpers/sv.ts"],"sourcesContent":["import type { Custom, StateValue } from
|
|
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 { sv };\n"],"mappings":";AAEA,MAAM,KAAK,EAAE"}
|
package/lib/helpers/tuple.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tuple.cjs","names":[],"sources":["../../src/helpers/tuple.ts"],"sourcesContent":["import type { NotReadonly, ObjectT } from \"../types\";\n\nconst tuple = <const T extends [ObjectT, ...ObjectT[]]>(...values: T) =>\n values as NotReadonly<T>;\n\nexport
|
|
1
|
+
{"version":3,"file":"tuple.cjs","names":[],"sources":["../../src/helpers/tuple.ts"],"sourcesContent":["import type { NotReadonly, ObjectT } from \"../types\";\n\nconst tuple = <const T extends [ObjectT, ...ObjectT[]]>(...values: T) =>\n values as NotReadonly<T>;\n\nexport { tuple };\n"],"mappings":";;AAEA,MAAM,SAAkD,GAAG,WACzD"}
|
package/lib/helpers/tuple.d.ts
CHANGED
package/lib/helpers/tuple.js
CHANGED
package/lib/helpers/tuple.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tuple.js","names":[],"sources":["../../src/helpers/tuple.ts"],"sourcesContent":["import type { NotReadonly, ObjectT } from \"../types\";\n\nconst tuple = <const T extends [ObjectT, ...ObjectT[]]>(...values: T) =>\n values as NotReadonly<T>;\n\nexport
|
|
1
|
+
{"version":3,"file":"tuple.js","names":[],"sources":["../../src/helpers/tuple.ts"],"sourcesContent":["import type { NotReadonly, ObjectT } from \"../types\";\n\nconst tuple = <const T extends [ObjectT, ...ObjectT[]]>(...values: T) =>\n values as NotReadonly<T>;\n\nexport { tuple };\n"],"mappings":";AAEA,MAAM,SAAkD,GAAG,WACzD"}
|
package/lib/helpers/union.cjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
const require_utils_expandFn = require("../utils/expandFn.cjs");
|
|
2
3
|
//#region src/helpers/union.ts
|
|
3
|
-
const
|
|
4
|
+
const _union = (...values) => {
|
|
4
5
|
return values[0];
|
|
5
6
|
};
|
|
6
|
-
const
|
|
7
|
+
const union = require_utils_expandFn.expandFn(_union, { discriminated: (_key, ...values) => _union(...values) });
|
|
7
8
|
//#endregion
|
|
8
|
-
|
|
9
|
+
exports.union = union;
|
|
9
10
|
|
|
10
11
|
//# sourceMappingURL=union.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"union.cjs","names":["expandFn"],"sources":["../../src/helpers/union.ts"],"sourcesContent":["import type { Keys, ObjectMapS, ObjectT } from \"../types\";\nimport { expandFn } from \"../utils/expandFn\";\n\nconst
|
|
1
|
+
{"version":3,"file":"union.cjs","names":["expandFn"],"sources":["../../src/helpers/union.ts"],"sourcesContent":["import type { Keys, ObjectMapS, ObjectT } from \"../types\";\nimport { expandFn } from \"../utils/expandFn\";\n\nconst _union = <T extends [ObjectT, ObjectT, ...ObjectT[]]>(...values: T) => {\n return values[0] as T[number];\n};\n\ntype Discriminated<K extends Keys> = ObjectMapS & Record<K, ObjectT>;\n\nconst union = 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 { union };\n"],"mappings":";;;AAGA,MAAM,UAAsD,GAAG,WAAc;AAC3E,QAAO,OAAO;;AAKhB,MAAM,QAAQA,uBAAAA,SAAS,QAAQ,EAC7B,gBAIE,MACA,GAAG,WACA,OAAO,GAAG,OAAO,EACvB,CAAC"}
|
package/lib/helpers/union.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Keys, ObjectMapS, ObjectT } from "../types";
|
|
2
2
|
type Discriminated<K extends Keys> = ObjectMapS & Record<K, ObjectT>;
|
|
3
|
-
declare const
|
|
3
|
+
declare const union: import("..").FnBasic<(<T extends [ObjectT, ObjectT, ...ObjectT[]]>(...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
5
|
}>;
|
|
6
|
-
export
|
|
6
|
+
export { union };
|
package/lib/helpers/union.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { expandFn } from "../utils/expandFn.js";
|
|
2
2
|
//#region src/helpers/union.ts
|
|
3
|
-
const
|
|
3
|
+
const _union = (...values) => {
|
|
4
4
|
return values[0];
|
|
5
5
|
};
|
|
6
|
-
const
|
|
6
|
+
const union = expandFn(_union, { discriminated: (_key, ...values) => _union(...values) });
|
|
7
7
|
//#endregion
|
|
8
|
-
export {
|
|
8
|
+
export { union };
|
|
9
9
|
|
|
10
10
|
//# sourceMappingURL=union.js.map
|
package/lib/helpers/union.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"union.js","names":[],"sources":["../../src/helpers/union.ts"],"sourcesContent":["import type { Keys, ObjectMapS, ObjectT } from \"../types\";\nimport { expandFn } from \"../utils/expandFn\";\n\nconst
|
|
1
|
+
{"version":3,"file":"union.js","names":[],"sources":["../../src/helpers/union.ts"],"sourcesContent":["import type { Keys, ObjectMapS, ObjectT } from \"../types\";\nimport { expandFn } from \"../utils/expandFn\";\n\nconst _union = <T extends [ObjectT, ObjectT, ...ObjectT[]]>(...values: T) => {\n return values[0] as T[number];\n};\n\ntype Discriminated<K extends Keys> = ObjectMapS & Record<K, ObjectT>;\n\nconst union = 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 { union };\n"],"mappings":";;AAGA,MAAM,UAAsD,GAAG,WAAc;AAC3E,QAAO,OAAO;;AAKhB,MAAM,QAAQ,SAAS,QAAQ,EAC7B,gBAIE,MACA,GAAG,WACA,OAAO,GAAG,OAAO,EACvB,CAAC"}
|
package/lib/index.cjs
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_types = require("./types.cjs");
|
|
3
3
|
const require_constants = require("./constants.cjs");
|
|
4
|
-
const
|
|
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
|
-
const require_helpers_primitiveObject = require("./helpers/primitiveObject.cjs");
|
|
17
|
-
require("./helpers/index.cjs");
|
|
4
|
+
const require_helpers_index = require("./helpers/index.cjs");
|
|
18
5
|
const require_type = require("./type.cjs");
|
|
19
6
|
exports.ARRAY = require_constants.ARRAY;
|
|
20
7
|
exports.CUSTOM = require_constants.CUSTOM;
|
|
@@ -24,17 +11,10 @@ exports.PARTIAL = require_constants.PARTIAL;
|
|
|
24
11
|
exports.PRIMITIVES = require_constants.PRIMITIVES;
|
|
25
12
|
exports.PRIMITIVE_OBJECTS = require_constants.PRIMITIVE_OBJECTS;
|
|
26
13
|
exports.SOA = require_constants.SOA;
|
|
27
|
-
exports
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
exports.partial = require_helpers_partial;
|
|
34
|
-
exports.primitiveObject = require_helpers_primitiveObject;
|
|
35
|
-
exports.record = require_helpers_record;
|
|
36
|
-
exports.soa = require_helpers_soa;
|
|
37
|
-
exports.sv = require_helpers_sv;
|
|
38
|
-
exports.tuple = require_helpers_tuple;
|
|
14
|
+
Object.defineProperty(exports, "helpers", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function() {
|
|
17
|
+
return require_helpers_index.helpers_exports;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
39
20
|
exports.type = require_type.type;
|
|
40
|
-
exports.union = require_helpers_union;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from "./constants";
|
|
2
|
+
export * as helpers from "./helpers";
|
|
3
|
+
export * from "./type";
|
|
4
|
+
export * from "./types";
|
package/lib/index.js
CHANGED
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import { OptionalHelperClass } from "./types.js";
|
|
2
2
|
import { ARRAY, CUSTOM, OPTIONAL, PARTIAL, PRIMITIVES, PRIMITIVE_OBJECTS, SOA } from "./constants.js";
|
|
3
|
-
import
|
|
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 primitiveObject from "./helpers/primitiveObject.js";
|
|
16
|
-
import "./helpers/index.js";
|
|
3
|
+
import { helpers_exports } from "./helpers/index.js";
|
|
17
4
|
import { type } from "./type.js";
|
|
18
|
-
export { ARRAY, CUSTOM, OPTIONAL, OptionalHelperClass, PARTIAL, PRIMITIVES, PRIMITIVE_OBJECTS, SOA,
|
|
5
|
+
export { ARRAY, CUSTOM, OPTIONAL, OptionalHelperClass, PARTIAL, PRIMITIVES, PRIMITIVE_OBJECTS, SOA, helpers_exports as helpers, type };
|