rambda 9.4.2 → 10.0.0-alpha.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 (257) hide show
  1. package/CHANGELOG.md +69 -1
  2. package/README.md +4637 -13433
  3. package/dist/rambda.esm.js +1487 -0
  4. package/dist/rambda.js +952 -2113
  5. package/dist/rambda.umd.js +1595 -1
  6. package/immutable.d.ts +1066 -1293
  7. package/index.d.ts +1066 -1293
  8. package/package.json +95 -94
  9. package/rambda.js +10 -138
  10. package/src/_internals/baseSlice.js +5 -7
  11. package/src/_internals/createPath.js +4 -6
  12. package/src/_internals/includes.js +8 -4
  13. package/src/_internals/set.js +11 -11
  14. package/src/all.js +8 -6
  15. package/src/allPass.js +4 -4
  16. package/src/any.js +10 -10
  17. package/src/anyPass.js +4 -4
  18. package/src/append.js +4 -6
  19. package/src/checkObjectWithSpec.js +16 -0
  20. package/src/complement.js +1 -1
  21. package/src/concat.js +2 -4
  22. package/src/count.js +5 -4
  23. package/src/countBy.js +6 -7
  24. package/src/defaultTo.js +4 -6
  25. package/src/drop.js +4 -2
  26. package/src/dropLast.js +4 -8
  27. package/src/dropLastWhile.js +17 -26
  28. package/src/dropWhile.js +14 -22
  29. package/src/eqBy.js +3 -8
  30. package/src/eqProps.js +3 -8
  31. package/src/equals.js +99 -58
  32. package/src/evolve.js +19 -52
  33. package/src/excludes.js +5 -0
  34. package/src/filter.js +10 -40
  35. package/src/filterObject.js +13 -0
  36. package/src/find.js +6 -6
  37. package/src/findIndex.js +5 -5
  38. package/src/findLast.js +6 -6
  39. package/src/findLastIndex.js +5 -5
  40. package/src/flatMap.js +3 -0
  41. package/src/flatten.js +5 -5
  42. package/src/groupBy.js +9 -7
  43. package/src/head.js +5 -3
  44. package/src/includes.js +10 -7
  45. package/src/indexOf.js +2 -6
  46. package/src/init.js +6 -8
  47. package/src/innerJoin.js +11 -19
  48. package/src/intersection.js +2 -4
  49. package/src/intersperse.js +7 -7
  50. package/src/join.js +2 -4
  51. package/src/last.js +4 -4
  52. package/src/lastIndexOf.js +2 -6
  53. package/src/map.js +9 -49
  54. package/src/mapAsync.js +11 -0
  55. package/src/mapObject.js +18 -0
  56. package/src/mapObjectAsync.js +10 -0
  57. package/src/match.js +6 -6
  58. package/src/maxBy.js +2 -8
  59. package/src/merge.js +4 -1
  60. package/src/mergeTypes.js +3 -0
  61. package/src/minBy.js +2 -8
  62. package/src/modifyPath.js +22 -25
  63. package/src/none.js +8 -6
  64. package/src/objOf.js +2 -6
  65. package/src/omit.js +26 -11
  66. package/src/partition.js +20 -23
  67. package/src/path.js +14 -15
  68. package/src/pick.js +15 -15
  69. package/src/pipe.js +70 -13
  70. package/src/pipeAsync.js +10 -0
  71. package/src/pluck.js +7 -9
  72. package/src/prepend.js +2 -6
  73. package/src/prop.js +2 -10
  74. package/src/propEq.js +8 -10
  75. package/src/propOr.js +7 -8
  76. package/src/propSatisfies.js +2 -7
  77. package/src/range.js +3 -3
  78. package/src/reduce.js +15 -30
  79. package/src/reject.js +2 -4
  80. package/src/replace.js +2 -8
  81. package/src/replaceItemAtIndex.js +15 -0
  82. package/src/sort.js +2 -4
  83. package/src/sortBy.js +3 -3
  84. package/src/sortWith.js +9 -13
  85. package/src/split.js +2 -4
  86. package/src/splitEvery.js +6 -8
  87. package/src/symmetricDifference.js +5 -8
  88. package/src/tail.js +2 -2
  89. package/src/take.js +11 -9
  90. package/src/takeLast.js +14 -14
  91. package/src/takeLastWhile.js +19 -20
  92. package/src/takeWhile.js +12 -21
  93. package/src/tap.js +3 -3
  94. package/src/test.js +2 -8
  95. package/src/tryCatch.js +5 -14
  96. package/src/type.js +6 -5
  97. package/src/union.js +10 -8
  98. package/src/uniq.js +2 -2
  99. package/src/uniqBy.js +5 -6
  100. package/src/uniqWith.js +10 -14
  101. package/src/unless.js +7 -9
  102. package/src/unwind.js +6 -14
  103. package/src/update.js +8 -11
  104. package/src/when.js +7 -9
  105. package/src/zip.js +8 -8
  106. package/src/zipWith.js +5 -7
  107. package/src/F.js +0 -3
  108. package/src/T.js +0 -3
  109. package/src/_internals/_arity.js +0 -64
  110. package/src/_internals/compare.js +0 -3
  111. package/src/_internals/constants.js +0 -1
  112. package/src/_internals/createPathInput.js +0 -7
  113. package/src/_internals/isFalsy.js +0 -13
  114. package/src/_internals/isInteger.js +0 -10
  115. package/src/_internals/isIterable.js +0 -5
  116. package/src/_internals/isObject.js +0 -5
  117. package/src/_internals/isTruthy.js +0 -13
  118. package/src/_internals/objectIs.js +0 -9
  119. package/src/_internals/utils.js +0 -21
  120. package/src/add.js +0 -5
  121. package/src/addIndex.js +0 -23
  122. package/src/addIndexRight.js +0 -9
  123. package/src/adjust.js +0 -16
  124. package/src/always.js +0 -3
  125. package/src/and.js +0 -5
  126. package/src/ap.js +0 -7
  127. package/src/aperture.js +0 -15
  128. package/src/apply.js +0 -7
  129. package/src/applySpec.js +0 -132
  130. package/src/applyTo.js +0 -7
  131. package/src/ascend.js +0 -23
  132. package/src/assoc.js +0 -11
  133. package/src/assocPath.js +0 -46
  134. package/src/binary.js +0 -5
  135. package/src/bind.js +0 -9
  136. package/src/both.js +0 -5
  137. package/src/call.js +0 -1
  138. package/src/chain.js +0 -7
  139. package/src/clamp.js +0 -15
  140. package/src/clone.js +0 -18
  141. package/src/collectBy.js +0 -27
  142. package/src/comparator.js +0 -5
  143. package/src/compose.js +0 -9
  144. package/src/composeWith.js +0 -33
  145. package/src/cond.js +0 -14
  146. package/src/converge.js +0 -18
  147. package/src/curry.js +0 -7
  148. package/src/curryN.js +0 -40
  149. package/src/dec.js +0 -1
  150. package/src/descend.js +0 -17
  151. package/src/difference.js +0 -8
  152. package/src/differenceWith.js +0 -20
  153. package/src/dissoc.js +0 -13
  154. package/src/dissocPath.js +0 -47
  155. package/src/divide.js +0 -5
  156. package/src/dropRepeats.js +0 -20
  157. package/src/dropRepeatsBy.js +0 -21
  158. package/src/dropRepeatsWith.js +0 -28
  159. package/src/either.js +0 -8
  160. package/src/empty.js +0 -15
  161. package/src/endsWith.js +0 -23
  162. package/src/flip.js +0 -23
  163. package/src/forEach.js +0 -19
  164. package/src/forEachObjIndexed.js +0 -24
  165. package/src/fromPairs.js +0 -6
  166. package/src/groupWith.js +0 -46
  167. package/src/gt.js +0 -6
  168. package/src/gte.js +0 -6
  169. package/src/has.js +0 -7
  170. package/src/hasIn.js +0 -9
  171. package/src/hasPath.js +0 -9
  172. package/src/identical.js +0 -7
  173. package/src/identity.js +0 -3
  174. package/src/ifElse.js +0 -17
  175. package/src/inc.js +0 -1
  176. package/src/indexBy.js +0 -29
  177. package/src/insert.js +0 -11
  178. package/src/insertAll.js +0 -7
  179. package/src/is.js +0 -8
  180. package/src/isEmpty.js +0 -18
  181. package/src/isNil.js +0 -3
  182. package/src/isNotEmpty.js +0 -5
  183. package/src/isNotNil.js +0 -3
  184. package/src/isPromise.js +0 -5
  185. package/src/juxt.js +0 -3
  186. package/src/keys.js +0 -3
  187. package/src/length.js +0 -8
  188. package/src/lens.js +0 -7
  189. package/src/lensIndex.js +0 -7
  190. package/src/lensPath.js +0 -7
  191. package/src/lensProp.js +0 -7
  192. package/src/lt.js +0 -6
  193. package/src/lte.js +0 -6
  194. package/src/mathMod.js +0 -8
  195. package/src/max.js +0 -5
  196. package/src/maybe.js +0 -13
  197. package/src/mean.js +0 -5
  198. package/src/median.js +0 -17
  199. package/src/mergeAll.js +0 -11
  200. package/src/mergeDeepLeft.js +0 -5
  201. package/src/mergeDeepRight.js +0 -24
  202. package/src/mergeLeft.js +0 -7
  203. package/src/mergeRight.js +0 -8
  204. package/src/mergeWith.js +0 -25
  205. package/src/min.js +0 -5
  206. package/src/modify.js +0 -23
  207. package/src/modulo.js +0 -5
  208. package/src/move.js +0 -19
  209. package/src/multiply.js +0 -5
  210. package/src/negate.js +0 -3
  211. package/src/not.js +0 -3
  212. package/src/nth.js +0 -9
  213. package/src/of.js +0 -3
  214. package/src/on.js +0 -16
  215. package/src/once.js +0 -24
  216. package/src/or.js +0 -5
  217. package/src/over.js +0 -14
  218. package/src/partial.js +0 -17
  219. package/src/partialObject.js +0 -5
  220. package/src/pathEq.js +0 -11
  221. package/src/pathOr.js +0 -11
  222. package/src/pathSatisfies.js +0 -9
  223. package/src/paths.js +0 -9
  224. package/src/pickAll.js +0 -23
  225. package/src/pickBy.js +0 -11
  226. package/src/product.js +0 -4
  227. package/src/propIs.js +0 -10
  228. package/src/props.js +0 -13
  229. package/src/reduceBy.js +0 -29
  230. package/src/removeIndex.js +0 -7
  231. package/src/repeat.js +0 -7
  232. package/src/reverse.js +0 -9
  233. package/src/set.js +0 -9
  234. package/src/slice.js +0 -9
  235. package/src/splitAt.js +0 -21
  236. package/src/splitWhen.js +0 -25
  237. package/src/startsWith.js +0 -23
  238. package/src/subtract.js +0 -5
  239. package/src/sum.js +0 -3
  240. package/src/swap.js +0 -42
  241. package/src/times.js +0 -12
  242. package/src/toLower.js +0 -3
  243. package/src/toPairs.js +0 -3
  244. package/src/toString.js +0 -3
  245. package/src/toUpper.js +0 -3
  246. package/src/transpose.js +0 -10
  247. package/src/trim.js +0 -3
  248. package/src/unapply.js +0 -5
  249. package/src/unnest.js +0 -9
  250. package/src/values.js +0 -6
  251. package/src/view.js +0 -10
  252. package/src/where.js +0 -15
  253. package/src/whereAny.js +0 -12
  254. package/src/whereEq.js +0 -14
  255. package/src/without.js +0 -15
  256. package/src/xor.js +0 -5
  257. package/src/zipObj.js +0 -13
package/immutable.d.ts CHANGED
@@ -1,65 +1,59 @@
1
1
  export type RambdaTypes = "Object" | "Number" | "Boolean" | "String" | "Null" | "Array" | "RegExp" | "NaN" | "Function" | "Undefined" | "Async" | "Promise" | "Symbol" | "Set" | "Error" | "Map" | "WeakMap" | "Generator" | "GeneratorFunction" | "BigInt" | "ArrayBuffer" | "Date"
2
2
 
3
+ export type EqualTypes<X, Y> =
4
+ (<T>() => T extends X ? 1 : 2) extends
5
+ (<T>() => T extends Y ? 1 : 2) ? true : false
6
+
3
7
  export type NonEmptyArray<T> = readonly [T, ...readonly T[]];
4
8
  export type ReadonlyNonEmptyArray<T> = readonly [T, ...readonly T[]];
9
+ export type IterableContainer<T = unknown> = ReadonlyArray<T> | readonly [];
10
+
5
11
 
6
- type LastArrayElement<ValueType extends readonly unknown[]> =
7
- ValueType extends readonly [infer ElementType]
8
- ? ElementType
9
- : ValueType extends readonly [infer _, ...infer Tail]
10
- ? LastArrayElement<Tail>
11
- : ValueType extends ReadonlyArray<infer ElementType>
12
- ? ElementType
13
- : never;
14
- type FirstArrayElement<ValueType extends readonly unknown[]> =
15
- ValueType extends readonly [infer ElementType]
16
- ? ElementType
17
- : ValueType extends readonly [...infer Head, infer _]
18
- ? FirstArrayElement<Head>
19
- : ValueType extends ReadonlyArray<infer ElementType>
20
- ? ElementType
21
- : never;
22
-
23
- export function reduceStopper<T>(input: T) : T
24
- export type IndexedIterator<T, U> = (x: T, i: number) => U;
25
- export type Iterator<T, U> = (x: T) => U;
26
- export type ObjectIterator<T, U> = (x: T, prop: string, inputObj: Dictionary<T>) => U;
27
- type Ord = number | string | boolean | Date;
28
- type Ordering = -1 | 0 | 1;
29
- type Path = string | readonly (number | string)[];
30
- export type RamdaPath = readonly (number | string)[];
31
- export type Predicate<T> = (x: T) => boolean;
32
- export type IndexedPredicate<T> = (x: T, i: number) => boolean;
33
- export type ObjectPredicate<T> = (x: T, prop: string, inputObj: Dictionary<T>) => boolean;
34
- type CondPair<T extends readonly any[], R> = readonly [(...val: T) => boolean, (...val: T) => R]
12
+
13
+ export type Mapped<T extends IterableContainer, K> = { readonly
14
+ -readonly [P in keyof T]: K;
15
+ };
16
+
17
+ export type ElementOf<Type extends readonly any[]> = Type[number];
18
+ export type MergeTypes<T> = { readonly[KeyType in keyof T]: T[KeyType]} & {};
19
+ export type Simplify<T> = T extends infer O ? { readonly [K in keyof O]: O[K] } : never;
20
+
21
+ export type EntryForKey<T, Key extends keyof T> = Key extends number | string
22
+ ? readonly [key: `${Key}`, value: Required<T>[Key]]
23
+ : never;
24
+
25
+ export type Entry<T> = MergeTypes<{ readonly [P in keyof T]-?: EntryForKey<T, P> }[keyof T]>;
26
+
27
+ export type Ord = number | string | boolean | Date;
28
+ export type Ordering = -1 | 0 | 1;
29
+ type Path = ReadonlyArray<string> | string;
35
30
  type Prop<T, P extends keyof never> = P extends keyof Exclude<T, undefined>
36
31
  ? T extends undefined ? undefined : T[Extract<P, keyof T>]
37
32
  : undefined;
38
33
 
39
- type ValueOfRecord<R> =
40
- R extends Record<any, infer T>
41
- ? T
42
- : never;
43
-
44
34
  interface KeyValuePair<K, V> extends Array<K | V> {
45
35
  readonly 0: K;
46
36
  readonly 1: V;
47
37
  }
48
38
  export type Functor<A> = { readonly map: <B>(fn: (a: A) => B) => Functor<B>; readonly [key: string]: any };
49
- export type Lens<S, A> = (functorFactory: (a: A) => Functor<A>) => (s: S) => Functor<S>;
50
-
51
- export type ObjPred<T = unknown> = (value: any, key: unknown extends T ? string : keyof T) => boolean;
39
+ export type DeepModify<Keys extends readonly PropertyKey[], U, T> =
40
+ Keys extends readonly [infer K, ...infer Rest]
41
+ ? K extends keyof U
42
+ ? Rest extends readonly []
43
+ ? Omit<U, K> & Record<K, T>
44
+ : Rest extends readonly PropertyKey[]
45
+ ? Omit<U, K> & Record<K, DeepModify<Rest, U[K], T>>
46
+ : never
47
+ : never
48
+ : never;
52
49
 
53
- type Arity1Fn = (x: any) => any;
54
- type Arity2Fn = (x: any, y: any) => any;
55
50
 
56
- type Pred = (...x: readonly any[]) => boolean;
51
+ export type PickStringToPickPath<T> = T extends `${infer Head},${infer Tail}` ? readonly [Head, ...PickStringToPickPath<Tail>]
52
+ : T extends `${infer Head}` ? readonly [Head]
53
+ : readonly [];
57
54
 
58
- export interface Dictionary<T> {readonly [index: string]: T}
59
- type Partial<T> = { readonly [P in keyof T]?: T[P]};
60
55
 
61
- type _TupleOf<T, N extends number, R extends readonly unknown[]> = R['length'] extends N ? R : _TupleOf<T, N, readonly [T, ...R]>;
62
- export type Tuple<T, N extends number> = N extends N ? (number extends N ? readonly T[] : _TupleOf<T, N, readonly []>) : never;
56
+ export type Partial<T> = { readonly [P in keyof T]?: T[P]};
63
57
 
64
58
  type Evolvable<E extends Evolver> = { readonly[P in keyof E]?: Evolved<E[P]>};
65
59
 
@@ -92,257 +86,93 @@ type EvolveValue<V, E> =
92
86
  ? EvolveNestedValue<V, E>
93
87
  : never;
94
88
 
95
- type AtLeastOneFunctionsFlowFromRightToLeft<TArgs extends readonly any[], TResult> =
96
- | readonly [(...args: any) => TResult, ...ReadonlyArray<(args: any) => any>, (...args: TArgs) => any]
97
- | readonly [(...args: TArgs) => TResult];
98
-
99
- type AnyFunction = (...args: readonly any[]) => unknown;
100
- type AnyConstructor = new (...args: readonly any[]) => unknown;
101
-
102
- type RegExpReplacerFn =
103
- | ((m: string, offset: number, s: string, groups?: Record<string, string>) => string)
104
- | ((m: string, p1: string, offset: number, s: string, groups?: Record<string, string>) => string)
105
- | ((m: string, p1: string, p2: string, offset: number, s: string, groups?: Record<string, string>) => string)
106
- | ((m: string, p1: string, p2: string, p3: string, offset: number, s: string, groups?: Record<string, string>) => string)
107
- | ((m: string, p1: string, p2: string, p3: string, p4: string, offset: number, s: string, groups?: Record<string, string>) => string)
108
- | ((m: string, p1: string, p2: string, p3: string, p4: string, p5: string, offset: number, s: string, groups?: Record<string, string>) => string)
109
- | ((m: string, p1: string, p2: string, p3: string, p4: string, p5: string, p6: string, offset: number, s: string, groups?: Record<string, string>) => string)
110
- | ((m: string, p1: string, p2: string, p3: string, p4: string, p5: string, p6: string, p7: string, offset: number, s: string, groups?: Record<string, string>) => string)
111
- | ((m: string, p1: string, p2: string, p3: string, p4: string, p5: string, p6: string, p7: string, p8: string, offset: number, s: string, groups?: Record<string, string>) => string)
112
- | ((m: string, p1: string, p2: string, p3: string, p4: string, p5: string, p6: string, p7: string, p8: string, p9: string, offset: number, s: string, groups?: Record<string, string>) => string)
113
- type RegExpReplacer = string | RegExpReplacerFn
114
-
115
- /** `First`, when `First` is a supertype of `Second`; otherwise `never`. */
116
- type IsFirstSubtypeOfSecond<First, Second> = (First extends Second ? Second : never);
117
-
118
- // RAMBDAX INTERFACES
119
- // ============================================
120
- type Func<T> = (input: any) => T;
121
- type VoidInputFunc<T> = () => T;
122
- type Fn<In, Out> = (x: In) => Out;
123
- export type SortObjectPredicate<T> = (aProp: string, bProp: string, aValue: T, bValue: T) => number;
124
-
125
- export type IdentityFunction<T> = (x: T) => T;
126
-
127
- interface Filter<T> {
128
- (list: readonly T[]): readonly T[];
129
- (obj: Dictionary<T>): Dictionary<T>;
130
- }
131
-
132
- type ArgumentTypes<T> = T extends (...args: infer U) => infer R ? U : never;
133
- type isfn<T> = (x: any, y: any) => T;
134
-
135
- interface Switchem<T> {
136
- readonly is: isfn<Switchem<T>>;
137
- readonly default: IdentityFunction<T>;
138
- }
139
-
140
- interface Schema {
141
- readonly [key: string]: any;
142
- }
143
-
144
- interface SchemaAsync {
145
- readonly [key: string]: Promise<boolean>;
146
- }
147
-
148
- export interface IsValid {
149
- readonly input: object;
150
- readonly schema: Schema;
151
- }
152
-
153
- export interface IsValidAsync {
154
- readonly input: object;
155
- readonly schema: Schema | SchemaAsync;
156
- }
157
-
158
- export type ProduceRules<Output,K extends keyof Output, Input> = { readonly [P in K]: (input: Input) => Output[P];
159
- };
160
- export type ProduceAsyncRules<Output,K extends keyof Output, Input> = { readonly [P in K]: (input: Input) => Promise<Output[P]>;
161
- };
162
- type ProduceAsyncRule<Input> = (input: Input) => Promise<any>;
163
- type Async<T> = (x: any) => Promise<T>;
164
- type AsyncIterable<T, K> = (x: T) => Promise<K>;
165
- type AsyncIterableIndexed<T, K> = (x: T, i: number) => Promise<K>;
166
- type AsyncPredicate<T> = (x: T) => Promise<boolean>;
167
- type AsyncPredicateIndexed<T> = (x: T, i: number) => Promise<boolean>;
168
- type AsyncWithProp<T> = (x: any, prop?: string) => Promise<T>;
169
-
170
- export type ApplyDiffUpdate = {readonly op:'update', readonly path: string, readonly value: any};
171
- export type ApplyDiffAdd = {readonly op:'add', readonly path: string, readonly value: any};
172
- export type ApplyDiffRemove = {readonly op:'remove', readonly path: string};
173
- export type ApplyDiffRule = ApplyDiffUpdate | ApplyDiffAdd | ApplyDiffRemove;
174
-
175
-
176
- export function F(): boolean;
89
+ declare const emptyObjectSymbol: unique symbol;
90
+ type EmptyObject = {readonly [emptyObjectSymbol]?: never};
91
+ type EnumerableStringKeyOf<T> =
92
+ Required<T> extends Record<infer K, unknown>
93
+ ? `${Exclude<K, symbol>}`
94
+ : never;
95
+ type EnumerableStringKeyedValueOf<T> = ValuesOf<{ readonly
96
+ [K in keyof T]-?: K extends symbol ? never : T[K];
97
+ }>;
98
+ type ValuesOf<T> =
99
+ T extends EmptyObject
100
+ ? T[keyof T]
101
+ : T extends Record<PropertyKey, infer V>
102
+ ? V
103
+ : never;
104
+ type MappedValues<T extends object, Value> = MergeTypes<{ readonly
105
+ -readonly [P in keyof T as `${P extends number | string ? P : never}`]: Value;
106
+ }>;
177
107
 
