@lssm/lib.utils-typescript 0.0.0-canary-20251217054315 → 0.0.0-canary-20251217060433
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/dist/index.d.ts +32 -0
- package/dist/lib/AwaitedResult.d.ts +4 -0
- package/dist/lib/BrowserNativeObject.d.ts +4 -0
- package/dist/lib/DeepInfiniteArray.d.ts +4 -0
- package/dist/lib/DeepKeepOnly.d.ts +6 -0
- package/dist/lib/DeepKey.d.ts +4 -0
- package/dist/lib/DeepMap.d.ts +9 -0
- package/dist/lib/DeepNullable.d.ts +6 -0
- package/dist/lib/DeepOr.d.ts +4 -0
- package/dist/lib/DeepPartial.d.ts +7 -0
- package/dist/lib/DeepReplace.d.ts +4 -0
- package/dist/lib/DeepReplaceNullByUndefined.d.ts +6 -0
- package/dist/lib/DeepValue.d.ts +6 -0
- package/dist/lib/DictionaryFromEnum.d.ts +4 -0
- package/dist/lib/DictionaryFromEnumMapping.d.ts +4 -0
- package/dist/lib/EmptyRecord.d.ts +6 -0
- package/dist/lib/Identified.d.ts +6 -0
- package/dist/lib/IdentifiedLabel.d.ts +8 -0
- package/dist/lib/IsAny.d.ts +4 -0
- package/dist/lib/Json.d.ts +15 -0
- package/dist/lib/KeepOnly.d.ts +4 -0
- package/dist/lib/Maybe.d.ts +4 -0
- package/dist/lib/MaybeArray.d.ts +4 -0
- package/dist/lib/NestedValue.d.ts +7 -0
- package/dist/lib/NonUndefined.d.ts +4 -0
- package/dist/lib/Primitive.d.ts +6 -0
- package/dist/lib/Replaced.d.ts +6 -0
- package/dist/lib/ReverseMap.d.ts +4 -0
- package/dist/lib/Satisfies.d.ts +4 -0
- package/dist/lib/StringKey.d.ts +4 -0
- package/dist/lib/StringKeysOnly.d.ts +6 -0
- package/dist/staticShouldNotHappen.d.ts +4 -0
- package/package.json +35 -35
package/dist/index.d.ts
ADDED
|
@@ -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 };
|
|
@@ -0,0 +1,6 @@
|
|
|
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 };
|
|
@@ -0,0 +1,9 @@
|
|
|
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 };
|
|
@@ -0,0 +1,4 @@
|
|
|
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 };
|
|
@@ -0,0 +1,7 @@
|
|
|
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 };
|
|
@@ -0,0 +1,4 @@
|
|
|
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 };
|
|
@@ -0,0 +1,6 @@
|
|
|
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 };
|
|
@@ -0,0 +1,15 @@
|
|
|
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 };
|
|
@@ -0,0 +1,6 @@
|
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/lib.utils-typescript",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251217060433",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"clean": "rm -rf dist",
|
|
6
6
|
"lint": "bun run lint:fix",
|
|
@@ -14,47 +14,47 @@
|
|
|
14
14
|
"dev": "bun build:bundle --watch"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@lssm/tool.typescript": "0.0.0-canary-
|
|
18
|
-
"@lssm/tool.tsdown": "0.0.0-canary-
|
|
17
|
+
"@lssm/tool.typescript": "0.0.0-canary-20251217060433",
|
|
18
|
+
"@lssm/tool.tsdown": "0.0.0-canary-20251217060433",
|
|
19
19
|
"tsdown": "^0.17.4",
|
|
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.
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
26
|
"exports": {
|
|
27
|
-
".": "./
|
|
28
|
-
"./lib/AwaitedResult": "./
|
|
29
|
-
"./lib/BrowserNativeObject": "./
|
|
30
|
-
"./lib/DeepInfiniteArray": "./
|
|
31
|
-
"./lib/DeepKeepOnly": "./
|
|
32
|
-
"./lib/DeepKey": "./
|
|
33
|
-
"./lib/DeepMap": "./
|
|
34
|
-
"./lib/DeepNullable": "./
|
|
35
|
-
"./lib/DeepOr": "./
|
|
36
|
-
"./lib/DeepPartial": "./
|
|
37
|
-
"./lib/DeepReplace": "./
|
|
38
|
-
"./lib/DeepReplaceNullByUndefined": "./
|
|
39
|
-
"./lib/DeepValue": "./
|
|
40
|
-
"./lib/DictionaryFromEnum": "./
|
|
41
|
-
"./lib/DictionaryFromEnumMapping": "./
|
|
42
|
-
"./lib/EmptyRecord": "./
|
|
43
|
-
"./lib/Identified": "./
|
|
44
|
-
"./lib/IdentifiedLabel": "./
|
|
45
|
-
"./lib/IsAny": "./
|
|
46
|
-
"./lib/Json": "./
|
|
47
|
-
"./lib/KeepOnly": "./
|
|
48
|
-
"./lib/Maybe": "./
|
|
49
|
-
"./lib/MaybeArray": "./
|
|
50
|
-
"./lib/NestedValue": "./
|
|
51
|
-
"./lib/NonUndefined": "./
|
|
52
|
-
"./lib/Primitive": "./
|
|
53
|
-
"./lib/Replaced": "./
|
|
54
|
-
"./lib/ReverseMap": "./
|
|
55
|
-
"./lib/Satisfies": "./
|
|
56
|
-
"./lib/StringKey": "./
|
|
57
|
-
"./lib/StringKeysOnly": "./
|
|
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": {
|