@lssm/lib.utils-typescript 1.42.0 → 1.42.2

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 (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +13 -0
  3. package/dist/index.d.ts +32 -0
  4. package/dist/index.js +3 -1
  5. package/dist/lib/AwaitedResult.d.ts +5 -0
  6. package/dist/lib/AwaitedResult.d.ts.map +1 -0
  7. package/dist/lib/BrowserNativeObject.d.ts +5 -0
  8. package/dist/lib/BrowserNativeObject.d.ts.map +1 -0
  9. package/dist/lib/DeepInfiniteArray.d.ts +5 -0
  10. package/dist/lib/DeepInfiniteArray.d.ts.map +1 -0
  11. package/dist/lib/DeepKeepOnly.d.ts +7 -0
  12. package/dist/lib/DeepKeepOnly.d.ts.map +1 -0
  13. package/dist/lib/DeepKey.d.ts +5 -0
  14. package/dist/lib/DeepKey.d.ts.map +1 -0
  15. package/dist/lib/DeepMap.d.ts +10 -0
  16. package/dist/lib/DeepMap.d.ts.map +1 -0
  17. package/dist/lib/DeepNullable.d.ts +7 -0
  18. package/dist/lib/DeepNullable.d.ts.map +1 -0
  19. package/dist/lib/DeepOr.d.ts +5 -0
  20. package/dist/lib/DeepOr.d.ts.map +1 -0
  21. package/dist/lib/DeepPartial.d.ts +8 -0
  22. package/dist/lib/DeepPartial.d.ts.map +1 -0
  23. package/dist/lib/DeepReplace.d.ts +5 -0
  24. package/dist/lib/DeepReplace.d.ts.map +1 -0
  25. package/dist/lib/DeepReplaceNullByUndefined.d.ts +7 -0
  26. package/dist/lib/DeepReplaceNullByUndefined.d.ts.map +1 -0
  27. package/dist/lib/DeepValue.d.ts +7 -0
  28. package/dist/lib/DeepValue.d.ts.map +1 -0
  29. package/dist/lib/DictionaryFromEnum.d.ts +5 -0
  30. package/dist/lib/DictionaryFromEnum.d.ts.map +1 -0
  31. package/dist/lib/DictionaryFromEnumMapping.d.ts +5 -0
  32. package/dist/lib/DictionaryFromEnumMapping.d.ts.map +1 -0
  33. package/dist/lib/EmptyRecord.d.ts +7 -0
  34. package/dist/lib/EmptyRecord.d.ts.map +1 -0
  35. package/dist/lib/Identified.d.ts +7 -0
  36. package/dist/lib/Identified.d.ts.map +1 -0
  37. package/dist/lib/IdentifiedLabel.d.ts +9 -0
  38. package/dist/lib/IdentifiedLabel.d.ts.map +1 -0
  39. package/dist/lib/IsAny.d.ts +5 -0
  40. package/dist/lib/IsAny.d.ts.map +1 -0
  41. package/dist/lib/Json.d.ts +16 -0
  42. package/dist/lib/Json.d.ts.map +1 -0
  43. package/dist/lib/KeepOnly.d.ts +5 -0
  44. package/dist/lib/KeepOnly.d.ts.map +1 -0
  45. package/dist/lib/Maybe.d.ts +5 -0
  46. package/dist/lib/Maybe.d.ts.map +1 -0
  47. package/dist/lib/MaybeArray.d.ts +5 -0
  48. package/dist/lib/MaybeArray.d.ts.map +1 -0
  49. package/dist/lib/NestedValue.d.ts +8 -0
  50. package/dist/lib/NestedValue.d.ts.map +1 -0
  51. package/dist/lib/NonUndefined.d.ts +5 -0
  52. package/dist/lib/NonUndefined.d.ts.map +1 -0
  53. package/dist/lib/Primitive.d.ts +7 -0
  54. package/dist/lib/Primitive.d.ts.map +1 -0
  55. package/dist/lib/Replaced.d.ts +7 -0
  56. package/dist/lib/Replaced.d.ts.map +1 -0
  57. package/dist/lib/ReverseMap.d.ts +5 -0
  58. package/dist/lib/ReverseMap.d.ts.map +1 -0
  59. package/dist/lib/Satisfies.d.ts +5 -0
  60. package/dist/lib/Satisfies.d.ts.map +1 -0
  61. package/dist/lib/StringKey.d.ts +5 -0
  62. package/dist/lib/StringKey.d.ts.map +1 -0
  63. package/dist/lib/StringKeysOnly.d.ts +7 -0
  64. package/dist/lib/StringKeysOnly.d.ts.map +1 -0
  65. package/dist/staticShouldNotHappen.d.ts +5 -0
  66. package/dist/staticShouldNotHappen.d.ts.map +1 -0
  67. package/dist/staticShouldNotHappen.js +8 -1
  68. package/dist/staticShouldNotHappen.js.map +1 -0
  69. package/package.json +46 -39
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Chaman Ventures, SASU
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # @lssm/lib.utils-typescript
2
2
 
3
+ Website: https://contractspec.lssm.tech/
4
+
5
+
3
6
  A collection of essential TypeScript utility types and helper functions.
4
7
 
5
8
  ## Purpose
@@ -55,6 +58,16 @@ const update: DeepPartial<User> = {
55
58
 
56
59
 
57
60
 
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
58
71
 
59
72
 
60
73
 
@@ -0,0 +1,32 @@
1
+ import { AwaitedResult } from "./lib/AwaitedResult.js";
2
+ import { BrowserNativeObject } from "./lib/BrowserNativeObject.js";
3
+ import { DeepInfiniteArray } from "./lib/DeepInfiniteArray.js";
4
+ import { KeepOnly } from "./lib/KeepOnly.js";
5
+ import { DeepKeepOnly } from "./lib/DeepKeepOnly.js";
6
+ import { DeepKey } from "./lib/DeepKey.js";
7
+ import { IsAny } from "./lib/IsAny.js";
8
+ import { NestedValue } from "./lib/NestedValue.js";
9
+ import { NonUndefined } from "./lib/NonUndefined.js";
10
+ import { DeepMap } from "./lib/DeepMap.js";
11
+ import { DeepOr } from "./lib/DeepOr.js";
12
+ import { DeepNullable } from "./lib/DeepNullable.js";
13
+ import { DeepPartial } from "./lib/DeepPartial.js";
14
+ import { DeepReplace } from "./lib/DeepReplace.js";
15
+ import { DeepReplaceNullByUndefined } from "./lib/DeepReplaceNullByUndefined.js";
16
+ import { DeepValue } from "./lib/DeepValue.js";
17
+ import { DictionaryFromEnum } from "./lib/DictionaryFromEnum.js";
18
+ import { DictionaryFromEnumMapping } from "./lib/DictionaryFromEnumMapping.js";
19
+ import { AnyRecord, EmptyRecord, UnknownRecord } from "./lib/EmptyRecord.js";
20
+ import { Identified } from "./lib/Identified.js";
21
+ import { IdentifiedLabel } from "./lib/IdentifiedLabel.js";
22
+ import { ExtendedJsonObject, JSONArray, JSONObject, JSONValue, NonJsonArray, NonJsonObject, NonJsonValue, PrimitiveJSONValue } from "./lib/Json.js";
23
+ import { Maybe } from "./lib/Maybe.js";
24
+ import { MaybeArray } from "./lib/MaybeArray.js";
25
+ import { Primitive } from "./lib/Primitive.js";
26
+ import { Replaced } from "./lib/Replaced.js";
27
+ import { ReverseMap } from "./lib/ReverseMap.js";
28
+ import { Satisfies } from "./lib/Satisfies.js";
29
+ import { StringKey } from "./lib/StringKey.js";
30
+ import { StringKeysOnly } from "./lib/StringKeysOnly.js";
31
+ import { staticShouldNotHappen } from "./staticShouldNotHappen.js";
32
+ export { AnyRecord, AwaitedResult, BrowserNativeObject, DeepInfiniteArray, DeepKeepOnly, DeepKey, DeepMap, DeepNullable, DeepOr, DeepPartial, DeepReplace, DeepReplaceNullByUndefined, DeepValue, DictionaryFromEnum, DictionaryFromEnumMapping, EmptyRecord, ExtendedJsonObject, Identified, IdentifiedLabel, IsAny, JSONArray, JSONObject, JSONValue, KeepOnly, Maybe, MaybeArray, NestedValue, NonJsonArray, NonJsonObject, NonJsonValue, NonUndefined, Primitive, PrimitiveJSONValue, Replaced, ReverseMap, Satisfies, StringKey, StringKeysOnly, UnknownRecord, staticShouldNotHappen };
package/dist/index.js CHANGED
@@ -1 +1,3 @@
1
- import{staticShouldNotHappen as e}from"./staticShouldNotHappen.js";export{e as staticShouldNotHappen};
1
+ import { staticShouldNotHappen } from "./staticShouldNotHappen.js";
2
+
3
+ export { staticShouldNotHappen };
@@ -0,0 +1,5 @@
1
+ //#region src/lib/AwaitedResult.d.ts
2
+ type AwaitedResult<T extends (...args: any) => any> = Awaited<ReturnType<T>>;
3
+ //#endregion
4
+ export { AwaitedResult };
5
+ //# sourceMappingURL=AwaitedResult.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AwaitedResult.d.ts","names":[],"sources":["../../src/lib/AwaitedResult.ts"],"sourcesContent":[],"mappings":";KACY,iDAAiD,QAC3D,WAAW"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/BrowserNativeObject.d.ts
2
+ declare type BrowserNativeObject = Date | FileList | File;
3
+ //#endregion
4
+ export { BrowserNativeObject };
5
+ //# sourceMappingURL=BrowserNativeObject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrowserNativeObject.d.ts","names":[],"sources":["../../src/lib/BrowserNativeObject.ts"],"sourcesContent":[],"mappings":";aAAoB,mBAAA,GAAsB,OAAO,WAAW"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/DeepInfiniteArray.d.ts
2
+ declare type DeepInfiniteArray<T> = (T | DeepInfiniteArray<T>)[];
3
+ //#endregion
4
+ export { DeepInfiniteArray };
5
+ //# sourceMappingURL=DeepInfiniteArray.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepInfiniteArray.d.ts","names":[],"sources":["../../src/lib/DeepInfiniteArray.ts"],"sourcesContent":[],"mappings":";aAAoB,wBAAwB,IAAI,kBAAkB"}
@@ -0,0 +1,7 @@
1
+ import { KeepOnly } from "./KeepOnly.js";
2
+
3
+ //#region src/lib/DeepKeepOnly.d.ts
4
+ type DeepKeepOnly<T, KeepType> = T | (T extends (infer U)[] ? KeepOnly<U, KeepType>[] : T extends Map<infer K, infer V> ? Map<KeepOnly<K, KeepType>, KeepOnly<V, KeepType>> : T extends Set<infer M> ? Set<KeepOnly<M, KeepType>> : KeepOnly<T, KeepType>);
5
+ //#endregion
6
+ export { DeepKeepOnly };
7
+ //# sourceMappingURL=DeepKeepOnly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepKeepOnly.d.ts","names":[],"sources":["../../src/lib/DeepKeepOnly.ts"],"sourcesContent":[],"mappings":";;;KAEY,4BACR,KACC,wBACG,SAAS,GAAG,cACZ,UAAU,wBACR,IAAI,SAAS,GAAG,WAAW,SAAS,GAAG,aACvC,UAAU,eACR,IAAI,SAAS,GAAG,aAChB,SAAS,GAAG"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/DeepKey.d.ts
2
+ type DeepKey<T, K extends keyof T = keyof T> = K extends string | number ? T[K] extends infer R ? `${K}` | (R extends Record<string, unknown> ? `${K}.${DeepKey<R>}` : never) : never : never;
3
+ //#endregion
4
+ export { DeepKey };
5
+ //# sourceMappingURL=DeepKey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepKey.d.ts","names":[],"sources":["../../src/lib/DeepKey.ts"],"sourcesContent":[],"mappings":";KAAY,2BAA2B,UAAU,KAAK,4BAClD,EAAE,wBAEO,iBACQ,6BAA6B,KAAK,QAAQ"}
@@ -0,0 +1,10 @@
1
+ import { BrowserNativeObject } from "./BrowserNativeObject.js";
2
+ import { IsAny } from "./IsAny.js";
3
+ import { NestedValue } from "./NestedValue.js";
4
+ import { NonUndefined } from "./NonUndefined.js";
5
+
6
+ //#region src/lib/DeepMap.d.ts
7
+ declare type DeepMap<T, TValue> = IsAny<T> extends true ? any : T extends BrowserNativeObject | NestedValue ? TValue : T extends object ? { [K in keyof T]: DeepMap<NonUndefined<T[K]>, TValue> } : TValue;
8
+ //#endregion
9
+ export { DeepMap };
10
+ //# sourceMappingURL=DeepMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepMap.d.ts","names":[],"sources":["../../src/lib/DeepMap.ts"],"sourcesContent":[],"mappings":";;;;;;aAKoB,qBAClB,MAAM,wBAGF,UAAU,sBAAsB,cAC9B,SACA,iCAEgB,IAAI,QAAQ,aAAa,EAAE,KAAK,SARxD,GAUU,MAVU"}
@@ -0,0 +1,7 @@
1
+ import { DeepOr } from "./DeepOr.js";
2
+
3
+ //#region src/lib/DeepNullable.d.ts
4
+ type DeepNullable<T> = DeepOr<T, null>;
5
+ //#endregion
6
+ export { DeepNullable };
7
+ //# sourceMappingURL=DeepNullable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepNullable.d.ts","names":[],"sources":["../../src/lib/DeepNullable.ts"],"sourcesContent":[],"mappings":";;;KAEY,kBAAkB,OAAO"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/DeepOr.d.ts
2
+ type DeepOr<T, OrValue> = T | (T extends (infer U)[] ? DeepOr<U, OrValue>[] : T extends Map<infer K, infer V> ? Map<DeepOr<K, OrValue>, DeepOr<V, OrValue>> : T extends Set<infer M> ? Set<DeepOr<M, OrValue>> : T extends object ? { [K in keyof T]: DeepOr<T[K], OrValue> | OrValue } : T);
3
+ //#endregion
4
+ export { DeepOr };
5
+ //# sourceMappingURL=DeepOr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepOr.d.ts","names":[],"sources":["../../src/lib/DeepOr.ts"],"sourcesContent":[],"mappings":";KAAY,qBACR,KACC,wBACG,OAAO,GAAG,aACV,UAAU,wBACR,IAAI,OAAO,GAAG,UAAU,OAAO,GAAG,YAClC,UAAU,eACR,IAAI,OAAO,GAAG,YACd,2BARA,MAUgB,CAVV,GAUc,MAVd,CAUqB,CAVrB,CAUuB,CAVvB,CAAA,EAU2B,OAV3B,CAAA,GAUsC,OAVtC,EACd,GAWU,CAXV,CAAA"}
@@ -0,0 +1,8 @@
1
+ //#region src/lib/DeepPartial.d.ts
2
+ /**
3
+ * Same as Partial<T> but goes deeper and makes Partial<T> all its properties and sub-properties.
4
+ */
5
+ type DeepPartial<T> = { [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P] };
6
+ //#endregion
7
+ export { DeepPartial };
8
+ //# sourceMappingURL=DeepPartial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepPartial.d.ts","names":[],"sources":["../../src/lib/DeepPartial.ts"],"sourcesContent":[],"mappings":";;AAiBA;;AACmB,KADP,WACO,CAAA,CAAA,CAAA,GAAA,QAAE,MAAP,CAAO,IAAF,CAAE,CAAA,CAAA,CAAA,SAAA,MAAA,GAAoB,WAApB,CAAgC,CAAhC,CAAkC,CAAlC,CAAA,CAAA,GAAwC,CAAxC,CAA0C,CAA1C,CAAA,EAAgC"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/DeepReplace.d.ts
2
+ type DeepReplace<T, Search, Replace> = T extends (infer ArrayItemT)[] ? DeepReplace<ArrayItemT, Search, Replace>[] : T extends Map<infer MapKey, infer MapT> ? Map<DeepReplace<MapKey, Search, Replace>, DeepReplace<MapT, Search, Replace>> : T extends Set<infer SetT> ? Set<DeepReplace<SetT, Search, Replace>> : T extends object ? { [ObjKey in keyof T]: DeepReplace<T[ObjKey], Search, Replace> } : T extends Search ? Replace : T;
3
+ //#endregion
4
+ export { DeepReplace };
5
+ //# sourceMappingURL=DeepReplace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepReplace.d.ts","names":[],"sources":["../../src/lib/DeepReplace.ts"],"sourcesContent":[],"mappings":";KAAY,kCAAkC,iCAC1C,YAAY,YAAY,QAAQ,aAChC,UAAU,gCACR,IACE,YAAY,QAAQ,QAAQ,UAC5B,YAAY,MAAM,QAAQ,YAE5B,UAAU,kBACR,IAAI,YAAY,MAAM,QAAQ,YAC9B,gCATI,MAWiB,CAXN,GAWU,WAXV,CAWsB,CAXtB,CAWwB,MAXxB,CAAA,EAWiC,MAXjC,EAWyC,OAXzC,CAAA,EAAuB,GAapC,CAboC,SAa1B,MAb0B,GAclC,OAdkC,GAelC,CAfkC"}
@@ -0,0 +1,7 @@
1
+ import { DeepReplace } from "./DeepReplace.js";
2
+
3
+ //#region src/lib/DeepReplaceNullByUndefined.d.ts
4
+ type DeepReplaceNullByUndefined<T> = DeepReplace<T, null, undefined>;
5
+ //#endregion
6
+ export { DeepReplaceNullByUndefined };
7
+ //# sourceMappingURL=DeepReplaceNullByUndefined.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepReplaceNullByUndefined.d.ts","names":[],"sources":["../../src/lib/DeepReplaceNullByUndefined.ts"],"sourcesContent":[],"mappings":";;;KAEY,gCAAgC,YAAY"}
@@ -0,0 +1,7 @@
1
+ import { DeepKey } from "./DeepKey.js";
2
+
3
+ //#region src/lib/DeepValue.d.ts
4
+ type DeepValue<T, P extends DeepKey<T>> = P extends `${infer K}.${infer Rest}` ? T[(K extends `${infer R extends number}` ? R : K) & keyof T] extends infer S ? S extends never ? never : Rest extends DeepKey<S> ? DeepValue<S, Rest> : never : never : T[(P extends `${infer R extends number}` ? R : P) & keyof T];
5
+ //#endregion
6
+ export { DeepValue };
7
+ //# sourceMappingURL=DeepValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepValue.d.ts","names":[],"sources":["../../src/lib/DeepValue.ts"],"sourcesContent":[],"mappings":";;;KAEY,uBAEA,QAAQ,MAChB,uCACA,0DAA0D,4DAGzC,QAAQ,KACnB,UAAU,GAAG,wBAGnB,GAAG,4CAA4C,WAAW"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/DictionaryFromEnum.d.ts
2
+ type DictionaryFromEnum<Enum, ObjMapping> = Record<keyof Enum, ObjMapping>;
3
+ //#endregion
4
+ export { DictionaryFromEnum };
5
+ //# sourceMappingURL=DictionaryFromEnum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DictionaryFromEnum.d.ts","names":[],"sources":["../../src/lib/DictionaryFromEnum.ts"],"sourcesContent":[],"mappings":";KAAY,uCAAuC,aAC3C,MACN"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/DictionaryFromEnumMapping.d.ts
2
+ type DictionaryFromEnumMapping<Enum, Mapped, Mapping extends Record<keyof Enum, Mapped>> = { [k in keyof Enum]: Mapping[k] };
3
+ //#endregion
4
+ export { DictionaryFromEnumMapping };
5
+ //# sourceMappingURL=DictionaryFromEnumMapping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DictionaryFromEnumMapping.d.ts","names":[],"sources":["../../src/lib/DictionaryFromEnumMapping.ts"],"sourcesContent":[],"mappings":";KAAY,wDAGM,aAAa,MAAM,mBAHzB,MAKE,IALF,GAKS,OALT,CAKiB,CALQ,CAAA,EAGN"}
@@ -0,0 +1,7 @@
1
+ //#region src/lib/EmptyRecord.d.ts
2
+ type EmptyRecord = Record<string, never>;
3
+ type UnknownRecord = Record<string, unknown>;
4
+ type AnyRecord = Record<string, any>;
5
+ //#endregion
6
+ export { AnyRecord, EmptyRecord, UnknownRecord };
7
+ //# sourceMappingURL=EmptyRecord.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyRecord.d.ts","names":[],"sources":["../../src/lib/EmptyRecord.ts"],"sourcesContent":[],"mappings":";KAAY,WAAA,GAAc;AAAd,KACA,aAAA,GAAgB,MADF,CAAA,MAAM,EAAA,OAAA,CAAA;AACpB,KAEA,SAAA,GAAY,MAFC,CAAA,MAAG,EAAM,GAAA,CAAA"}
@@ -0,0 +1,7 @@
1
+ //#region src/lib/Identified.d.ts
2
+ interface Identified {
3
+ id: string;
4
+ }
5
+ //#endregion
6
+ export { Identified };
7
+ //# sourceMappingURL=Identified.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Identified.d.ts","names":[],"sources":["../../src/lib/Identified.ts"],"sourcesContent":[],"mappings":";UAAiB,UAAA;EAAA,EAAA,EAAA,MAAA"}
@@ -0,0 +1,9 @@
1
+ import { Identified } from "./Identified.js";
2
+
3
+ //#region src/lib/IdentifiedLabel.d.ts
4
+ type IdentifiedLabel = Identified & {
5
+ label: string;
6
+ };
7
+ //#endregion
8
+ export { IdentifiedLabel };
9
+ //# sourceMappingURL=IdentifiedLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentifiedLabel.d.ts","names":[],"sources":["../../src/lib/IdentifiedLabel.ts"],"sourcesContent":[],"mappings":";;;KAEY,eAAA,GAAkB;;AAA9B,CAAA"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/IsAny.d.ts
2
+ declare type IsAny<T> = 0 extends 1 & T ? true : false;
3
+ //#endregion
4
+ export { IsAny };
5
+ //# sourceMappingURL=IsAny.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IsAny.d.ts","names":[],"sources":["../../src/lib/IsAny.ts"],"sourcesContent":[],"mappings":";aAAoB,yBAAyB"}
@@ -0,0 +1,16 @@
1
+ //#region src/lib/Json.d.ts
2
+ declare type PrimitiveJSONValue = string | number | boolean | undefined | null;
3
+ declare type JSONValue = PrimitiveJSONValue | JSONArray | JSONObject;
4
+ interface JSONArray extends Array<JSONValue> {}
5
+ interface JSONObject {
6
+ [key: string]: JSONValue;
7
+ }
8
+ declare type NonJsonValue<ExtraTypes> = PrimitiveJSONValue | NonJsonArray<ExtraTypes> | NonJsonObject<ExtraTypes> | ExtraTypes;
9
+ interface NonJsonArray<ExtraTypes> extends Array<NonJsonValue<ExtraTypes>> {}
10
+ interface NonJsonObject<ExtraTypes> {
11
+ [key: string]: NonJsonValue<ExtraTypes>;
12
+ }
13
+ type ExtendedJsonObject = NonJsonObject<bigint | Date>;
14
+ //#endregion
15
+ export { ExtendedJsonObject, JSONArray, JSONObject, JSONValue, NonJsonArray, NonJsonObject, NonJsonValue, PrimitiveJSONValue };
16
+ //# sourceMappingURL=Json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Json.d.ts","names":[],"sources":["../../src/lib/Json.ts"],"sourcesContent":[],"mappings":";aAAoB,kBAAA;AAAA,aAMA,SAAA,GAAY,kBANM,GAMe,SANf,GAM2B,UAN3B;AAMlB,UAGH,SAAA,SAAkB,KAHN,CAGY,SAHZ,CAAA,CAAA;AAAwB,UAKpC,UAAA,CALoC;EAAY,CAAA,GAAA,EAAA,MAAA,CAAA,EAMhD,SANgD;;AAGhD,aAMG,YANqB,CAAA,UAAN,CAAA,GAO/B,kBAPoC,GAQpC,YARoC,CAQvB,UARuB,CAAA,GASpC,aAToC,CAStB,UATsB,CAAA,GAUpC,UAVoC;AAEvB,UAWA,YAVA,CAAA,UAAS,CAAA,SAUwB,KAVxB,CAWxB,YAXwB,CAWX,UAXW,CAAA,CAAA,CAAA,CAG1B;AACI,UAUa,aAVb,CAAA,UAAA,CAAA,CAAA;EACa,CAAA,GAAA,EAAA,MAAA,CAAA,EAUA,YAVA,CAUa,UAVb,CAAA;;AACC,KAYN,kBAAA,GAAqB,aAZf,CAAA,MAAA,GAYsC,IAZtC,CAAA"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/KeepOnly.d.ts
2
+ type KeepOnly<T, KeepType> = T extends object ? { [K in keyof T]: KeepOnly<T[K], KeepType> } : T extends KeepType ? T : never;
3
+ //#endregion
4
+ export { KeepOnly };
5
+ //# sourceMappingURL=KeepOnly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeepOnly.d.ts","names":[],"sources":["../../src/lib/KeepOnly.ts"],"sourcesContent":[],"mappings":";KAAY,wBAAwB,2BAAxB,MAEM,CAFE,GAEE,QAFF,CAEW,CAFX,CAEa,CAFb,CAAA,EAEiB,QAFjB,CAAA,EAAgB,GAIhC,CAJgC,SAItB,QAJsB,GAK9B,CAL8B,GAAA,KAAA"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/Maybe.d.ts
2
+ type Maybe<T> = T | null;
3
+ //#endregion
4
+ export { Maybe };
5
+ //# sourceMappingURL=Maybe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Maybe.d.ts","names":[],"sources":["../../src/lib/Maybe.ts"],"sourcesContent":[],"mappings":";KAAY,WAAW"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/MaybeArray.d.ts
2
+ type MaybeArray<T> = T | T[];
3
+ //#endregion
4
+ export { MaybeArray };
5
+ //# sourceMappingURL=MaybeArray.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MaybeArray.d.ts","names":[],"sources":["../../src/lib/MaybeArray.ts"],"sourcesContent":[],"mappings":";KAAY,gBAAgB,IAAI"}
@@ -0,0 +1,8 @@
1
+ //#region src/lib/NestedValue.d.ts
2
+ declare const $NestedValue: unique symbol;
3
+ declare type NestedValue<TValue extends object = object> = {
4
+ [$NestedValue]: never;
5
+ } & TValue;
6
+ //#endregion
7
+ export { NestedValue };
8
+ //# sourceMappingURL=NestedValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NestedValue.d.ts","names":[],"sources":["../../src/lib/NestedValue.ts"],"sourcesContent":[],"mappings":";cAAc;AAAA,aAEM,WAFqB,CAAA,eAAA,MAAA,GAAA,MAAA,CAAA,GAAA;EAErB,CACjB,YAAA,CAD4B,EAAA,KAAA;IAE3B"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/NonUndefined.d.ts
2
+ declare type NonUndefined<T> = T extends undefined ? never : T;
3
+ //#endregion
4
+ export { NonUndefined };
5
+ //# sourceMappingURL=NonUndefined.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NonUndefined.d.ts","names":[],"sources":["../../src/lib/NonUndefined.ts"],"sourcesContent":[],"mappings":";aAAoB,kBAAkB,8BAA8B"}
@@ -0,0 +1,7 @@
1
+ import { PrimitiveJSONValue } from "./Json.js";
2
+
3
+ //#region src/lib/Primitive.d.ts
4
+ declare type Primitive = PrimitiveJSONValue | symbol | bigint;
5
+ //#endregion
6
+ export { Primitive };
7
+ //# sourceMappingURL=Primitive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Primitive.d.ts","names":[],"sources":["../../src/lib/Primitive.ts"],"sourcesContent":[],"mappings":";;;aAEoB,SAAA,GAAY"}
@@ -0,0 +1,7 @@
1
+ import { Primitive } from "./Primitive.js";
2
+
3
+ //#region src/lib/Replaced.d.ts
4
+ type Replaced<T, TReplace, TWith, TKeep = Primitive> = T extends TReplace | TKeep ? T extends TReplace ? TWith | Exclude<T, TReplace> : T : { [P in keyof T]: Replaced<T[P], TReplace, TWith, TKeep> };
5
+ //#endregion
6
+ export { Replaced };
7
+ //# sourceMappingURL=Replaced.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Replaced.d.ts","names":[],"sources":["../../src/lib/Replaced.ts"],"sourcesContent":[],"mappings":";;;KAGY,qCAAqC,aAAa,UAC1D,WACA,QACA,UAAU,WACR,QAAQ,QAAQ,GAAG,YACnB,kBAEY,IAAI,SAAS,EAAE,IAAI,UAAU,OAAO,QAPtD"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/ReverseMap.d.ts
2
+ type ReverseMap<T extends Record<keyof T, keyof any>> = { [K in keyof T as T[K]]: K };
3
+ //#endregion
4
+ export { ReverseMap };
5
+ //# sourceMappingURL=ReverseMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReverseMap.d.ts","names":[],"sources":["../../src/lib/ReverseMap.ts"],"sourcesContent":[],"mappings":";KACY,qBAAqB,aAAa,yBAAlC,MACE,CADQ,IACH,CADG,CACD,CADC,CAAA,GACI,CADJ,EAAwB"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/Satisfies.d.ts
2
+ declare type Satisfies<ConstraintShape, ToValidate> = ConstraintShape extends ConstraintShape ? ToValidate : never;
3
+ //#endregion
4
+ export { Satisfies };
5
+ //# sourceMappingURL=Satisfies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Satisfies.d.ts","names":[],"sources":["../../src/lib/Satisfies.ts"],"sourcesContent":[],"mappings":";aAAoB,yCAClB,wBAAwB,kBAAkB"}
@@ -0,0 +1,5 @@
1
+ //#region src/lib/StringKey.d.ts
2
+ type StringKey<T> = { [K in keyof T]: T[K] extends string ? K : never }[keyof T];
3
+ //#endregion
4
+ export { StringKey };
5
+ //# sourceMappingURL=StringKey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StringKey.d.ts","names":[],"sources":["../../src/lib/StringKey.ts"],"sourcesContent":[],"mappings":";KAAY,uBAAA,MACE,CADO,GACH,CADG,CACD,CADC,CAAA,SAAA,MAAA,GACmB,CADnB,GAAA,KAAA,EACP,CAAA,MACN,CADM,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { StringKey } from "./StringKey.js";
2
+
3
+ //#region src/lib/StringKeysOnly.d.ts
4
+ type StringKeysOnly<T> = Pick<T, StringKey<T>>;
5
+ //#endregion
6
+ export { StringKeysOnly };
7
+ //# sourceMappingURL=StringKeysOnly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StringKeysOnly.d.ts","names":[],"sources":["../../src/lib/StringKeysOnly.ts"],"sourcesContent":[],"mappings":";;;KAEY,oBAAoB,KAAK,GAAG,UAAU"}
@@ -0,0 +1,5 @@
1
+ //#region src/staticShouldNotHappen.d.ts
2
+ declare function staticShouldNotHappen(value: never): asserts value;
3
+ //#endregion
4
+ export { staticShouldNotHappen };
5
+ //# sourceMappingURL=staticShouldNotHappen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staticShouldNotHappen.d.ts","names":[],"sources":["../src/staticShouldNotHappen.ts"],"sourcesContent":[],"mappings":";iBAAgB,qBAAA"}
@@ -1 +1,8 @@
1
- function e(e){throw Error(`Missing switch value ${e?.toString?.()}`)}export{e as staticShouldNotHappen};
1
+ //#region src/staticShouldNotHappen.ts
2
+ function staticShouldNotHappen(value) {
3
+ throw new Error(`Missing switch value ${value?.toString?.()}`);
4
+ }
5
+
6
+ //#endregion
7
+ export { staticShouldNotHappen };
8
+ //# sourceMappingURL=staticShouldNotHappen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staticShouldNotHappen.js","names":[],"sources":["../src/staticShouldNotHappen.ts"],"sourcesContent":["export function staticShouldNotHappen(value: never): asserts value {\n throw new Error(\n `Missing switch value ${(value as null | { toString?: () => string })?.toString?.()}`\n );\n}\n"],"mappings":";AAAA,SAAgB,sBAAsB,OAA6B;AACjE,OAAM,IAAI,MACR,wBAAyB,OAA8C,YAAY,GACpF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lssm/lib.utils-typescript",
3
- "version": "1.42.0",
3
+ "version": "1.42.2",
4
4
  "scripts": {
5
5
  "clean": "rm -rf dist",
6
6
  "lint": "bun run lint:fix",
@@ -8,53 +8,53 @@
8
8
  "lint:check": "eslint src",
9
9
  "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
10
10
  "publish:pkg:canary": "bun publish:pkg --tag canary",
11
- "build": "bun build:bundle && bun build:types",
11
+ "build": "bun build:types && bun build:bundle",
12
12
  "build:bundle": "tsdown",
13
13
  "build:types": "tsc --noEmit",
14
14
  "dev": "bun build:bundle --watch"
15
15
  },
16
16
  "devDependencies": {
17
- "@lssm/tool.typescript": "1.42.0",
18
- "@lssm/tool.tsdown": "1.42.0",
19
- "tsdown": "^0.17.4",
17
+ "@lssm/tool.typescript": "1.42.2",
18
+ "@lssm/tool.tsdown": "1.42.2",
19
+ "tsdown": "^0.18.3",
20
20
  "typescript": "^5.9.3"
21
21
  },
22
22
  "type": "module",
23
23
  "main": "./dist/index.js",
24
24
  "module": "./dist/index.js",
25
- "types": "./dist/index.d.mts",
25
+ "types": "./dist/index.d.ts",
26
26
  "exports": {
27
- ".": "./src/index.ts",
28
- "./lib/AwaitedResult": "./src/lib/AwaitedResult.ts",
29
- "./lib/BrowserNativeObject": "./src/lib/BrowserNativeObject.ts",
30
- "./lib/DeepInfiniteArray": "./src/lib/DeepInfiniteArray.ts",
31
- "./lib/DeepKeepOnly": "./src/lib/DeepKeepOnly.ts",
32
- "./lib/DeepKey": "./src/lib/DeepKey.ts",
33
- "./lib/DeepMap": "./src/lib/DeepMap.ts",
34
- "./lib/DeepNullable": "./src/lib/DeepNullable.ts",
35
- "./lib/DeepOr": "./src/lib/DeepOr.ts",
36
- "./lib/DeepPartial": "./src/lib/DeepPartial.ts",
37
- "./lib/DeepReplace": "./src/lib/DeepReplace.ts",
38
- "./lib/DeepReplaceNullByUndefined": "./src/lib/DeepReplaceNullByUndefined.ts",
39
- "./lib/DeepValue": "./src/lib/DeepValue.ts",
40
- "./lib/DictionaryFromEnum": "./src/lib/DictionaryFromEnum.ts",
41
- "./lib/DictionaryFromEnumMapping": "./src/lib/DictionaryFromEnumMapping.ts",
42
- "./lib/EmptyRecord": "./src/lib/EmptyRecord.ts",
43
- "./lib/Identified": "./src/lib/Identified.ts",
44
- "./lib/IdentifiedLabel": "./src/lib/IdentifiedLabel.ts",
45
- "./lib/IsAny": "./src/lib/IsAny.ts",
46
- "./lib/Json": "./src/lib/Json.ts",
47
- "./lib/KeepOnly": "./src/lib/KeepOnly.ts",
48
- "./lib/Maybe": "./src/lib/Maybe.ts",
49
- "./lib/MaybeArray": "./src/lib/MaybeArray.ts",
50
- "./lib/NestedValue": "./src/lib/NestedValue.ts",
51
- "./lib/NonUndefined": "./src/lib/NonUndefined.ts",
52
- "./lib/Primitive": "./src/lib/Primitive.ts",
53
- "./lib/Replaced": "./src/lib/Replaced.ts",
54
- "./lib/ReverseMap": "./src/lib/ReverseMap.ts",
55
- "./lib/Satisfies": "./src/lib/Satisfies.ts",
56
- "./lib/StringKey": "./src/lib/StringKey.ts",
57
- "./lib/StringKeysOnly": "./src/lib/StringKeysOnly.ts",
27
+ ".": "./dist/index.js",
28
+ "./lib/AwaitedResult": "./dist/lib/AwaitedResult.js",
29
+ "./lib/BrowserNativeObject": "./dist/lib/BrowserNativeObject.js",
30
+ "./lib/DeepInfiniteArray": "./dist/lib/DeepInfiniteArray.js",
31
+ "./lib/DeepKeepOnly": "./dist/lib/DeepKeepOnly.js",
32
+ "./lib/DeepKey": "./dist/lib/DeepKey.js",
33
+ "./lib/DeepMap": "./dist/lib/DeepMap.js",
34
+ "./lib/DeepNullable": "./dist/lib/DeepNullable.js",
35
+ "./lib/DeepOr": "./dist/lib/DeepOr.js",
36
+ "./lib/DeepPartial": "./dist/lib/DeepPartial.js",
37
+ "./lib/DeepReplace": "./dist/lib/DeepReplace.js",
38
+ "./lib/DeepReplaceNullByUndefined": "./dist/lib/DeepReplaceNullByUndefined.js",
39
+ "./lib/DeepValue": "./dist/lib/DeepValue.js",
40
+ "./lib/DictionaryFromEnum": "./dist/lib/DictionaryFromEnum.js",
41
+ "./lib/DictionaryFromEnumMapping": "./dist/lib/DictionaryFromEnumMapping.js",
42
+ "./lib/EmptyRecord": "./dist/lib/EmptyRecord.js",
43
+ "./lib/Identified": "./dist/lib/Identified.js",
44
+ "./lib/IdentifiedLabel": "./dist/lib/IdentifiedLabel.js",
45
+ "./lib/IsAny": "./dist/lib/IsAny.js",
46
+ "./lib/Json": "./dist/lib/Json.js",
47
+ "./lib/KeepOnly": "./dist/lib/KeepOnly.js",
48
+ "./lib/Maybe": "./dist/lib/Maybe.js",
49
+ "./lib/MaybeArray": "./dist/lib/MaybeArray.js",
50
+ "./lib/NestedValue": "./dist/lib/NestedValue.js",
51
+ "./lib/NonUndefined": "./dist/lib/NonUndefined.js",
52
+ "./lib/Primitive": "./dist/lib/Primitive.js",
53
+ "./lib/Replaced": "./dist/lib/Replaced.js",
54
+ "./lib/ReverseMap": "./dist/lib/ReverseMap.js",
55
+ "./lib/Satisfies": "./dist/lib/Satisfies.js",
56
+ "./lib/StringKey": "./dist/lib/StringKey.js",
57
+ "./lib/StringKeysOnly": "./dist/lib/StringKeysOnly.js",
58
58
  "./*": "./*"
59
59
  },
60
60
  "publishConfig": {
@@ -92,10 +92,17 @@
92
92
  "./lib/StringKeysOnly": "./dist/lib/StringKeysOnly.js",
93
93
  "./*": "./*"
94
94
  },
95
- "access": "public"
95
+ "access": "public",
96
+ "registry": "https://registry.npmjs.org/"
96
97
  },
97
98
  "files": [
98
99
  "dist",
99
100
  "README.md"
100
- ]
101
+ ],
102
+ "license": "MIT",
103
+ "repository": {
104
+ "type": "git",
105
+ "url": "https://github.com/lssm-tech/contractspec.git",
106
+ "directory": "packages/libs/utils-typescript"
107
+ }
101
108
  }