178
108
  export function T(): boolean;
179
109
 
180
110
  /**
181
111
  * It adds `a` and `b`.
182
112
  */
183
- export function add(a: number, b: number): number;
184
113
  export function add(a: number): (b: number) => number;
185
114
 
186
- export function addIndex(originalFn: any): (fn: any) => (list: readonly any[]) => readonly any[];
187
- export function addIndex(originalFn: any): (fn: any, list: readonly any[]) => readonly any[];
188
-
189
- /**
190
- * Same as `R.addIndex`, but it will passed indexes are decreasing, instead of increasing.
191
- */
192
- export function addIndexRight(originalFn: any): (fn: any) => (list: readonly any[]) => readonly any[];
193
- export function addIndexRight(originalFn: any): (fn: any, list: readonly any[]) => readonly any[];
194
-
195
- /**
196
- * It replaces `index` in array `list` with the result of `replaceFn(list[i])`.
197
- */
198
- export function adjust<T>(index: number, replaceFn: (x: T) => T, list: readonly T[]): readonly T[];
199
- export function adjust<T>(index: number, replaceFn: (x: T) => T): (list: readonly T[]) => readonly T[];
200
-
201
115
  /**
202
116
  * It returns `true`, if all members of array `list` returns `true`, when applied as argument to `predicate` function.
203
117
  */
204
- export function all<T>(predicate: (x: T) => boolean, list: readonly T[]): boolean;
205
118
  export function all<T>(predicate: (x: T) => boolean): (list: readonly T[]) => boolean;
206
119
 
207
120
  /**
208
121
  * It returns `true`, if all functions of `predicates` return `true`, when `input` is their argument.
209
122
  */
210
- export function allPass<T>(predicates: readonly ((x: T) => boolean)[]): (input: T) => boolean;
211
- export function allPass<T>(predicates: readonly ((...inputs: readonly T[]) => boolean)[]): (...inputs: readonly T[]) => boolean;
212
-
213
- /**
214
- * It returns function that always returns `x`.
215
- */
216
- export function always<T>(x: T): (...args: readonly unknown[]) => T;
217
-
218
- /**
219
- * Logical AND
220
- */
221
- export function and<T, U>(x: T, y: U): T | U;
222
- export function and<T>(x: T): <U>(y: U) => T | U;
123
+ export function allPass<F extends (...args: readonly any[]) => boolean>(predicates: readonly F[]): F;
223
124
 
224
125
  /**
225
126
  * It returns `true`, if at least one member of `list` returns true, when passed to a `predicate` function.
226
127
  */
227
- export function any<T>(predicate: (x: T) => boolean, list: readonly T[]): boolean;
228
128
  export function any<T>(predicate: (x: T) => boolean): (list: readonly T[]) => boolean;
229
129
 
230
130
  /**
231
131
  * It accepts list of `predicates` and returns a function. This function with its `input` will return `true`, if any of `predicates` returns `true` for this `input`.
232
132
  */
233
- export function anyPass<T>(predicates: readonly ((x: T) => boolean)[]): (input: T) => boolean;
234
- export function anyPass<T>(predicates: readonly ((...inputs: readonly T[]) => boolean)[]): (...inputs: readonly T[]) => boolean;
235
-
236
- /**
237
- * It takes a list of functions and a list of values. Then it returns a list of values obtained by applying each function to each value.
238
- */
239
- export function ap<T, U>(fns: readonly ReadonlyArray<(a: T) => U>[], vs: readonly T[]): readonly U[];
240
- export function ap<T, U>(fns: ReadonlyArray<(a: T) => U>): (vs: readonly T[]) => readonly U[];
241
- export function ap<R, A, B>(fn: (r: R, a: A) => B, fn1: (r: R) => A): (r: R) => B;
242
-
243
- /**
244
- * It returns a new list, composed of consecutive `n`-tuples from a `list`.
245
- */
246
- export function aperture<N extends number, T>(n: N, list: readonly T[]): ReadonlyArray<Tuple<T, N>> | readonly [];
247
- export function aperture<N extends number>(n: N): <T>(list: readonly T[]) => ReadonlyArray<Tuple<T, N>> | readonly [];
133
+ export function anyPass<T, TF1 extends T, TF2 extends T>(
134
+ predicates: readonly [(a: T) => a is TF1, (a: T) => a is TF2],
135
+ ): (a: T) => a is TF1 | TF2;
136
+ export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T>(
137
+ predicates: readonly [(a: T) => a is TF1, (a: T) => a is TF2, (a: T) => a is TF3],
138
+ ): (a: T) => a is TF1 | TF2 | TF3;
139
+ export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T>(
140
+ predicates: readonly [(a: T) => a is TF1, (a: T) => a is TF2, (a: T) => a is TF3],
141
+ ): (a: T) => a is TF1 | TF2 | TF3;
142
+ export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T>(
143
+ predicates: readonly [(a: T) => a is TF1, (a: T) => a is TF2, (a: T) => a is TF3, (a: T) => a is TF4],
144
+ ): (a: T) => a is TF1 | TF2 | TF3 | TF4;
145
+ export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T, TF5 extends T>(
146
+ predicates: readonly [
147
+ (a: T) => a is TF1,
148
+ (a: T) => a is TF2,
149
+ (a: T) => a is TF3,
150
+ (a: T) => a is TF4,
151
+ (a: T) => a is TF5
152
+ ],
153
+ ): (a: T) => a is TF1 | TF2 | TF3 | TF4 | TF5;
154
+ export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T, TF5 extends T, TF6 extends T>(
155
+ predicates: readonly [
156
+ (a: T) => a is TF1,
157
+ (a: T) => a is TF2,
158
+ (a: T) => a is TF3,
159
+ (a: T) => a is TF4,
160
+ (a: T) => a is TF5,
161
+ (a: T) => a is TF6
162
+ ],
163
+ ): (a: T) => a is TF1 | TF2 | TF3 | TF4 | TF5 | TF6;
164
+ export function anyPass<F extends (...args: readonly any[]) => boolean>(predicates: readonly F[]): F;
248
165
 
249
166
  /**
250
167
  * It adds element `x` at the end of `iterable`.
251
168
  */
252
- export function append<T>(xToAppend: T, iterable: readonly T[]): readonly T[];
253
- export function append<T, U>(xToAppend: T, iterable: readonly IsFirstSubtypeOfSecond<T, U>[]) : readonly U[];
254
- export function append<T>(xToAppend: T): <U>(iterable: readonly IsFirstSubtypeOfSecond<T, U>[]) => readonly U[];
255
- export function append<T>(xToAppend: T): (iterable: readonly T[]) => readonly T[];
256
-
257
- /**
258
- * It applies function `fn` to the list of arguments.
259
- *
260
- * This is useful for creating a fixed-arity function from a variadic function. `fn` should be a bound function if context is significant.
261
- */
262
- export function apply<T = any>(fn: (...args: readonly any[]) => T, args: readonly any[]): T;
263
- export function apply<T = any>(fn: (...args: readonly any[]) => T): (args: readonly any[]) => T;
264
-
265
- export function applySpec<Spec extends Record<string, AnyFunction>>(
266
- spec: Spec
267
- ): (
268
- ...args: Parameters<ValueOfRecord<Spec>>
269
- ) => { readonly [Key in keyof Spec]: ReturnType<Spec[Key]> };
270
- export function applySpec<T>(spec: any): (...args: readonly unknown[]) => T;
271
-
272
- export function applyTo<T, U>(el: T, fn: (t: T) => U): U;
273
- export function applyTo<T>(el: T): <U>(fn: (t: T) => U) => U;
274
-
275
- export function ascend<T>(fn: (obj: T) => Ord, a: T, b: T): Ordering;
276
- export function ascend<T>(fn: (obj: T) => Ord): (a: T, b: T) => Ordering;
277
-
278
- /**
279
- * It makes a shallow clone of `obj` with setting or overriding the property `prop` with `newValue`.
280
- */
281
- export function assoc<K extends PropertyKey>(prop: K): {
282
- <T>(val: T): <U extends Record<K, T>>(obj: U) => U;
283
- <U extends Record<K, T>, T>(val: T, obj: U): U;
284
- };
285
- export function assoc<T, K extends PropertyKey>(prop: K, val: T): {
286
- <U>(obj: U): U extends Record<K, any> ? U[K] extends T ? U : Record<K, T> & Omit<U, K> : U & Record<K, T>;
287
- };
288
- export function assoc<U, K extends keyof U, T extends U[K]>(prop: K, val: T, obj: U): U;
289
-
290
- /**
291
- * It makes a shallow clone of `obj` with setting or overriding with `newValue` the property found with `path`.
292
- */
293
- export function assocPath<Output>(path: Path, newValue: any, obj: object): Output;
294
- export function assocPath<Output>(path: Path, newValue: any): (obj: object) => Output;
295
- export function assocPath<Output>(path: Path): (newValue: any) => (obj: object) => Output;
296
-
297
- export function binary<T extends (...arg: readonly any[]) => any>(fn: T): (...args: readonly any[]) => ReturnType<T>;
169
+ export function append<T>(el: T): (list: readonly T[]) => readonly T[];
170
+ export function append<T>(el: T): (list: readonly T[]) => readonly T[];
298
171
 
299
172
  /**
300
- * Creates a function that is bound to a context.
301
- */
302
- export function bind<F extends AnyFunction, T>(fn: F, thisObj: T): (...args: Parameters<F>) => ReturnType<F>;
303
- export function bind<F extends AnyFunction, T>(fn: F): (thisObj: T) => (...args: Parameters<F>) => ReturnType<F>;
304
-
305
- /**
306
- * It returns a function with `input` argument.
307
- *
308
- * This function will return `true`, if both `firstCondition` and `secondCondition` return `true` when `input` is passed as their argument.
309
- */
310
- export function both(pred1: Pred, pred2: Pred): Pred;
311
- export function both<T>(pred1: Predicate<T>, pred2: Predicate<T>): Predicate<T>;
312
- export function both<T>(pred1: Predicate<T>): (pred2: Predicate<T>) => Predicate<T>;
313
- export function both(pred1: Pred): (pred2: Pred) => Pred;
314
-
315
- export function call<T extends (...args: readonly any[]) => any>(fn: T, ...args: Parameters<T>): ReturnType<T>;
316
-
317
- /**
318
- * The method is also known as `flatMap`.
319
- */
320
- export function chain<T, U>(fn: (n: T) => readonly U[], list: readonly T[]): readonly U[];
321
- export function chain<T, U>(fn: (n: T) => readonly U[]): (list: readonly T[]) => readonly U[];
322
-
323
- /**
324
- * Restrict a number `input` to be within `min` and `max` limits.
325
- *
326
- * If `input` is bigger than `max`, then the result is `max`.
327
- *
328
- * If `input` is smaller than `min`, then the result is `min`.
329
- */
330
- export function clamp(min: number, max: number, input: number): number;
331
- export function clamp(min: number, max: number): (input: number) => number;
332
-
333
- /**
334
- * It creates a deep copy of the `input`, which may contain (nested) Arrays and Objects, Numbers, Strings, Booleans and Dates.
335
- */
336
- export function clone<T>(input: T): T;
337
- export function clone<T>(input: readonly T[]): readonly T[];
338
-
339
- export function collectBy<T, K extends PropertyKey>(keyFn: (value: T) => K, list: readonly T[]): readonly (readonly T[])[];
340
- export function collectBy<T, K extends PropertyKey>(keyFn: (value: T) => K): (list: readonly T[]) => readonly (readonly T[])[];
341
-
342
- /**
343
- * It returns a comparator function that can be used in `sort` method.
173
+ * It returns `true` if all each property in `conditions` returns `true` when applied to corresponding property in `input` object.
344
174
  */
345
- export function comparator<T>(pred: (a: T, b: T) => boolean): (x: T, y: T) => Ordering;
175
+ export function checkObjectWithSpec<T>(spec: T): <U>(testObj: U) => boolean;
346
176
 
347
177
  /**
348
178
  * It returns `inverted` version of `origin` function that accept `input` as argument.
@@ -351,129 +181,21 @@ export function comparator<T>(pred: (a: T, b: T) => boolean): (x: T, y: T) => Or
351
181
  */
352
182
  export function complement<T extends readonly any[]>(predicate: (...args: T) => unknown): (...args: T) => boolean;
353
183
 
354
- /**
355
- * It performs right-to-left function composition.
356
- */
357
- export function compose<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6, R7, TResult>(
358
- ...func: readonly [
359
- fnLast: (a: any) => TResult,
360
- ...func: ReadonlyArray<(a: any) => any>,
361
- f7: (a: R6) => R7,
362
- f6: (a: R5) => R6,
363
- f5: (a: R4) => R5,
364
- f4: (a: R3) => R4,
365
- f3: (a: R2) => R3,
366
- f2: (a: R1) => R2,
367
- f1: (...args: TArgs) => R1
368
- ]
369
- ): (...args: TArgs) => TResult;
370
- export function compose<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6, R7, TResult>(
371
- f7: (a: R6) => R7,
372
- f6: (a: R5) => R6,
373
- f5: (a: R4) => R5,
374
- f4: (a: R3) => R4,
375
- f3: (a: R2) => R3,
376
- f2: (a: R1) => R2,
377
- f1: (...args: TArgs) => R1
378
- ): (...args: TArgs) => R7;
379
- export function compose<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6, R7>(
380
- f7: (a: R6) => R7,
381
- f6: (a: R5) => R6,
382
- f5: (a: R4) => R5,
383
- f4: (a: R3) => R4,
384
- f3: (a: R2) => R3,
385
- f2: (a: R1) => R2,
386
- f1: (...args: TArgs) => R1
387
- ): (...args: TArgs) => R7;
388
- export function compose<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6>(
389
- f6: (a: R5) => R6,
390
- f5: (a: R4) => R5,
391
- f4: (a: R3) => R4,
392
- f3: (a: R2) => R3,
393
- f2: (a: R1) => R2,
394
- f1: (...args: TArgs) => R1
395
- ): (...args: TArgs) => R6;
396
- export function compose<TArgs extends readonly any[], R1, R2, R3, R4, R5>(
397
- f5: (a: R4) => R5,
398
- f4: (a: R3) => R4,
399
- f3: (a: R2) => R3,
400
- f2: (a: R1) => R2,
401
- f1: (...args: TArgs) => R1
402
- ): (...args: TArgs) => R5;
403
- export function compose<TArgs extends readonly any[], R1, R2, R3, R4>(
404
- f4: (a: R3) => R4,
405
- f3: (a: R2) => R3,
406
- f2: (a: R1) => R2,
407
- f1: (...args: TArgs) => R1
408
- ): (...args: TArgs) => R4;
409
- export function compose<TArgs extends readonly any[], R1, R2, R3>(
410
- f3: (a: R2) => R3,
411
- f2: (a: R1) => R2,
412
- f1: (...args: TArgs) => R1
413
- ): (...args: TArgs) => R3;
414
- export function compose<TArgs extends readonly any[], R1, R2>(
415
- f2: (a: R1) => R2,
416
- f1: (...args: TArgs) => R1
417
- ): (...args: TArgs) => R2;
418
- export function compose<TArgs extends readonly any[], R1>(
419
- f1: (...args: TArgs) => R1
420
- ): (...args: TArgs) => R1;
421
-
422
- export function composeWith<TArgs extends readonly any[], TResult>(
423
- transformer: (fn: (...args: readonly any[]) => any, intermediatResult: any) => any,
424
- fns: AtLeastOneFunctionsFlowFromRightToLeft<TArgs, TResult>,
425
- ): (...args: TArgs) => TResult;
426
- export function composeWith(
427
- transformer: (fn: (...args: readonly any[]) => any, intermediatResult: any) => any,
428
- ): <TArgs extends readonly any[], TResult>(
429
- fns: AtLeastOneFunctionsFlowFromRightToLeft<TArgs, TResult>,
430
- ) => (...args: TArgs) => TResult;
431
-
432
184
  /**
433
185
  * It returns a new string or array, which is the result of merging `x` and `y`.
434
186
  */
435
- export function concat<T>(x: readonly T[], y: readonly T[]): readonly T[];
436
187
  export function concat<T>(x: readonly T[]): (y: readonly T[]) => readonly T[];
437
- export function concat(x: string, y: string): string;
438
188
  export function concat(x: string): (y: string) => string;
439
189
 
440
- /**
441
- * It takes list with `conditions` and returns a new function `fn` that expects `input` as argument.
442
- *
443
- * This function will start evaluating the `conditions` in order to find the first winner(order of conditions matter).
444
- *
445
- * The winner is this condition, which left side returns `true` when `input` is its argument. Then the evaluation of the right side of the winner will be the final result.
446
- *
447
- * If no winner is found, then `fn` returns `undefined`.
448
- */
449
- export function cond<T extends readonly any[], R>(conditions: ReadonlyArray<CondPair<T, R>>): (...args: T) => R;
450
-
451
- /**
452
- * Accepts a converging function and a list of branching functions and returns a new function. When invoked, this new function is applied to some arguments, each branching function is applied to those same arguments. The results of each branching function are passed as arguments to the converging function to produce the return value.
453
- */
454
- export function converge(after: ((...a: readonly any[]) => any), fns: readonly ((...x: readonly any[]) => any)[]): (...y: readonly any[]) => any;
455
-
456
190
  /**
457
191
  * It counts how many times `predicate` function returns `true`, when supplied with iteration of `list`.
458
192
  */
459
- export function count<T>(predicate: (x: T) => boolean, list: readonly T[]): number;
460
193
  export function count<T>(predicate: (x: T) => boolean): (list: readonly T[]) => number;
461
194
 
462
195
  /**
463
196
  * It counts elements in a list after each instance of the input list is passed through `transformFn` function.
464
197
  */
465
- export function countBy<T extends unknown>(transformFn: (x: T) => any, list: readonly T[]): Record<string, number>;
466
- export function countBy<T extends unknown>(transformFn: (x: T) => any): (list: readonly T[]) => Record<string, number>;
467
-
468
- /**
469
- * It expects a function as input and returns its curried version.
470
- */
471
- export function curry(fn: AnyFunction): (...a: readonly any[]) => any;
472
-
473
- /**
474
- * It returns a curried equivalent of the provided function, with the specified arity.
475
- */
476
- export function curryN(length: number, fn: AnyFunction): (...a: readonly any[]) => any;
198
+ export function countBy<T>(fn: (a: T) => string | number): (list: readonly T[]) => { readonly [index: string]: number };
477
199
 
