@bemedev/typings 0.3.0 → 0.4.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 (68) hide show
  1. package/lib/constants.cjs +4 -0
  2. package/lib/constants.d.ts +7 -5
  3. package/lib/constants.js +3 -1
  4. package/lib/helpers/any.cjs +4 -3
  5. package/lib/helpers/any.d.ts +4 -2
  6. package/lib/helpers/any.js +5 -3
  7. package/lib/helpers/array.cjs +6 -4
  8. package/lib/helpers/array.d.ts +4 -2
  9. package/lib/helpers/array.js +6 -4
  10. package/lib/helpers/custom.cjs +21 -2
  11. package/lib/helpers/custom.d.ts +20 -3
  12. package/lib/helpers/custom.js +22 -2
  13. package/lib/helpers/index.cjs +4 -2
  14. package/lib/helpers/index.d.ts +1 -0
  15. package/lib/helpers/index.js +4 -3
  16. package/lib/helpers/intersection.cjs +2 -6
  17. package/lib/helpers/intersection.d.ts +1 -2
  18. package/lib/helpers/intersection.js +2 -6
  19. package/lib/helpers/litterals.cjs +7 -1
  20. package/lib/helpers/litterals.d.ts +4 -2
  21. package/lib/helpers/litterals.js +7 -1
  22. package/lib/helpers/object.cjs +10 -0
  23. package/lib/helpers/object.d.ts +5 -0
  24. package/lib/helpers/object.js +9 -0
  25. package/lib/helpers/optional.cjs +4 -2
  26. package/lib/helpers/optional.d.ts +2 -3
  27. package/lib/helpers/optional.js +4 -2
  28. package/lib/helpers/partial.cjs +2 -7
  29. package/lib/helpers/partial.d.ts +1 -2
  30. package/lib/helpers/partial.js +2 -7
  31. package/lib/helpers/primitive.cjs +21 -18
  32. package/lib/helpers/primitive.d.ts +25 -7
  33. package/lib/helpers/primitive.js +21 -19
  34. package/lib/helpers/primitiveObject.cjs +8 -5
  35. package/lib/helpers/primitiveObject.d.ts +8 -3
  36. package/lib/helpers/primitiveObject.js +8 -6
  37. package/lib/helpers/record.cjs +7 -4
  38. package/lib/helpers/record.d.ts +4 -2
  39. package/lib/helpers/record.js +7 -4
  40. package/lib/helpers/soa.cjs +2 -2
  41. package/lib/helpers/soa.d.ts +1 -2
  42. package/lib/helpers/soa.js +2 -2
  43. package/lib/helpers/sv.cjs +6 -1
  44. package/lib/helpers/sv.d.ts +4 -2
  45. package/lib/helpers/sv.js +6 -1
  46. package/lib/helpers/tuple.cjs +6 -1
  47. package/lib/helpers/tuple.d.ts +4 -2
  48. package/lib/helpers/tuple.js +6 -1
  49. package/lib/helpers/union.cjs +3 -1
  50. package/lib/helpers/union.d.ts +2 -2
  51. package/lib/helpers/union.js +3 -1
  52. package/lib/index.cjs +2 -0
  53. package/lib/index.js +2 -2
  54. package/lib/standard.cjs +21 -0
  55. package/lib/standard.d.ts +7 -0
  56. package/lib/standard.js +19 -0
  57. package/lib/standard.types.d.ts +59 -0
  58. package/lib/type.cjs +12 -21
  59. package/lib/type.js +12 -21
  60. package/lib/type.types.d.ts +3 -2
  61. package/lib/types.d.ts +12 -5
  62. package/lib/utils/expandFn.cjs +8 -0
  63. package/lib/utils/expandFn.d.ts +5 -1
  64. package/lib/utils/expandFn.js +8 -1
  65. package/lib/utils/index.cjs +8 -0
  66. package/lib/utils/index.d.ts +3 -0
  67. package/lib/utils/index.js +5 -0
  68. package/package.json +2 -2
