@fncts/typelevel 0.0.15 → 0.0.16

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/Check.d.ts CHANGED
@@ -39,7 +39,7 @@ export declare namespace Check {
39
39
  /**
40
40
  * @tsplus type fncts.Check.IsLiteral
41
41
  */
42
- type IsLiteral<A extends string | number | boolean> = Not<Extends<string, A> | Extends<number, A> | Extends<boolean, A>>;
42
+ type IsLiteral<A extends string | number | boolean | bigint | null> = Not<Extends<string, A> | Extends<number, A> | Extends<boolean, A> | Extends<bigint, A> | Extends<null, A>>;
43
43
  /**
44
44
  * @tsplus type fncts.Check.IsStruct
45
45
  */
package/_cjs/HKT.cjs CHANGED
@@ -7,7 +7,6 @@ exports.HKT = void 0;
7
7
  exports.unifyFK1 = unifyFK1;
8
8
  // eslint-disable-next-line @typescript-eslint/no-namespace
9
9
  var HKT;
10
- exports.HKT = HKT;
11
10
  (function (HKT) {
12
11
  /*
13
12
  * Instance util
package/_cjs/HKT.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"HKT.cjs","names":["HKT","instance","_","unifyFK1"],"sources":["../esm/HKT.js"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-namespace\nexport var HKT;\n(function (HKT) {\n /*\n * Instance util\n */\n /**\n * @tsplus macro identity\n */\n function instance(_) {\n // @ts-expect-error: typelevel utility\n return _;\n }\n HKT.instance = instance;\n})(HKT || (HKT = {}));\n/**\n * @tsplus unify fncts.HKT.FK1\n */\nexport function unifyFK1(_) {\n return _;\n}\n"],"mappings":";;;;;;;AAAA;AACO,IAAIA,GAAG;AAAC;AACf,CAAC,UAAUA,GAAG,EAAE;EACZ;AACJ;AACA;EACI;AACJ;AACA;EACI,SAASC,QAAQ,CAACC,CAAC,EAAE;IACjB;IACA,OAAOA,CAAC;EACZ;EACAF,GAAG,CAACC,QAAQ,GAAGA,QAAQ;AAC3B,CAAC,EAAED,GAAG,mBAAKA,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACrB;AACA;AACA;AACO,SAASG,QAAQ,CAACD,CAAC,EAAE;EACxB,OAAOA,CAAC;AACZ"}
1
+ {"version":3,"file":"HKT.cjs","names":["HKT","instance","_","exports","unifyFK1"],"sources":["../esm/HKT.js"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-namespace\nexport var HKT;\n(function (HKT) {\n /*\n * Instance util\n */\n /**\n * @tsplus macro identity\n */\n function instance(_) {\n // @ts-expect-error: typelevel utility\n return _;\n }\n HKT.instance = instance;\n})(HKT || (HKT = {}));\n/**\n * @tsplus unify fncts.HKT.FK1\n */\nexport function unifyFK1(_) {\n return _;\n}\n"],"mappings":";;;;;;;AAAA;AACO,IAAIA,GAAG;AACd,CAAC,UAAUA,GAAG,EAAE;EACZ;AACJ;AACA;EACI;AACJ;AACA;EACI,SAASC,QAAQA,CAACC,CAAC,EAAE;IACjB;IACA,OAAOA,CAAC;EACZ;EACAF,GAAG,CAACC,QAAQ,GAAGA,QAAQ;AAC3B,CAAC,EAAED,GAAG,KAAAG,OAAA,CAAAH,GAAA,GAAKA,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACrB;AACA;AACA;AACO,SAASI,QAAQA,CAACF,CAAC,EAAE;EACxB,OAAOA,CAAC;AACZ"}
package/_cjs/index.cjs CHANGED
@@ -24,6 +24,6 @@ var _String = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./Stri
24
24
  exports.String = _String;
25
25
  var _Union = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./Union.cjs"));
26
26
  exports.Union = _Union;
27
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
28
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
28
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
29
29
  //# sourceMappingURL=index.cjs.map
package/_mjs/HKT.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"HKT.mjs","names":["HKT","instance","_","unifyFK1"],"sources":["../esm/HKT.js"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-namespace\nexport var HKT;\n(function (HKT) {\n /*\n * Instance util\n */\n /**\n * @tsplus macro identity\n */\n function instance(_) {\n // @ts-expect-error: typelevel utility\n return _;\n }\n HKT.instance = instance;\n})(HKT || (HKT = {}));\n/**\n * @tsplus unify fncts.HKT.FK1\n */\nexport function unifyFK1(_) {\n return _;\n}\n"],"mappings":"AAAA;AACA,OAAO,IAAIA,GAAG;AACd,CAAC,UAAUA,GAAG,EAAE;EACZ;AACJ;AACA;EACI;AACJ;AACA;EACI,SAASC,QAAQ,CAACC,CAAC,EAAE;IACjB;IACA,OAAOA,CAAC;EACZ;EACAF,GAAG,CAACC,QAAQ,GAAGA,QAAQ;AAC3B,CAAC,EAAED,GAAG,KAAKA,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACrB;AACA;AACA;AACA,OAAO,SAASG,QAAQ,CAACD,CAAC,EAAE;EACxB,OAAOA,CAAC;AACZ"}
1
+ {"version":3,"file":"HKT.mjs","names":["HKT","instance","_","unifyFK1"],"sources":["../esm/HKT.js"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-namespace\nexport var HKT;\n(function (HKT) {\n /*\n * Instance util\n */\n /**\n * @tsplus macro identity\n */\n function instance(_) {\n // @ts-expect-error: typelevel utility\n return _;\n }\n HKT.instance = instance;\n})(HKT || (HKT = {}));\n/**\n * @tsplus unify fncts.HKT.FK1\n */\nexport function unifyFK1(_) {\n return _;\n}\n"],"mappings":"AAAA;AACA,OAAO,IAAIA,GAAG;AACd,CAAC,UAAUA,GAAG,EAAE;EACZ;AACJ;AACA;EACI;AACJ;AACA;EACI,SAASC,QAAQA,CAACC,CAAC,EAAE;IACjB;IACA,OAAOA,CAAC;EACZ;EACAF,GAAG,CAACC,QAAQ,GAAGA,QAAQ;AAC3B,CAAC,EAAED,GAAG,KAAKA,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACrB;AACA;AACA;AACA,OAAO,SAASG,QAAQA,CAACD,CAAC,EAAE;EACxB,OAAOA,CAAC;AACZ"}
package/_src/Any.ts CHANGED
@@ -11,9 +11,8 @@ export type Extends<A, B> = [A] extends [never] ? False : A extends B ? True : F
11
11
 
12
12
  export type Contains<A, B> = Extends<A, B> extends True ? True : False;
13
13
 
14
- export type Equals<A, B> = (<X>() => X extends B ? True : False) extends <X>() => X extends A ? True : False
15
- ? True
16
- : False;
14
+ export type Equals<A, B> =
15
+ (<X>() => X extends B ? True : False) extends <X>() => X extends A ? True : False ? True : False;
17
16
 
18
17
  export type If<B extends Boolean, Then, Else = never> = B extends True ? Then : Else;
19
18
 
@@ -58,14 +57,14 @@ export type ComputeRaw<A> = A extends Function ? A : { [K in keyof A]: A[K] } &
58
57
  export type ComputeFlat<A> = A extends BuiltIn
59
58
  ? A
60
59
  : A extends Array<any>
61
- ? A extends Array<Record<Key, any>>
62
- ? Array<{ [K in keyof A[number]]: A[number][K] } & unknown>
63
- : A
64
- : A extends ReadonlyArray<any>
65
- ? A extends ReadonlyArray<Record<Key, any>>
66
- ? ReadonlyArray<{ [K in keyof A[number]]: A[number][K] } & unknown>
67
- : A
68
- : { [K in keyof A]: A[K] } & unknown;
60
+ ? A extends Array<Record<Key, any>>
61
+ ? Array<{ [K in keyof A[number]]: A[number][K] } & unknown>
62
+ : A
63
+ : A extends ReadonlyArray<any>
64
+ ? A extends ReadonlyArray<Record<Key, any>>
65
+ ? ReadonlyArray<{ [K in keyof A[number]]: A[number][K] } & unknown>
66
+ : A
67
+ : { [K in keyof A]: A[K] } & unknown;
69
68
 
70
69
  export type ComputeDeep<A, Seen = never> = A extends BuiltIn
71
70
  ? A
@@ -75,10 +74,10 @@ export type ComputeDeep<A, Seen = never> = A extends BuiltIn
75
74
  ? Array<{ [K in keyof A[number]]: ComputeDeep<A[number][K], A | Seen> } & unknown>
76
75
  : A
77
76
  : A extends ReadonlyArray<any>
78
- ? A extends ReadonlyArray<Record<Key, any>>
79
- ? ReadonlyArray<{ [K in keyof A[number]]: ComputeDeep<A[number][K], A | Seen> } & unknown>
80
- : A
81
- : { [K in keyof A]: ComputeDeep<A[K], A | Seen> } & unknown;
77
+ ? A extends ReadonlyArray<Record<Key, any>>
78
+ ? ReadonlyArray<{ [K in keyof A[number]]: ComputeDeep<A[number][K], A | Seen> } & unknown>
79
+ : A
80
+ : { [K in keyof A]: ComputeDeep<A[K], A | Seen> } & unknown;
82
81
  [True]: A;
83
82
  }[Has<Seen, A>];
84
83
 
@@ -88,10 +87,10 @@ export type At<A, K extends Key> = A extends List
88
87
  ? A[never] | undefined
89
88
  : undefined
90
89
  : K extends keyof A
91
- ? A[K]
92
- : undefined
90
+ ? A[K]
91
+ : undefined
93
92
  : unknown extends A
94
- ? unknown
95
- : K extends keyof A
96
- ? A[K]
97
- : undefined;
93
+ ? unknown
94
+ : K extends keyof A
95
+ ? A[K]
96
+ : undefined;
package/_src/Check.ts CHANGED
@@ -46,15 +46,14 @@ export declare namespace Check {
46
46
  /**
47
47
  * @tsplus type fncts.Check.IsEqual
48
48
  */
49
- type IsEqual<A, B> = (<T>() => T extends EqualsWrapped<A> ? 1 : 2) extends <T>() => T extends EqualsWrapped<B> ? 1 : 2
50
- ? unknown
51
- : never;
49
+ type IsEqual<A, B> =
50
+ (<T>() => T extends EqualsWrapped<A> ? 1 : 2) extends <T>() => T extends EqualsWrapped<B> ? 1 : 2 ? unknown : never;
52
51
 
53
52
  /**
54
53
  * @tsplus type fncts.Check.IsLiteral
55
54
  */
56
- type IsLiteral<A extends string | number | boolean> = Not<
57
- Extends<string, A> | Extends<number, A> | Extends<boolean, A>
55
+ type IsLiteral<A extends string | number | boolean | bigint | null> = Not<
56
+ Extends<string, A> | Extends<number, A> | Extends<boolean, A> | Extends<bigint, A> | Extends<null, A>
58
57
  >;
59
58
 
60
59
  /**
package/_src/HKT.ts CHANGED
@@ -227,24 +227,24 @@ export namespace HKT {
227
227
  ? N extends "C"
228
228
  ? C
229
229
  : N extends "K"
230
- ? K
231
- : N extends "Q"
232
- ? Q
233
- : N extends "W"
234
- ? W
235
- : N extends "X"
236
- ? X
237
- : N extends "I"
238
- ? I
239
- : N extends "S"
240
- ? S
241
- : N extends "R"
242
- ? R
243
- : N extends "E"
244
- ? E
245
- : N extends "A"
246
- ? A
247
- : never
230
+ ? K
231
+ : N extends "Q"
232
+ ? Q
233
+ : N extends "W"
234
+ ? W
235
+ : N extends "X"
236
+ ? X
237
+ : N extends "I"
238
+ ? I
239
+ : N extends "S"
240
+ ? S
241
+ : N extends "R"
242
+ ? R
243
+ : N extends "E"
244
+ ? E
245
+ : N extends "A"
246
+ ? A
247
+ : never
248
248
  : never;
249
249
 
250
250
  /*
@@ -269,14 +269,14 @@ export namespace HKT {
269
269
  "-": P extends [any]
270
270
  ? P[0]
271
271
  : P extends [any, any]
272
- ? P[0] & P[1]
273
- : P extends [any, any, any]
274
- ? P[0] & P[1] & P[2]
275
- : P extends [any, any, any, any]
276
- ? P[0] & P[1] & P[2] & P[3]
277
- : P extends [any, any, any, any, any]
278
- ? P[0] & P[1] & P[2] & P[3] & P[4]
279
- : Union.IntersectionOf<P[number]>;
272
+ ? P[0] & P[1]
273
+ : P extends [any, any, any]
274
+ ? P[0] & P[1] & P[2]
275
+ : P extends [any, any, any, any]
276
+ ? P[0] & P[1] & P[2] & P[3]
277
+ : P extends [any, any, any, any, any]
278
+ ? P[0] & P[1] & P[2] & P[3] & P[4]
279
+ : Union.IntersectionOf<P[number]>;
280
280
  "+": P[number];
281
281
  _: P[0];
282
282
  }
@@ -291,10 +291,10 @@ export namespace HKT {
291
291
  export type MixStruct<F extends HKT, N extends ParamName, X, Y> = F["variance"][N] extends "_"
292
292
  ? X
293
293
  : F["variance"][N] extends "+"
294
- ? Y[keyof Y]
295
- : F["variance"][N] extends "-"
296
- ? Union.IntersectionOf<{ [k in keyof Y]: OrNever<Y[k]> }[keyof Y]>
297
- : X;
294
+ ? Y[keyof Y]
295
+ : F["variance"][N] extends "-"
296
+ ? Union.IntersectionOf<{ [k in keyof Y]: OrNever<Y[k]> }[keyof Y]>
297
+ : X;
298
298
 
299
299
  export interface Intros<A, B> {
300
300
  "-": B;
package/_src/List.ts CHANGED
@@ -20,9 +20,8 @@ export type Last<L extends List> = L[Length<Tail<L>>];
20
20
 
21
21
  export type UnionOf<L extends List> = L[number];
22
22
 
23
- export type PrependAll<L extends List, A, O extends List = []> = Length<L> extends 0
24
- ? O
25
- : PrependAll<Tail<L>, A, [...O, A, Head<L>]>;
23
+ export type PrependAll<L extends List, A, O extends List = []> =
24
+ Length<L> extends 0 ? O : PrependAll<Tail<L>, A, [...O, A, Head<L>]>;
26
25
 
27
26
  export type Pop<L extends List> = L extends readonly [...infer LBody, any] | readonly [...infer LBody, any?]
28
27
  ? LBody
package/_src/Number.ts CHANGED
@@ -30,25 +30,17 @@ export type _Negate<N extends Iteration> = IterationMap[N[4]];
30
30
 
31
31
  export type Negate<N extends number> = N extends unknown ? _Negate<IterationOf<N>>[0] : never;
32
32
 
33
- export type _AddPositive<N1 extends Iteration, N2 extends Iteration> = Pos<N2> extends 0
34
- ? N1
35
- : number extends Pos<N2>
36
- ? IterationOf<number>
37
- : _AddPositive<Next<N1>, Prev<N2>>;
38
-
39
- export type AddPositive<N1 extends Iteration, N2 extends Iteration> = _AddPositive<N1, N2> extends infer X
40
- ? Cast<X, Iteration>
41
- : never;
33
+ export type _AddPositive<N1 extends Iteration, N2 extends Iteration> =
34
+ Pos<N2> extends 0 ? N1 : number extends Pos<N2> ? IterationOf<number> : _AddPositive<Next<N1>, Prev<N2>>;
42
35
 
43
- export type _AddNegative<N1 extends Iteration, N2 extends Iteration> = Pos<N2> extends 0
44
- ? N1
45
- : number extends Pos<N2>
46
- ? IterationOf<number>
47
- : _AddNegative<Prev<N1>, Next<N2>>;
36
+ export type AddPositive<N1 extends Iteration, N2 extends Iteration> =
37
+ _AddPositive<N1, N2> extends infer X ? Cast<X, Iteration> : never;
48
38
 
49
- export type AddNegative<N1 extends Iteration, N2 extends Iteration> = _AddNegative<N1, N2> extends infer X
50
- ? Cast<X, Iteration>
51
- : never;
39
+ export type _AddNegative<N1 extends Iteration, N2 extends Iteration> =
40
+ Pos<N2> extends 0 ? N1 : number extends Pos<N2> ? IterationOf<number> : _AddNegative<Prev<N1>, Next<N2>>;
41
+
42
+ export type AddNegative<N1 extends Iteration, N2 extends Iteration> =
43
+ _AddNegative<N1, N2> extends infer X ? Cast<X, Iteration> : never;
52
44
 
53
45
  export type _Add<N1 extends Iteration, N2 extends Iteration> = {
54
46
  [False]: AddPositive<N1, N2>;
package/_src/Object.ts CHANGED
@@ -170,36 +170,31 @@ type Longer<L extends List, L1 extends List> = L extends unknown
170
170
  type MergeProp<OK, O1K, Fill, OOKeys extends Key, K extends Key> = K extends OOKeys
171
171
  ? U.Exclude<OK, undefined> | O1K
172
172
  : [OK] extends [never]
173
- ? O1K
174
- : OK extends Fill
175
- ? O1K
176
- : OK;
173
+ ? O1K
174
+ : OK extends Fill
175
+ ? O1K
176
+ : OK;
177
177
 
178
178
  type MergeFlatObject<O, O1, Fill, OOKeys extends Key = OptionalKeys<O>> = {
179
179
  [K in keyof (Anyify<O> & O1)]: MergeProp<At<O, K>, At<O1, K>, Fill, OOKeys, K>;
180
180
  } & {};
181
181
 
182
- type MergeFlatList<
183
- L extends List,
184
- L1 extends List,
185
- Ignore,
186
- Fill,
187
- LOK extends Key = _OptionalKeys<L>,
188
- > = number extends Length<L | L1>
189
- ? MergeFlatChoice<L[number], L1[number], Ignore, Fill>[]
190
- : Longer<L, L1> extends True
191
- ? { [K in keyof L]: MergeProp<L[K], At<L1, K>, Fill, LOK, K> }
192
- : { [K in keyof L1]: MergeProp<At<L, K>, L1[K], Fill, LOK, K> };
182
+ type MergeFlatList<L extends List, L1 extends List, Ignore, Fill, LOK extends Key = _OptionalKeys<L>> =
183
+ number extends Length<L | L1>
184
+ ? MergeFlatChoice<L[number], L1[number], Ignore, Fill>[]
185
+ : Longer<L, L1> extends True
186
+ ? { [K in keyof L]: MergeProp<L[K], At<L1, K>, Fill, LOK, K> }
187
+ : { [K in keyof L1]: MergeProp<At<L, K>, L1[K], Fill, LOK, K> };
193
188
 
194
189
  type MergeFlatChoice<O, O1, Ignore, Fill> = O extends Ignore
195
190
  ? O
196
191
  : O1 extends Ignore
197
- ? O
198
- : O extends List
199
- ? O1 extends List
200
- ? MergeFlatList<O, O1, Ignore, Fill>
201
- : MergeFlatObject<O, O1, Fill>
202
- : MergeFlatObject<O, O1, Fill>;
192
+ ? O
193
+ : O extends List
194
+ ? O1 extends List
195
+ ? MergeFlatList<O, O1, Ignore, Fill>
196
+ : MergeFlatObject<O, O1, Fill>
197
+ : MergeFlatObject<O, O1, Fill>;
203
198
 
204
199
  export type MergeFlat<O, O1, Ignore = BuiltIn, Fill = undefined> = O extends unknown
205
200
  ? O1 extends unknown
@@ -207,11 +202,12 @@ export type MergeFlat<O, O1, Ignore = BuiltIn, Fill = undefined> = O extends unk
207
202
  : never
208
203
  : never;
209
204
 
210
- type MergeDeepList<L extends List, L1 extends List, Ignore, Fill> = number extends Length<L | L1>
211
- ? MergeDeepChoice<L[number], L1[number], Ignore, Fill, never, any>[]
212
- : Longer<L, L1> extends True
213
- ? { [K in keyof L]: MergeDeepChoice<L[K], At<L1, K>, Ignore, Fill, _OptionalKeys<L>, K> }
214
- : { [K in keyof L1]: MergeDeepChoice<At<L, K>, L1[K], Ignore, Fill, _OptionalKeys<L>, K> };
205
+ type MergeDeepList<L extends List, L1 extends List, Ignore, Fill> =
206
+ number extends Length<L | L1>
207
+ ? MergeDeepChoice<L[number], L1[number], Ignore, Fill, never, any>[]
208
+ : Longer<L, L1> extends True
209
+ ? { [K in keyof L]: MergeDeepChoice<L[K], At<L1, K>, Ignore, Fill, _OptionalKeys<L>, K> }
210
+ : { [K in keyof L1]: MergeDeepChoice<At<L, K>, L1[K], Ignore, Fill, _OptionalKeys<L>, K> };
215
211
 
216
212
  type MergeDeepObject<O, O1, Ignore, Fill, OOKeys extends Key = _OptionalKeys<O>> = {
217
213
  [K in keyof (Anyify<O> & O1)]: MergeDeepChoice<At<O, K>, At<O1, K>, Ignore, Fill, OOKeys, K>;
@@ -220,20 +216,20 @@ type MergeDeepObject<O, O1, Ignore, Fill, OOKeys extends Key = _OptionalKeys<O>>
220
216
  type MergeDeepChoice<OK, O1K, Ignore, Fill, OOKeys extends Key, K extends Key> = [OK] extends [never]
221
217
  ? MergeProp<OK, O1K, Fill, OOKeys, K>
222
218
  : [O1K] extends [never]
223
- ? MergeProp<OK, O1K, Fill, OOKeys, K>
224
- : OK extends Ignore
225
- ? MergeProp<OK, O1K, Fill, OOKeys, K>
226
- : O1K extends Ignore
227
- ? MergeProp<OK, O1K, Fill, OOKeys, K>
228
- : OK extends List
229
- ? O1K extends List
230
- ? MergeDeepList<OK, O1K, Ignore, Fill>
231
- : MergeProp<OK, O1K, Fill, OOKeys, K>
232
- : OK extends object
233
- ? O1K extends object
234
- ? MergeDeepObject<OK, O1K, Ignore, Fill>
235
- : MergeProp<OK, O1K, Fill, OOKeys, K>
236
- : MergeProp<OK, O1K, Fill, OOKeys, K>;
219
+ ? MergeProp<OK, O1K, Fill, OOKeys, K>
220
+ : OK extends Ignore
221
+ ? MergeProp<OK, O1K, Fill, OOKeys, K>
222
+ : O1K extends Ignore
223
+ ? MergeProp<OK, O1K, Fill, OOKeys, K>
224
+ : OK extends List
225
+ ? O1K extends List
226
+ ? MergeDeepList<OK, O1K, Ignore, Fill>
227
+ : MergeProp<OK, O1K, Fill, OOKeys, K>
228
+ : OK extends object
229
+ ? O1K extends object
230
+ ? MergeDeepObject<OK, O1K, Ignore, Fill>
231
+ : MergeProp<OK, O1K, Fill, OOKeys, K>
232
+ : MergeProp<OK, O1K, Fill, OOKeys, K>;
237
233
 
238
234
  export type MergeDeep<O, O1, Ignore, Fill> = O extends unknown
239
235
  ? O1 extends unknown
@@ -256,21 +252,22 @@ type PatchFlatObject<O, O1, Fill, OKeys extends Key = keyof O> = {
256
252
  [K in keyof (O & _Omit<O1, OKeys>)]: PatchProp<At<O, K>, At<O1, K>, Fill, OKeys, K>;
257
253
  } & {};
258
254
 
259
- type PatchFlatList<L extends List, L1 extends List, Ignore, Fill> = number extends Length<L | L1>
260
- ? PatchFlatChoice<L[number], L1[number], Ignore, Fill>[]
261
- : Longer<L, L1> extends True
262
- ? { [K in keyof L]: PatchProp<L[K], At<L1, K>, Fill, keyof L, K> }
263
- : { [K in keyof L1]: PatchProp<At<L, K>, L1[K], Fill, keyof L, K> };
255
+ type PatchFlatList<L extends List, L1 extends List, Ignore, Fill> =
256
+ number extends Length<L | L1>
257
+ ? PatchFlatChoice<L[number], L1[number], Ignore, Fill>[]
258
+ : Longer<L, L1> extends True
259
+ ? { [K in keyof L]: PatchProp<L[K], At<L1, K>, Fill, keyof L, K> }
260
+ : { [K in keyof L1]: PatchProp<At<L, K>, L1[K], Fill, keyof L, K> };
264
261
 
265
262
  export type PatchFlatChoice<O, O1, Ignore, Fill> = O extends Ignore
266
263
  ? O
267
264
  : O1 extends Ignore
268
- ? O
269
- : O extends List
270
- ? O1 extends List
271
- ? PatchFlatList<O, O1, Ignore, Fill>
272
- : PatchFlatObject<O, O1, Fill>
273
- : PatchFlatObject<O, O1, Fill>;
265
+ ? O
266
+ : O extends List
267
+ ? O1 extends List
268
+ ? PatchFlatList<O, O1, Ignore, Fill>
269
+ : PatchFlatObject<O, O1, Fill>
270
+ : PatchFlatObject<O, O1, Fill>;
274
271
 
275
272
  export type PatchFlat<O, O1, Ignore = BuiltIn, Fill = never> = O extends unknown
276
273
  ? O1 extends unknown
@@ -278,11 +275,12 @@ export type PatchFlat<O, O1, Ignore = BuiltIn, Fill = never> = O extends unknown
278
275
  : never
279
276
  : never;
280
277
 
281
- type PatchDeepList<L extends List, L1 extends List, Ignore, Fill> = number extends Length<L | L1>
282
- ? PatchDeepChoice<L[number], L1[number], Ignore, Fill, never, any>[]
283
- : Longer<L, L1> extends True
284
- ? { [K in keyof L]: PatchDeepChoice<L[K], At<L1, K>, Ignore, Fill, keyof L, K> }
285
- : { [K in keyof L1]: PatchDeepChoice<At<L, K>, L1[K], Ignore, Fill, keyof L, K> };
278
+ type PatchDeepList<L extends List, L1 extends List, Ignore, Fill> =
279
+ number extends Length<L | L1>
280
+ ? PatchDeepChoice<L[number], L1[number], Ignore, Fill, never, any>[]
281
+ : Longer<L, L1> extends True
282
+ ? { [K in keyof L]: PatchDeepChoice<L[K], At<L1, K>, Ignore, Fill, keyof L, K> }
283
+ : { [K in keyof L1]: PatchDeepChoice<At<L, K>, L1[K], Ignore, Fill, keyof L, K> };
286
284
 
287
285
  type PatchDeepObject<O, O1, Ignore, Fill, OKeys extends Key = keyof O> = {
288
286
  [K in keyof (O & _Omit<O1, OKeys>)]: PatchDeepChoice<At<O, K>, At<O1, K>, Ignore, Fill, OKeys, K>;
@@ -291,20 +289,20 @@ type PatchDeepObject<O, O1, Ignore, Fill, OKeys extends Key = keyof O> = {
291
289
  type PatchDeepChoice<OK, O1K, Ignore, fill, OKeys extends Key, K extends Key> = [OK] extends [never]
292
290
  ? PatchProp<OK, O1K, fill, OKeys, K>
293
291
  : [O1K] extends [never]
294
- ? PatchProp<OK, O1K, fill, OKeys, K>
295
- : OK extends Ignore
296
- ? PatchProp<OK, O1K, fill, OKeys, K>
297
- : O1K extends Ignore
298
- ? PatchProp<OK, O1K, fill, OKeys, K>
299
- : OK extends List
300
- ? O1K extends List
301
- ? PatchDeepList<OK, O1K, Ignore, fill>
302
- : PatchProp<OK, O1K, fill, OKeys, K>
303
- : OK extends object
304
- ? O1K extends object
305
- ? PatchDeepObject<OK, O1K, Ignore, fill>
306
- : PatchProp<OK, O1K, fill, OKeys, K>
307
- : PatchProp<OK, O1K, fill, OKeys, K>;
292
+ ? PatchProp<OK, O1K, fill, OKeys, K>
293
+ : OK extends Ignore
294
+ ? PatchProp<OK, O1K, fill, OKeys, K>
295
+ : O1K extends Ignore
296
+ ? PatchProp<OK, O1K, fill, OKeys, K>
297
+ : OK extends List
298
+ ? O1K extends List
299
+ ? PatchDeepList<OK, O1K, Ignore, fill>
300
+ : PatchProp<OK, O1K, fill, OKeys, K>
301
+ : OK extends object
302
+ ? O1K extends object
303
+ ? PatchDeepObject<OK, O1K, Ignore, fill>
304
+ : PatchProp<OK, O1K, fill, OKeys, K>
305
+ : PatchProp<OK, O1K, fill, OKeys, K>;
308
306
 
309
307
  export type PatchDeep<O, O1, Ignore, Fill> = O extends unknown
310
308
  ? O1 extends unknown
package/_src/String.ts CHANGED
@@ -4,14 +4,13 @@ import type { List, Pop } from "./List.js";
4
4
  type _Join<T extends List, D extends string> = T extends []
5
5
  ? ""
6
6
  : T extends [Literal]
7
- ? `${T[0]}`
8
- : T extends [Literal, ...infer R]
9
- ? `${T[0]}${D}${_Join<R, D>}`
10
- : string;
7
+ ? `${T[0]}`
8
+ : T extends [Literal, ...infer R]
9
+ ? `${T[0]}${D}${_Join<R, D>}`
10
+ : string;
11
11
 
12
- export type Join<T extends List<Literal>, D extends string = ""> = _Join<T, D> extends infer X
13
- ? Cast<X, string>
14
- : never;
12
+ export type Join<T extends List<Literal>, D extends string = ""> =
13
+ _Join<T, D> extends infer X ? Cast<X, string> : never;
15
14
 
16
15
  type __Split<S extends string, D extends string, T extends string[] = []> = S extends `${infer BS}${D}${infer AS}`
17
16
  ? __Split<AS, D, [...T, BS]>
package/_src/Union.ts CHANGED
@@ -4,13 +4,11 @@ import type { List, Prepend } from "./List.js";
4
4
 
5
5
  export type IntersectionOf<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
6
6
 
7
- export type Last<U> = IntersectionOf<U extends unknown ? (x: U) => void : never> extends (x: infer P) => void
8
- ? P
9
- : never;
7
+ export type Last<U> =
8
+ IntersectionOf<U extends unknown ? (x: U) => void : never> extends (x: infer P) => void ? P : never;
10
9
 
11
- type _ListOf<U, LN extends List = [], LastU = Last<U>> = Extends<[U], [never]> extends False
12
- ? _ListOf<Exclude<U, LastU>, Prepend<LN, LastU>>
13
- : LN;
10
+ type _ListOf<U, LN extends List = [], LastU = Last<U>> =
11
+ Extends<[U], [never]> extends False ? _ListOf<Exclude<U, LastU>, Prepend<LN, LastU>> : LN;
14
12
 
15
13
  export type ListOf<U> = _ListOf<U> extends infer X ? Cast<X, List> : never;
16
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fncts/typelevel",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "exports": {
5
5
  "./*": {
6
6
  "import": "./_mjs/*.mjs",