478
200
  /**
479
201
  * It decrements a number.
@@ -486,121 +208,33 @@ export function dec(x: number): number;
486
208
  * Else, it returns the first truthy `inputArguments` instance(from left to right).
487
209
  */
488
210
  export function defaultTo<T>(defaultValue: T, input: T | null | undefined): T;
489
- export function defaultTo<T>(defaultValue: T): (input: T | null | undefined) => T;
490
-
491
- export function descend<T>(fn: (obj: T) => Ord, a: T, b: T): Ordering;
492
- export function descend<T>(fn: (obj: T) => Ord): (a: T, b: T) => Ordering;
493
-
494
- /**
495
- * It returns the uniq set of all elements in the first list `a` not contained in the second list `b`.
496
- *
497
- * `R.equals` is used to determine equality.
498
- */
499
- export function difference<T>(a: readonly T[], b: readonly T[]): readonly T[];
500
- export function difference<T>(a: readonly T[]): (b: readonly T[]) => readonly T[];
501
-
502
- export function differenceWith<T1, T2>(
503
- pred: (a: T1, b: T2) => boolean,
504
- list1: readonly T1[],
505
- list2: readonly T2[],
506
- ): readonly T1[];
507
- export function differenceWith<T1, T2>(
508
- pred: (a: T1, b: T2) => boolean,
509
- ): (list1: readonly T1[], list2: readonly T2[]) => readonly T1[];
510
- export function differenceWith<T1, T2>(
511
- pred: (a: T1, b: T2) => boolean,
512
- list1: readonly T1[],
513
- ): (list2: readonly T2[]) => readonly T1[];
514
-
515
- /**
516
- * It returns a new object that does not contain property `prop`.
517
- */
518
- export function dissoc<K extends PropertyKey>(prop: K): <U extends { readonly [P in K]?: any}>(obj: string extends keyof U ? U : undefined extends U[K] ? U : never) => U;
519
- export function dissoc<U, K extends keyof U>(prop: string extends keyof U ? K : undefined extends U[K] ? K : never, obj: U): U;
520
-
521
- export function dissocPath<T>(path: Path, obj: any): T;
522
- export function dissocPath<T>(path: Path): (obj: any) => T;
523
-
524
- export function divide(x: number, y: number): number;
525
- export function divide(x: number): (y: number) => number;
211
+ export function defaultTo<T>(defaultValue: T): <U>(input: U | null | undefined) => EqualTypes<U, T> extends true ? T : never
526
212
 
527
213
  /**
528
214
  * It returns `howMany` items dropped from beginning of list or string `input`.
529
215
  */
530
- export function drop<T>(howMany: number, input: readonly T[]): readonly T[];
531
- export function drop(howMany: number, input: string): string;
532
- export function drop<T>(howMany: number): {
533
- <T>(input: readonly T[]): readonly T[];
534
- (input: string): string;
535
- };
216
+ export function drop<T>(howMany: number): (list: readonly T[]) => readonly T[];
536
217
 
537
218
  /**
538
- * It returns `howMany` items dropped from the end of list or string `input`.
219
+ * It returns `howMany` items dropped from the end of list or string `input`.
539
220
  */
540
- export function dropLast<T>(howMany: number, input: readonly T[]): readonly T[];
541
- export function dropLast(howMany: number, input: string): string;
542
- export function dropLast<T>(howMany: number): {
543
- <T>(input: readonly T[]): readonly T[];
544
- (input: string): string;
545
- };
221
+ export function dropLast<T>(howMany: number): (list: readonly T[]) => readonly T[];
546
222
 
547
- export function dropLastWhile(predicate: (x: string) => boolean, iterable: string): string;
548
- export function dropLastWhile(predicate: (x: string) => boolean): (iterable: string) => string;
549
- export function dropLastWhile<T>(predicate: (x: T) => boolean, iterable: readonly T[]): readonly T[];
550
- export function dropLastWhile<T>(predicate: (x: T) => boolean): <T>(iterable: readonly T[]) => readonly T[];
223
+ export function dropLastWhile<T>(predicate: (x: T, index: number) => boolean): (list: readonly T[]) => readonly T[];
224
+ export function dropLastWhile<T>(predicate: (x: T) => boolean): (list: readonly T[]) => readonly T[];
551
225
 
552
- /**
553
- * It removes any successive duplicates according to `R.equals`.
554
- */
555
- export function dropRepeats<T>(list: readonly T[]): readonly T[];
556
-
557
- export function dropRepeatsBy<T, U>(fn: (a: T) => U, list: readonly T[]): readonly T[];
558
- export function dropRepeatsBy<T, U>(
559
- fn: (a: T) => U
560
- ): (list: readonly T[]) => readonly T[];
561
- export function dropRepeatsBy(fn: any): <T>(list: readonly T[]) => readonly T[];
226
+ export function dropRepeatsBy<T, U>(fn: (a: T) => U): (list: readonly T[]) => readonly T[];
562
227
 
563
- export function dropRepeatsWith<T>(predicate: (x: T, y: T) => boolean, list: readonly T[]): readonly T[];
564
228
  export function dropRepeatsWith<T>(predicate: (x: T, y: T) => boolean): (list: readonly T[]) => readonly T[];
565
229
 
566
- export function dropWhile(fn: Predicate<string>, iterable: string): string;
567
- export function dropWhile(fn: Predicate<string>): (iterable: string) => string;
568
- export function dropWhile<T>(fn: Predicate<T>, iterable: readonly T[]): readonly T[];
569
- export function dropWhile<T>(fn: Predicate<T>): (iterable: readonly T[]) => readonly T[];
230
+ export function dropWhile<T>(predicate: (x: T, index: number) => boolean): (list: readonly T[]) => readonly T[];
231
+ export function dropWhile<T>(predicate: (x: T) => boolean): (list: readonly T[]) => readonly T[];
570
232
 
571
- /**
572
- * It returns a new `predicate` function from `firstPredicate` and `secondPredicate` inputs.
573
- *
574
- * This `predicate` function will return `true`, if any of the two input predicates return `true`.
575
- */
576
- export function either(firstPredicate: Pred, secondPredicate: Pred): Pred;
577
- export function either<T>(firstPredicate: Predicate<T>, secondPredicate: Predicate<T>): Predicate<T>;
578
- export function either<T>(firstPredicate: Predicate<T>): (secondPredicate: Predicate<T>) => Predicate<T>;
579
- export function either(firstPredicate: Pred): (secondPredicate: Pred) => Pred;
580
-
581
- export function empty<T>(x: T): T;
582
-
583
- /**
584
- * When iterable is a string, then it behaves as `String.prototype.endsWith`.
585
- * When iterable is a list, then it uses R.equals to determine if the target list ends in the same way as the given target.
586
- */
587
- export function endsWith<T extends string>(question: T, str: string): boolean;
588
- export function endsWith<T extends string>(question: T): (str: string) => boolean;
589
- export function endsWith<T>(question: readonly T[], list: readonly T[]): boolean;
590
- export function endsWith<T>(question: readonly T[]): (list: readonly T[]) => boolean;
591
-
592
- export function eqBy<T>(fn: (a: T) => unknown, a: T, b: T): boolean;
593
- export function eqBy<T>(fn: (a: T) => unknown, a: T): (b: T) => boolean;
594
- export function eqBy<T>(fn: (a: T) => unknown): {
595
- (a: T, b: T): boolean;
596
- (a: T): (b: T) => boolean;
597
- };
233
+ export function eqBy<T>(fn: (x: T) => unknown, a: T): (b: T) => boolean;
598
234
 
599
235
  /**
600
236
  * It returns `true` if property `prop` in `obj1` is equal to property `prop` in `obj2` according to `R.equals`.
601
237
  */
602
- export function eqProps<T, U>(prop: string, obj1: T, obj2: U): boolean;
603
- export function eqProps<P extends string>(prop: P): <T, U>(obj1: Record<P, T>, obj2: Record<P, U>) => boolean;
604
238
  export function eqProps<T>(prop: string, obj1: T): <U>(obj2: U) => boolean;
605
239
 
606
240
  /**
@@ -610,27 +244,50 @@ export function equals<T>(x: T, y: T): boolean;
610
244
  export function equals<T>(x: T): (y: T) => boolean;
611
245
 
612
246
  /**
613
- * It takes object or array of functions as set of rules. These `rules` are applied to the `iterable` input to produce the result.
247
+ * It takes object of functions as set of rules. These `rules` are applied to the `iterable` input to produce the result.
614
248
  */
615
- export function evolve<T, U>(rules: readonly ((x: T) => U)[], list: readonly T[]): readonly U[];
616
- export function evolve<T, U>(rules: readonly ((x: T) => U)[]) : (list: readonly T[]) => readonly U[];
617
- export function evolve<E extends Evolver, V extends Evolvable<E>>(rules: E, obj: V): Evolve<V, E>;
618
249
  export function evolve<E extends Evolver>(rules: E): <V extends Evolvable<E>>(obj: V) => Evolve<V, E>;
619
250
 
251
+ /**
252
+ * Opposite of `R.includes`
253
+ *
254
+ * `R.equals` is used to determine equality.
255
+ */
256
+ export function excludes<T extends string>(valueToFind: T): (input: string) => boolean;
257
+ export function excludes<T>(valueToFind: T): (input: readonly T[]) => boolean;
258
+
620
259
  /**
621
260
  * It filters list or object `input` using a `predicate` function.
622
261
  */
623
- export function filter<T>(predicate: Predicate<T>): (input: readonly T[]) => readonly T[];
624
- export function filter<T>(predicate: Predicate<T>, input: readonly T[]): readonly T[];
625
- export function filter<T, U>(predicate: ObjectPredicate<T>): (x: Dictionary<T>) => Dictionary<T>;
626
- export function filter<T>(predicate: ObjectPredicate<T>, x: Dictionary<T>): Dictionary<T>;
262
+ export function filter<T, S extends T>(
263
+ predicate: (value: T) => value is S,
264
+ ): (list: readonly T[]) => readonly S[];
265
+ export function filter<T>(
266
+ predicate: BooleanConstructor,
267
+ ): (list: readonly T[]) => readonly NonNullable<T>[];
268
+ export function filter<T>(
269
+ predicate: BooleanConstructor,
270
+ ): (list: readonly T[]) => readonly NonNullable<T>[];
271
+ export function filter<T>(
272
+ predicate: (value: T) => boolean,
273
+ ): (list: readonly T[]) => readonly T[];
274
+
275
+ /**
276
+ * It loops over each property of `obj` and returns a new object with only those properties that satisfy the `predicate`.
277
+ */
278
+ export function filterObject<T extends object>(
279
+ valueMapper: (
280
+ value: EnumerableStringKeyedValueOf<T>,
281
+ key: EnumerableStringKeyOf<T>,
282
+ data: T,
283
+ ) => boolean,
284
+ ): <U extends T>(data: T) => U;
627
285
 
628
286
  /**
629
287
  * It returns the first element of `list` that satisfy the `predicate`.
630
288
  *
631
289
  * If there is no such element, it returns `undefined`.
632
290
  */
633
- export function find<T>(predicate: (x: T) => boolean, list: readonly T[]): T | undefined;
634
291
  export function find<T>(predicate: (x: T) => boolean): (list: readonly T[]) => T | undefined;
635
292
 
636
293
  /**
@@ -638,7 +295,6 @@ export function find<T>(predicate: (x: T) => boolean): (list: readonly T[]) => T
638
295
  *
639
296
  * If there is no such element, then `-1` is returned.
640
297
  */
641
- export function findIndex<T>(predicate: (x: T) => boolean, list: readonly T[]): number;
642
298
  export function findIndex<T>(predicate: (x: T) => boolean): (list: readonly T[]) => number;
643
299
 
644
300
  /**
@@ -646,7 +302,6 @@ export function findIndex<T>(predicate: (x: T) => boolean): (list: readonly T[])
646
302
  *
647
303
  * If there is no such element, then `undefined` is returned.
648
304
  */
649
- export function findLast<T>(fn: (x: T) => boolean, list: readonly T[]): T | undefined;
650
305
  export function findLast<T>(fn: (x: T) => boolean): (list: readonly T[]) => T | undefined;
651
306
 
652
307
  /**
@@ -654,97 +309,34 @@ export function findLast<T>(fn: (x: T) => boolean): (list: readonly T[]) => T |
654
309
  *
655
310
  * If there is no such element, then `-1` is returned.
656
311
  */
657
- export function findLastIndex<T>(predicate: (x: T) => boolean, list: readonly T[]): number;
658
312
  export function findLastIndex<T>(predicate: (x: T) => boolean): (list: readonly T[]) => number;
659
313
 
660
314
  /**
661
- * It deeply flattens an array.
315
+ * It maps `fn` over `list` and then flatten the result by one-level.
662
316
  */
663
- export function flatten<T>(list: readonly any[]): readonly T[];
317
+ export function flatMap<T, U extends unknown>(transformFn: (x: T extends readonly any[] ? T[number]: never) => U): (listOfLists: readonly T[]) => readonly U[];
664
318
 
665
319
  /**
666
- * It returns function which calls `fn` with exchanged first and second argument.
667
- */
668
- export function flip<T, U, TResult>(fn: (arg0: T, arg1: U) => TResult): (arg1: U, arg0?: T) => TResult;
669
-
670
- /**
671
- * It applies `iterable` function over all members of `list` and returns `list`.
672
- */
673
- export function forEach<T>(fn: Iterator<T, void>, list: readonly T[]): readonly T[];
674
- export function forEach<T>(fn: Iterator<T, void>): (list: readonly T[]) => readonly T[];
675
- export function forEach<T>(fn: ObjectIterator<T, void>, list: Dictionary<T>): Dictionary<T>;
676
- export function forEach<T, U>(fn: ObjectIterator<T, void>): (list: Dictionary<T>) => Dictionary<T>;
677
-
678
- export function forEachObjIndexed<T>(fn: (value: T[keyof T], key: keyof T, obj: T) => void, obj: T): T;
679
- export function forEachObjIndexed<T>(fn: (value: T[keyof T], key: keyof T, obj: T) => void): (obj: T) => T;
680
-
681
- /**
682
- * It transforms a `listOfPairs` to an object.
320
+ * It deeply flattens an array.
683
321
  */
684
- export function fromPairs<V>(listOfPairs: readonly ((readonly [number, V]))[]): { readonly [index: number]: V };
685
- export function fromPairs<V>(listOfPairs: readonly ((readonly [string, V]))[]): { readonly [index: string]: V };
322
+ export function flatten<T>(list: readonly any[]): readonly T[];
686
323
 
687
324
  /**
688
325
  * It splits `list` according to a provided `groupFn` function and returns an object.
689
326
  */
690
327
  export function groupBy<T, K extends string = string>(fn: (a: T) => K): (list: readonly T[]) => Partial<Record<K, readonly T[]>>;
691
- export function groupBy<T, K extends string = string>(fn: (a: T) => K, list: readonly T[]): Partial<Record<K, readonly T[]>>;
692
-
693
- /**
694
- * It returns separated version of list or string `input`, where separation is done with equality `compareFn` function.
695
- */
696
- export function groupWith<T>(compareFn: (x: T, y: T) => boolean): (input: readonly T[]) => readonly ((readonly T[]))[];
697
- export function groupWith<T>(compareFn: (x: T, y: T) => boolean, input: readonly T[]): readonly ((readonly T[]))[];
698
- export function groupWith<T>(compareFn: (x: T, y: T) => boolean, input: string): readonly string[];
699
-
700
- export function gt<T, U>(x: T, y: U): boolean;
701
- export function gt<T, U>(x: T): (y: U) => boolean;
702
-
703
- export function gte<T, U>(x: T, y: U): boolean;
704
- export function gte<T, U>(x: T): (y: U) => boolean;
705
-
706
- /**
707
- * It returns `true` if `obj` has property `prop`.
708
- */
709
- export function has<T>(prop: string, obj: T): boolean;
710
- export function has(prop: string): <T>(obj: T) => boolean;
711
-
712
- export function hasIn(searchProperty: string): <T>(obj: T) => boolean;
713
- export function hasIn<T>(searchProperty: string, obj: T): boolean;
714
-
715
- /**
716
- * It will return true, if `input` object has truthy `path`(calculated with `R.path`).
717
- */
718
- export function hasPath<T>(
719
- path: string | readonly string[],
720
- input: object
721
- ): boolean;
722
- export function hasPath<T>(
723
- path: string | readonly string[]
724
- ): (input: object) => boolean;
725
328
 
726
329
  /**
727
330
  * It returns the first element of list or string `input`. It returns `undefined` if array has length of 0.
728
331
  */
729
- export function head(str: string): string;
730
- export function head(str: ''): undefined;
731
- export function head(list: readonly[]): undefined;
732
- export function head<T>(list: readonly never[]): undefined;
733
- export function head<T extends readonly unknown[]>(array: T): FirstArrayElement<T>
734
- export function head<T extends readonly unknown[]>(array: T): FirstArrayElement<T>
735
-
736
- /**
737
- * It returns `true` if its arguments `a` and `b` are identical.
738
- *
739
- * Otherwise, it returns `false`.
740
- */
741
- export function identical<T>(x: T, y: T): boolean;
742
- export function identical<T>(x: T): (y: T) => boolean;
743
-
744
- /**
745
- * It just passes back the supplied `input` argument.
746
- */
747
- export function identity<T>(input: T): T;
332
+ export function head<T>(listOrString: T): T extends string ? string :
333
+ T extends readonly [] ? undefined:
334
+ T extends readonly [infer F, ...infer R] ? F :
335
+ T extends readonly [infer F] ? F :
336
+ T extends readonly [infer F] ? F :
337
+ T extends readonly [infer F, ...infer R] ? F :
338
+ T extends readonly unknown[] ? T[number] :
339
+ undefined;
748
340
 
749
341
  /**
750
342
  * It expects `condition`, `onTrue` and `onFalse` functions as inputs and it returns a new function with example name of `fn`.
@@ -758,41 +350,17 @@ export function ifElse<T, TFiltered extends T, TOnTrueResult, TOnFalseResult>(
758
350
  ): (a: T) => TOnTrueResult | TOnFalseResult;
759
351
  export function ifElse<TArgs extends readonly any[], TOnTrueResult, TOnFalseResult>(fn: (...args: TArgs) => boolean, onTrue: (...args: TArgs) => TOnTrueResult, onFalse: (...args: TArgs) => TOnFalseResult): (...args: TArgs) => TOnTrueResult | TOnFalseResult;
760
352
 
761
- /**
762
- * It increments a number.
763
- */
764
- export function inc(x: number): number;
765
-
766
353
  /**
767
354
  * If `input` is string, then this method work as native `String.includes`.
768
355
  *
769
356
  * If `input` is array, then `R.equals` is used to define if `valueToFind` belongs to the list.
770
357
  */
771
- export function includes<T extends string>(valueToFind: T, input: string): boolean;
772
358
  export function includes<T extends string>(valueToFind: T): (input: string) => boolean;
773
- export function includes<T>(valueToFind: T, input: readonly T[]): boolean;
774
359
  export function includes<T>(valueToFind: T): (input: readonly T[]) => boolean;
775
360
 
776
361
  /**
777
- * It generates object with properties provided by `condition` and values provided by `list` array.
778
- *
779
- * If `condition` is a function, then all list members are passed through it.
780
- *
781
- * If `condition` is a string, then all list members are passed through `R.path(condition)`.
782
- */
783
- export function indexBy<T, K extends string | number = string>(condition: (key: T) => K, list: readonly T[]): { readonly [key in K]: T };
784
- export function indexBy<T, K extends string | number | undefined = string>(condition: (key: T) => K, list: readonly T[]): { readonly [key in NonNullable<K>]?: T };
785
- export function indexBy<T, K extends string | number = string>(condition: (key: T) => K): (list: readonly T[]) => { readonly [key in K]: T };
786
- export function indexBy<T, K extends string | number | undefined = string>(condition: (key: T) => K | undefined): (list: readonly T[]) => { readonly [key in NonNullable<K>]?: T };
787
- export function indexBy<T>(condition: string, list: readonly T[]): { readonly [key: string]: T };
788
- export function indexBy<T>(condition: string): (list: readonly T[]) => { readonly [key: string]: T };
789
-
790
- /**
791
- * It returns the index of the first element of `list` equals to `valueToFind`.
792
- *
793
- * If there is no such element, it returns `-1`.
362
+ * It uses `R.equals` for list of objects/arrays or native `indexOf` for any other case.
794
363
  */
795
- export function indexOf<T>(valueToFind: T, list: readonly T[]): number;
796
364
  export function indexOf<T>(valueToFind: T): (list: readonly T[]) => number;
797
365
 
798
366
  /**
@@ -804,22 +372,10 @@ export function init(input: string): string;
804
372
  /**
805
373
  * It returns a new list by applying a `predicate` function to all elements of `list1` and `list2` and keeping only these elements where `predicate` returns `true`.
806
374
  */