package/lib/constants.cjs CHANGED
@@ -18,15 +18,19 @@ const PRIMITIVE_OBJECTS = [
18
18
  "unknown"
19
19
  ];
20
20
  const OPTIONAL = "$$app-ts => optional$$";
21
+ const UNION = "$$app-ts => union$$";
21
22
  const CUSTOM = "$$app-ts => custom$$";
22
23
  const PARTIAL = "$$app-ts => partial$$";
23
24
  const ARRAY = "$$app-ts => array$$";
24
25
  const SOA = "$$app-ts => soa$$";
26
+ const LITTERALS = "$$app-ts => litterals$$";
25
27
  //#endregion
26
28
  exports.ARRAY = ARRAY;
27
29
  exports.CUSTOM = CUSTOM;
30
+ exports.LITTERALS = LITTERALS;
28
31
  exports.OPTIONAL = OPTIONAL;
29
32
  exports.PARTIAL = PARTIAL;
30
33
  exports.PRIMITIVES = PRIMITIVES;
31
34
  exports.PRIMITIVE_OBJECTS = PRIMITIVE_OBJECTS;
32
35
  exports.SOA = SOA;
36
+ exports.UNION = UNION;
@@ -1,7 +1,9 @@
1
1
  export declare const PRIMITIVES: readonly ["string", "number", "boolean", "bigint", "symbol", "undefined", "null", "never", "primitive"];
2
2
  export declare const PRIMITIVE_OBJECTS: readonly ["date", "any", "object", "unknown"];
3
- export declare const OPTIONAL: "$$app-ts => optional$$";
4
- export declare const CUSTOM: "$$app-ts => custom$$";
5
- export declare const PARTIAL: "$$app-ts => partial$$";
6
- export declare const ARRAY: "$$app-ts => array$$";
7
- export declare const SOA: "$$app-ts => soa$$";
3
+ export declare const OPTIONAL = "$$app-ts => optional$$";
4
+ export declare const UNION = "$$app-ts => union$$";
5
+ export declare const CUSTOM = "$$app-ts => custom$$";
6
+ export declare const PARTIAL = "$$app-ts => partial$$";
7
+ export declare const ARRAY = "$$app-ts => array$$";
8
+ export declare const SOA = "$$app-ts => soa$$";
9
+ export declare const LITTERALS = "$$app-ts => litterals$$";
package/lib/constants.js CHANGED
@@ -17,9 +17,11 @@ const PRIMITIVE_OBJECTS = [
17
17
  "unknown"
18
18
  ];
19
19
  const OPTIONAL = "$$app-ts => optional$$";
20
+ const UNION = "$$app-ts => union$$";
20
21
  const CUSTOM = "$$app-ts => custom$$";
21
22
  const PARTIAL = "$$app-ts => partial$$";
22
23
  const ARRAY = "$$app-ts => array$$";
23
24
  const SOA = "$$app-ts => soa$$";
25
+ const LITTERALS = "$$app-ts => litterals$$";
24
26
  //#endregion
25
- export { ARRAY, CUSTOM, OPTIONAL, PARTIAL, PRIMITIVES, PRIMITIVE_OBJECTS, SOA };
27
+ export { ARRAY, CUSTOM, LITTERALS, OPTIONAL, PARTIAL, PRIMITIVES, PRIMITIVE_OBJECTS, SOA, UNION };
@@ -1,7 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_standard = require("../standard.cjs");
2
3
  //#region src/helpers/any.ts
3
- const any = (value) => {
4
- return value;
5
- };
4
+ const any = require("../utils/expandFn.cjs").expandFn2((value) => {
5
+ return require_standard.standardize2(value);
6
+ }, "any");
6
7
  //#endregion
7
8
  exports.any = any;
@@ -1,3 +1,5 @@
1
1
  import type { NotReadonly, ObjectT } from "../types";