807
- export function innerJoin<T1, T2>(
808
- pred: (a: T1, b: T2) => boolean,
809
- ): (list1: readonly T1[], list2: readonly T2[]) => readonly T1[];
810
375
  export function innerJoin<T1, T2>(
811
376
  pred: (a: T1, b: T2) => boolean,
812
377
  list1: readonly T1[],
813
378
  ): (list2: readonly T2[]) => readonly T1[];
814
- export function innerJoin<T1, T2>(pred: (a: T1, b: T2) => boolean, list1: readonly T1[], list2: readonly T2[]): readonly T1[];
815
-
816
- export function insert(index: number): <T>(itemToInsert: T, list: readonly T[]) => readonly T[];
817
- export function insert<T>(index: number, itemToInsert: T): (list: readonly T[]) => readonly T[];
818
- export function insert<T>(index: number, itemToInsert: T, list: readonly T[]): readonly T[];
819
-
820
- export function insertAll(index: number): <T>(itemsToInsert: readonly T[], list: readonly T[]) => readonly T[];
821
- export function insertAll<T>(index: number, itemsToInsert: readonly T[]): (list: readonly T[]) => readonly T[];
822
- export function insertAll<T>(index: number, itemsToInsert: readonly T[], list: readonly T[]): readonly T[];
823
379
 
824
380
  /**
825
381
  * It loops through `listA` and `listB` and returns the intersection of the two according to `R.equals`.
@@ -830,65 +386,29 @@ export function intersection<T>(listA: readonly T[]): (listB: readonly T[]) => r
830
386
  /**
831
387
  * It adds a `separator` between members of `list`.
832
388
  */
833
- export function intersperse<T>(separator: T, list: readonly T[]): readonly T[];
834
389
  export function intersperse<T>(separator: T): (list: readonly T[]) => readonly T[];
835
390
 
836
- /**
837
- * It returns `true` if `x` is instance of `targetPrototype`.
838
- */
839
- export function is<C extends () => any>(targetPrototype: C, val: any): val is ReturnType<C>;
840
- export function is<C extends new () => any>(targetPrototype: C, val: any): val is InstanceType<C>;
841
- export function is<C extends () => any>(targetPrototype: C): (val: any) => val is ReturnType<C>;
842
- export function is<C extends new () => any>(targetPrototype: C): (val: any) => val is InstanceType<C>;
843
-
844
- /**
845
- * It returns `true` if `x` is `empty`.
846
- */
847
- export function isEmpty<T>(x: T): boolean;
848
-
849
- /**
850
- * It returns `true` if `x` is either `null` or `undefined`.
851
- */
852
- export function isNil(x: any): x is null | undefined;
853
-
854
391
  export function isNotEmpty<T>(value: readonly T[]): value is NonEmptyArray<T>;
855
392
  export function isNotEmpty<T>(value: readonly T[]): value is ReadonlyNonEmptyArray<T>;
856
393
  export function isNotEmpty(value: any): boolean;
857
394
 
858
- export function isNotNil<T>(value: T): value is NonNullable<T>;
859
-
860
395
  /**
861
396
  * It returns a string of all `list` instances joined with a `glue`.
862
397
  */
863
398
  export function join<T>(glue: string, list: readonly T[]): string;
864
399
  export function join<T>(glue: string): (list: readonly T[]) => string;
865
400
 
866
- /**
867
- * It applies list of function to a list of inputs.
868
- */
869
- export function juxt<A extends readonly any[], R1>(fns: readonly [(...a: A) => R1]): (...a: A) => readonly [R1];
870
- export function juxt<A extends readonly any[], R1, R2>(fns: readonly [(...a: A) => R1, (...a: A) => R2]): (...a: A) => readonly [R1, R2];
871
- export function juxt<A extends readonly any[], R1, R2, R3>(fns: readonly [(...a: A) => R1, (...a: A) => R2, (...a: A) => R3]): (...a: A) => readonly [R1, R2, R3];
872
- export function juxt<A extends readonly any[], R1, R2, R3, R4>(fns: readonly [(...a: A) => R1, (...a: A) => R2, (...a: A) => R3, (...a: A) => R4]): (...a: A) => readonly [R1, R2, R3, R4];
873
- export function juxt<A extends readonly any[], R1, R2, R3, R4, R5>(fns: readonly [(...a: A) => R1, (...a: A) => R2, (...a: A) => R3, (...a: A) => R4, (...a: A) => R5]): (...a: A) => readonly [R1, R2, R3, R4, R5];
874
- export function juxt<A extends readonly any[], U>(fns: ReadonlyArray<(...args: A) => U>): (...args: A) => readonly U[];
875
-
876
- /**
877
- * It applies `Object.keys` over `x` and returns its keys.
878
- */
879
- export function keys<T extends object>(x: T): readonly (keyof T & string)[];
880
- export function keys<T>(x: T): readonly string[];
881
-
882
401
  /**
883
402
  * It returns the last element of `input`, as the `input` can be either a string or an array. It returns `undefined` if array has length of 0.
884
403
  */
885
- export function last(str: ''): undefined;
886
- export function last(str: string): string;
887
- export function last(list: readonly[]): undefined;
888
- export function last(list: readonly never[]): undefined;
889
- export function last<T extends readonly unknown[]>(array: T): LastArrayElement<T>;
890
- export function last<T extends readonly unknown[]>(array: T): LastArrayElement<T>;
891
- export function last(str: string): string | undefined;
404
+ export function last<T>(listOrString: T): T extends string ? string :
405
+ T extends readonly [] ? undefined :
406
+ T extends readonly [...infer R, infer L] ? L :
407
+ T extends readonly [infer L] ? L :
408
+ T extends readonly [infer L] ? L :
409
+ T extends readonly [...infer R, infer L] ? L :
410
+ T extends readonly unknown[] ? T[number] :
411
+ undefined;
892
412
 
893
413
  /**
894
414
  * It returns the last index of `target` in `list` array.
@@ -900,95 +420,64 @@ export function last(str: string): string | undefined;
900
420
  export function lastIndexOf<T>(target: T, list: readonly T[]): number;
901
421
  export function lastIndexOf<T>(target: T): (list: readonly T[]) => number;
902
422
 
903
- /**
904
- * It returns the `length` property of list or string `input`.
905
- */
906
- export function length<T>(input: readonly T[]): number;
907
-
908
- /**
909
- * It returns a `lens` for the given `getter` and `setter` functions.
910
- *
911
- * The `getter` **gets** the value of the focus; the `setter` **sets** the value of the focus.
912
- *
913
- * The setter should not mutate the data structure.
914
- */
915
- export function lens<S, A>(getter: (s: S) => A, setter: (a: A, s: S) => S): Lens<S, A>;
916
-
917
- /**
918
- * It returns a lens that focuses on specified `index`.
919
- */
920
- export function lensIndex<A>(n: number): Lens<readonly A[], A>;
921
- export function lensIndex<A extends readonly any[], N extends number>(n: N): Lens<A, A[N]>;
922
-
923
- /**
924
- * It returns a lens that focuses on specified `path`.
925
- */
926
- export function lensPath<S, K0 extends keyof S = keyof S>(path: readonly [K0]): Lens<S, S[K0]>;
927
- export function lensPath<S, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0]>(
928
- path: readonly [K0, K1],
929
- ): Lens<S, S[K0][K1]>;
930
- export function lensPath<
931
- S,
932
- K0 extends keyof S = keyof S,
933
- K1 extends keyof S[K0] = keyof S[K0],
934
- K2 extends keyof S[K0][K1] = keyof S[K0][K1]
935
- >(path: readonly [K0, K1, K2]): Lens<S, S[K0][K1][K2]>;
936
- export function lensPath<
937
- S,
938
- K0 extends keyof S = keyof S,
939
- K1 extends keyof S[K0] = keyof S[K0],
940
- K2 extends keyof S[K0][K1] = keyof S[K0][K1],
941
- K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2]
942
- >(path: readonly [K0, K1, K2, K3]): Lens<S, S[K0][K1][K2][K3]>;
943
- export function lensPath<
944
- S,
945
- K0 extends keyof S = keyof S,
946
- K1 extends keyof S[K0] = keyof S[K0],
947
- K2 extends keyof S[K0][K1] = keyof S[K0][K1],
948
- K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],
949
- K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3]
950
- >(path: readonly [K0, K1, K2, K3, K4]): Lens<S, S[K0][K1][K2][K3][K4]>;
951
- export function lensPath<
952
- S,
953
- K0 extends keyof S = keyof S,
954
- K1 extends keyof S[K0] = keyof S[K0],
955
- K2 extends keyof S[K0][K1] = keyof S[K0][K1],
956
- K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],
957
- K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3],
958
- K5 extends keyof S[K0][K1][K2][K3][K4] = keyof S[K0][K1][K2][K3][K4]
959
- >(path: readonly [K0, K1, K2, K3, K4, K5]): Lens<S, S[K0][K1][K2][K3][K4][K5]>;
960
- export function lensPath<S = any, A = any>(path: Path): Lens<S, A>;
961
-
962
- /**
963
- * It returns a lens that focuses on specified property `prop`.
964
- */
965
- export function lensProp<S, K extends keyof S = keyof S>(prop: K): Lens<S, S[K]>;
966
-
967
- export function lt<T, U>(x: T, y: U): boolean;
968
- export function lt<T, U>(x: T): (y: U) => boolean;
969
-
970
- export function lte<T, U>(x: T, y: U): boolean;
971
- export function lte<T, U>(x: T): (y: U) => boolean;
972
-
973
423
  /**
974
424
  * It returns the result of looping through `iterable` with `fn`.
975
425
  *
976
426
  * It works with both array and object.
977
427
  */
978
- export function map<T, U>(fn: ObjectIterator<T, U>, iterable: Dictionary<T>): Dictionary<U>;
979
- export function map<T, U>(fn: Iterator<T, U>, iterable: readonly T[]): readonly U[];
980
- export function map<T, U>(fn: Iterator<T, U>): (iterable: readonly T[]) => readonly U[];
981
- export function map<T, U, S>(fn: ObjectIterator<T, U>): (iterable: Dictionary<T>) => Dictionary<U>;
982
- export function map<T>(fn: Iterator<T, T>): (iterable: readonly T[]) => readonly T[];
983
- export function map<T>(fn: Iterator<T, T>, iterable: readonly T[]): readonly T[];
428
+ export function map<T extends IterableContainer, U>(
429
+ fn: (value: T[number], index: number) => U,
430
+ ): (data: T) => Mapped<T, U>;
431
+ export function map<T extends IterableContainer, U>(
432
+ fn: (value: T[number]) => U,
433
+ ): (data: T) => Mapped<T, U>;
434
+ export function map<T extends IterableContainer, U>(
435
+ fn: (value: T[number], index: number) => U,
436
+ data: T
437
+ ) : Mapped<T, U>;
438
+ export function map<T extends IterableContainer, U>(
439
+ fn: (value: T[number]) => U,
440
+ data: T
441
+ ) : Mapped<T, U>;
442
+
443
+ /**
444
+ * Sequential asynchronous mapping with `fn` over members of `list`.
445
+ */
446
+ export function mapAsync<T extends IterableContainer, U>(
447
+ fn: (value: T[number], index: number) => Promise<U>,
448
+ ): (data: T) => Promise<Mapped<T, U>>;
449
+ export function mapAsync<T extends IterableContainer, U>(
450
+ fn: (value: T[number]) => Promise<U>,
451
+ ): (data: T) => Promise<Mapped<T, U>>;
452
+ export function mapAsync<T extends IterableContainer, U>(
453
+ fn: (value: T[number], index: number) => Promise<U>,
454
+ data: T
455
+ ): Promise<Mapped<T, U>>;
456
+ export function mapAsync<T extends IterableContainer, U>(
457
+ fn: (value: T[number]) => Promise<U>,
458
+ data: T
459
+ ): Promise<Mapped<T, U>>;
460
+
461
+ export function mapObject<T extends object, Value>(
462
+ valueMapper: (
463
+ value: EnumerableStringKeyedValueOf<T>,
464
+ key: EnumerableStringKeyOf<T>,
465
+ data: T,
466
+ ) => Value,
467
+ ): (data: T) => MappedValues<T, Value>;
468
+
469
+ export function mapObjectAsync<T extends object, Value>(
470
+ valueMapper: (
471
+ value: EnumerableStringKeyedValueOf<T>,
472
+ key: EnumerableStringKeyOf<T>,
473
+ data: T,
474
+ ) => Promise<Value>,
475
+ ): (data: T) => Promise<MappedValues<T, Value>>;
476
+
477
+ // API_MARKER_END
478
+ // ============================================
984
479
 
985
- /**
986
- * It works the same way as `R.map` does for objects. It is added as Ramda also has this method.
987
- */
988
- export function mapObjIndexed<T>(fn: ObjectIterator<T, T>, iterable: Dictionary<T>): Dictionary<T>;
989
- export function mapObjIndexed<T, U>(fn: ObjectIterator<T, U>, iterable: Dictionary<T>): Dictionary<U>;
990
- export function mapObjIndexed<T>(fn: ObjectIterator<T, T>): (iterable: Dictionary<T>) => Dictionary<T>;
991
- export function mapObjIndexed<T, U>(fn: ObjectIterator<T, U>): (iterable: Dictionary<T>) => Dictionary<U>;
480
+ export as namespace R
992
481
 
993
482
  /**
994
483
  * Curried version of `String.prototype.match` which returns empty array, when there is no match.
@@ -1031,30 +520,6 @@ export function median(list: readonly number[]): number;
1031
520
  export function merge<A, B>(target: A, newProps: B): A & B
1032
521
  export function merge<Output>(target: any): (newProps: any) => Output;
1033
522
 
1034
- /**
1035
- * It merges all objects of `list` array sequentially and returns the result.
1036
- */
1037
- export function mergeAll<T>(list: readonly object[]): T;
1038
- export function mergeAll(list: readonly object[]): object;
1039
-
1040
- export function mergeDeepLeft<Output>(newProps: object, target: object): Output;
1041
- export function mergeDeepLeft<Output>(newProps: object): (target: object) => Output;
1042
-
1043
- /**
1044
- * Creates a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects:
1045
- *
1046
- * - and both values are objects, the two values will be recursively merged
1047
- * - otherwise the value from the second object will be used.
1048
- */
1049
- export function mergeDeepRight<Output>(target: object, newProps: object): Output;
1050
- export function mergeDeepRight<Output>(target: object): (newProps: object) => Output;
1051
-
1052
- /**
1053
- * Same as `R.merge`, but in opposite direction.
1054
- */
1055
- export function mergeLeft<Output>(newProps: object, target: object): Output;
1056
- export function mergeLeft<Output>(newProps: object): (target: object) => Output;
1057
-
1058
523
  /**
1059
524
  * It creates a copy of `target` object with overwritten `newProps` properties. Previously known as `R.merge` but renamed after Ramda did the same.
1060
525
  */
@@ -1062,498 +527,948 @@ export function mergeRight<A, B>(target: A, newProps: B): A & B
1062
527
  export function mergeRight<Output>(target: any): (newProps: any) => Output;
1063
528
 
1064
529
  /**
1065
- * It takes two objects and a function, which will be used when there is an overlap between the keys.
530
+ * Helper to merge all calculated TypeScript definitions into one definition.
531
+ * It returns its input and it is intended to be used as last method inside `R.pipe` chain.
1066
532
  */
1067
- export function mergeWith(fn: (x: any, z: any) => any, a: Record<string, unknown>, b: Record<string, unknown>): Record<string, unknown>;
1068
- export function mergeWith<Output>(fn: (x: any, z: any) => any, a: Record<string, unknown>, b: Record<string, unknown>): Output;
1069
- export function mergeWith(fn: (x: any, z: any) => any, a: Record<string, unknown>): (b: Record<string, unknown>) => Record<string, unknown>;
1070
- export function mergeWith<Output>(fn: (x: any, z: any) => any, a: Record<string, unknown>): (b: Record<string, unknown>) => Output;
1071
- export function mergeWith(fn: (x: any, z: any) => any): <U, V>(a: U, b: V) => Record<string, unknown>;
1072
- export function mergeWith<Output>(fn: (x: any, z: any) => any): <U, V>(a: U, b: V) => Output;
533
+ export function mergeTypes<T>(x: T): MergeTypes<T>;
1073
534
 
1074
535
  /**
1075
536
  * It returns the lesser value between `x` and `y`.
1076
537
  */
1077
- export function min<T extends Ord>(x: T, y: T): T;
1078
538
  export function min<T extends Ord>(x: T): (y: T) => T;
1079
539
 
1080
540
  /**
1081
541
  * It returns the lesser value between `x` and `y` according to `compareFn` function.
1082
542
  */
1083
- export function minBy<T>(compareFn: (input: T) => Ord, x: T, y: T): T;
1084
543
  export function minBy<T>(compareFn: (input: T) => Ord, x: T): (y: T) => T;
1085
- export function minBy<T>(compareFn: (input: T) => Ord): (x: T) => (y: T) => T;
1086
-
1087
- export function modify<K extends PropertyKey, T>(prop: K, fn: (value: T) => T): <U extends Record<K, T>>(object: U) => U;
1088
- export function modify<U, K extends keyof U>(prop: K, fn: (value: U[K]) => U[K], object: U): U;
1089
- export function modify<K extends PropertyKey>(prop: K): {
1090
- <T>(fn: (value: T) => T): <U extends Record<K, T>>(object: U) => U;
1091
- <T, U extends Record<K, T>>(fn: (value: T) => T, object: U): U;
1092
- };
1093
544
 
1094
545
  /**
1095
- * It changes a property of object on the base of provided path and transformer function.
546
+ * It changes a property with the result of transformer function.
1096
547
  */
1097
- export function modifyPath<T extends Record<string, unknown>>(path: Path, fn: (x: any) => unknown, object: Record<string, unknown>): T;
1098
- export function modifyPath<T extends Record<string, unknown>>(path: Path, fn: (x: any) => unknown): (object: Record<string, unknown>) => T;
1099
- export function modifyPath<T extends Record<string, unknown>>(path: Path): (fn: (x: any) => unknown) => (object: Record<string, unknown>) => T;
1100
-
1101
- /**
1102
- * Curried version of `x%y`.
1103
- */
1104
- export function modulo(x: number, y: number): number;
1105
- export function modulo(x: number): (y: number) => number;
1106
-
1107
- /**
1108
- * It returns a copy of `list` with exchanged `fromIndex` and `toIndex` elements.
1109
- */
1110
- export function move<T>(fromIndex: number, toIndex: number, list: readonly T[]): readonly T[];
1111
- export function move(fromIndex: number, toIndex: number): <T>(list: readonly T[]) => readonly T[];
1112
- export function move(fromIndex: number): {
1113
- <T>(toIndex: number, list: readonly T[]): readonly T[];
1114
- (toIndex: number): <T>(list: readonly T[]) => readonly T[];
1115
- };
548
+ export function modify<K extends string, A, P>(
549
+ prop: K,
550
+ fn: (a: A) => P,
551
+ ): <T extends Record<K, A>>(target: T) => Omit<T, K> & Record<K, P>;
1116
552
 
1117
553
  /**
1118
- * Curried version of `x*y`.
554
+ * It changes a property of object on the base of provided path and transformer function.
1119
555
  */
1120
- export function multiply(x: number, y: number): number;
1121
- export function multiply(x: number): (y: number) => number;
1122
-
1123
- export function negate(x: number): number;
556
+ export function modifyPath<U, T>(path: readonly [], fn: (value: U) => T): (obj: U) => T;
557
+ export function modifyPath<
558
+ K0 extends keyof U,
559
+ U,
560
+ T
561
+ >(path: readonly [K0], fn: (value: U[K0]) => T): (obj: U) => DeepModify<readonly [K0], U, T>;
562
+ export function modifyPath<
563
+ K0 extends keyof U,
564
+ U,
565
+ T
566
+ >(path: `${K0}`, fn: (value: U[K0]) => T): (obj: U) => DeepModify<readonly [K0], U, T>;
567
+ export function modifyPath<
568
+ K0 extends keyof U,
569
+ K1 extends keyof U[K0],
570
+ U,
571
+ T
572
+ >(path: readonly [K0, K1], fn: (value: U[K0][K1]) => T): (obj: U) => DeepModify<readonly [K0, K1], U, T>;
573
+ export function modifyPath<
574
+ K0 extends keyof U,
575
+ K1 extends keyof U[K0],
576
+ U,
577
+ T
578
+ >(path: `${K0}.${K1}`, fn: (value: U[K0][K1]) => T): (obj: U) => DeepModify<readonly [K0, K1], U, T>;
579
+ export function modifyPath<
580
+ K0 extends keyof U,
581
+ K1 extends keyof U[K0],
582
+ K2 extends keyof U[K0][K1],
583
+ U,
584
+ T
585
+ >(path: readonly [K0, K1, K2], fn: (value: U[K0][K1][K2]) => T): (obj: U) => DeepModify<readonly [K0, K1, K2], U, T>;
586
+ export function modifyPath<
587
+ K0 extends keyof U,
588
+ K1 extends keyof U[K0],
589
+ K2 extends keyof U[K0][K1],
590
+ U,
591
+ T
592
+ >(path: `${K0}.${K1}.${K2}`, fn: (value: U[K0][K1][K2]) => T): (obj: U) => DeepModify<readonly [K0, K1, K2], U, T>;
593
+ export function modifyPath<
594
+ K0 extends keyof U,
595
+ K1 extends keyof U[K0],
596
+ K2 extends keyof U[K0][K1],
597
+ K3 extends keyof U[K0][K1][K2],
598
+ U,
599
+ T
600
+ >(path: readonly [K0, K1, K2, K3], fn: (value: U[K0][K1][K2][K3]) => T): (obj: U) => DeepModify<readonly [K0, K1, K2, K3], U, T>;
601
+ export function modifyPath<
602
+ K0 extends keyof U,
603
+ K1 extends keyof U[K0],
604
+ K2 extends keyof U[K0][K1],
605
+ K3 extends keyof U[K0][K1][K2],
606
+ U,
607
+ T
608
+ >(path: `${K0}.${K1}.${K2}.${K3}`, fn: (value: U[K0][K1][K2][K3]) => T): (obj: U) => DeepModify<readonly [K0, K1, K2, K3], U, T>;
609
+ export function modifyPath<
610
+ K0 extends keyof U,
611
+ K1 extends keyof U[K0],
612
+ K2 extends keyof U[K0][K1],
613
+ K3 extends keyof U[K0][K1][K2],
614
+ K4 extends keyof U[K0][K1][K2][K3],
615
+ U,
616
+ T
617
+ >(path: readonly [K0, K1, K2, K3, K4], fn: (value: U[K0][K1][K2][K3][K4]) => T): (obj: U) => DeepModify<readonly [K0, K1, K2, K3, K4], U, T>;
618
+ export function modifyPath<
619
+ K0 extends keyof U,
620
+ K1 extends keyof U[K0],
621
+ K2 extends keyof U[K0][K1],
622
+ K3 extends keyof U[K0][K1][K2],
623
+ K4 extends keyof U[K0][K1][K2][K3],
624
+ U,
625
+ T
626
+ >(path: `${K0}.${K1}.${K2}.${K3}.${K4}`, fn: (value: U[K0][K1][K2][K3][K4]) => T): (obj: U) => DeepModify<readonly [K0, K1, K2, K3, K4], U, T>;
627
+ export function modifyPath<
628
+ K0 extends keyof U,
629
+ K1 extends keyof U[K0],
630
+ K2 extends keyof U[K0][K1],
631
+ K3 extends keyof U[K0][K1][K2],
632
+ K4 extends keyof U[K0][K1][K2][K3],
633
+ K5 extends keyof U[K0][K1][K2][K3][K4],
634
+ U,
635
+ T
636
+ >(path: readonly [K0, K1, K2, K3, K4, K5], fn: (value: U[K0][K1][K2][K3][K4][K5]) => T): (obj: U) => DeepModify<readonly [K0, K1, K2, K3, K4, K5], U, T>;
637
+ export function modifyPath<
638
+ K0 extends keyof U,
639
+ K1 extends keyof U[K0],
640
+ K2 extends keyof U[K0][K1],
641
+ K3 extends keyof U[K0][K1][K2],
642
+ K4 extends keyof U[K0][K1][K2][K3],
643
+ K5 extends keyof U[K0][K1][K2][K3][K4],
644
+ U,
645
+ T
646
+ >(path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}`, fn: (value: U[K0][K1][K2][K3][K4][K5]) => T): (obj: U) => DeepModify<readonly [K0, K1, K2, K3, K4, K5], U, T>;
647
+ export function modifyPath<
648
+ K0 extends keyof U,
649
+ K1 extends keyof U[K0],
650
+ K2 extends keyof U[K0][K1],
651
+ K3 extends keyof U[K0][K1][K2],
652
+ K4 extends keyof U[K0][K1][K2][K3],
653
+ K5 extends keyof U[K0][K1][K2][K3][K4],
654
+ K6 extends keyof U[K0][K1][K2][K3][K4][K5],
655
+ U,
656
+ T
657
+ >(path: readonly [K0, K1, K2, K3, K4, K5, K6], fn: (value: U[K0][K1][K2][K3][K4][K5][K6]) => T): (obj: U) => DeepModify<readonly [K0, K1, K2, K3, K4, K5, K6], U, T>;
658
+ export function modifyPath<
659
+ K0 extends keyof U,
660
+ K1 extends keyof U[K0],
661
+ K2 extends keyof U[K0][K1],
662
+ K3 extends keyof U[K0][K1][K2],
663
+ K4 extends keyof U[K0][K1][K2][K3],
664
+ K5 extends keyof U[K0][K1][K2][K3][K4],
665
+ K6 extends keyof U[K0][K1][K2][K3][K4][K5],
666
+ U,
667
+ T
668
+ >(path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}`, fn: (value: U[K0][K1][K2][K3][K4][K5][K6]) => T): (obj: U) => DeepModify<readonly [K0, K1, K2, K3, K4, K5, K6], U, T>;
669
+ export function modifyPath<B, A = any>(path: Path, fn: (a: any) => any): (obj: A) => B;
1124
670
 
1125
671
  /**
1126
672
  * It returns `true`, if all members of array `list` returns `false`, when applied as argument to `predicate` function.
1127
673
  */
1128
- export function none<T>(predicate: (x: T) => boolean, list: readonly T[]): boolean;
1129
674
  export function none<T>(predicate: (x: T) => boolean): (list: readonly T[]) => boolean;
1130
675
 
1131
- /**
1132
- * It returns a boolean negated version of `input`.
1133
- */
1134
- export function not(input: any): boolean;
1135
-
1136
- /**
1137
- * Curried version of `input[index]`.
1138
- */
1139
- export function nth(index: number, input: string): string;
1140
- export function nth<T>(index: number, input: readonly T[]): T | undefined;
1141
- export function nth(n: number): {
1142
- <T>(input: readonly T[]): T | undefined;
1143
- (input: string): string;
1144
- };
1145
-
1146
676
  /**
1147
677
  * It creates an object with a single key-value pair.
1148
678
  */
1149
- export function objOf<T, K extends string>(key: K, value: T): Record<K, T>;
1150
- export function objOf<K extends string>(key: K): <T>(value: T) => Record<K, T>;
1151
-
1152
- export function of<T>(x: T): readonly T[];
1153
-
1154
- /**
1155
- * It returns a partial copy of an `obj` without `propsToOmit` properties.
1156
- */
1157
- export function omit<T, K extends string>(propsToOmit: readonly K[], obj: T): Omit<T, K>;
1158
- export function omit<K extends string>(propsToOmit: readonly K[]): <T>(obj: T) => Omit<T, K>;
1159
- export function omit<T, U>(propsToOmit: string, obj: T): U;
1160
- export function omit<T, U>(propsToOmit: string): (obj: T) => U;
1161
- export function omit<T>(propsToOmit: string, obj: object): T;
1162
- export function omit<T>(propsToOmit: string): (obj: object) => T;
679
+ export function objOf<T, K extends PropertyKey>(key: K): (value: T) => { readonly [P in K]: T };
1163
680
 
1164
681
  /**
1165
- * It passes the two inputs through `unaryFn` and then the results are passed as inputs the the `binaryFn` to receive the final result(`binaryFn(unaryFn(FIRST_INPUT), unaryFn(SECOND_INPUT))`).
682
+ * It will return `true` if `specification` object fully or partially include `obj` object.
1166
683
  *
1167
- * This method is also known as P combinator.
1168
- */
1169
- export function on<T, U, R>(binaryFn: (a: U, b: U) => R, unaryFn: (value: T) => U, a: T, b: T): R;
1170
- export function on<T, U, R>(binaryFn: (a: U, b: U) => R, unaryFn: (value: T) => U, a: T): (b: T) => R;
1171
- export function on<T, U, R>(binaryFn: (a: U, b: U) => R, unaryFn: (value: T) => U): {
1172
- (a: T, b: T): R;
1173
- (a: T): (b: T) => R;
1174
- };
1175
-
1176
- /**
1177
- * It returns a function, which invokes only once `fn` function.
1178
- */
1179
- export function once<T extends AnyFunction, C = unknown>(fn: T, context?: C): T;
1180
-
1181
- /**
1182
- * Logical OR
1183
- */
1184
- export function or<T, U>(a: T, b: U): T | U;
1185
- export function or<T>(a: T): <U>(b: U) => T | U;
1186
-
1187
- /**
1188
- * It returns a copied **Object** or **Array** with modified value received by applying function `fn` to `lens` focus.
684
+ * `R.equals` is used to determine equality.
1189
685
  */
1190
- export function over<S, A>(lens: Lens<S, A>): {
1191
- (fn: (a: A) => A): (value: S) => S;
1192
- (fn: (a: A) => A, value: S): S;
1193
- };
1194
- export function over<S, A>(lens: Lens<S, A>, fn: (a: A) => A): (value: S) => S;
1195
- export function over<S, A>(lens: Lens<S, A>, fn: (a: A) => A, value: S): S;
686
+ export function objectIncludes<T>(specification: T): <U>(obj: U) => boolean;
1196
687
 
1197
688
  /**
1198
- * It is very similar to `R.curry`, but you can pass initial arguments when you create the curried function.
1199
- *
1200
- * `R.partial` will keep returning a function until all the arguments that the function `fn` expects are passed.
1201
- * The name comes from the fact that you partially inject the inputs.
1202
- */
1203
- export function partial<V0, V1, T>(fn: (x0: V0, x1: V1) => T, args: readonly [V0]): (x1: V1) => T;
1204
- export function partial<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: readonly [V0, V1]): (x2: V2) => T;
1205
- export function partial<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: readonly [V0]): (x1: V1, x2: V2) => T;
1206
- export function partial<V0, V1, V2, V3, T>(
1207
- fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T,
1208
- args: readonly [V0, V1, V2],
1209
- ): (x2: V3) => T;
1210
- export function partial<V0, V1, V2, V3, T>(
1211
- fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T,
1212
- args: readonly [V0, V1],
1213
- ): (x2: V2, x3: V3) => T;
1214
- export function partial<V0, V1, V2, V3, T>(
1215
- fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T,
1216
- args: readonly [V0],
1217
- ): (x1: V1, x2: V2, x3: V3) => T;
1218
- export function partial<T>(fn: (...a: readonly any[]) => T, args: readonly any[]): (...a: readonly any[]) => T;
1219
-
1220
- /**
1221
- * `R.partialObject` is a curry helper designed specifically for functions accepting object as a single argument.
1222
- *
1223
- * Initially the function knows only a part from the whole input object and then `R.partialObject` helps in preparing the function for the second part, when it receives the rest of the input.
689
+ * It returns a partial copy of an `obj` without `propsToOmit` properties.
1224
690
  */
1225
- export function partialObject<Input, PartialInput, Output>(
1226
- fn: (input: Input) => Output,
1227
- partialInput: PartialInput,
1228
- ): (input: Pick<Input, Exclude<keyof Input, keyof PartialInput>>) => Output;
691
+ export function omit<
692
+ S extends string,
693
+ Keys extends PickStringToPickPath<S>,
694
+ >(propsToPick: S): <U extends Partial<Record<ElementOf<Keys>, any>>>(obj: ElementOf<Keys> extends keyof U ? U : never) => ElementOf<Keys> extends keyof U ? MergeTypes<Omit<U, ElementOf<Keys>>> : never;
695
+ export function omit<const Keys extends readonly PropertyKey[]>(propsToPick: Keys): <U extends Partial<Record<ElementOf<Keys>, any>>>(obj: ElementOf<Keys> extends keyof U ? U : never) => ElementOf<Keys> extends keyof U ? MergeTypes<Omit<U, ElementOf<Keys>>> : never;
1229
696
 
1230
697
  /**
1231
698
  * It will return array of two objects/arrays according to `predicate` function. The first member holds all instances of `input` that pass the `predicate` function, while the second member - those who doesn't.
1232
699
  */
700
+ export function partition<T, S extends T>(
701
+ predicate: (value: T, index: number, data: ReadonlyArray<T>) => value is S,
702
+ ): (data: ReadonlyArray<T>) => readonly [ReadonlyArray<S>, ReadonlyArray<Exclude<T, S>>];
1233
703
  export function partition<T>(
1234
- predicate: Predicate<T>,
1235
- input: readonly T[]
1236
- ): readonly [readonly T[], readonly T[]];
1237
- export function partition<T>(
1238
- predicate: Predicate<T>
1239
- ): (input: readonly T[]) => readonly [readonly T[], readonly T[]];
1240
- export function partition<T>(
1241
- predicate: (x: T, prop?: string) => boolean,
1242
- input: { readonly [key: string]: T}
1243
- ): readonly [{ readonly [key: string]: T}, { readonly [key: string]: T}];
1244
- export function partition<T>(
1245
- predicate: (x: T, prop?: string) => boolean
1246
- ): (input: { readonly [key: string]: T}) => readonly [{ readonly [key: string]: T}, { readonly [key: string]: T}];
704
+ predicate: (value: T, index: number, data: ReadonlyArray<T>) => boolean,
705
+ ): (data: ReadonlyArray<T>) => readonly [ReadonlyArray<T>, ReadonlyArray<T>];
1247
706
 
1248
707
  /**
1249
708
  * If `pathToSearch` is `'a.b'` then it will return `1` if `obj` is `{a:{b:1}}`.
1250
709
  *
1251
710
  * It will return `undefined`, if such path is not found.
1252
711
  */
1253
- export function path<S, K0 extends keyof S = keyof S>(path: readonly [K0], obj: S): S[K0];
1254
- export function path<S, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0]>(path: readonly [K0, K1], obj: S): S[K0][K1];
712
+ export function path<S, K0 extends keyof S>(path: readonly [K0]): (obj: S) => S[K0];
713
+ export function path<S, K0 extends keyof S>(path: `${K0}`): (obj: S) => S[K0];
714
+ export function path<S, K0 extends keyof S, K1 extends keyof S[K0]>(path: readonly [K0, K1]): (obj: S) => S[K0][K1];
715
+ export function path<S, K0 extends keyof S, K1 extends keyof S[K0]>(path: `${K0}.${K1}`): (obj: S) => S[K0][K1];
716
+ export function path<
717
+ S,
718
+ K0 extends keyof S,
719
+ K1 extends keyof S[K0],
720
+ K2 extends keyof S[K0][K1]
721
+ >(path: readonly [K0, K1, K2]): (obj: S) => S[K0][K1][K2];
1255
722
  export function path<
1256
723
  S,
1257
- K0 extends keyof S = keyof S,
1258
- K1 extends keyof S[K0] = keyof S[K0],
1259
- K2 extends keyof S[K0][K1] = keyof S[K0][K1]
1260
- >(path: readonly [K0, K1, K2], obj: S): S[K0][K1][K2];
724
+ K0 extends keyof S,
725
+ K1 extends keyof S[K0],
726
+ K2 extends keyof S[K0][K1]
727
+ >(path: `${K0}.${K1}.${K2}`): (obj: S) => S[K0][K1][K2];
1261
728
  export function path<
1262
729
  S,
1263
- K0 extends keyof S = keyof S,
1264
- K1 extends keyof S[K0] = keyof S[K0],
1265
- K2 extends keyof S[K0][K1] = keyof S[K0][K1],
1266
- K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],
1267
- >(path: readonly [K0, K1, K2, K3], obj: S): S[K0][K1][K2][K3];
730
+ K0 extends keyof S,
731
+ K1 extends keyof S[K0],
732
+ K2 extends keyof S[K0][K1],
733
+ K3 extends keyof S[K0][K1][K2]
734
+ >(path: readonly [K0, K1, K2, K3]): (obj: S) => S[K0][K1][K2][K3];
1268
735
  export function path<
1269
736
  S,
1270
- K0 extends keyof S = keyof S,
1271
- K1 extends keyof S[K0] = keyof S[K0],
1272
- K2 extends keyof S[K0][K1] = keyof S[K0][K1],
1273
- K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],
1274
- K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3],
737
+ K0 extends keyof S,
738
+ K1 extends keyof S[K0],
739
+ K2 extends keyof S[K0][K1],
740
+ K3 extends keyof S[K0][K1][K2]
741
+ >(path: `${K0}.${K1}.${K2}.${K3}`): (obj: S) => S[K0][K1][K2][K3];
742
+ export function path<
743
+ S,
744
+ K0 extends keyof S,
745
+ K1 extends keyof S[K0],
746
+ K2 extends keyof S[K0][K1],
747
+ K3 extends keyof S[K0][K1][K2],
748
+ K4 extends keyof S[K0][K1][K2][K3]
749
+ >(path: readonly [K0, K1, K2, K3, K4]): (obj: S) => S[K0][K1][K2][K3][K4];
750
+ export function path<
751
+ S,
752
+ K0 extends keyof S,
753
+ K1 extends keyof S[K0],
754
+ K2 extends keyof S[K0][K1],
755
+ K3 extends keyof S[K0][K1][K2],
756
+ K4 extends keyof S[K0][K1][K2][K3]
757
+ >(path: `${K0}.${K1}.${K2}.${K3}.${K4}`): (obj: S) => S[K0][K1][K2][K3][K4];
758
+ export function path<
759
+ S,
760
+ K0 extends keyof S,
761
+ K1 extends keyof S[K0],
762
+ K2 extends keyof S[K0][K1],
763
+ K3 extends keyof S[K0][K1][K2],
764
+ K4 extends keyof S[K0][K1][K2][K3]
1275
765
  >(path: readonly [K0, K1, K2, K3, K4], obj: S): S[K0][K1][K2][K3][K4];
1276
766
  export function path<
1277
767
  S,
1278
- K0 extends keyof S = keyof S,
1279
- K1 extends keyof S[K0] = keyof S[K0],
1280
- K2 extends keyof S[K0][K1] = keyof S[K0][K1],
1281
- K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],
1282
- K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3],
1283
- K5 extends keyof S[K0][K1][K2][K3][K4] = keyof S[K0][K1][K2][K3][K4],
768
+ K0 extends keyof S,
769
+ K1 extends keyof S[K0],
770
+ K2 extends keyof S[K0][K1],
771
+ K3 extends keyof S[K0][K1][K2],
772
+ K4 extends keyof S[K0][K1][K2][K3],
773
+ K5 extends keyof S[K0][K1][K2][K3][K4]
774
+ >(path: readonly [K0, K1, K2, K3, K4, K5]): (obj: S) => S[K0][K1][K2][K3][K4][K5];
775
+ export function path<
776
+ S,
777
+ K0 extends keyof S,
778
+ K1 extends keyof S[K0],
779
+ K2 extends keyof S[K0][K1],
780
+ K3 extends keyof S[K0][K1][K2],
781
+ K4 extends keyof S[K0][K1][K2][K3],
782
+ K5 extends keyof S[K0][K1][K2][K3][K4]
783
+ >(path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}`): (obj: S) => S[K0][K1][K2][K3][K4][K5];
784
+ export function path<
785
+ S,
786
+ K0 extends keyof S,
787
+ K1 extends keyof S[K0],
788
+ K2 extends keyof S[K0][K1],
789
+ K3 extends keyof S[K0][K1][K2],
790
+ K4 extends keyof S[K0][K1][K2][K3],
791
+ K5 extends keyof S[K0][K1][K2][K3][K4]
1284
792
  >(path: readonly [K0, K1, K2, K3, K4, K5], obj: S): S[K0][K1][K2][K3][K4][K5];
1285
- export function path<T>(pathToSearch: string, obj: any): T | undefined;
1286
- export function path<T>(pathToSearch: string): (obj: any) => T | undefined;
1287
- export function path<T>(pathToSearch: RamdaPath): (obj: any) => T | undefined;
1288
- export function path<T>(pathToSearch: RamdaPath, obj: any): T | undefined;
793
+ export function path<
794
+ S,
795
+ K0 extends keyof S,
796
+ K1 extends keyof S[K0],
797
+ K2 extends keyof S[K0][K1],
798
+ K3 extends keyof S[K0][K1][K2],
799
+ K4 extends keyof S[K0][K1][K2][K3],
800
+ K5 extends keyof S[K0][K1][K2][K3][K4],
801
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5]
802
+ >(path: readonly [K0, K1, K2, K3, K4, K5, K6]): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6];
803
+ export function path<
804
+ S,
805
+ K0 extends keyof S,
806
+ K1 extends keyof S[K0],
807
+ K2 extends keyof S[K0][K1],
808
+ K3 extends keyof S[K0][K1][K2],
809
+ K4 extends keyof S[K0][K1][K2][K3],
810
+ K5 extends keyof S[K0][K1][K2][K3][K4],
811
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5]
812
+ >(path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}`): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6];
813
+ export function path<
814
+ S,
815
+ K0 extends keyof S,
816
+ K1 extends keyof S[K0],
817
+ K2 extends keyof S[K0][K1],
818
+ K3 extends keyof S[K0][K1][K2],
819
+ K4 extends keyof S[K0][K1][K2][K3],
820
+ K5 extends keyof S[K0][K1][K2][K3][K4],
821
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5]
822
+ >(path: readonly [K0, K1, K2, K3, K4, K5, K6], obj: S): S[K0][K1][K2][K3][K4][K5][K6];
823
+ export function path<
824
+ S,
825
+ K0 extends keyof S,
826
+ K1 extends keyof S[K0],
827
+ K2 extends keyof S[K0][K1],
828
+ K3 extends keyof S[K0][K1][K2],
829
+ K4 extends keyof S[K0][K1][K2][K3],
830
+ K5 extends keyof S[K0][K1][K2][K3][K4],
831
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5],
832
+ K7 extends keyof S[K0][K1][K2][K3][K4][K5][K6]
833
+ >(path: readonly [K0, K1, K2, K3, K4, K5, K6, K7]): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6][K7];
834
+ export function path<
835
+ S,
836
+ K0 extends keyof S,
837
+ K1 extends keyof S[K0],
838
+ K2 extends keyof S[K0][K1],
839
+ K3 extends keyof S[K0][K1][K2],
840
+ K4 extends keyof S[K0][K1][K2][K3],
841
+ K5 extends keyof S[K0][K1][K2][K3][K4],
842
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5],
843
+ K7 extends keyof S[K0][K1][K2][K3][K4][K5][K6]
844
+ >(path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}.${K7}`): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6][K7];
845
+ export function path<
846
+ S,
847
+ K0 extends keyof S,
848
+ K1 extends keyof S[K0],
849
+ K2 extends keyof S[K0][K1],
850
+ K3 extends keyof S[K0][K1][K2],
851
+ K4 extends keyof S[K0][K1][K2][K3],
852
+ K5 extends keyof S[K0][K1][K2][K3][K4],
853
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5],
854
+ K7 extends keyof S[K0][K1][K2][K3][K4][K5][K6],
855
+ K8 extends keyof S[K0][K1][K2][K3][K4][K5][K6][K7]
856
+ >(path: readonly [K0, K1, K2, K3, K4, K5, K6, K7, K8]): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6][K7][K8];
857
+ export function path<
858
+ S,
859
+ K0 extends keyof S,
860
+ K1 extends keyof S[K0],
861
+ K2 extends keyof S[K0][K1],
862
+ K3 extends keyof S[K0][K1][K2],
863
+ K4 extends keyof S[K0][K1][K2][K3],
864
+ K5 extends keyof S[K0][K1][K2][K3][K4],
865
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5],
866
+ K7 extends keyof S[K0][K1][K2][K3][K4][K5][K6],
867
+ K8 extends keyof S[K0][K1][K2][K3][K4][K5][K6][K7]
868
+ >(path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}.${K7}.${K8}`): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6][K7][K8];
1289
869
 