2
- declare const any: <const T extends ObjectT = ObjectT>(value?: T) => ObjectT extends NotReadonly<T> ? "any" : NotReadonly<T>;
3
- export { any };
2
+ export declare const any: import("..").FnBasic<(<const T extends ObjectT = ObjectT>(value?: T) => ObjectT extends NotReadonly<T> ? "any" : NotReadonly<T>), object & {
3
+ const: "any";
4
+ type: "any";
5
+ }>;
@@ -1,6 +1,8 @@
1
+ import { standardize2 } from "../standard.js";
2
+ import { expandFn2 } from "../utils/expandFn.js";
1
3
  //#region src/helpers/any.ts
2
- const any = (value) => {
3
- return value;
4
- };
4
+ const any = expandFn2((value) => {
5
+ return standardize2(value);
6
+ }, "any");
5
7
  //#endregion
6
8
  export { any };
@@ -1,8 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_constants = require("../constants.cjs");
2
+ const require_standard = require("../standard.cjs");
3
+ const require_utils_expandFn = require("../utils/expandFn.cjs");
4
+ const require_utils_index = require("../utils/index.cjs");
3
5
  //#region src/helpers/array.ts
4
- const array = (value) => {
5
- return { [require_constants.ARRAY]: value };
6
- };
6
+ const array = require_utils_expandFn.expandFn2((value) => {
7
+ return require_standard.standardize2([value]);
8
+ }, require_utils_index._const());
7
9
  //#endregion
8
10
  exports.array = array;
@@ -1,3 +1,5 @@
1
1
  import type { ArrayCustom, ObjectT } from "../types";
2
- declare const array: <T extends ObjectT>(value: T) => ArrayCustom<T>;
3
- export { array };
2
+ export declare const array: import("..").FnBasic<(<T extends ObjectT>(value: T) => ArrayCustom<T>), object & {
3
+ const: ArrayCustom;
4
+ type: ArrayCustom;
5
+ }>;
@@ -1,7 +1,9 @@
1
- import { ARRAY } from "../constants.js";
1
+ import { standardize2 } from "../standard.js";
2
+ import { expandFn2 } from "../utils/expandFn.js";
3
+ import { _const } from "../utils/index.js";
2
4
  //#region src/helpers/array.ts
3
- const array = (value) => {
4
- return { [ARRAY]: value };
5
- };
5
+ const array = expandFn2((value) => {
6
+ return standardize2([value]);
7
+ }, _const());
6
8
  //#endregion
7
9
  export { array };
@@ -1,6 +1,25 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_constants = require("../constants.cjs");
2
+ const require_standard = require("../standard.cjs");
3
+ const require_utils_expandFn = require("../utils/expandFn.cjs");
3
4
  //#region src/helpers/custom.ts
4
- const custom = (value) => ({ [require_constants.CUSTOM]: value });
5
+ require("../utils/index.cjs")._const("any");
6
+ /**
7
+ * Create a custom value that can be used in the state value or as a literal.
8
+ * @param value The value to create the custom value from.
9
+ * @returns A custom value that can be used in the state value or as a literal.
10
+ *
11
+ * @important the type parameter `T` must not inherit of type {@link ObjectT}, otherwise it will be considered as an object and do not transform it in {@link type}
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const myCustomValue = custom({ foo: 'bar' });
16
+ * // myCustomValue is of type Custom<{ foo: 'bar }>
17
+ * ```
18
+ *
19
+ * @see {@link Custom} for more information about custom values.
20
+ */
21
+ const custom = require_utils_expandFn.expandFn2((value) => {
22
+ return require_standard.standardize2(value);
23
+ }, "any");
5
24
  //#endregion
6
25
  exports.custom = custom;