1290
870
  /**
1291
- * It returns `true` if `pathToSearch` of `input` object is equal to `target` value.
871
+ * It returns a partial copy of an `input` containing only `propsToPick` properties.
1292
872
  *
1293
- * `pathToSearch` is passed to `R.path`, which means that it can be either a string or an array. Also equality between `target` and the found value is determined by `R.equals`.
1294
- */
1295
- export function pathEq(pathToSearch: Path, target: any, input: any): boolean;
1296
- export function pathEq(pathToSearch: Path, target: any): (input: any) => boolean;
1297
- export function pathEq(pathToSearch: Path): (target: any) => (input: any) => boolean;
1298
-
1299
- /**
1300
- * It reads `obj` input and returns either `R.path(pathToSearch, Record<string, unknown>)` result or `defaultValue` input.
1301
- */
1302
- export function pathOr<T>(defaultValue: T, pathToSearch: Path, obj: any): T;
1303
- export function pathOr<T>(defaultValue: T, pathToSearch: Path): (obj: any) => T;
1304
- export function pathOr<T>(defaultValue: T): (pathToSearch: Path) => (obj: any) => T;
1305
-
1306
- export function pathSatisfies<T, U>(pred: (val: T) => boolean, path: Path): (obj: U) => boolean;
1307
- export function pathSatisfies<T, U>(pred: (val: T) => boolean, path: Path, obj: U): boolean;
1308
-
1309
- /**
1310
- * It loops over members of `pathsToSearch` as `singlePath` and returns the array produced by `R.path(singlePath, Record<string, unknown>)`.
873
+ * `input` can be either an object or an array.
1311
874
  *
1312
- * Because it calls `R.path`, then `singlePath` can be either string or a list.
875
+ * String annotation of `propsToPick` is one of the differences between `Rambda` and `Ramda`.
1313
876
  */
1314
- export function paths<Input, T>(pathsToSearch: readonly Path[], obj: Input): readonly (T | undefined)[];
1315
- export function paths<Input, T>(pathsToSearch: readonly Path[]): (obj: Input) => readonly (T | undefined)[];
1316
- export function paths<T>(pathsToSearch: readonly Path[], obj: any): readonly (T | undefined)[];
1317
- export function paths<T>(pathsToSearch: readonly Path[]): (obj: any) => readonly (T | undefined)[];
877
+ export function pick<K extends PropertyKey>(propsToPick: readonly K[]): <T>(input: T) => MergeTypes<Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>>;
878
+ export function pick<
879
+ S extends string,
880
+ K extends PickStringToPickPath<K>
881
+ >(propsToPick: S): <T>(input: T) => MergeTypes<Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>>;
1318
882
 
1319
883
  /**
1320
- * It returns a partial copy of an `input` containing only `propsToPick` properties.
884
+ * It performs left-to-right function composition, where first argument is the input for the chain of functions.
1321
885
  *
1322
- * `input` can be either an object or an array.
886
+ * This is huge difference from `Ramda.pipe` where input is passed like `R.pipe(...fns)(input)`.
887
+ * Here we have `R.pipe(input, ...fns)`.
1323
888
  *
1324
- * String annotation of `propsToPick` is one of the differences between `Rambda` and `Ramda`.
1325
- */
1326
- export function pick<T, K extends string | number | symbol>(propsToPick: readonly K[], input: T): Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>;
1327
- export function pick<K extends string | number | symbol>(propsToPick: readonly K[]): <T>(input: T) => Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>;
1328
- export function pick<T, U>(propsToPick: string, input: T): U;
1329
- export function pick<T, U>(propsToPick: string): (input: T) => U;
1330
- export function pick<T>(propsToPick: string, input: object): T;
1331
- export function pick<T>(propsToPick: string): (input: object) => T;
1332
-
1333
- /**
1334
- * Same as `R.pick` but it won't skip the missing props, i.e. it will assign them to `undefined`.
1335
- */
1336
- export function pickAll<T, K extends keyof T>(propsToPicks: readonly K[], input: T): Pick<T, K>;
1337
- export function pickAll<T, U>(propsToPicks: readonly string[], input: T): U;
1338
- export function pickAll(propsToPicks: readonly string[]): <T, U>(input: T) => U;
1339
- export function pickAll<T, U>(propsToPick: string, input: T): U;
1340
- export function pickAll<T, U>(propsToPick: string): (input: T) => U;
1341
-
1342
- export function pickBy<T>(pred: ObjPred<T>): <U, V extends T>(obj: V) => U;
1343
- export function pickBy<T, U>(pred: ObjPred<T>, obj: T): U;
1344
-
1345
- /**
1346
- * It performs left-to-right function composition.
1347
- */
1348
- export function pipe<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6, R7, TResult>(
1349
- ...funcs: readonly [
1350
- f1: (...args: TArgs) => R1,
1351
- f2: (a: R1) => R2,
1352
- f3: (a: R2) => R3,
1353
- f4: (a: R3) => R4,
1354
- f5: (a: R4) => R5,
1355
- f6: (a: R5) => R6,
1356
- f7: (a: R6) => R7,
1357
- ...func: ReadonlyArray<(a: any) => any>,
1358
- fnLast: (a: any) => TResult
1359
- ]
1360
- ): (...args: TArgs) => TResult; // fallback overload if number of piped functions greater than 7
1361
- export function pipe<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6, R7>(
1362
- f1: (...args: TArgs) => R1,
1363
- f2: (a: R1) => R2,
1364
- f3: (a: R2) => R3,
1365
- f4: (a: R3) => R4,
1366
- f5: (a: R4) => R5,
1367
- f6: (a: R5) => R6,
1368
- f7: (a: R6) => R7
1369
- ): (...args: TArgs) => R7;
1370
- export function pipe<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6>(
1371
- f1: (...args: TArgs) => R1,
1372
- f2: (a: R1) => R2,
1373
- f3: (a: R2) => R3,
1374
- f4: (a: R3) => R4,
1375
- f5: (a: R4) => R5,
1376
- f6: (a: R5) => R6
1377
- ): (...args: TArgs) => R6;
1378
- export function pipe<TArgs extends readonly any[], R1, R2, R3, R4, R5>(
1379
- f1: (...args: TArgs) => R1,
1380
- f2: (a: R1) => R2,
1381
- f3: (a: R2) => R3,
1382
- f4: (a: R3) => R4,
1383
- f5: (a: R4) => R5
1384
- ): (...args: TArgs) => R5;
1385
- export function pipe<TArgs extends readonly any[], R1, R2, R3, R4>(
1386
- f1: (...args: TArgs) => R1,
1387
- f2: (a: R1) => R2,
1388
- f3: (a: R2) => R3,
1389
- f4: (a: R3) => R4
1390
- ): (...args: TArgs) => R4;
1391
- export function pipe<TArgs extends readonly any[], R1, R2, R3>(
1392
- f1: (...args: TArgs) => R1,
1393
- f2: (a: R1) => R2,
1394
- f3: (a: R2) => R3
1395
- ): (...args: TArgs) => R3;
1396
- export function pipe<TArgs extends readonly any[], R1, R2>(
1397
- f1: (...args: TArgs) => R1,
1398
- f2: (a: R1) => R2
1399
- ): (...args: TArgs) => R2;
1400
- export function pipe<TArgs extends readonly any[], R1>(
1401
- f1: (...args: TArgs) => R1
1402
- ): (...args: TArgs) => R1;
889
+ * It has much better TypeScript support than `Ramda.pipe` and this is the reason why `Rambda` goes in this direction.
890
+ */
891
+ export function pipe<A, B>(value: A, op1: (input: A) => B): B;
892
+ export function pipe<A, B, C>(
893
+ value: A,
894
+ op1: (input: A) => B,
895
+ op2: (input: B) => C,
896
+ ): C;
897
+ export function pipe<A, B, C, D>(
898
+ value: A,
899
+ op1: (input: A) => B,
900
+ op2: (input: B) => C,
901
+ op3: (input: C) => D,
902
+ ): D;
903
+ export function pipe<A, B, C, D, E>(
904
+ value: A,
905
+ op1: (input: A) => B,
906
+ op2: (input: B) => C,
907
+ op3: (input: C) => D,
908
+ op4: (input: D) => E,
909
+ ): E;
910
+ export function pipe<A, B, C, D, E, F>(
911
+ value: A,
912
+ op1: (input: A) => B,
913
+ op2: (input: B) => C,
914
+ op3: (input: C) => D,
915
+ op4: (input: D) => E,
916
+ op5: (input: E) => F,
917
+ ): F;
918
+ export function pipe<A, B, C, D, E, F, G>(
919
+ value: A,
920
+ op1: (input: A) => B,
921
+ op2: (input: B) => C,
922
+ op3: (input: C) => D,
923
+ op4: (input: D) => E,
924
+ op5: (input: E) => F,
925
+ op6: (input: F) => G,
926
+ ): G;
927
+ export function pipe<A, B, C, D, E, F, G, H>(
928
+ value: A,
929
+ op1: (input: A) => B,
930
+ op2: (input: B) => C,
931
+ op3: (input: C) => D,
932
+ op4: (input: D) => E,
933
+ op5: (input: E) => F,
934
+ op6: (input: F) => G,
935
+ op7: (input: G) => H,
936
+ ): H;
937
+ export function pipe<A, B, C, D, E, F, G, H, I>(
938
+ value: A,
939
+ op1: (input: A) => B,
940
+ op2: (input: B) => C,
941
+ op3: (input: C) => D,
942
+ op4: (input: D) => E,
943
+ op5: (input: E) => F,
944
+ op6: (input: F) => G,
945
+ op7: (input: G) => H,
946
+ op8: (input: H) => I,
947
+ ): I;
948
+ export function pipe<A, B, C, D, E, F, G, H, I, J>(
949
+ value: A,
950
+ op1: (input: A) => B,
951
+ op2: (input: B) => C,
952
+ op3: (input: C) => D,
953
+ op4: (input: D) => E,
954
+ op5: (input: E) => F,
955
+ op6: (input: F) => G,
956
+ op7: (input: G) => H,
957
+ op8: (input: H) => I,
958
+ op9: (input: I) => J,
959
+ ): J;
960
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K>(
961
+ value: A,
962
+ op01: (input: A) => B,
963
+ op02: (input: B) => C,
964
+ op03: (input: C) => D,
965
+ op04: (input: D) => E,
966
+ op05: (input: E) => F,
967
+ op06: (input: F) => G,
968
+ op07: (input: G) => H,
969
+ op08: (input: H) => I,
970
+ op09: (input: I) => J,
971
+ op10: (input: J) => K,
972
+ ): K;
973
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L>(
974
+ value: A,
975
+ op01: (input: A) => B,
976
+ op02: (input: B) => C,
977
+ op03: (input: C) => D,
978
+ op04: (input: D) => E,
979
+ op05: (input: E) => F,
980
+ op06: (input: F) => G,
981
+ op07: (input: G) => H,
982
+ op08: (input: H) => I,
983
+ op09: (input: I) => J,
984
+ op10: (input: J) => K,
985
+ op11: (input: K) => L,
986
+ ): L;
987
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M>(
988
+ value: A,
989
+ op01: (input: A) => B,
990
+ op02: (input: B) => C,
991
+ op03: (input: C) => D,
992
+ op04: (input: D) => E,
993
+ op05: (input: E) => F,
994
+ op06: (input: F) => G,
995
+ op07: (input: G) => H,
996
+ op08: (input: H) => I,
997
+ op09: (input: I) => J,
998
+ op10: (input: J) => K,
999
+ op11: (input: K) => L,
1000
+ op12: (input: L) => M,
1001
+ ): M;
1002
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N>(
1003
+ value: A,
1004
+ op01: (input: A) => B,
1005
+ op02: (input: B) => C,
1006
+ op03: (input: C) => D,
1007
+ op04: (input: D) => E,
1008
+ op05: (input: E) => F,
1009
+ op06: (input: F) => G,
1010
+ op07: (input: G) => H,
1011
+ op08: (input: H) => I,
1012
+ op09: (input: I) => J,
1013
+ op10: (input: J) => K,
1014
+ op11: (input: K) => L,
1015
+ op12: (input: L) => M,
1016
+ op13: (input: M) => N,
1017
+ ): N;
1018
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(
1019
+ value: A,
1020
+ op01: (input: A) => B,
1021
+ op02: (input: B) => C,
1022
+ op03: (input: C) => D,
1023
+ op04: (input: D) => E,
1024
+ op05: (input: E) => F,
1025
+ op06: (input: F) => G,
1026
+ op07: (input: G) => H,
1027
+ op08: (input: H) => I,
1028
+ op09: (input: I) => J,
1029
+ op10: (input: J) => K,
1030
+ op11: (input: K) => L,
1031
+ op12: (input: L) => M,
1032
+ op13: (input: M) => N,
1033
+ op14: (input: N) => O,
1034
+ ): O;
1035
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>(
1036
+ value: A,
1037
+ op01: (input: A) => B,
1038
+ op02: (input: B) => C,
1039
+ op03: (input: C) => D,
1040
+ op04: (input: D) => E,
1041
+ op05: (input: E) => F,
1042
+ op06: (input: F) => G,
1043
+ op07: (input: G) => H,
1044
+ op08: (input: H) => I,
1045
+ op09: (input: I) => J,
1046
+ op10: (input: J) => K,
1047
+ op11: (input: K) => L,
1048
+ op12: (input: L) => M,
1049
+ op13: (input: M) => N,
1050
+ op14: (input: N) => O,
1051
+ op15: (input: O) => P,
1052
+ ): P;
1053
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q>(
1054
+ value: A,
1055
+ op01: (input: A) => B,
1056
+ op02: (input: B) => C,
1057
+ op03: (input: C) => D,
1058
+ op04: (input: D) => E,
1059
+ op05: (input: E) => F,
1060
+ op06: (input: F) => G,
1061
+ op07: (input: G) => H,
1062
+ op08: (input: H) => I,
1063
+ op09: (input: I) => J,
1064
+ op10: (input: J) => K,
1065
+ op11: (input: K) => L,
1066
+ op12: (input: L) => M,
1067
+ op13: (input: M) => N,
1068
+ op14: (input: N) => O,
1069
+ op15: (input: O) => P,
1070
+ op16: (input: P) => Q,
1071
+ ): Q;
1072
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R>(
1073
+ value: A,
1074
+ op01: (input: A) => B,
1075
+ op02: (input: B) => C,
1076
+ op03: (input: C) => D,
1077
+ op04: (input: D) => E,
1078
+ op05: (input: E) => F,
1079
+ op06: (input: F) => G,
1080
+ op07: (input: G) => H,
1081
+ op08: (input: H) => I,
1082
+ op09: (input: I) => J,
1083
+ op10: (input: J) => K,
1084
+ op11: (input: K) => L,
1085
+ op12: (input: L) => M,
1086
+ op13: (input: M) => N,
1087
+ op14: (input: N) => O,
1088
+ op15: (input: O) => P,
1089
+ op16: (input: P) => Q,
1090
+ op17: (input: Q) => R,
1091
+ ): R;
1092
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S>(
1093
+ value: A,
1094
+ op01: (input: A) => B,
1095
+ op02: (input: B) => C,
1096
+ op03: (input: C) => D,
1097
+ op04: (input: D) => E,
1098
+ op05: (input: E) => F,
1099
+ op06: (input: F) => G,
1100
+ op07: (input: G) => H,
1101
+ op08: (input: H) => I,
1102
+ op09: (input: I) => J,
1103
+ op10: (input: J) => K,
1104
+ op11: (input: K) => L,
1105
+ op12: (input: L) => M,
1106
+ op13: (input: M) => N,
1107
+ op14: (input: N) => O,
1108
+ op15: (input: O) => P,
1109
+ op16: (input: P) => Q,
1110
+ op17: (input: Q) => R,
1111
+ op18: (input: R) => S,
1112
+ ): S;
1113
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>(
1114
+ value: A,
1115
+ op01: (input: A) => B,
1116
+ op02: (input: B) => C,
1117
+ op03: (input: C) => D,
1118
+ op04: (input: D) => E,
1119
+ op05: (input: E) => F,
1120
+ op06: (input: F) => G,
1121
+ op07: (input: G) => H,
1122
+ op08: (input: H) => I,
1123
+ op09: (input: I) => J,
1124
+ op10: (input: J) => K,
1125
+ op11: (input: K) => L,
1126
+ op12: (input: L) => M,
1127
+ op13: (input: M) => N,
1128
+ op14: (input: N) => O,
1129
+ op15: (input: O) => P,
1130
+ op16: (input: P) => Q,
1131
+ op17: (input: Q) => R,
1132
+ op18: (input: R) => S,
1133
+ op19: (input: S) => T,
1134
+ ): T;
1135
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U>(
1136
+ value: A,
1137
+ op01: (input: A) => B,
1138
+ op02: (input: B) => C,
1139
+ op03: (input: C) => D,
1140
+ op04: (input: D) => E,
1141
+ op05: (input: E) => F,
1142
+ op06: (input: F) => G,
1143
+ op07: (input: G) => H,
1144
+ op08: (input: H) => I,
1145
+ op09: (input: I) => J,
1146
+ op10: (input: J) => K,
1147
+ op11: (input: K) => L,
1148
+ op12: (input: L) => M,
1149
+ op13: (input: M) => N,
1150
+ op14: (input: N) => O,
1151
+ op15: (input: O) => P,
1152
+ op16: (input: P) => Q,
1153
+ op17: (input: Q) => R,
1154
+ op18: (input: R) => S,
1155
+ op19: (input: S) => T,
1156
+ op20: (input: T) => U,
1157
+ ): U;
1158
+
1159
+ /**
1160
+ * It accepts input as first argument and series of functions as next arguments. It is same as `R.pipe` but with support for asynchronous functions.
1161
+ */
1162
+ export function pipeAsync<A, B>(input: A, fn0: (x: Awaited<A>) => B) : B;
1163
+ export function pipeAsync<A, B, C>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C) : C;
1164
+ export function pipeAsync<A, B, C, D>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D) : D;
1165
+ export function pipeAsync<A, B, C, D, E>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E) : E;
1166
+ export function pipeAsync<A, B, C, D, E, F>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E, fn4: (x: Awaited<E>) => F) : F;
1167
+ export function pipeAsync<A, B, C, D, E, F, G>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E, fn4: (x: Awaited<E>) => F, fn5: (x: Awaited<F>) => G) : G;
1168
+ export function pipeAsync<A, B, C, D, E, F, G, H>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E, fn4: (x: Awaited<E>) => F, fn5: (x: Awaited<F>) => G, fn6: (x: Awaited<G>) => H) : H;
1169
+ export function pipeAsync<A, B, C, D, E, F, G, H, I>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E, fn4: (x: Awaited<E>) => F, fn5: (x: Awaited<F>) => G, fn6: (x: Awaited<G>) => H, fn7: (x: Awaited<H>) => I) : I;
1170
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J>(
1171
+ input: A,
1172
+ fn0: (x: Awaited<A>) => B,
1173
+ fn1: (x: Awaited<B>) => C,
1174
+ fn2: (x: Awaited<C>) => D,
1175
+ fn3: (x: Awaited<D>) => E,
1176
+ fn4: (x: Awaited<E>) => F,
1177
+ fn5: (x: Awaited<F>) => G,
1178
+ fn6: (x: Awaited<G>) => H,
1179
+ fn7: (x: Awaited<H>) => I,
1180
+ fn8: (x: Awaited<I>) => J,
1181
+ ) : J;
1182
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K>(
1183
+ input: A,
1184
+ fn0: (x: Awaited<A>) => B,
1185
+ fn1: (x: Awaited<B>) => C,
1186
+ fn2: (x: Awaited<C>) => D,
1187
+ fn3: (x: Awaited<D>) => E,
1188
+ fn4: (x: Awaited<E>) => F,
1189
+ fn5: (x: Awaited<F>) => G,
1190
+ fn6: (x: Awaited<G>) => H,
1191
+ fn7: (x: Awaited<H>) => I,
1192
+ fn8: (x: Awaited<I>) => J,
1193
+ fn9: (x: Awaited<J>) => K,
1194
+ ): K;
1195
+
1196
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L>(
1197
+ input: A,
1198
+ fn0: (x: Awaited<A>) => B,
1199
+ fn1: (x: Awaited<B>) => C,
1200
+ fn2: (x: Awaited<C>) => D,
1201
+ fn3: (x: Awaited<D>) => E,
1202
+ fn4: (x: Awaited<E>) => F,
1203
+ fn5: (x: Awaited<F>) => G,
1204
+ fn6: (x: Awaited<G>) => H,
1205
+ fn7: (x: Awaited<H>) => I,
1206
+ fn8: (x: Awaited<I>) => J,
1207
+ fn9: (x: Awaited<J>) => K,
1208
+ fn10: (x: Awaited<K>) => L,
1209
+ ): L;
1210
+
1211
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M>(
1212
+ input: A,
1213
+ fn0: (x: Awaited<A>) => B,
1214
+ fn1: (x: Awaited<B>) => C,
1215
+ fn2: (x: Awaited<C>) => D,
1216
+ fn3: (x: Awaited<D>) => E,
1217
+ fn4: (x: Awaited<E>) => F,
1218
+ fn5: (x: Awaited<F>) => G,
1219
+ fn6: (x: Awaited<G>) => H,
1220
+ fn7: (x: Awaited<H>) => I,
1221
+ fn8: (x: Awaited<I>) => J,
1222
+ fn9: (x: Awaited<J>) => K,
1223
+ fn10: (x: Awaited<K>) => L,
1224
+ fn11: (x: Awaited<L>) => M,
1225
+ ): M;
1226
+
1227
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N>(
1228
+ input: A,
1229
+ fn0: (x: Awaited<A>) => B,
1230
+ fn1: (x: Awaited<B>) => C,
1231
+ fn2: (x: Awaited<C>) => D,
1232
+ fn3: (x: Awaited<D>) => E,
1233
+ fn4: (x: Awaited<E>) => F,
1234
+ fn5: (x: Awaited<F>) => G,
1235
+ fn6: (x: Awaited<G>) => H,
1236
+ fn7: (x: Awaited<H>) => I,
1237
+ fn8: (x: Awaited<I>) => J,
1238
+ fn9: (x: Awaited<J>) => K,
1239
+ fn10: (x: Awaited<K>) => L,
1240
+ fn11: (x: Awaited<L>) => M,
1241
+ fn12: (x: Awaited<M>) => N,
1242
+ ): N;
1243
+
1244
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(
1245
+ input: A,
1246
+ fn0: (x: Awaited<A>) => B,
1247
+ fn1: (x: Awaited<B>) => C,
1248
+ fn2: (x: Awaited<C>) => D,
1249
+ fn3: (x: Awaited<D>) => E,
1250
+ fn4: (x: Awaited<E>) => F,
1251
+ fn5: (x: Awaited<F>) => G,
1252
+ fn6: (x: Awaited<G>) => H,
1253
+ fn7: (x: Awaited<H>) => I,
1254
+ fn8: (x: Awaited<I>) => J,
1255
+ fn9: (x: Awaited<J>) => K,
1256
+ fn10: (x: Awaited<K>) => L,
1257
+ fn11: (x: Awaited<L>) => M,
1258
+ fn12: (x: Awaited<M>) => N,
1259
+ fn13: (x: Awaited<N>) => O,
1260
+ ): O;
1261
+
1262
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>(
1263
+ input: A,
1264
+ fn0: (x: Awaited<A>) => B,
1265
+ fn1: (x: Awaited<B>) => C,
1266
+ fn2: (x: Awaited<C>) => D,
1267
+ fn3: (x: Awaited<D>) => E,
1268
+ fn4: (x: Awaited<E>) => F,
1269
+ fn5: (x: Awaited<F>) => G,
1270
+ fn6: (x: Awaited<G>) => H,
1271
+ fn7: (x: Awaited<H>) => I,
1272
+ fn8: (x: Awaited<I>) => J,
1273
+ fn9: (x: Awaited<J>) => K,
1274
+ fn10: (x: Awaited<K>) => L,
1275
+ fn11: (x: Awaited<L>) => M,
1276
+ fn12: (x: Awaited<M>) => N,
1277
+ fn13: (x: Awaited<N>) => O,
1278
+ fn14: (x: Awaited<O>) => P,
1279
+ ): P;
1280
+
1281
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q>(
1282
+ input: A,
1283
+ fn0: (x: Awaited<A>) => B,
1284
+ fn1: (x: Awaited<B>) => C,
1285
+ fn2: (x: Awaited<C>) => D,
1286
+ fn3: (x: Awaited<D>) => E,
1287
+ fn4: (x: Awaited<E>) => F,
1288
+ fn5: (x: Awaited<F>) => G,
1289
+ fn6: (x: Awaited<G>) => H,
1290
+ fn7: (x: Awaited<H>) => I,
1291
+ fn8: (x: Awaited<I>) => J,
1292
+ fn9: (x: Awaited<J>) => K,
1293
+ fn10: (x: Awaited<K>) => L,
1294
+ fn11: (x: Awaited<L>) => M,
1295
+ fn12: (x: Awaited<M>) => N,
1296
+ fn13: (x: Awaited<N>) => O,
1297
+ fn14: (x: Awaited<O>) => P,
1298
+ fn15: (x: Awaited<P>) => Q,
1299
+ ): Q;
1300
+
1301
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R>(
1302
+ input: A,
1303
+ fn0: (x: Awaited<A>) => B,
1304
+ fn1: (x: Awaited<B>) => C,
1305
+ fn2: (x: Awaited<C>) => D,
1306
+ fn3: (x: Awaited<D>) => E,
1307
+ fn4: (x: Awaited<E>) => F,
1308
+ fn5: (x: Awaited<F>) => G,
1309
+ fn6: (x: Awaited<G>) => H,
1310
+ fn7: (x: Awaited<H>) => I,
1311
+ fn8: (x: Awaited<I>) => J,
1312
+ fn9: (x: Awaited<J>) => K,
1313
+ fn10: (x: Awaited<K>) => L,
1314
+ fn11: (x: Awaited<L>) => M,
1315
+ fn12: (x: Awaited<M>) => N,
1316
+ fn13: (x: Awaited<N>) => O,
1317
+ fn14: (x: Awaited<O>) => P,
1318
+ fn15: (x: Awaited<P>) => Q,
1319
+ fn16: (x: Awaited<Q>) => R,
1320
+ ): R;
1321
+
1322
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S>(
1323
+ input: A,
1324
+ fn0: (x: Awaited<A>) => B,
1325
+ fn1: (x: Awaited<B>) => C,
1326
+ fn2: (x: Awaited<C>) => D,
1327
+ fn3: (x: Awaited<D>) => E,
1328
+ fn4: (x: Awaited<E>) => F,
1329
+ fn5: (x: Awaited<F>) => G,
1330
+ fn6: (x: Awaited<G>) => H,
1331
+ fn7: (x: Awaited<H>) => I,
1332
+ fn8: (x: Awaited<I>) => J,
1333
+ fn9: (x: Awaited<J>) => K,
1334
+ fn10: (x: Awaited<K>) => L,
1335
+ fn11: (x: Awaited<L>) => M,
1336
+ fn12: (x: Awaited<M>) => N,
1337
+ fn13: (x: Awaited<N>) => O,
1338
+ fn14: (x: Awaited<O>) => P,
1339
+ fn15: (x: Awaited<P>) => Q,
1340
+ fn16: (x: Awaited<Q>) => R,
1341
+ fn17: (x: Awaited<R>) => S,
1342
+ ): S;
1343
+
1344
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>(
1345
+ input: A,
1346
+ fn0: (x: Awaited<A>) => B,
1347
+ fn1: (x: Awaited<B>) => C,
1348
+ fn2: (x: Awaited<C>) => D,
1349
+ fn3: (x: Awaited<D>) => E,
1350
+ fn4: (x: Awaited<E>) => F,
1351
+ fn5: (x: Awaited<F>) => G,
1352
+ fn6: (x: Awaited<G>) => H,
1353
+ fn7: (x: Awaited<H>) => I,
1354
+ fn8: (x: Awaited<I>) => J,
1355
+ fn9: (x: Awaited<J>) => K,
1356
+ fn10: (x: Awaited<K>) => L,
1357
+ fn11: (x: Awaited<L>) => M,
1358
+ fn12: (x: Awaited<M>) => N,
1359
+ fn13: (x: Awaited<N>) => O,
1360
+ fn14: (x: Awaited<O>) => P,
1361
+ fn15: (x: Awaited<P>) => Q,
1362
+ fn16: (x: Awaited<Q>) => R,
1363
+ fn17: (x: Awaited<R>) => S,
1364
+ fn18: (x: Awaited<S>) => T,
1365
+ ): T;
1366
+
1367
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U>(
1368
+ input: A,
1369
+ fn0: (x: Awaited<A>) => B,
1370
+ fn1: (x: Awaited<B>) => C,
1371
+ fn2: (x: Awaited<C>) => D,
1372
+ fn3: (x: Awaited<D>) => E,
1373
+ fn4: (x: Awaited<E>) => F,
1374
+ fn5: (x: Awaited<F>) => G,
1375
+ fn6: (x: Awaited<G>) => H,
1376
+ fn7: (x: Awaited<H>) => I,
1377
+ fn8: (x: Awaited<I>) => J,
1378
+ fn9: (x: Awaited<J>) => K,
1379
+ fn10: (x: Awaited<K>) => L,
1380
+ fn11: (x: Awaited<L>) => M,
1381
+ fn12: (x: Awaited<M>) => N,
1382
+ fn13: (x: Awaited<N>) => O,
1383
+ fn14: (x: Awaited<O>) => P,
1384
+ fn15: (x: Awaited<P>) => Q,
1385
+ fn16: (x: Awaited<Q>) => R,
1386
+ fn17: (x: Awaited<R>) => S,
1387
+ fn18: (x: Awaited<S>) => T,
1388
+ fn19: (x: Awaited<T>) => U,
1389
+ ): U;
1403
1390
 