@@ -1,3 +1,20 @@
1
- import type { Custom } from "../types";
2
- declare const custom: <T = any>(value?: T) => Custom<T>;
3
- export { custom };
1
+ import type { Custom, ObjectT } from "../types";
2
+ /**
3
+ * Create a custom value that can be used in the state value or as a literal.
4
+ * @param value The value to create the custom value from.
5
+ * @returns A custom value that can be used in the state value or as a literal.
6
+ *
7
+ * @important the type parameter `T` must not inherit of type {@link ObjectT}, otherwise it will be considered as an object and do not transform it in {@link type}
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const myCustomValue = custom({ foo: 'bar' });
12
+ * // myCustomValue is of type Custom<{ foo: 'bar }>
13
+ * ```
14
+ *
15
+ * @see {@link Custom} for more information about custom values.
16
+ */
17
+ export declare const custom: import("..").FnBasic<(<const T = any>(value?: T) => ObjectT extends T ? "any" : Custom<T>), object & {
18
+ const: "any";
19
+ type: "any";
20
+ }>;
@@ -1,5 +1,25 @@
1
- import { CUSTOM } from "../constants.js";
1
+ import { standardize2 } from "../standard.js";
2
+ import { expandFn2 } from "../utils/expandFn.js";
3
+ import { _const } from "../utils/index.js";
2
4
  //#region src/helpers/custom.ts
3
- const custom = (value) => ({ [CUSTOM]: value });
5
+ _const("any");
6
+ /**
7
+ * Create a custom value that can be used in the state value or as a literal.
8
+ * @param value The value to create the custom value from.
9
+ * @returns A custom value that can be used in the state value or as a literal.
10
+ *
11
+ * @important the type parameter `T` must not inherit of type {@link ObjectT}, otherwise it will be considered as an object and do not transform it in {@link type}
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const myCustomValue = custom({ foo: 'bar' });
16
+ * // myCustomValue is of type Custom<{ foo: 'bar }>
17
+ * ```
18
+ *
19
+ * @see {@link Custom} for more information about custom values.
20
+ */
21
+ const custom = expandFn2((value) => {
22
+ return standardize2(value);
23
+ }, "any");
4
24
  //#endregion
5
25
  export { custom };
@@ -1,24 +1,26 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_helpers_readonly = require("./readonly.cjs");
3
2
  const require_helpers_any = require("./any.cjs");
4
3
  const require_helpers_array = require("./array.cjs");
5
4
  const require_helpers_custom = require("./custom.cjs");
6
5
  const require_helpers_intersection = require("./intersection.cjs");
6
+ const require_helpers_union = require("./union.cjs");
7
7
  const require_helpers_litterals = require("./litterals.cjs");
8
8
  const require_helpers_optional = require("./optional.cjs");
9
9
  const require_helpers_partial = require("./partial.cjs");
10
10
  const require_helpers_primitive = require("./primitive.cjs");
11
11
  const require_helpers_primitiveObject = require("./primitiveObject.cjs");
12
+ const require_helpers_readonly = require("./readonly.cjs");
13
+ const require_helpers_object = require("./object.cjs");
12
14
  const require_helpers_record = require("./record.cjs");
13
15
  const require_helpers_soa = require("./soa.cjs");
14
16
  const require_helpers_sv = require("./sv.cjs");
15
17
  const require_helpers_tuple = require("./tuple.cjs");
16
- const require_helpers_union = require("./union.cjs");
17
18
  exports.any = require_helpers_any.any;
18
19
  exports.array = require_helpers_array.array;
19
20
  exports.custom = require_helpers_custom.custom;
20
21
  exports.intersection = require_helpers_intersection.intersection;
21
22
  exports.litterals = require_helpers_litterals.litterals;
23
+ exports.object = require_helpers_object.object;
22
24
  exports.optional = require_helpers_optional.optional;
23
25
  exports.partial = require_helpers_partial.partial;
24
26
  exports.primitive = require_helpers_primitive.primitive;
@@ -13,3 +13,4 @@ export * from "./soa";
13
13
  export * from "./sv";
14
14
  export * from "./tuple";
15
15
  export * from "./union";
16
+ export * from "./object";
@@ -1,16 +1,17 @@
1
- import { readonly } from "./readonly.js";
2
1
  import { any } from "./any.js";
3
2
  import { array } from "./array.js";
4
3
  import { custom } from "./custom.js";
5
4
  import { intersection } from "./intersection.js";
5
+ import { union } from "./union.js";
6
6
  import { litterals } from "./litterals.js";
7
7
  import { optional } from "./optional.js";
8
8
  import { partial } from "./partial.js";
9
9
  import { primitive } from "./primitive.js";
10
10
  import { primitiveObject } from "./primitiveObject.js";
11
+ import { readonly } from "./readonly.js";
12
+ import { object } from "./object.js";
11
13
  import { record } from "./record.js";
12
14
  import { soa } from "./soa.js";
13
15
  import { sv } from "./sv.js";
14
16
  import { tuple } from "./tuple.js";
15
- import { union } from "./union.js";
16
- export { any, array, custom, intersection, litterals, optional, partial, primitive, primitiveObject, readonly, record, soa, sv, tuple, union };
17
+ export { any, array, custom, intersection, litterals, object, optional, partial, primitive, primitiveObject, readonly, record, soa, sv, tuple, union };
@@ -1,12 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_standard = require("../standard.cjs");
2
3
  //#region src/helpers/intersection.ts
3
4
  const intersection = (...values) => {
4
- return values.reduce((acc, curr) => {
5
- Object.entries(curr).forEach(([key, value]) => {
6
- acc[key] = value;
7
- });
8
- return acc;
9
- }, {});
5
+ return require_standard.standardize2(values);
10
6
  };
11
7
  //#endregion
12
8
  exports.intersection = intersection;
@@ -1,3 +1,2 @@
1
1
  import type { IntersectionCustom, NotReadonly, ObjectMapS } from "../types";
2
- declare const intersection: <const T extends [ObjectMapS, ObjectMapS, ...ObjectMapS[]]>(...values: T) => IntersectionCustom<NotReadonly<T>>;
3
- export { intersection };
2
+ export declare const intersection: <const T extends [ObjectMapS, ObjectMapS, ...ObjectMapS[]]>(...values: T) => IntersectionCustom<NotReadonly<T>>;
@@ -1,11 +1,7 @@
1
+ import { standardize2 } from "../standard.js";
1
2
  //#region src/helpers/intersection.ts
2
3
  const intersection = (...values) => {
3
- return values.reduce((acc, curr) => {
4
- Object.entries(curr).forEach(([key, value]) => {
5
- acc[key] = value;
6
- });
7
- return acc;
8
- }, {});
4
+ return standardize2(values);
9
5
  };
10
6
  //#endregion
11
7
  export { intersection };
@@ -1,5 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_standard = require("../standard.cjs");
3
+ const require_utils_expandFn = require("../utils/expandFn.cjs");
4
+ const require_utils_index = require("../utils/index.cjs");
5
+ const require_helpers_union = require("./union.cjs");
2
6
  //#region src/helpers/litterals.ts
3
- const litterals = (...values) => values[0];
7
+ const litterals = require_utils_expandFn.expandFn2((...values) => {
8
+ return require_standard.standardize2(values[0]);
9
+ }, require_utils_index._const(require_helpers_union.union("string", "number", "boolean")));
4
10
  //#endregion
5
11
  exports.litterals = litterals;
@@ -1,3 +1,5 @@
1
1
  import type { Custom } from "../types";
2
- declare const litterals: <const T extends (string | number | boolean)[]>(...values: T) => Custom<T[number]>;
3
- export { litterals };
2
+ export declare const litterals: import("..").FnBasic<(<const T extends (string | number | boolean)[]>(...values: T) => Custom<T[number]>), object & {
3
+ const: "string" | "number" | "boolean";
4
+ type: "string" | "number" | "boolean";
5
+ }>;
@@ -1,4 +1,10 @@
1
+ import { standardize2 } from "../standard.js";
2
+ import { expandFn2 } from "../utils/expandFn.js";
3
+ import { _const } from "../utils/index.js";
4
+ import { union } from "./union.js";
1
5
  //#region src/helpers/litterals.ts
2
- const litterals = (...values) => values[0];
6
+ const litterals = expandFn2((...values) => {
7
+ return standardize2(values[0]);
8
+ }, _const(union("string", "number", "boolean")));
3
9
  //#endregion
4
10
  export { litterals };