1404
1391
  /**
1405
1392
  * It returns list of the values of `property` taken from the all objects inside `list`.
1393
+ * Basically, this is `R.map(R.prop(property))`.
1406
1394
  */
1407
- export function pluck<K extends keyof T, T>(property: K, list: readonly T[]): readonly T[K][];
1408
- export function pluck<T>(property: number, list: readonly { readonly [k: number]: T }[]): readonly T[];
1409
- export function pluck<P extends string>(property: P): <T>(list: readonly Record<P, T>[]) => readonly T[];
1410
- export function pluck(property: number): <T>(list: readonly { readonly [k: number]: T }[]) => readonly T[];
1395
+ export function pluck<T, K extends keyof T>(property: K): (list: readonly T[]) => readonly T[K][];
1411
1396
 
1412
1397
  /**
1413
1398
  * It adds element `x` at the beginning of `list`.
1414
1399
  */
1415
1400
  export function prepend<T>(xToPrepend: T, iterable: readonly T[]): readonly T[];
1416
- export function prepend<T, U>(xToPrepend: T, iterable: readonly IsFirstSubtypeOfSecond<T, U>[]) : readonly U[];
1417
- export function prepend<T>(xToPrepend: T): <U>(iterable: readonly IsFirstSubtypeOfSecond<T, U>[]) => readonly U[];
1418
1401
  export function prepend<T>(xToPrepend: T): (iterable: readonly T[]) => readonly T[];
1419
1402
 
1420
- export function product(list: readonly number[]): number;
1421
-
1422
1403
  /**
1423
1404
  * It returns the value of property `propToFind` in `obj`.
1424
1405
  *
1425
1406
  * If there is no such property, it returns `undefined`.
1426
1407
  */
1427
- export function prop<_, P extends keyof never, T>(p: P, value: T): Prop<T, P>;
1428
- export function prop<V>(p: keyof never, value: unknown): V;
1429
- export function prop<_, P extends keyof never>(p: P): <T>(value: T) => Prop<T, P>;
1430
- export function prop<V>(p: keyof never): (value: unknown) => V;
1408
+ export function prop<K extends PropertyKey>(prop: K): <U extends { readonly [P in K]?: unknown }>(obj: U) => U[K];
1409
+ export function prop<K extends keyof U, U>(prop: K, obj: U): U[K];
1431
1410
 
1432
1411
  /**
1433
1412
  * It returns true if `obj` has property `propToFind` and its value is equal to `valueToMatch`.
1434
1413
  */