@@ -0,0 +1,10 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_standard = require("../standard.cjs");
3
+ const require_utils_expandFn = require("../utils/expandFn.cjs");
4
+ const require_utils_index = require("../utils/index.cjs");
5
+ //#region src/helpers/object.ts
6
+ const object = require_utils_expandFn.expandFn2((value) => {
7
+ return require_standard.standardize2(value);
8
+ }, require_utils_index._const());
9
+ //#endregion
10
+ exports.object = object;
@@ -0,0 +1,5 @@
1
+ import type { NotReadonly, ObjectMapS } from "../types";
2
+ export declare const object: import("..").FnBasic<(<const T extends ObjectMapS>(value?: T) => ObjectMapS extends NotReadonly<T> ? ObjectMapS : NotReadonly<T>), object & {
3
+ const: ObjectMapS;
4
+ type: ObjectMapS;
5
+ }>;
@@ -0,0 +1,9 @@
1
+ import { standardize2 } from "../standard.js";
2
+ import { expandFn2 } from "../utils/expandFn.js";
3
+ import { _const } from "../utils/index.js";
4
+ //#region src/helpers/object.ts
5
+ const object = expandFn2((value) => {
6
+ return standardize2(value);
7
+ }, _const());
8
+ //#endregion
9
+ export { object };
@@ -1,6 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_constants = require("../constants.cjs");
2
+ const require_standard = require("../standard.cjs");
3
3
  //#region src/helpers/optional.ts
4
- const optional = (value) => ({ [require_constants.OPTIONAL]: value });
4
+ const optional = (value) => {
5
+ return require_standard.standardize2(value);
6
+ };
5
7
  //#endregion
6
8
  exports.optional = optional;
@@ -1,3 +1,2 @@
1
- import type { __ObjectT, AnyArray, ArrayCustom, NotReadonly, Optional } from "../types";
2
- declare const optional: <const T extends __ObjectT | ArrayCustom | AnyArray<__ObjectT>>(value?: T) => Optional<NotReadonly<T>>;
3
- export { optional };
1
+ import type { CanOptional, NotReadonly, Optional } from "../types";
2
+ export declare const optional: <const T extends CanOptional>(value?: T) => Optional<NotReadonly<T>>;
@@ -1,5 +1,7 @@
1
- import { OPTIONAL } from "../constants.js";
1
+ import { standardize2 } from "../standard.js";
2
2
  //#region src/helpers/optional.ts
3
- const optional = (value) => ({ [OPTIONAL]: value });
3
+ const optional = (value) => {
4
+ return standardize2(value);
5
+ };
4
6
  //#endregion
5
7
  export { optional };
@@ -1,13 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_constants = require("../constants.cjs");
2
+ const require_standard = require("../standard.cjs");
3
3
  //#region src/helpers/partial.ts
4
4
  const partial = (value) => {
5
- const entries = Object.entries(value).filter(([key]) => key !== require_constants.PARTIAL);
6
- const out = {};
7
- entries.forEach(([key, value]) => {
8
- out[key] = value;
9
- });
10
- return out;
5
+ return require_standard.standardize2(value);
11
6
  };
12
7
  //#endregion
13
8
  exports.partial = partial;
@@ -1,3 +1,2 @@
1
1
  import type { NotReadonly, ObjectT, PartialCustom } from "../types";
2
- declare const partial: <const T extends ObjectT>(value: T) => NotReadonly<T> & PartialCustom;
3
- export { partial };
2
+ export declare const partial: <const T extends ObjectT>(value: T) => NotReadonly<T> & PartialCustom;
@@ -1,12 +1,7 @@
1
- import { PARTIAL } from "../constants.js";
1
+ import { standardize2 } from "../standard.js";
2
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
+ return standardize2(value);
10
5
  };
11
6
  //#endregion
12
7
  export { partial };
@@ -1,23 +1,26 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_standard = require("../standard.cjs");
3
+ const require_utils_expandFn = require("../utils/expandFn.cjs");
4
+ const require_utils_index = require("../utils/index.cjs");
2
5
  //#region src/helpers/primitive.ts
3
- const primitive = require("../utils/expandFn.cjs").expandFn((value) => value, {
4
- boolean: (value) => {
5
- return value;
6
- },
7
- string: (value) => {
8
- return value;
9
- },
10
- number: (value) => {
11
- return value;
12
- },
13
- bigint: (value) => {
14
- return value;
15
- },
16
- symbol: (value) => {
17
- return value;
18
- },
19
- never: () => {},
20
- undefined: () => {}
6
+ const primitive = require_utils_expandFn.expandFn2((value) => require_standard.standardize2(value), require_utils_index._const(), {
7
+ boolean: require_utils_expandFn.expandFn2((value) => {
8
+ return require_standard.standardize2(value);
9
+ }, "boolean"),
10
+ string: require_utils_expandFn.expandFn2((value) => {
11
+ return require_standard.standardize2(value);
12
+ }, "string"),
13
+ number: require_utils_expandFn.expandFn2((value) => {
14
+ return require_standard.standardize2(value);
15
+ }, "number"),
16
+ bigint: require_utils_expandFn.expandFn2((value) => {
17
+ return require_standard.standardize2(value);
18
+ }, "bigint"),
19
+ symbol: require_utils_expandFn.expandFn2((value) => {
20
+ return require_standard.standardize2(value);
21
+ }, "symbol"),
22
+ never: require_standard.standardize2(),
23
+ undefined: require_standard.standardize2()
21
24
  });
22
25
  //#endregion
23
26
  exports.primitive = primitive;
@@ -1,10 +1,28 @@
1
1
  import type { Custom, PrimitiveT } from "../types";
2
2
  export declare const primitive: import("..").FnBasic<(<const T extends PrimitiveT>(value?: T) => T), {
3
- readonly boolean: <const T extends boolean>(value?: T) => boolean extends T ? "boolean" : Custom<T>;
4
- readonly string: <const T extends string = string>(value?: T) => string extends T ? "string" : Custom<T>;
5
- readonly number: <const T extends number = number>(value?: T) => number extends T ? "number" : Custom<T>;
6
- readonly bigint: <const T extends bigint = bigint>(value?: T) => bigint extends T ? "bigint" : Custom<T>;
7
- readonly symbol: <const T extends symbol = symbol>(value?: T) => symbol extends T ? "symbol" : Custom<T>;
8
- readonly never: () => Custom<never>;
9
- readonly undefined: () => Custom<undefined>;
3
+ readonly boolean: import("..").FnBasic<(<const T extends boolean>(value?: T) => boolean extends T ? "boolean" : Custom<T>), object & {
4
+ const: "boolean";
5
+ type: "boolean";
6
+ }>;
7
+ readonly string: import("..").FnBasic<(<const T extends string = string>(value?: T) => string extends T ? "string" : Custom<T>), object & {
8
+ const: "string";
9
+ type: "string";
10
+ }>;
11
+ readonly number: import("..").FnBasic<(<const T extends number = number>(value?: T) => number extends T ? "number" : Custom<T>), object & {
12
+ const: "number";
13
+ type: "number";
14
+ }>;
15
+ readonly bigint: import("..").FnBasic<(<const T extends bigint = bigint>(value?: T) => bigint extends T ? "bigint" : Custom<T>), object & {
16
+ const: "bigint";
17
+ type: "bigint";
18
+ }>;
19
+ readonly symbol: import("..").FnBasic<(<const T extends symbol = symbol>(value?: T) => symbol extends T ? "symbol" : Custom<T>), object & {
20
+ const: "symbol";
21
+ type: "symbol";
22
+ }>;
23
+ readonly never: Custom<never>;
24
+ readonly undefined: Custom<undefined>;
25
+ } & {
26
+ const: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "null" | "never" | "primitive";
27
+ type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "null" | "never" | "primitive";
10
28
  }>;
@@ -1,23 +1,25 @@
1
- import { expandFn } from "../utils/expandFn.js";
1
+ import { standardize2 } from "../standard.js";
2
+ import { expandFn2 } from "../utils/expandFn.js";
3
+ import { _const } from "../utils/index.js";
2
4
  //#region src/helpers/primitive.ts
3
- const primitive = expandFn((value) => value, {
4
- boolean: (value) => {
5
- return value;
6
- },
7
- string: (value) => {
8
- return value;
9
- },
10
- number: (value) => {
11
- return value;
12
- },
13
- bigint: (value) => {
14
- return value;
15
- },
16
- symbol: (value) => {
17
- return value;
18
- },
19
- never: () => {},
20
- undefined: () => {}
5
+ const primitive = expandFn2((value) => standardize2(value), _const(), {
6
+ boolean: expandFn2((value) => {
7
+ return standardize2(value);
8
+ }, "boolean"),
9
+ string: expandFn2((value) => {
10
+ return standardize2(value);
11
+ }, "string"),
12
+ number: expandFn2((value) => {
13
+ return standardize2(value);
14
+ }, "number"),
15
+ bigint: expandFn2((value) => {
16
+ return standardize2(value);
17
+ }, "bigint"),
18
+ symbol: expandFn2((value) => {
19
+ return standardize2(value);
20
+ }, "symbol"),
21
+ never: standardize2(),
22
+ undefined: standardize2()
21
23
  });
22
24
  //#endregion
23
25
  export { primitive };
@@ -1,9 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_standard = require("../standard.cjs");
3
+ const require_utils_expandFn = require("../utils/expandFn.cjs");
4
+ const require_utils_index = require("../utils/index.cjs");
2
5
  //#region src/helpers/primitiveObject.ts
3
- const primitiveObject = require("../utils/expandFn.cjs").expandFn((value) => {
4
- return value || {};
5
- }, { map: (value) => {
6
- return value || {};
7
- } });
6
+ const primitiveObject = require_utils_expandFn.expandFn2((value) => {
7
+ return require_standard.standardize2(value);
8
+ }, require_utils_index._const(), { map: require_utils_expandFn.expandFn2((value) => {
9
+ return require_standard.standardize2(value);
10
+ }, require_utils_index._const()) });
8
11
  //#endregion
9
12
  exports.primitiveObject = primitiveObject;
@@ -1,5 +1,10 @@
1
1
  import type { IntersectionCustom, NotReadonly, PrimitiveObjectMapS, PrimitiveObjectT } from "../types";
2
- declare const primitiveObject: import("..").FnBasic<(<const T extends PrimitiveObjectT | IntersectionCustom<PrimitiveObjectMapS[]> = PrimitiveObjectT>(value?: T) => NotReadonly<T>), {
3
- readonly map: <const T extends PrimitiveObjectMapS | IntersectionCustom<PrimitiveObjectMapS[]> = PrimitiveObjectMapS>(value?: T) => NotReadonly<T>;
2
+ export declare const primitiveObject: import("..").FnBasic<(<const T extends PrimitiveObjectT | IntersectionCustom<PrimitiveObjectMapS[]> = PrimitiveObjectT>(value?: T) => NotReadonly<T>), {
3
+ readonly map: import("..").FnBasic<(<const T extends PrimitiveObjectMapS | IntersectionCustom<PrimitiveObjectMapS[]> = PrimitiveObjectMapS>(value?: T) => NotReadonly<T>), object & {
4
+ const: PrimitiveObjectMapS;
5
+ type: PrimitiveObjectMapS;
6
+ }>;
7
+ } & {
8
+ const: PrimitiveObjectT;
9
+ type: PrimitiveObjectT;
4
10
  }>;
5
- export { primitiveObject };
@@ -1,9 +1,11 @@
1
- import { expandFn } from "../utils/expandFn.js";
1
+ import { standardize2 } from "../standard.js";
2
+ import { expandFn2 } from "../utils/expandFn.js";
3
+ import { _const } from "../utils/index.js";
2
4
  //#region src/helpers/primitiveObject.ts
3
- const primitiveObject = expandFn((value) => {
4
- return value || {};
5
- }, { map: (value) => {
6
- return value || {};
7
- } });
5
+ const primitiveObject = expandFn2((value) => {
6
+ return standardize2(value);
7
+ }, _const(), { map: expandFn2((value) => {
8
+ return standardize2(value);
9
+ }, _const()) });
8
10
  //#endregion
9
11
  export { primitiveObject };