1435
- export function propEq<K extends string | number>(valueToMatch: any, propToFind: K, obj: Record<K, any>): boolean;
1436
- export function propEq<K extends string | number>(valueToMatch: any, propToFind: K): (obj: Record<K, any>) => boolean;
1437
- export function propEq(valueToMatch: any): {
1438
- <K extends string | number>(propToFind: K, obj: Record<K, any>): boolean;
1439
- <K extends string | number>(propToFind: K): (obj: Record<K, any>) => boolean;
1440
- };
1441
-
1442
- /**
1443
- * It returns `true` if `property` of `obj` is from `target` type.
1444
- */
1445
- export function propIs<C extends AnyFunction, K extends keyof any>(type: C, name: K, obj: any): obj is Record<K, ReturnType<C>>;
1446
- export function propIs<C extends AnyConstructor, K extends keyof any>(type: C, name: K, obj: any): obj is Record<K, InstanceType<C>>;
1447
- export function propIs<C extends AnyFunction, K extends keyof any>(type: C, name: K): (obj: any) => obj is Record<K, ReturnType<C>>;
1448
- export function propIs<C extends AnyConstructor, K extends keyof any>(type: C, name: K): (obj: any) => obj is Record<K, InstanceType<C>>;
1449
- export function propIs<C extends AnyFunction>(type: C): {
1450
- <K extends keyof any>(name: K, obj: any): obj is Record<K, ReturnType<C>>;
1451
- <K extends keyof any>(name: K): (obj: any) => obj is Record<K, ReturnType<C>>;
1414
+ export function propEq<T>(val: T): {
1415
+ <K extends PropertyKey>(name: K): (obj: Record<K, T>) => boolean;
1416
+ <K extends PropertyKey>(name: K, obj: Record<K, T>): boolean;
1452
1417
  };
1418
+ export function propEq<T, K extends PropertyKey>(val: T, name: K): (obj: Record<K, T>) => boolean;
1419
+ export function propEq<K extends keyof U, U>(val: U[K], name: K, obj: U): boolean;
1453
1420
 
1454
- /**
1455
- * It returns either `defaultValue` or the value of `property` in `obj`.
1456
- */
1457
- export function propOr<T, P extends string>(defaultValue: T, property: P, obj: Partial<Record<P, T>> | undefined): T;
1458
- export function propOr<T, P extends string>(defaultValue: T, property: P): (obj: Partial<Record<P, T>> | undefined) => T;
1459
- export function propOr<T>(defaultValue: T): {
1460
- <P extends string>(property: P, obj: Partial<Record<P, T>> | undefined): T;
1461
- <P extends string>(property: P): (obj: Partial<Record<P, T>> | undefined) => T;
1462
- }
1421
+ export function propOr<T, P extends string>(defaultValue: T, property: P): (obj: Partial<Record<P, T>>) => T;
1463
1422
 
1464
1423
  /**
1465
1424
  * It returns `true` if the object property satisfies a given predicate.
1466
1425
  */
1467
- export function propSatisfies<T>(predicate: Predicate<T>, property: string, obj: Record<string, T>): boolean;
1468
- export function propSatisfies<T>(predicate: Predicate<T>, property: string): (obj: Record<string, T>) => boolean;
1469
-
1470
- /**
1471
- * It takes list with properties `propsToPick` and returns a list with property values in `obj`.
1472
- */
1473
- export function props<P extends string, T>(propsToPick: readonly P[], obj: Record<P, T>): readonly T[];
1474
- export function props<P extends string>(propsToPick: readonly P[]): <T>(obj: Record<P, T>) => readonly T[];
1475
- export function props<P extends string, T>(propsToPick: readonly P[]): (obj: Record<P, T>) => readonly T[];
1426
+ export function propSatisfies<T>(predicate: (x: T) => boolean, property: string): (obj: Record<PropertyKey, T>) => boolean;
1476
1427
 
1477
1428
  /**
1478
1429
  * It returns list of numbers between `startInclusive` to `endExclusive` markers.
1479
1430
  */
1480
- export function range(startInclusive: number, endExclusive: number): readonly number[];
1481
1431
  export function range(startInclusive: number): (endExclusive: number) => readonly number[];
1482
1432
 
1483
- export function reduce<T, TResult>(reducer: (prev: TResult, current: T, i: number) => TResult, initialValue: TResult, list: readonly T[]): TResult;
1484
- export function reduce<T, TResult>(reducer: (prev: TResult, current: T) => TResult, initialValue: TResult, list: readonly T[]): TResult;
1485
- export function reduce<T, TResult>(reducer: (prev: TResult, current: T, i: number) => TResult): (initialValue: TResult, list: readonly T[]) => TResult;
1486
1433
  export function reduce<T, TResult>(reducer: (prev: TResult, current: T, i: number) => TResult, initialValue: TResult): (list: readonly T[]) => TResult;
1487
1434
 
1488
- export function reduceBy<T, TResult>(
1489
- valueFn: (acc: TResult, elem: T) => TResult,
1490
- ): (a: TResult, b: (elem: T) => string, c: readonly T[]) => { readonly [index: string]: TResult }
1491
- export function reduceBy<T, TResult>(
1492
- valueFn: (acc: TResult, elem: T) => TResult,
1493
- acc: TResult,
1494
- ): (a: (elem: T) => string, b: readonly T[]) => { readonly [index: string]: TResult }
1495
- export function reduceBy<T, TResult>(
1496
- valueFn: (acc: TResult, elem: T) => TResult,
1497
- acc: TResult,
1498
- keyFn: (elem: T) => string,
1499
- ): (list: readonly T[]) => { readonly [index: string]: TResult };
1500
- export function reduceBy<T, TResult>(
1501
- valueFn: (acc: TResult, elem: T) => TResult,
1502
- acc: TResult,
1503
- keyFn: (elem: T) => string,
1504
- list: readonly T[],
1505
- ): { readonly [index: string]: TResult };
1506
-
1507
1435
  /**
1508
1436
  * It has the opposite effect of `R.filter`.
1509
1437
  */
1510
- export function reject<T>(predicate: Predicate<T>, list: readonly T[]): readonly T[];
1511
- export function reject<T>(predicate: Predicate<T>): (list: readonly T[]) => readonly T[];
1512
- export function reject<T>(predicate: Predicate<T>, obj: Dictionary<T>): Dictionary<T>;
1513
- export function reject<T, U>(predicate: Predicate<T>): (obj: Dictionary<T>) => Dictionary<T>;
1438
+ export function reject<T>(
1439
+ predicate: (value: T) => boolean,
1440
+ list: readonly T[],
1441
+ ): readonly T[];
1442
+ export function reject<T>(
1443
+ predicate: BooleanConstructor,
1444
+ ): (list: readonly T[]) => readonly ("" | null | undefined | false | 0)[];
1445
+ export function reject<T>(
1446
+ predicate: BooleanConstructor,
1447
+ ): (list: readonly T[]) => readonly ("" | null | undefined | false | 0)[];
1448
+ export function reject<T>(
1449
+ predicate: (value: T) => boolean,
1450
+ ): (list: readonly T[]) => readonly T[];
1514
1451
 
1515
1452
  /**
1516
- * It returns a copy of `list` input with removed `index`.
1453
+ * Same as `R.filterObject` but it returns the object with properties that do not satisfy the predicate function.
1517
1454
  */
1518
- export function removeIndex<T>(index: number, list: readonly T[]): readonly T[];
1519
- export function removeIndex(index: number): <T>(list: readonly T[]) => readonly T[];
1520
-
1521
- export function repeat<T>(x: T): (timesToRepeat: number) => readonly T[];
1522
- export function repeat<T>(x: T, timesToRepeat: number): readonly T[];
1455
+ export function rejectObject<T extends object>(
1456
+ valueMapper: (
1457
+ value: EnumerableStringKeyedValueOf<T>,
1458
+ key: EnumerableStringKeyOf<T>,
1459
+ data: T,
1460
+ ) => boolean,
1461
+ ): <U extends T>(data: T) => U;
1523
1462
 
1524
1463
  /**
1525
1464
  * It replaces `strOrRegex` found in `str` with `replacer`.
1526
1465
  */
1527
- export function replace(strOrRegex: RegExp | string, replacer: RegExpReplacer, str: string): string;
1528
- export function replace(strOrRegex: RegExp | string, replacer: RegExpReplacer): (str: string) => string;
1529
- export function replace(strOrRegex: RegExp | string): (replacer: RegExpReplacer) => (str: string) => string;
1466
+ export function replace(strOrRegex: RegExp | string, replacer: RegExp | string): (str: string) => string;
1530
1467
 
1531
1468
  /**
1532
- * It returns a reversed copy of list or string `input`.
1469
+ * It replaces `index` in array `list` with the result of `replaceFn(list[i])`.
1533
1470
  */
1534
- export function reverse<T>(input: readonly T[]): readonly T[];
1535
- export function reverse(input: string): string;
1536
-
1537
- /**
1538
- * It returns a copied **Object** or **Array** with modified `lens` focus set to `replacer` value.
1539
- */
1540
- export function set<S, A>(lens: Lens<S, A>): {
1541
- (a: A): (obj: S) => S
1542
- (a: A, obj: S): S
1543
- };
1544
- export function set<S, A>(lens: Lens<S, A>, a: A): (obj: S) => S;
1545
- export function set<S, A>(lens: Lens<S, A>, a: A, obj: S): S;
1546
-
1547
- export function slice(from: number, to: number, input: string): string;
1548
- export function slice<T>(from: number, to: number, input: readonly T[]): readonly T[];
1549
- export function slice(from: number, to: number): {
1550
- (input: string): string;
1551
- <T>(input: readonly T[]): readonly T[];
1552
- };
1553
- export function slice(from: number): {
1554
- (to: number, input: string): string;
1555
- <T>(to: number, input: readonly T[]): readonly T[];
1556
- };
1471
+ export function replaceItemAtIndex<T>(index: number, replaceFn: (x: T) => T): (list: readonly T[]) => readonly T[];
1557
1472
 
1558
1473
  /**
1559
1474
  * It returns copy of `list` sorted by `sortFn` function, where `sortFn` needs to return only `-1`, `0` or `1`.
@@ -1564,55 +1479,17 @@ export function sort<T>(sortFn: (a: T, b: T) => number): (list: readonly T[]) =>
1564
1479
  /**
1565
1480
  * It returns copy of `list` sorted by `sortFn` function, where `sortFn` function returns a value to compare, i.e. it doesn't need to return only `-1`, `0` or `1`.
1566
1481
  */
1567
- export function sortBy<T>(sortFn: (a: T) => Ord, list: readonly T[]): readonly T[];
1568
1482
  export function sortBy<T>(sortFn: (a: T) => Ord): (list: readonly T[]) => readonly T[];
1569
1483
  export function sortBy(sortFn: (a: any) => Ord): <T>(list: readonly T[]) => readonly T[];
1570
1484
 
1571
1485
  export function sortWith<T>(fns: ReadonlyArray<(a: T, b: T) => number>): (list: readonly T[]) => readonly T[];
1572
- export function sortWith<T>(fns: ReadonlyArray<(a: T, b: T) => number>, list: readonly T[]): readonly T[];
1573
1486
 
1574
- /**
1575
- * Curried version of `String.prototype.split`
1576
- */
1577
1487
  export function split(separator: string | RegExp): (str: string) => readonly string[];
1578
- export function split(separator: string | RegExp, str: string): readonly string[];
1579
-
1580
- /**
1581
- * It splits string or array at a given index.
1582
- */
1583
- export function splitAt<T>(index: number, input: readonly T[]): readonly [readonly T[], readonly T[]];
1584
- export function splitAt(index: number, input: string): readonly [string, string];
1585
- export function splitAt(index: number): {
1586
- <T>(input: readonly T[]): readonly [readonly T[], readonly T[]];
1587
- (input: string): readonly [string, string];
1588
- };
1589
1488
 
1590
1489
  /**
1591
1490
  * It splits `input` into slices of `sliceLength`.
1592
1491
  */
1593
- export function splitEvery<T>(sliceLength: number, input: readonly T[]): readonly ((readonly T[]))[];
1594
- export function splitEvery(sliceLength: number, input: string): readonly string[];
1595
- export function splitEvery(sliceLength: number): {
1596
- (input: string): readonly string[];
1597
- <T>(input: readonly T[]): readonly ((readonly T[]))[];
1598
- };
1599
-
1600
- /**
1601
- * It splits `list` to two arrays according to a `predicate` function.
1602
- *
1603
- * The first array contains all members of `list` before `predicate` returns `true`.
1604
- */
1605
- export function splitWhen<T, U>(predicate: Predicate<T>, list: readonly U[]): readonly ((readonly U[]))[];
1606
- export function splitWhen<T>(predicate: Predicate<T>): <U>(list: readonly U[]) => readonly ((readonly U[]))[];
1607
-
1608
- /**
1609
- * When iterable is a string, then it behaves as `String.prototype.startsWith`.
1610
- * When iterable is a list, then it uses R.equals to determine if the target list starts in the same way as the given target.
1611
- */
1612
- export function startsWith<T extends string>(question: T, input: string): boolean;
1613
- export function startsWith<T extends string>(question: T): (input: string) => boolean;
1614
- export function startsWith<T>(question: readonly T[], input: readonly T[]): boolean;
1615
- export function startsWith<T>(question: readonly T[]): (input: readonly T[]) => boolean;
1492
+ export function splitEvery<T>(sliceLength: number): (input: readonly T[]) => readonly ((readonly T[]))[];
1616
1493
 
1617
1494
  /**
1618
1495
  * Curried version of `x - y`
@@ -1622,15 +1499,11 @@ export function subtract(x: number): (y: number) => number;
1622
1499
 
1623
1500
  export function sum(list: readonly number[]): number;
1624
1501
 
1625
- export function swap(indexA: number, indexB: number): <T>(list: readonly T[]) => readonly T[];
1626
- export function swap<T>(indexA: number, indexB: number, list: readonly T[]): readonly T[];
1627
-
1628
1502
  /**
1629
1503
  * It returns a merged list of `x` and `y` with all equal elements removed.
1630
1504
  *
1631
1505
  * `R.equals` is used to determine equality.
1632
1506
  */
1633
- export function symmetricDifference<T>(x: readonly T[], y: readonly T[]): readonly T[];
1634
1507
  export function symmetricDifference<T>(x: readonly T[]): <T>(y: readonly T[]) => readonly T[];
1635
1508
 
1636
1509
  /**
@@ -1642,29 +1515,31 @@ export function tail(input: string): string;
1642
1515
  /**
1643
1516
  * It returns the first `howMany` elements of `input`.
1644
1517
  */
1645
- export function take<T>(howMany: number, input: T): T extends string ? string : T;
1646
- export function take<T>(howMany: number) : (input: T) => T extends string ? string : T;
1518
+ export function take<T>(howMany: number): {
1519
+ (input: string): string;
1520
+ (input: readonly T[]): readonly T[];
1521
+ (input: readonly T[]): readonly T[];
1522
+ };
1647
1523
 
1648
1524
  /**
1649
1525
  * It returns the last `howMany` elements of `input`.
1650
1526
  */
1651
- export function takeLast<T>(howMany: number, input: T): T extends string ? string : T;
1652
- export function takeLast<T>(howMany: number) : (input: T) => T extends string ? string : T;
1527
+ export function takeLast<T>(howMany: number): {
1528
+ (input: string): string;
1529
+ (input: readonly T[]): readonly T[];
1530
+ (input: readonly T[]): readonly T[];
1531
+ };
1653
1532
 
1654
- export function takeLastWhile(predicate: (x: string) => boolean, input: string): string;
1655
- export function takeLastWhile(predicate: (x: string) => boolean): (input: string) => string;
1656
- export function takeLastWhile<T>(predicate: (x: T) => boolean, input: readonly T[]): readonly T[];
1657
- export function takeLastWhile<T>(predicate: (x: T) => boolean): <T>(input: readonly T[]) => readonly T[];
1533
+ export function takeLastWhile<T>(predicate: (x: T) => boolean): (input: readonly T[]) => readonly T[];
1534
+ export function takeLastWhile<T>(predicate: (x: T, index: number) => boolean): (list: readonly T[]) => readonly T[];
1658
1535
 
1659
- export function takeWhile(fn: Predicate<string>, iterable: string): string;
1660
- export function takeWhile(fn: Predicate<string>): (iterable: string) => string;
1661
- export function takeWhile<T>(fn: Predicate<T>, iterable: readonly T[]): readonly T[];
1662
- export function takeWhile<T>(fn: Predicate<T>): (iterable: readonly T[]) => readonly T[];
1536
+ export function takeWhile<T>(predicate: (x: T, index: number) => boolean): (list: readonly T[]) => readonly T[];
1537
+ export function takeWhile<T>(predicate: (x: T) => boolean): (input: readonly T[]) => readonly T[];
1663
1538
 
1664
1539
  /**
1665
1540
  * It applies function `fn` to input `x` and returns `x`.
1666
1541
  *
1667
- * One use case is debugging in the middle of `R.compose`.
1542
+ * One use case is debugging in the middle of `R.pipe` chain.
1668
1543
  */
1669
1544
  export function tap<T>(fn: (x: T) => void, input: T): T;
1670
1545
  export function tap<T>(fn: (x: T) => void): (input: T) => T;
@@ -1683,24 +1558,6 @@ export function test(regExpression: RegExp, str: string): boolean;
1683
1558
  export function times<T>(fn: (i: number) => T, howMany: number): readonly T[];
1684
1559
  export function times<T>(fn: (i: number) => T): (howMany: number) => readonly T[];
1685
1560
 
1686
- export function toLower<S extends string>(str: S): Lowercase<S>;
1687
- export function toLower(str: string): string;
1688
-
1689
- /**
1690
- * It transforms an object to a list.
1691
- */
1692
- export function toPairs<O extends object, K extends Extract<keyof O, string | number>>(obj: O): ReadonlyArray<{ readonly [key in K]: readonly [`${key}`, O[key]] }[K]>;
1693
- export function toPairs<S>(obj: Record<string | number, S>): ReadonlyArray<readonly [string, S]>;
1694
-
1695
- export function toString(x: unknown): string;
1696
-
1697
- export function toUpper<S extends string>(str: S): Uppercase<S>;
1698
- export function toUpper(str: string): string;
1699
-
1700
- export function transpose<T>(list: readonly ((readonly T[]))[]): readonly ((readonly T[]))[];
1701
-
1702
- export function trim(str: string): string;
1703
-
1704
1561
  /**
1705
1562
  * It returns function that runs `fn` in `try/catch` block. If there was an error, then `fallback` is used to return the result. Note that `fn` can be value or asynchronous/synchronous function(unlike `Ramda` where fallback can only be a synchronous function).
1706
1563
  */
@@ -1708,37 +1565,17 @@ export function tryCatch<T, U>(
1708
1565
  fn: (input: T) => U,
1709
1566
  fallback: U
1710
1567
  ): (input: T) => U;
1711
- export function tryCatch<T, U>(
1712
- fn: (input: T) => U,
1713
- fallback: (input: T) => U
1714
- ): (input: T) => U;
1715
- export function tryCatch<T>(
1716
- fn: (input: any) => Promise<any>,
1717
- fallback: T
1718
- ): (input: any) => Promise<T>;
1719
- export function tryCatch<T>(
1720
- fn: (input: any) => Promise<any>,
1721
- fallback: (input: any) => Promise<any>,
1722
- ): (input: any) => Promise<T>;
1723
1568
 
1724
1569
  /**
1725
1570
  * It accepts any input and it returns its type.
1726
1571
  */
1727
1572
  export function type(x: any): RambdaTypes;
1728
1573
 
1729
- /**
1730
- * It calls a function `fn` with the list of values of the returned function.
1731
- *
1732
- * `R.unapply` is the opposite of `R.apply` method.
1733
- */
1734
- export function unapply<T = any>(fn: (args: readonly any[]) => T): (...args: readonly any[]) => T;
1735
-
1736
1574
  /**
1737
1575
  * It takes two lists and return a new list containing a merger of both list with removed duplicates.
1738
1576
  *
1739
1577
  * `R.equals` is used to compare for duplication.
1740
1578
  */
1741
- export function union<T>(x: readonly T[], y: readonly T[]): readonly T[];
1742
1579
  export function union<T>(x: readonly T[]): (y: readonly T[]) => readonly T[];
1743
1580
 
1744
1581
  /**
@@ -1753,7 +1590,6 @@ export function uniq<T>(list: readonly T[]): readonly T[];
1753
1590
  *
1754
1591
  * `R.equals` is used to determine equality.
1755
1592
  */
1756
- export function uniqBy<T, U>(fn: (a: T) => U, list: readonly T[]): readonly T[];
1757
1593
  export function uniqBy<T, U>(fn: (a: T) => U): (list: readonly T[]) => readonly T[];
1758
1594
 
1759
1595
  /**
@@ -1761,7 +1597,6 @@ export function uniqBy<T, U>(fn: (a: T) => U): (list: readonly T[]) => readonly
1761
1597
  *
1762
1598
  * This predicate should return true, if two elements are equal.
1763
1599
  */
1764
- export function uniqWith<T, U>(predicate: (x: T, y: T) => boolean, list: readonly T[]): readonly T[];
1765
1600
  export function uniqWith<T, U>(predicate: (x: T, y: T) => boolean): (list: readonly T[]) => readonly T[];
1766
1601
 
1767
1602
  /**
@@ -1771,96 +1606,34 @@ export function uniqWith<T, U>(predicate: (x: T, y: T) => boolean): (list: reado
1771
1606
  *
1772
1607
  * In the other case, the final output will be the `input` itself.
1773
1608
  */
1774
- export function unless<T, U>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => U, x: T): T | U;
1775
1609
  export function unless<T, U>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => U): (x: T) => T | U;
1776
- export function unless<T>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => T, x: T): T;
1777
1610
  export function unless<T>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => T): (x: T) => T;
1778
1611
 
1779
- export function unnest(list: readonly unknown[]): readonly unknown[];
1780
- export function unnest<T>(list: readonly unknown[]): T;
1781
-
1782
- export function unwind<T, U>(prop: keyof T, obj: T): readonly U[];
1783
- export function unwind<T, U>(prop: keyof T): (obj: T) => readonly U[];
1784
-
1785
- /**
1786
- * It returns a copy of `list` with updated element at `index` with `newValue`.
1787
- */
1788
- export function update<T>(index: number, newValue: T, list: readonly T[]): readonly T[];
1789
- export function update<T>(index: number, newValue: T): (list: readonly T[]) => readonly T[];
1790
-
1791
1612
  /**
1792
- * With correct input, this is nothing more than `Object.values(Record<string, unknown>)`. If `obj` is not an object, then it returns an empty array.
1613
+ * It takes an object and a property name. The method will return a list of objects, where each object is a shallow copy of the input object, but with the property array unwound.
1793
1614
  */
1794
- export function values<T extends object, K extends keyof T>(obj: T): readonly T[K][];
1615
+ export function unwind<S extends string>(prop: S): <T>(obj: T) => Omit<T, S> & { readonly [K in S]: T[S][number] };
1795
1616
 
1796
1617
  /**
1797
- * It returns the value of `lens` focus over `target` object.
1618
+ * It returns a copy of `list` with updated element at `index` with `newValue`.
1798
1619
  */
1799
- export function view<S, A>(lens: Lens<S, A>): (obj: S) => A;
1800
- export function view<S, A>(lens: Lens<S, A>, obj: S): A;
1620
+ export function update<T>(index: number, newValue: T): (list: readonly T[]) => readonly T[];
1801
1621
 
1802
1622
  /**
1803
1623
  * It pass `input` to `predicate` function and if the result is `true`, it will return the result of `whenTrueFn(input)`.
1804
1624
  * If the `predicate` returns `false`, then it will simply return `input`.
1805
1625
  */
1806
- export function when<T, U>(predicate: (x: T) => boolean, whenTrueFn: (a: T) => U, input: T): T | U;
1626
+ export function when<T>(predicate: (x: T) => boolean, whenTrueFn: (a: T) => T): (input: T) => T;
1807
1627
  export function when<T, U>(predicate: (x: T) => boolean, whenTrueFn: (a: T) => U): (input: T) => T | U;
1808
- export function when<T, U>(predicate: (x: T) => boolean): ((whenTrueFn: (a: T) => U) => (input: T) => T | U);
1809
-
1810
- /**
1811
- * It returns `true` if all each property in `conditions` returns `true` when applied to corresponding property in `input` object.
1812
- */
1813
- export function where<T, U>(conditions: T, input: U): boolean;
1814
- export function where<T>(conditions: T): <U>(input: U) => boolean;
1815
- export function where<ObjFunc2, U>(conditions: ObjFunc2, input: U): boolean;
1816
- export function where<ObjFunc2>(conditions: ObjFunc2): <U>(input: U) => boolean;
1817
-
1818
- /**
1819
- * Same as `R.where`, but it will return `true` if at least one condition check returns `true`.
1820
- */
1821
- export function whereAny<T, U>(conditions: T, input: U): boolean;
1822
- export function whereAny<T>(conditions: T): <U>(input: U) => boolean;
1823
- export function whereAny<ObjFunc2, U>(conditions: ObjFunc2, input: U): boolean;
1824
- export function whereAny<ObjFunc2>(conditions: ObjFunc2): <U>(input: U) => boolean;
1825
-
1826
- /**
1827
- * It will return `true` if all of `input` object fully or partially include `rule` object.
1828
- *
1829
- * `R.equals` is used to determine equality.
1830
- */
1831
- export function whereEq<T, U>(condition: T, input: U): boolean;
1832
- export function whereEq<T>(condition: T): <U>(input: U) => boolean;
1833
-
1834
- /**
1835
- * It will return a new array, based on all members of `source` list that are not part of `matchAgainst` list.
1836
- *
1837
- * `R.equals` is used to determine equality.
1838
- */
1839
- export function without<T>(matchAgainst: readonly T[], source: readonly T[]): readonly T[];
1840
- export function without<T>(matchAgainst: readonly T[]): (source: readonly T[]) => readonly T[];
1841
-
1842
- /**
1843
- * Logical XOR
1844
- */
1845
- export function xor(x: boolean, y: boolean): boolean;
1846
- export function xor(y: boolean): (y: boolean) => boolean;
1847
1628
 
1848
1629
  /**
1849
1630
  * It will return a new array containing tuples of equally positions items from both `x` and `y` lists.
1850
1631
  *
1851
1632
  * The returned list will be truncated to match the length of the shortest supplied list.
1852
1633
  */
1853
- export function zip<K, V>(x: readonly K[], y: readonly V[]): readonly KeyValuePair<K, V>[];
1854
1634
  export function zip<K>(x: readonly K[]): <V>(y: readonly V[]) => readonly KeyValuePair<K, V>[];
1855
1635
 
1856
- /**
1857
- * It will return a new object with keys of `keys` array and values of `values` array.
1858
- */
1859
- export function zipObj<T, K extends string>(keys: readonly K[], values: readonly T[]): { readonly [P in K]: T };
1860
- export function zipObj<K extends string>(keys: readonly K[]): <T>(values: readonly T[]) => { readonly [P in K]: T };
1861
- export function zipObj<T, K extends number>(keys: readonly K[], values: readonly T[]): { readonly [P in K]: T };
1862
- export function zipObj<K extends number>(keys: readonly K[]): <T>(values: readonly T[]) => { readonly [P in K]: T };
1863
-
1864
- export function zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult, list1: readonly T[], list2: readonly U[]): readonly TResult[];
1865
- export function zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult, list1: readonly T[]): (list2: readonly U[]) => readonly TResult[];
1866
- export function zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult): (list1: readonly T[], list2: readonly U[]) => readonly TResult[];
1636
+ export function zipWith<T, U, TResult>(
1637
+ fn: (x: T, y: U) => TResult,
1638
+ list1: readonly T[],
1639
+ ): (list2: readonly U[]) => readonly TResult[];