1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 | import * as _ from 'ts-toolbelt';
|
38 | import {
|
39 | AnyConstructor,
|
40 | AnyFunction,
|
41 | AtLeastOneFunctionsFlow,
|
42 | AtLeastOneFunctionsFlowFromRightToLeft,
|
43 | AssocPartialOne,
|
44 | CondPair,
|
45 | CondPairTypeguard,
|
46 | Dictionary,
|
47 | Evolvable,
|
48 | Evolve,
|
49 | Evolver,
|
50 | Falsy,
|
51 | Find,
|
52 | Functor,
|
53 | InputTypesOfFns,
|
54 | KeyValuePair,
|
55 | Lens,
|
56 | Merge,
|
57 | MergeAll,
|
58 | ObjectHavingSome,
|
59 | ObjPred,
|
60 | Ord,
|
61 | Ordering,
|
62 | Path,
|
63 | Placeholder,
|
64 | Pred,
|
65 | PredTypeguard,
|
66 | Reduced,
|
67 | ReturnTypesOfFns,
|
68 | ValueOfUnion,
|
69 | Take,
|
70 | ToTupleOfArray,
|
71 | ToTupleOfFunction,
|
72 | Tuple,
|
73 | Fn,
|
74 | IfFunctionsArgumentsDoNotOverlap,
|
75 | LargestArgumentsList,
|
76 | mergeArrWithLeft,
|
77 | Prop,
|
78 | } from './tools';
|
79 |
|
80 | export * from './tools';
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 | export const __: Placeholder;
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 | export function add(a: number, b: number): number;
|
115 | export function add(a: number): (b: number) => number;
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 | export function addIndex<T>(
|
138 | fn: (f: (item: T) => void, list: readonly T[]) => T[],
|
139 | ): _.F.Curry<(a: (item: T, idx: number, list: T[]) => void, b: readonly T[]) => T[]>;
|
140 |
|
141 | export function addIndex<T>(
|
142 | fn: (f: (item: T) => boolean, list: readonly T[]) => T[],
|
143 | ): _.F.Curry<(a: (item: T, idx: number, list: T[]) => boolean, b: readonly T[]) => T[]>;
|
144 |
|
145 | export function addIndex<T, U>(
|
146 | fn: (f: (item: T) => U, list: readonly T[]) => U[],
|
147 | ): _.F.Curry<(a: (item: T, idx: number, list: T[]) => U, b: readonly T[]) => U[]>;
|
148 |
|
149 | export function addIndex<T, U>(
|
150 | fn: (f: (acc: U, item: T) => U, aci: U, list: readonly T[]) => U,
|
151 | ): _.F.Curry<(a: (acc: U, item: T, idx: number, list: T[]) => U, b: U, c: readonly T[]) => U>;
|
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 | export function adjust<T>(index: number, fn: (a: T) => T, list: readonly T[]): T[];
|
166 | export function adjust<T>(index: number, fn: (a: T) => T): (list: readonly T[]) => T[];
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 |
|
183 |
|
184 | export function all<T>(fn: (a: T) => boolean, list: readonly T[]): boolean;
|
185 | export function all<T>(fn: (a: T) => boolean): (list: readonly T[]) => boolean;
|
186 |
|
187 |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 |
|
206 |
|
207 | export function allPass<T, TF1 extends T, TF2 extends T>(
|
208 | preds: [PredTypeguard<T, TF1>, PredTypeguard<T, TF2>],
|
209 | ): (a: T) => a is TF1 & TF2;
|
210 | export function allPass<T, TF1 extends T, TF2 extends T, TF3 extends T>(
|
211 | preds: [PredTypeguard<T, TF1>, PredTypeguard<T, TF2>, PredTypeguard<T, TF3>],
|
212 | ): (a: T) => a is TF1 & TF2 & TF3;
|
213 | export function allPass<T, TF1 extends T, TF2 extends T, TF3 extends T>(
|
214 | preds: [PredTypeguard<T, TF1>, PredTypeguard<T, TF2>, PredTypeguard<T, TF3>],
|
215 | ): (a: T) => a is TF1 & TF2 & TF3;
|
216 | export function allPass<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T>(
|
217 | preds: [PredTypeguard<T, TF1>, PredTypeguard<T, TF2>, PredTypeguard<T, TF3>, PredTypeguard<T, TF4>],
|
218 | ): (a: T) => a is TF1 & TF2 & TF3 & TF4;
|
219 | export function allPass<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T, TF5 extends T>(
|
220 | preds: [
|
221 | PredTypeguard<T, TF1>,
|
222 | PredTypeguard<T, TF2>,
|
223 | PredTypeguard<T, TF3>,
|
224 | PredTypeguard<T, TF4>,
|
225 | PredTypeguard<T, TF5>,
|
226 | ],
|
227 | ): PredTypeguard<T, TF1 & TF2 & TF3 & TF4 & TF5>;
|
228 | export function allPass<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T, TF5 extends T, TF6 extends T>(
|
229 | preds: [
|
230 | PredTypeguard<T, TF1>,
|
231 | PredTypeguard<T, TF2>,
|
232 | PredTypeguard<T, TF3>,
|
233 | PredTypeguard<T, TF4>,
|
234 | PredTypeguard<T, TF5>,
|
235 | PredTypeguard<T, TF6>,
|
236 | ],
|
237 | ): PredTypeguard<T, TF1 & TF2 & TF3 & TF4 & TF5 & TF6>;
|
238 | export function allPass<F extends Pred>(preds: readonly F[]): F;
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 | export function always<T>(val: T): (...args: unknown[]) => T;
|
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 | export function and<T, U>(a: T, b: U): T | U;
|
271 | export function and<T>(a: T): <U>(b: U) => T | U;
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 |
|
282 |
|
283 |
|
284 |
|
285 |
|
286 |
|
287 |
|
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 | export function andThen<A, B>(onSuccess: (a: A) => B | Promise<B>, promise: Promise<A>): Promise<B>;
|
298 | export function andThen<A, B>(onSuccess: (a: A) => B | Promise<B>): (promise: Promise<A>) => Promise<B>;
|
299 |
|
300 |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 | export function any<T>(fn: (a: T) => boolean, list: readonly T[]): boolean;
|
318 | export function any<T>(fn: (a: T) => boolean): (list: readonly T[]) => boolean;
|
319 |
|
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 | export function anyPass<T, TF1 extends T, TF2 extends T>(
|
344 | preds: [PredTypeguard<T, TF1>, PredTypeguard<T, TF2>],
|
345 | ): (a: T) => a is TF1 | TF2;
|
346 | export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T>(
|
347 | preds: [PredTypeguard<T, TF1>, PredTypeguard<T, TF2>, PredTypeguard<T, TF3>],
|
348 | ): (a: T) => a is TF1 | TF2 | TF3;
|
349 | export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T>(
|
350 | preds: [PredTypeguard<T, TF1>, PredTypeguard<T, TF2>, PredTypeguard<T, TF3>],
|
351 | ): (a: T) => a is TF1 | TF2 | TF3;
|
352 | export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T>(
|
353 | preds: [PredTypeguard<T, TF1>, PredTypeguard<T, TF2>, PredTypeguard<T, TF3>, PredTypeguard<T, TF4>],
|
354 | ): (a: T) => a is TF1 | TF2 | TF3 | TF4;
|
355 | export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T, TF5 extends T>(
|
356 | preds: [
|
357 | PredTypeguard<T, TF1>,
|
358 | PredTypeguard<T, TF2>,
|
359 | PredTypeguard<T, TF3>,
|
360 | PredTypeguard<T, TF4>,
|
361 | PredTypeguard<T, TF5>,
|
362 | ],
|
363 | ): PredTypeguard<T, TF1 | TF2 | TF3 | TF4 | TF5>;
|
364 | export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T, TF5 extends T, TF6 extends T>(
|
365 | preds: [
|
366 | PredTypeguard<T, TF1>,
|
367 | PredTypeguard<T, TF2>,
|
368 | PredTypeguard<T, TF3>,
|
369 | PredTypeguard<T, TF4>,
|
370 | PredTypeguard<T, TF5>,
|
371 | PredTypeguard<T, TF6>,
|
372 | ],
|
373 | ): PredTypeguard<T, TF1 | TF2 | TF3 | TF4 | TF5 | TF6>;
|
374 | export function anyPass<F extends Pred>(preds: readonly F[]): F;
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 | export function ap<T, U>(fns: ReadonlyArray<(a: T) => U>, vs: readonly T[]): U[];
|
393 | export function ap<T, U>(fns: ReadonlyArray<(a: T) => U>): (vs: readonly T[]) => U[];
|
394 | export function ap<R, A, B>(fn: (r: R, a: A) => B, fn1: (r: R) => A): (r: R) => B;
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 | export function aperture<N extends number, T>(n: N, list: readonly T[]): Array<Tuple<T, N>> | [];
|
412 | export function aperture<N extends number>(n: N): <T>(list: readonly T[]) => Array<Tuple<T, N>> | [];
|
413 |
|
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 | export function append<T>(el: T, list: readonly T[]): T[];
|
427 | export function append<T>(el: T): (list: readonly T[]) => T[];
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 | export function apply<F extends AnyFunction>(fn: F, args: Parameters<F>): ReturnType<F>;
|
437 | export function apply<F extends AnyFunction>(fn: F): (args: Parameters<F>) => ReturnType<F>;
|
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 |
|
453 |
|
454 |
|
455 | export function applySpec<Obj extends Record<string, AnyFunction>>(
|
456 | obj: Obj,
|
457 | ): (...args: Parameters<Obj[keyof Obj]>) => { [Key in keyof Obj]: ReturnType<Obj[Key]> };
|
458 | export function applySpec<T>(obj: any): (...args: unknown[]) => T;
|
459 |
|
460 |
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 |
|
468 |
|
469 |
|
470 |
|
471 |
|
472 | export function applyTo<T, U>(el: T, fn: (t: T) => U): U;
|
473 | export function applyTo<T>(el: T): <U>(fn: (t: T) => U) => U;
|
474 |
|
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 | export function ascend<T>(fn: (obj: T) => Ord, a: T, b: T): Ordering;
|
493 | export function ascend<T>(fn: (obj: T) => Ord): (a: T, b: T) => Ordering;
|
494 |
|
495 |
|
496 |
|
497 |
|
498 |
|
499 |
|
500 |
|
501 |
|
502 |
|
503 |
|
504 |
|
505 |
|
506 |
|
507 |
|
508 | export function assoc<T, U>(__: Placeholder, val: T, obj: U): <K extends string>(prop: K) => K extends keyof U ? T extends U[K] ? U : Record<K, T> & Omit<U, K> : Record<K, T> & Omit<U, K>;
|
509 | export function assoc<U, K extends keyof U>(prop: K, __: Placeholder, obj: U): <T>(val: T) => T extends U[K] ? U : Record<K, T> & Omit<U, K>;
|
510 | export function assoc<U, K extends string>(prop: K, __: Placeholder, obj: U): <T>(val: T) => Record<K, T> & Omit<U, K>;
|
511 | export function assoc<K extends keyof U, U>(prop: K, val: U[K], obj: U): U;
|
512 | export function assoc<T, U, K extends string>(prop: K, val: T, obj: U): Record<K, T> & Omit<U, K>;
|
513 | export function assoc<T, K extends string>(prop: K, val: T): <U>(obj: U) => Record<K, T> & Omit<U, K>;
|
514 | export function assoc<K extends string>(prop: K): AssocPartialOne<K>;
|
515 |
|
516 |
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 |
|
534 | export function assocPath<T, U>(__: Placeholder, val: T, obj: U): (path: Path) => U;
|
535 | export function assocPath<T, U>(path: Path, __: Placeholder, obj: U): (val: T) => U;
|
536 | export function assocPath<T, U>(path: Path, val: T, obj: U): U;
|
537 | export function assocPath<T, U>(path: Path, val: T): (obj: U) => U;
|
538 | export function assocPath<T, U>(path: Path): _.F.Curry<(a: T, b: U) => U>;
|
539 |
|
540 |
|
541 |
|
542 |
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 | export function binary<T extends AnyFunction>(fn: T): (...arg: _.T.Take<Parameters<T>, '2'>) => ReturnType<T>;
|
562 |
|
563 |
|
564 |
|
565 |
|
566 |
|
567 |
|
568 |
|
569 |
|
570 |
|
571 |
|
572 |
|
573 |
|
574 |
|
575 | export function bind<F extends AnyFunction, T>(fn: F, thisObj: T): (...args: Parameters<F>) => ReturnType<F>;
|
576 | export function bind<F extends AnyFunction, T>(fn: F): (thisObj: T) => (...args: Parameters<F>) => ReturnType<F>;
|
577 |
|
578 |
|
579 |
|
580 |
|
581 |
|
582 |
|
583 |
|
584 |
|
585 |
|
586 |
|
587 |
|
588 |
|
589 |
|
590 |
|
591 |
|
592 |
|
593 |
|
594 |
|
595 |
|
596 |
|
597 |
|
598 |
|
599 | export function both<T, TF1 extends T, TF2 extends T>(
|
600 | pred1: PredTypeguard<T, TF1>,
|
601 | pred2: PredTypeguard<T, TF2>,
|
602 | ): (a: T) => a is TF1 & TF2;
|
603 | export function both<T extends Pred>(pred1: T, pred2: T): T;
|
604 | export function both<T extends Pred>(pred1: T): (pred2: T) => T;
|
605 |
|
606 |
|
607 |
|
608 |
|
609 |
|
610 |
|
611 |
|
612 |
|
613 |
|
614 |
|
615 |
|
616 |
|
617 |
|
618 |
|
619 |
|
620 |
|
621 |
|
622 |
|
623 |
|
624 |
|
625 |
|
626 | export function call<T extends AnyFunction>(fn: T, ...args: Parameters<T>): ReturnType<T>;
|
627 |
|
628 |
|
629 |
|
630 |
|
631 |
|
632 |
|
633 |
|
634 |
|
635 |
|
636 |
|
637 |
|
638 |
|
639 |
|
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 |
|
646 |
|
647 | export function chain<A, B, T = never>(fn: (n: A) => readonly B[], list: readonly A[]): B[];
|
648 | export function chain<A, B, T = never>(fn: (n: A) => readonly B[]): (list: readonly A[]) => B[];
|
649 |
|
650 | export function chain<A, Ma extends { chain: (fn: (a: A) => Mb) => Mb }, Mb>(fn: (a: A) => Mb, monad: Ma): Mb;
|
651 | export function chain<A, Ma extends { chain: (fn: (a: A) => Mb) => Mb }, Mb>(fn: (a: A) => Mb): (monad: Ma) => Mb;
|
652 |
|
653 | export function chain<A, B, R>(aToMb: (a: A, r: R) => B, Ma: (r: R) => A): (r: R) => B;
|
654 | export function chain<A, B, R>(aToMb: (a: A, r: R) => B): (Ma: (r: R) => A) => (r: R) => B;
|
655 |
|
656 |
|
657 |
|
658 |
|
659 |
|
660 |
|
661 |
|
662 |
|
663 |
|
664 |
|
665 |
|
666 |
|
667 | export function clamp<T>(min: T, max: T, value: T): T;
|
668 | export function clamp<T>(min: T, max: T): (value: T) => T;
|
669 | export function clamp<T>(min: T): (max: T, value: T) => T;
|
670 | export function clamp<T>(min: T): (max: T) => (value: T) => T;
|
671 |
|
672 |
|
673 |
|
674 |
|
675 |
|
676 |
|
677 |
|
678 |
|
679 |
|
680 |
|
681 |
|
682 |
|
683 |
|
684 |
|
685 |
|
686 |
|
687 |
|
688 |
|
689 |
|
690 |
|
691 | export function clone<T>(value: T): T;
|
692 | export function clone<T>(value: readonly T[]): T[];
|
693 |
|
694 |
|
695 |
|
696 |
|
697 |
|
698 |
|
699 |
|
700 |
|
701 |
|
702 |
|
703 |
|
704 |
|
705 |
|
706 |
|
707 |
|
708 |
|
709 |
|
710 |
|
711 |
|
712 |
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 | export function collectBy<T, K extends PropertyKey>(keyFn: (value: T) => K, list: readonly T[]): T[][];
|
719 | export function collectBy<T, K extends PropertyKey>(keyFn: (value: T) => K): (list: readonly T[]) => T[][];
|
720 |
|
721 |
|
722 |
|
723 |
|
724 |
|
725 |
|
726 |
|
727 |
|
728 |
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 |
|
737 |
|
738 | export function comparator<T>(pred: (a: T, b: T) => boolean): (x: T, y: T) => Ordering;
|
739 |
|
740 |
|
741 |
|
742 |
|
743 |
|
744 |
|
745 |
|
746 |
|
747 |
|
748 |
|
749 |
|
750 |
|
751 |
|
752 |
|
753 |
|
754 |
|
755 |
|
756 |
|
757 |
|
758 |
|
759 | export function complement<T, TFiltered extends T>(
|
760 | pred: (value: T) => value is TFiltered,
|
761 | ): (value: T) => value is Exclude<T, TFiltered>;
|
762 | export function complement<TArgs extends any[]>(pred: (...args: TArgs) => unknown): (...args: TArgs) => boolean;
|
763 |
|
764 |
|
765 |
|
766 |
|
767 |
|
768 |
|
769 |
|
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 | export function compose<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult>(
|
783 | ...func: [
|
784 | fnLast: (a: any) => TResult,
|
785 | ...func: Array<(a: any) => any>,
|
786 | f7: (a: R6) => R7,
|
787 | f6: (a: R5) => R6,
|
788 | f5: (a: R4) => R5,
|
789 | f4: (a: R3) => R4,
|
790 | f3: (a: R2) => R3,
|
791 | f2: (a: R1) => R2,
|
792 | f1: (...args: TArgs) => R1,
|
793 | ]
|
794 | ): (...args: TArgs) => TResult;
|
795 | export function compose<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7>(
|
796 | f7: (a: R6) => R7,
|
797 | f6: (a: R5) => R6,
|
798 | f5: (a: R4) => R5,
|
799 | f4: (a: R3) => R4,
|
800 | f3: (a: R2) => R3,
|
801 | f2: (a: R1) => R2,
|
802 | f1: (...args: TArgs) => R1,
|
803 | ): (...args: TArgs) => R7;
|
804 | export function compose<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7>(
|
805 | f7: (a: R6) => R7,
|
806 | f6: (a: R5) => R6,
|
807 | f5: (a: R4) => R5,
|
808 | f4: (a: R3) => R4,
|
809 | f3: (a: R2) => R3,
|
810 | f2: (a: R1) => R2,
|
811 | f1: (...args: TArgs) => R1,
|
812 | ): (...args: TArgs) => R7;
|
813 | export function compose<TArgs extends any[], R1, R2, R3, R4, R5, R6>(
|
814 | f6: (a: R5) => R6,
|
815 | f5: (a: R4) => R5,
|
816 | f4: (a: R3) => R4,
|
817 | f3: (a: R2) => R3,
|
818 | f2: (a: R1) => R2,
|
819 | f1: (...args: TArgs) => R1,
|
820 | ): (...args: TArgs) => R6;
|
821 | export function compose<TArgs extends any[], R1, R2, R3, R4, R5>(
|
822 | f5: (a: R4) => R5,
|
823 | f4: (a: R3) => R4,
|
824 | f3: (a: R2) => R3,
|
825 | f2: (a: R1) => R2,
|
826 | f1: (...args: TArgs) => R1,
|
827 | ): (...args: TArgs) => R5;
|
828 | export function compose<TArgs extends any[], R1, R2, R3, R4>(
|
829 | f4: (a: R3) => R4,
|
830 | f3: (a: R2) => R3,
|
831 | f2: (a: R1) => R2,
|
832 | f1: (...args: TArgs) => R1,
|
833 | ): (...args: TArgs) => R4;
|
834 | export function compose<TArgs extends any[], R1, R2, R3>(
|
835 | f3: (a: R2) => R3,
|
836 | f2: (a: R1) => R2,
|
837 | f1: (...args: TArgs) => R1,
|
838 | ): (...args: TArgs) => R3;
|
839 | export function compose<TArgs extends any[], R1, R2>(
|
840 | f2: (a: R1) => R2,
|
841 | f1: (...args: TArgs) => R1,
|
842 | ): (...args: TArgs) => R2;
|
843 | export function compose<TArgs extends any[], R1>(f1: (...args: TArgs) => R1): (...args: TArgs) => R1;
|
844 |
|
845 |
|
846 |
|
847 |
|
848 |
|
849 |
|
850 |
|
851 |
|
852 |
|
853 | export function composeK<V0, T1>(fn0: (x0: V0) => T1[]): (x0: V0) => T1[];
|
854 | export function composeK<V0, T1, T2>(fn1: (x: T1) => T2[], fn0: (x0: V0) => T1[]): (x0: V0) => T2[];
|
855 | export function composeK<V0, T1, T2, T3>(
|
856 | fn2: (x: T2) => T3[],
|
857 | fn1: (x: T1) => T2[],
|
858 | fn0: (x: V0) => T1[],
|
859 | ): (x: V0) => T3[];
|
860 | export function composeK<V0, T1, T2, T3, T4>(
|
861 | fn3: (x: T3) => T4[],
|
862 | fn2: (x: T2) => T3[],
|
863 | fn1: (x: T1) => T2[],
|
864 | fn0: (x: V0) => T1[],
|
865 | ): (x: V0) => T4[];
|
866 | export function composeK<V0, T1, T2, T3, T4, T5>(
|
867 | fn4: (x: T4) => T5[],
|
868 | fn3: (x: T3) => T4[],
|
869 | fn2: (x: T2) => T3[],
|
870 | fn1: (x: T1) => T2[],
|
871 | fn0: (x: V0) => T1[],
|
872 | ): (x: V0) => T5[];
|
873 | export function composeK<V0, T1, T2, T3, T4, T5, T6>(
|
874 | fn5: (x: T5) => T6[],
|
875 | fn4: (x: T4) => T5[],
|
876 | fn3: (x: T3) => T4[],
|
877 | fn2: (x: T2) => T3[],
|
878 | fn1: (x: T1) => T2[],
|
879 | fn0: (x: V0) => T1[],
|
880 | ): (x: V0) => T6[];
|
881 |
|
882 |
|
883 |
|
884 |
|
885 |
|
886 |
|
887 |
|
888 | export function composeP<V0, T1>(fn0: (x0: V0) => Promise<T1>): (x0: V0) => Promise<T1>;
|
889 | export function composeP<V0, T1, T2>(
|
890 | fn1: (x: T1) => Promise<T2>,
|
891 | fn0: (x0: V0) => Promise<T1>,
|
892 | ): (x0: V0) => Promise<T2>;
|
893 | export function composeP<V0, T1, T2, T3>(
|
894 | fn2: (x: T2) => Promise<T3>,
|
895 | fn1: (x: T1) => Promise<T2>,
|
896 | fn0: (x: V0) => Promise<T1>,
|
897 | ): (x: V0) => Promise<T3>;
|
898 | export function composeP<V0, T1, T2, T3, T4>(
|
899 | fn3: (x: T3) => Promise<T4>,
|
900 | fn2: (x: T2) => Promise<T3>,
|
901 | fn1: (x: T1) => Promise<T2>,
|
902 | fn0: (x: V0) => Promise<T1>,
|
903 | ): (x: V0) => Promise<T4>;
|
904 | export function composeP<V0, T1, T2, T3, T4, T5>(
|
905 | fn4: (x: T4) => Promise<T5>,
|
906 | fn3: (x: T3) => Promise<T4>,
|
907 | fn2: (x: T2) => Promise<T3>,
|
908 | fn1: (x: T1) => Promise<T2>,
|
909 | fn0: (x: V0) => Promise<T1>,
|
910 | ): (x: V0) => Promise<T5>;
|
911 | export function composeP<V0, T1, T2, T3, T4, T5, T6>(
|
912 | fn5: (x: T5) => Promise<T6>,
|
913 | fn4: (x: T4) => Promise<T5>,
|
914 | fn3: (x: T3) => Promise<T4>,
|
915 | fn2: (x: T2) => Promise<T3>,
|
916 | fn1: (x: T1) => Promise<T2>,
|
917 | fn0: (x: V0) => Promise<T1>,
|
918 | ): (x: V0) => Promise<T6>;
|
919 |
|
920 |
|
921 |
|
922 |
|
923 |
|
924 |
|
925 |
|
926 |
|
927 |
|
928 |
|
929 |
|
930 |
|
931 |
|
932 |
|
933 |
|
934 |
|
935 |
|
936 | export function composeWith<TArgs extends any[], TResult>(
|
937 | transformer: (fn: AnyFunction, intermediatResult: any) => any,
|
938 | fns: AtLeastOneFunctionsFlowFromRightToLeft<TArgs, TResult>,
|
939 | ): (...args: TArgs) => TResult;
|
940 | export function composeWith(
|
941 | transformer: (fn: AnyFunction, intermediatResult: any) => any,
|
942 | ): <TArgs extends any[], TResult>(
|
943 | fns: AtLeastOneFunctionsFlowFromRightToLeft<TArgs, TResult>,
|
944 | ) => (...args: TArgs) => TResult;
|
945 |
|
946 |
|
947 |
|
948 |
|
949 |
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 |
|
956 |
|
957 |
|
958 |
|
959 |
|
960 |
|
961 |
|
962 |
|
963 | export function concat(
|
964 | placeholder: Placeholder,
|
965 | ): (<L1 extends any[], L2 extends any[]>(list1: L1, list2: L2) => [...L1, ...L2]) &
|
966 | (<S1 extends string, S2 extends string>(s1: S1, s2: S2) => `${S1}${S2}`);
|
967 | export function concat<L2 extends any[]>(
|
968 | placeholder: Placeholder,
|
969 | list2: L2,
|
970 | ): <L1 extends any[]>(list1: L1) => [...L1, ...L2];
|
971 | export function concat<S2 extends string>(
|
972 | placeholder: Placeholder,
|
973 | s2: S2,
|
974 | ): <S1 extends string>(s1: S1) => `${S1}${S2}`;
|
975 | export function concat<L1 extends any[]>(list1: L1): <L2 extends any[]>(list2: L2) => [...L1, ...L2];
|
976 | export function concat<S1 extends string>(s1: S1): <S2 extends string>(s2: S2) => `${S1}${S2}`;
|
977 | export function concat<L1 extends any[], L2 extends any[]>(list1: L1, list2: L2): [...L1, ...L2];
|
978 | export function concat<S1 extends string, S2 extends string>(s1: S1, s2: S2): `${S1}${S2}`;
|
979 | export function concat(s1: string, s2: string): string;
|
980 | export function concat(s1: string): (s2: string) => string;
|
981 |
|
982 | /**
|
983 | * Returns a function, `fn`, which encapsulates `if/else, if/else, ...` logic.
|
984 | * `R.cond` takes a list of [predicate, transformer] pairs. All of the arguments
|
985 | * to `fn` are applied to each of the predicates in turn until one returns a
|
986 | * "truthy" value, at which point `fn` returns the result of applying its
|
987 | * arguments to the corresponding transformer. If none of the predicates
|
988 | * matches, `fn` returns undefined.
|
989 | *
|
990 | * @note This is not a direct substitute for a `switch` statement.
|
991 | * Remember that both elements of every pair passed to `cond` are *functions*,
|
992 | * and `cond` returns a function.
|
993 | *
|
994 | * @note When using this function with a typeguard as predicate,
|
995 | * **all** predicates in all pairs must be typeguards.
|
996 | *
|
997 | * See also {@link ifElse}, {@link unless}, {@link when}.
|
998 | *
|
999 | * @example
|
1000 | * ```typescript
|
1001 | * const fn = R.cond([
|
1002 | * [R.equals(0), R.always('water freezes at 0°C')],
|
1003 | * [R.equals(100), R.always('water boils at 100°C')],
|
1004 | * [R.T, temp => 'nothing special happens at ' + temp + '°C']
|
1005 | * ]);
|
1006 | * fn(0);
|
1007 | * fn(50);
|
1008 | * fn(100);
|
1009 | * ```
|
1010 | */
|
1011 | export function cond<T, TF1 extends T, R>(pairs: [CondPairTypeguard<T, TF1, R>]): (value: T) => R;
|
1012 | export function cond<T, TF1 extends T, TF2 extends T, R>(
|
1013 | pairs: [CondPairTypeguard<T, TF1, R>, CondPairTypeguard<T, TF2, R>],
|
1014 | ): (value: T) => R;
|
1015 | export function cond<T, TF1 extends T, TF2 extends T, TF3 extends T, R>(
|
1016 | pairs: [CondPairTypeguard<T, TF1, R>, CondPairTypeguard<T, TF2, R>, CondPairTypeguard<T, TF3, R>],
|
1017 | ): (value: T) => R;
|
1018 | export function cond<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T, R>(
|
1019 | pairs: [
|
1020 | CondPairTypeguard<T, TF1, R>,
|
1021 | CondPairTypeguard<T, TF2, R>,
|
1022 | CondPairTypeguard<T, TF3, R>,
|
1023 | CondPairTypeguard<T, TF4, R>,
|
1024 | ],
|
1025 | ): (value: T) => R;
|
1026 | export function cond<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T, TF5 extends T, R>(
|
1027 | pairs: [
|
1028 | CondPairTypeguard<T, TF1, R>,
|
1029 | CondPairTypeguard<T, TF2, R>,
|
1030 | CondPairTypeguard<T, TF3, R>,
|
1031 | CondPairTypeguard<T, TF4, R>,
|
1032 | CondPairTypeguard<T, TF5, R>,
|
1033 | ],
|
1034 | ): (value: T) => R;
|
1035 | export function cond<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T, TF5 extends T, TF6 extends T, R>(
|
1036 | pairs: [
|
1037 | CondPairTypeguard<T, TF1, R>,
|
1038 | CondPairTypeguard<T, TF2, R>,
|
1039 | CondPairTypeguard<T, TF3, R>,
|
1040 | CondPairTypeguard<T, TF4, R>,
|
1041 | CondPairTypeguard<T, TF5, R>,
|
1042 | CondPairTypeguard<T, TF6, R>,
|
1043 | ],
|
1044 | ): (value: T) => R;
|
1045 | export function cond<
|
1046 | T,
|
1047 | TF1 extends T,
|
1048 | TF2 extends T,
|
1049 | TF3 extends T,
|
1050 | TF4 extends T,
|
1051 | TF5 extends T,
|
1052 | TF6 extends T,
|
1053 | TF7 extends T,
|
1054 | R,
|
1055 | >(
|
1056 | pairs: [
|
1057 | CondPairTypeguard<T, TF1, R>,
|
1058 | CondPairTypeguard<T, TF2, R>,
|
1059 | CondPairTypeguard<T, TF3, R>,
|
1060 | CondPairTypeguard<T, TF4, R>,
|
1061 | CondPairTypeguard<T, TF5, R>,
|
1062 | CondPairTypeguard<T, TF6, R>,
|
1063 | CondPairTypeguard<T, TF7, R>,
|
1064 | ],
|
1065 | ): (value: T) => R;
|
1066 | export function cond<
|
1067 | T,
|
1068 | TF1 extends T,
|
1069 | TF2 extends T,
|
1070 | TF3 extends T,
|
1071 | TF4 extends T,
|
1072 | TF5 extends T,
|
1073 | TF6 extends T,
|
1074 | TF7 extends T,
|
1075 | TF8 extends T,
|
1076 | R,
|
1077 | >(
|
1078 | pairs: [
|
1079 | CondPairTypeguard<T, TF1, R>,
|
1080 | CondPairTypeguard<T, TF2, R>,
|
1081 | CondPairTypeguard<T, TF3, R>,
|
1082 | CondPairTypeguard<T, TF4, R>,
|
1083 | CondPairTypeguard<T, TF5, R>,
|
1084 | CondPairTypeguard<T, TF6, R>,
|
1085 | CondPairTypeguard<T, TF7, R>,
|
1086 | CondPairTypeguard<T, TF8, R>,
|
1087 | ],
|
1088 | ): (value: T) => R;
|
1089 | export function cond<
|
1090 | T,
|
1091 | TF1 extends T,
|
1092 | TF2 extends T,
|
1093 | TF3 extends T,
|
1094 | TF4 extends T,
|
1095 | TF5 extends T,
|
1096 | TF6 extends T,
|
1097 | TF7 extends T,
|
1098 | TF8 extends T,
|
1099 | TF9 extends T,
|
1100 | R,
|
1101 | >(
|
1102 | pairs: [
|
1103 | CondPairTypeguard<T, TF1, R>,
|
1104 | CondPairTypeguard<T, TF2, R>,
|
1105 | CondPairTypeguard<T, TF3, R>,
|
1106 | CondPairTypeguard<T, TF4, R>,
|
1107 | CondPairTypeguard<T, TF5, R>,
|
1108 | CondPairTypeguard<T, TF6, R>,
|
1109 | CondPairTypeguard<T, TF7, R>,
|
1110 | CondPairTypeguard<T, TF8, R>,
|
1111 | CondPairTypeguard<T, TF9, R>,
|
1112 | ],
|
1113 | ): (value: T) => R;
|
1114 | export function cond<
|
1115 | T,
|
1116 | TF1 extends T,
|
1117 | TF2 extends T,
|
1118 | TF3 extends T,
|
1119 | TF4 extends T,
|
1120 | TF5 extends T,
|
1121 | TF6 extends T,
|
1122 | TF7 extends T,
|
1123 | TF8 extends T,
|
1124 | TF9 extends T,
|
1125 | TF10 extends T,
|
1126 | R,
|
1127 | >(
|
1128 | pairs: [
|
1129 | CondPairTypeguard<T, TF1, R>,
|
1130 | CondPairTypeguard<T, TF2, R>,
|
1131 | CondPairTypeguard<T, TF3, R>,
|
1132 | CondPairTypeguard<T, TF4, R>,
|
1133 | CondPairTypeguard<T, TF5, R>,
|
1134 | CondPairTypeguard<T, TF6, R>,
|
1135 | CondPairTypeguard<T, TF7, R>,
|
1136 | CondPairTypeguard<T, TF8, R>,
|
1137 | CondPairTypeguard<T, TF9, R>,
|
1138 | CondPairTypeguard<T, TF10, R>,
|
1139 | ],
|
1140 | ): (value: T) => R;
|
1141 | export function cond<T extends any[], R>(pairs: ReadonlyArray<CondPair<T, R>>): (...args: T) => R;
|
1142 |
|
1143 | /**
|
1144 | * Wraps a constructor function inside a curried function that can be called with the same arguments and returns the same type.
|
1145 | *
|
1146 | * See also {@link invoker}.
|
1147 | *
|
1148 | * @example
|
1149 | * ```typescript
|
1150 | *
|
1151 | * class Animal {
|
1152 | * constructor(public kind: string) {}
|
1153 | *
|
1154 | * sighting() {
|
1155 | * return "It's a " + this.kind + "!";
|
1156 | * }
|
1157 | * }
|
1158 | *
|
1159 | * const AnimalConstructor = R.construct(Animal)
|
1160 | *
|
1161 | *
|
1162 | * AnimalConstructor('Pig');
|
1163 | *
|
1164 | * const animalTypes = ["Lion", "Tiger", "Bear"];
|
1165 | * const animalSighting = R.invoker(0, 'sighting');
|
1166 | * const sightNewAnimal = R.compose(animalSighting, AnimalConstructor);
|
1167 | * R.map(sightNewAnimal, animalTypes);
|
1168 | * ```
|
1169 | */
|
1170 | export function construct<A extends any[], T>(
|
1171 | constructor: { new (...args: A): T } | ((...args: A) => T),
|
1172 | ): _.F.Curry<(...args: A) => T>;
|
1173 |
|
1174 | // NOTE: Example doesn't work with this typing
|
1175 | /**
|
1176 | * Wraps a constructor function inside a curried function that can be called with the same arguments and returns the same type.
|
1177 | * The arity of the function returned is specified to allow using variadic constructor functions.
|
1178 | */
|
1179 | export function constructN<A extends any[], T, N extends number>(
|
1180 | n: N,
|
1181 | constructor: { new (...args: A): T } | ((...args: A) => T),
|
1182 | ): _.F.Curry<(...args: mergeArrWithLeft<Tuple<any, N>, A>) => T>;
|
1183 |
|
1184 | /**
|
1185 | * Returns `true` if the specified item is somewhere in the list, `false` otherwise.
|
1186 | * Equivalent to `indexOf(a)(list) > -1`. Uses strict (`===`) equality checking.
|
1187 | *
|
1188 | * @deprecated since 0.26 in favor of includes
|
1189 | */
|
1190 | export function contains(__: Placeholder, list: string): (a: string) => boolean;
|
1191 | export function contains<T>(__: Placeholder, list: readonly T[]): (a: T) => boolean;
|
1192 | export function contains(__: Placeholder): (list: string, a: string) => boolean;
|
1193 | export function contains<T>(__: Placeholder): (list: readonly T[], a: T) => boolean;
|
1194 | export function contains(a: string, list: string): boolean;
|
1195 | export function contains<T>(a: T, list: readonly T[]): boolean;
|
1196 | export function contains(a: string): (list: string) => boolean;
|
1197 | export function contains<T>(a: T): (list: readonly T[]) => boolean;
|
1198 |
|
1199 | // NOTE: Example doesn't work with this typing
|
1200 | /**
|
1201 | * Accepts a converging function and a list of branching functions and returns a new function.
|
1202 | * When invoked, this new function is applied to some arguments,
|
1203 | * each branching function is applied to those same arguments.
|
1204 | * The results of each branching function are passed as arguments to the converging function
|
1205 | * to produce the return value.
|
1206 | *
|
1207 | * See also {@link useWith}.
|
1208 | */
|
1209 | export function converge<
|
1210 | TResult,
|
1211 | FunctionsList extends ReadonlyArray<Fn> &
|
1212 | IfFunctionsArgumentsDoNotOverlap<_Fns, 'Functions arguments types must overlap'>,
|
1213 | _Fns extends ReadonlyArray<Fn> = FunctionsList,
|
1214 | >(
|
1215 | converging: (...args: ReturnTypesOfFns<FunctionsList>) => TResult,
|
1216 | branches: FunctionsList,
|
1217 | ): _.F.Curry<(...args: LargestArgumentsList<FunctionsList>) => TResult>;
|
1218 | export function converge<
|
1219 | CArgs extends ReadonlyArray<any>,
|
1220 | TResult,
|
1221 | FunctionsList extends readonly [
|
1222 | ...{
|
1223 | [Index in keyof CArgs]: (...args: ReadonlyArray<any>) => CArgs[Index];
|
1224 | },
|
1225 | ] &
|
1226 | IfFunctionsArgumentsDoNotOverlap<_Fns, 'Functions arguments types must overlap'>,
|
1227 | _Fns extends ReadonlyArray<Fn> = FunctionsList,
|
1228 | >(
|
1229 | converging: (...args: CArgs) => TResult,
|
1230 | branches: FunctionsList,
|
1231 | ): _.F.Curry<(...args: LargestArgumentsList<FunctionsList>) => TResult>;
|
1232 |
|
1233 | /**
|
1234 | * Returns the number of items in a given `list` matching the predicate `f`.
|
1235 | *
|
1236 | * @example
|
1237 | * ```typescript
|
1238 | * const even = (x: number) => x % 2 == 0;
|
1239 | *
|
1240 | * R.count(even, [1, 2, 3, 4, 5]);
|
1241 | * R.map(R.count(even), [[1, 1, 1], [2, 3, 4, 5], [6]]);
|
1242 | * ```
|
1243 | */
|
1244 | export function count<T>(fn: (a: T) => boolean, list: readonly T[]): number;
|
1245 | export function count<T>(fn: (a: T) => boolean): (list: readonly T[]) => number;
|
1246 |
|
1247 | /**
|
1248 | * Counts the elements of a list according to how many match each value of a key generated by the supplied function.
|
1249 | * Returns an object mapping the keys produced by `fn` to the number of occurrences in the list.
|
1250 | * Note that all keys are coerced to strings because of how JavaScript objects work.
|
1251 | *
|
1252 | * Acts as a transducer if a transformer is given in list position.
|
1253 | *
|
1254 | * See also {@link transduce}.
|
1255 | *
|
1256 | * @example
|
1257 | * ```typescript
|
1258 | * const numbers = [1.0, 1.1, 1.2, 2.0, 3.0, 2.2];
|
1259 | * R.countBy(Math.floor)(numbers);
|
1260 | *
|
1261 | * const letters = ['a', 'b', 'A', 'a', 'B', 'c'];
|
1262 | * R.countBy(R.toLower)(letters);
|
1263 | * ```
|
1264 | */
|
1265 | export function countBy<T>(fn: (a: T) => string | number, list: readonly T[]): { [index: string]: number };
|
1266 | export function countBy<T>(fn: (a: T) => string | number): (list: readonly T[]) => { [index: string]: number };
|
1267 |
|
1268 | /**
|
1269 | * Returns a curried equivalent of the provided function.
|
1270 | *
|
1271 | * See also {@link curryN}, {@link partial}.
|
1272 | *
|
1273 | * The curried function has two unusual capabilities.
|
1274 | *
|
1275 | * First, its arguments needn't be provided one at a time.
|
1276 | * If `f` is a ternary function and `g` is `R.curry(f)`, the following are equivalent:
|
1277 | * - `g(1)(2)(3)`
|
1278 | * - `g(1)(2, 3)`
|
1279 | * - `g(1, 2)(3)`
|
1280 | * - `g(1, 2, 3)`
|
1281 | *
|
1282 | * Secondly, the special placeholder value `R.__` may be used to specify "gaps",
|
1283 | * allowing partial application of any combination of arguments,
|
1284 | * regardless of their positions.
|
1285 | * If `g` is as above and `_` is `R.__`, the following are equivalent:
|
1286 | * - `g(1, 2, 3)`
|
1287 | * - `g(_, 2, 3)(1)`
|
1288 | * - `g(_, _, 3)(1)(2)`
|
1289 | * - `g(_, _, 3)(1, 2)`
|
1290 | * - `g(_, 2)(1)(3)`
|
1291 | * - `g(_, 2)(1, 3)`
|
1292 | * - `g(_, 2)(_, 3)(1)`
|
1293 | *
|
1294 | * @example
|
1295 | * ```typescript
|
1296 | * const addFourNumbers = (a: number, b: number, c: number, d: number) => a + b + c + d;
|
1297 | *
|
1298 | * const curriedAddFourNumbers = R.curry(addFourNumbers);
|
1299 | * const f = curriedAddFourNumbers(1, 2);
|
1300 | * const g = f(3);
|
1301 | * g(4);
|
1302 | * ```
|
1303 | */
|
1304 | export function curry<F extends AnyFunction>(f: F): _.F.Curry<F>;
|
1305 |
|
1306 | /**
|
1307 | * Returns a curried equivalent of the provided function, with the specified arity.
|
1308 | *
|
1309 | * See also {@link curry}.
|
1310 | *
|
1311 | * The curried function has two unusual capabilities.
|
1312 | *
|
1313 | * First, its arguments needn't be provided one at a time.
|
1314 | * If `f` is a ternary function and `g` is `R.curry(f)`, the following are equivalent:
|
1315 | * - `g(1)(2)(3)`
|
1316 | * - `g(1)(2, 3)`
|
1317 | * - `g(1, 2)(3)`
|
1318 | * - `g(1, 2, 3)`
|
1319 | *
|
1320 | * Secondly, the special placeholder value `R.__` may be used to specify "gaps",
|
1321 | * allowing partial application of any combination of arguments,
|
1322 | * regardless of their positions.
|
1323 | * If `g` is as above and `_` is `R.__`, the following are equivalent:
|
1324 | * - `g(1, 2, 3)`
|
1325 | * - `g(_, 2, 3)(1)`
|
1326 | * - `g(_, _, 3)(1)(2)`
|
1327 | * - `g(_, _, 3)(1, 2)`
|
1328 | * - `g(_, 2)(1)(3)`
|
1329 | * - `g(_, 2)(1, 3)`
|
1330 | * - `g(_, 2)(_, 3)(1)`
|
1331 | *
|
1332 | * @example
|
1333 | * ```typescript
|
1334 | * const sumArgs = (...args: number[]) => R.sum(args);
|
1335 | *
|
1336 | * const curriedAddFourNumbers = R.curryN(4, sumArgs);
|
1337 | * const f = curriedAddFourNumbers(1, 2);
|
1338 | * const g = f(3);
|
1339 | * g(4);
|
1340 | * ```
|
1341 | */
|
1342 | export function curryN<N extends number, F extends AnyFunction>(
|
1343 | length: N,
|
1344 | fn: F,
|
1345 | ): _.F.Curry<(...args: _.T.Take<Parameters<F>, _.N.NumberOf<N>>) => ReturnType<F>>;
|
1346 | export function curryN<N extends number>(
|
1347 | length: N,
|
1348 | ): <F extends AnyFunction>(fn: F) => _.F.Curry<(...args: _.T.Take<Parameters<F>, _.N.NumberOf<N>>) => ReturnType<F>>;
|
1349 |
|
1350 | /**
|
1351 | * Decrements its argument.
|
1352 | *
|
1353 | * See also {@link inc}.
|
1354 | *
|
1355 | * @example
|
1356 | * ```typescript
|
1357 | * R.dec(42);
|
1358 | * ```
|
1359 | */
|
1360 | export function dec(n: number): number;
|
1361 |
|
1362 | /**
|
1363 | * Returns the second argument if it is not `null`, `undefined` or `NaN`; otherwise the first argument is returned.
|
1364 | *
|
1365 | * @example
|
1366 | * ```typescript
|
1367 | * const defaultTo42 = R.defaultTo(42);
|
1368 | *
|
1369 | * defaultTo42(null);
|
1370 | * defaultTo42(undefined);
|
1371 | * defaultTo42(false);
|
1372 | * defaultTo42('Ramda');
|
1373 | *
|
1374 | * defaultTo42(parseInt('string'));
|
1375 | * ```
|
1376 | */
|
1377 | export function defaultTo<T, U>(a: T, b: U | null | undefined): T | U;
|
1378 | export function defaultTo<T>(a: T): <U>(b: U | null | undefined) => T | U;
|
1379 |
|
1380 | /**
|
1381 | * Makes a descending comparator function out of a function that returns a value that can be compared with `<` and `>`.
|
1382 | *
|
1383 | * See also {@link ascend}.
|
1384 | *
|
1385 | * @example
|
1386 | * ```typescript
|
1387 | * type Person = { name: string; age: number; };
|
1388 | *
|
1389 | * const byAge = R.descend<Person>(R.prop('age'));
|
1390 | * const people = [
|
1391 | * { name: 'Emma', age: 70 },
|
1392 | * { name: 'Peter', age: 78 },
|
1393 | * { name: 'Mikhail', age: 62 },
|
1394 | * ];
|
1395 | * const peopleByOldestFirst = R.sort(byAge, people);
|
1396 | *
|
1397 | * ```
|
1398 | */
|
1399 | export function descend<T>(fn: (obj: T) => Ord, a: T, b: T): Ordering;
|
1400 | export function descend<T>(fn: (obj: T) => Ord): (a: T, b: T) => Ordering;
|
1401 |
|
1402 | /**
|
1403 | * Finds the set (i.e. no duplicates) of all elements in the first list not contained in the second list.
|
1404 | * `Object`s and `Array`s are compared in terms of value equality, not reference equality.
|
1405 | *
|
1406 | * See also {@link differenceWith}, {@link symmetricDifference}, {@link symmetricDifferenceWith}, {@link without}.
|
1407 | *
|
1408 | * @example
|
1409 | * ```typescript
|
1410 | * R.difference([1,2,3,4], [7,6,5,4,3]);
|
1411 | * R.difference([7,6,5,4,3], [1,2,3,4]);
|
1412 | * R.difference<{ a: number; } | { b: number; } | { c: number; }>([{a: 1}, {b: 2}], [{a: 1}, {c: 3}])
|
1413 | * ```
|
1414 | */
|
1415 | export function difference<T>(list1: readonly T[], list2: readonly T[]): T[];
|
1416 | export function difference<T>(list1: readonly T[]): (list2: readonly T[]) => T[];
|
1417 |
|
1418 | /**
|
1419 | * Finds the set (i.e. no duplicates) of all elements in the first list not contained in the second list.
|
1420 | * Duplication is determined according to the value returned
|
1421 | * by applying the supplied predicate to two list elements.
|
1422 | *
|
1423 | * See also See also {@link difference}, {@link symmetricDifference}, {@link symmetricDifferenceWith}.
|
1424 | *
|
1425 | * @example
|
1426 | * ```typescript
|
1427 | * const cmp = (x: { a: number; }, y: { a: number; }) => x.a === y.a;
|
1428 | * const l1 = [{a: 1}, {a: 2}, {a: 3}];
|
1429 | * const l2 = [{a: 3}, {a: 4}];
|
1430 | * R.differenceWith(cmp, l1, l2);
|
1431 | * ```
|
1432 | */
|
1433 | export function differenceWith<T1, T2>(
|
1434 | pred: (a: T1, b: T2) => boolean,
|
1435 | list1: readonly T1[],
|
1436 | list2: readonly T2[],
|
1437 | ): T1[];
|
1438 | export function differenceWith<T1, T2>(
|
1439 | pred: (a: T1, b: T2) => boolean,
|
1440 | ): (list1: readonly T1[], list2: readonly T2[]) => T1[];
|
1441 | export function differenceWith<T1, T2>(
|
1442 | pred: (a: T1, b: T2) => boolean,
|
1443 | list1: readonly T1[],
|
1444 | ): (list2: readonly T2[]) => T1[];
|
1445 |
|
1446 | /**
|
1447 | * Returns a new object that does not contain the given property.
|
1448 | *
|
1449 | * See also {@link assoc}, {@link omit}.
|
1450 | *
|
1451 | * @example
|
1452 | * ```typescript
|
1453 | * R.dissoc('b', {a: 1, b: 2, c: 3});
|
1454 | * ```
|
1455 | */
|
1456 | export function dissoc<T extends object, K extends keyof T>(prop: K, obj: T): Omit<T, K>;
|
1457 | export function dissoc<K extends string | number>(prop: K): <T extends object>(obj: T) => Omit<T, K>;
|
1458 |
|
1459 | /**
|
1460 | * Makes a shallow clone of an object, omitting the property at the given path.
|
1461 | *
|
1462 | * @note This copies and flattens prototype properties onto the new object as well.
|
1463 | * All non-primitive properties are copied by reference.
|
1464 | *
|
1465 | * @example
|
1466 | * ```typescript
|
1467 | * R.dissocPath(['a', 'b', 'c'], {a: {b: {c: 42}}});
|
1468 | * ```
|
1469 | */
|
1470 | export function dissocPath<T>(path: Path, obj: any): T;
|
1471 | export function dissocPath<T>(path: Path): (obj: any) => T;
|
1472 |
|
1473 | /**
|
1474 | * Divides two numbers. Equivalent to `a / b` but curried.
|
1475 | *
|
1476 | * See also {@link multiply}.
|
1477 | *
|
1478 | * @example
|
1479 | * ```typescript
|
1480 | * R.divide(71, 100);
|
1481 | *
|
1482 | * const half = R.divide(R.__, 2);
|
1483 | * half(42);
|
1484 | *
|
1485 | * const reciprocal = R.divide(1);
|
1486 | * reciprocal(4);
|
1487 | * ```
|
1488 | */
|
1489 | export function divide(__: Placeholder, b: number): (a: number) => number;
|
1490 | export function divide(__: Placeholder): (b: number, a: number) => number;
|
1491 | export function divide(a: number, b: number): number;
|
1492 | export function divide(a: number): (b: number) => number;
|
1493 |
|
1494 | /**
|
1495 | * Returns all but the first `n` elements of the given list, string, or transducer/transformer.
|
1496 | *
|
1497 | * Dispatches to the `drop` method of the second argument, if present.
|
1498 | *
|
1499 | * See also {@link take}, {@link transduce}, {@link dropLast}, {@link dropWhile}.
|
1500 | *
|
1501 | * @example
|
1502 | * ```typescript
|
1503 | * R.drop(1, ['foo', 'bar', 'baz']);
|
1504 | * R.drop(2, ['foo', 'bar', 'baz']);
|
1505 | * R.drop(3, ['foo', 'bar', 'baz']);
|
1506 | * R.drop(4, ['foo', 'bar', 'baz']);
|
1507 | * R.drop(3, 'ramda');
|
1508 | * ```
|
1509 | */
|
1510 | export function drop<T>(n: number, xs: readonly T[]): T[];
|
1511 | export function drop(n: number, xs: string): string;
|
1512 | export function drop<T>(n: number): {
|
1513 | (xs: string): string;
|
1514 | (xs: readonly T[]): T[];
|
1515 | };
|
1516 |
|
1517 | /**
|
1518 | * Returns a list containing all but the last `n` elements of the given list.
|
1519 | *
|
1520 | * Acts as a transducer if a transformer is given in list position.
|
1521 | *
|
1522 | * See also {@link takeLast}, {@link drop}, {@link dropWhile}, {@link dropLastWhile}, {@link transduce}.
|
1523 | *
|
1524 | * @example
|
1525 | * ```typescript
|
1526 | * R.dropLast(1, ['foo', 'bar', 'baz']);
|
1527 | * R.dropLast(2, ['foo', 'bar', 'baz']);
|
1528 | * R.dropLast(3, ['foo', 'bar', 'baz']);
|
1529 | * R.dropLast(4, ['foo', 'bar', 'baz']);
|
1530 | * R.dropLast(3, 'ramda');
|
1531 | * ```
|
1532 | */
|
1533 | export function dropLast<T>(n: number, xs: readonly T[]): T[];
|
1534 | export function dropLast(n: number, xs: string): string;
|
1535 | export function dropLast<T>(n: number): {
|
1536 | (xs: readonly T[]): T[];
|
1537 | (xs: string): string;
|
1538 | };
|
1539 |
|
1540 | /**
|
1541 | * Returns a new list excluding all the tailing elements of a given list which satisfy the supplied predicate function.
|
1542 | * It passes each value from the right to the supplied predicate function,
|
1543 | * skipping elements until the predicate function returns a falsy value.
|
1544 | *
|
1545 | * Acts as a transducer if a transformer is given in list position.
|
1546 | *
|
1547 | * See also {@link takeLastWhile}, {@link addIndex}, {@link drop}, {@link dropWhile}, {@link transduce}.
|
1548 | *
|
1549 | * @example
|
1550 | * ```typescript
|
1551 | * const lteThree = (x: number) => x <= 3;
|
1552 | *
|
1553 | * R.dropLastWhile(lteThree, [1, 2, 3, 4, 3, 2, 1]);
|
1554 | *
|
1555 | * R.dropLastWhile(x => x !== 'd', 'Ramda');
|
1556 | * ```
|
1557 | */
|
1558 | export function dropLastWhile<T>(fn: (a: T) => boolean, list: readonly T[]): T[];
|
1559 | export function dropLastWhile<T>(fn: (a: T) => boolean): (list: readonly T[]) => T[];
|
1560 |
|
1561 | /**
|
1562 | * Returns a new list without any consecutively repeating elements.
|
1563 | * {@link equals `R.equals`} is used to determine equality.
|
1564 | *
|
1565 | * Acts as a transducer if a transformer is given in list position.
|
1566 | *
|
1567 | * See also {@link transduce}.
|
1568 | *
|
1569 | * @example
|
1570 | * ```typescript
|
1571 | * R.dropRepeats([1, 1, 1, 2, 3, 4, 4, 2, 2]);
|
1572 | * ```
|
1573 | */
|
1574 | export function dropRepeats<T>(list: readonly T[]): T[];
|
1575 |
|
1576 | /**
|
1577 | * Returns a new list without any consecutively repeating elements.
|
1578 | * Equality is determined by applying the supplied predicate to each pair of consecutive elements.
|
1579 | * The first element in a series of equal elements will be preserved.
|
1580 | *
|
1581 | * Acts as a transducer if a transformer is given in list position.
|
1582 | *
|
1583 | * See also {@link transduce}.
|
1584 | *
|
1585 | * @example
|
1586 | * ```typescript
|
1587 | * const l = [1, -1, 1, 3, 4, -4, -4, -5, 5, 3, 3];
|
1588 | * R.dropRepeatsWith(R.eqBy(Math.abs), l);
|
1589 | * ```
|
1590 | */
|
1591 | export function dropRepeatsWith<T>(predicate: (left: T, right: T) => boolean, list: readonly T[]): T[];
|
1592 | export function dropRepeatsWith<T>(predicate: (left: T, right: T) => boolean): (list: readonly T[]) => T[];
|
1593 |
|
1594 | /**
|
1595 | * Returns a new list excluding the leading elements of a given list
|
1596 | * which satisfy the supplied predicate function.
|
1597 | * It passes each value to the supplied predicate function,
|
1598 | * skipping elements while the predicate function returns a truthy value.
|
1599 | *
|
1600 | * Dispatches to the `dropWhile` method of the second argument, if present.
|
1601 | *
|
1602 | * Acts as a transducer if a transformer is given in list position.
|
1603 | *
|
1604 | * See also {@link takeWhile}, {@link addIndex}, {@link transduce}.
|
1605 | *
|
1606 | * @example
|
1607 | * ```typescript
|
1608 | * const lteTwo = (x: number) => x <= 2;
|
1609 | *
|
1610 | * R.dropWhile(lteTwo, [1, 2, 3, 4, 3, 2, 1]);
|
1611 | *
|
1612 | * R.dropWhile(x => x !== 'd' , 'Ramda');
|
1613 | * ```
|
1614 | */
|
1615 | export function dropWhile<T>(fn: (a: T) => boolean, list: readonly T[]): T[];
|
1616 | export function dropWhile<T>(fn: (a: T) => boolean): (list: readonly T[]) => T[];
|
1617 |
|
1618 | /**
|
1619 | * A function wrapping calls to the two functions in an `||` operation,
|
1620 | * returning the result of the first function if it is truthy
|
1621 | * and the result of the second function otherwise.
|
1622 | *
|
1623 | * @note This is short-circuited, meaning that the second function will not be invoked if the first returns a truthy value.
|
1624 | *
|
1625 | * See also {@link both}, {@link or}.
|
1626 | *
|
1627 | * @example
|
1628 | * ```typescript
|
1629 | * const gt10 = (x: number) => x > 10;
|
1630 | * const even = (x: number) => x % 2 === 0;
|
1631 | * const f = R.either(gt10, even);
|
1632 | * f(101);
|
1633 | * f(8);
|
1634 | * ```
|
1635 | */
|
1636 | export function either<T extends Pred>(pred1: T, pred2: T): T;
|
1637 | export function either<T extends Pred>(pred1: T): (pred2: T) => T;
|
1638 |
|
1639 | /**
|
1640 | * Returns the empty value of its argument's type.
|
1641 | * Ramda defines the empty value of `Array` (`[]`), `Object` (`{}`), string (`''`),
|
1642 | * `TypedArray` (`Uint8Array []`, `Float32Array []`, etc) and arguments.
|
1643 | *
|
1644 | * Other types are supported if they define `<Type>.empty`, `<Type>.prototype.empty`
|
1645 | * or implement the FantasyLand Monoid spec.
|
1646 | *
|
1647 | * Dispatches to the `empty` method of the first argument, if present.
|
1648 | *
|
1649 | * @example
|
1650 | * ```typescript
|
1651 | * R.empty([1, 2, 3]);
|
1652 | * R.empty('unicorns');
|
1653 | * R.empty({x: 1, y: 2});
|
1654 | * R.empty(Uint8Array.from([1, 2, 3]));
|
1655 | * ```
|
1656 | */
|
1657 | export function empty<T>(x: T): T;
|
1658 |
|
1659 | /**
|
1660 | * Checks if a list ends with the provided sublist.
|
1661 | *
|
1662 | * Similarly, checks if a string ends with the provided substring.
|
1663 | *
|
1664 | * See also {@link startsWith}.
|
1665 | *
|
1666 | * @example
|
1667 | * ```typescript
|
1668 | * R.endsWith('c', 'abc')
|
1669 | * R.endsWith('b', 'abc')
|
1670 | * R.endsWith(['c'], ['a', 'b', 'c'])
|
1671 | * R.endsWith(['b'], ['a', 'b', 'c'])
|
1672 | * ```
|
1673 | */
|
1674 | export function endsWith(substr: string, str: string): boolean;
|
1675 | export function endsWith(substr: string): (str: string) => boolean;
|
1676 | export function endsWith<T>(subList: readonly T[], list: readonly T[]): boolean;
|
1677 | export function endsWith<T>(subList: readonly T[]): (list: readonly T[]) => boolean;
|
1678 |
|
1679 | /**
|
1680 | * Takes a function and two values in its domain and returns `true` if the values map to the same value in the codomain;
|
1681 | * `false` otherwise.
|
1682 | *
|
1683 | * @example
|
1684 | * ```typescript
|
1685 | * R.eqBy(Math.abs, 5, -5);
|
1686 | * ```
|
1687 | */
|
1688 | export function eqBy<T>(fn: (a: T) => unknown, a: T, b: T): boolean;
|
1689 | export function eqBy<T>(fn: (a: T) => unknown, a: T): (b: T) => boolean;
|
1690 | export function eqBy<T>(fn: (a: T) => unknown): {
|
1691 | (a: T, b: T): boolean;
|
1692 | (a: T): (b: T) => boolean;
|
1693 | };
|
1694 |
|
1695 | /**
|
1696 | * Reports whether two objects have the same value, in {@link equals `R.equals`} terms, for the specified property.
|
1697 | * Useful as a curried predicate.
|
1698 | *
|
1699 | * @example
|
1700 | * ```typescript
|
1701 | * const o1 = { a: 1, b: 2, c: 3, d: 4 };
|
1702 | * const o2 = { a: 10, b: 20, c: 3, d: 40 };
|
1703 | * R.eqProps('a', o1, o2);
|
1704 | * R.eqProps('c', o1, o2);
|
1705 | * ```
|
1706 | */
|
1707 | export function eqProps<T, U>(prop: string, obj1: T, obj2: U): boolean;
|
1708 | export function eqProps<P extends string>(prop: P): <T, U>(obj1: Record<P, T>, obj2: Record<P, U>) => boolean;
|
1709 | export function eqProps<T>(prop: string, obj1: T): <U>(obj2: U) => boolean;
|
1710 |
|
1711 | /**
|
1712 | * Returns `true` if its arguments are equivalent, `false` otherwise.
|
1713 | * Handles cyclical data structures.
|
1714 | *
|
1715 | * Dispatches symmetrically to the `equals` methods of both arguments, if present.
|
1716 | *
|
1717 | * @example
|
1718 | * ```typescript
|
1719 | * R.equals(1, 1);
|
1720 | * R.equals([1, 2, 3], [1, 2, 3]);
|
1721 | *
|
1722 | * type Recursive = { v: Recursive; };
|
1723 | *
|
1724 | * const a: Recursive = {} as Recursive; a.v = a;
|
1725 | * const b: Recursive = {} as Recursive; b.v = b;
|
1726 | * R.equals(a, b);
|
1727 | * ```
|
1728 | */
|
1729 | export function equals<T>(__: Placeholder, b: T): (a: T) => boolean;
|
1730 | export function equals<T>(a: T, b: T): boolean;
|
1731 | export function equals<T>(a: T): (b: T) => boolean;
|
1732 |
|
1733 | /**
|
1734 | * Creates a new object by evolving a shallow copy of the `object`,
|
1735 | * according to the functions in `transformations`.
|
1736 | * All non-primitive properties are copied by reference.
|
1737 | *
|
1738 | * A function in `transformations` will not be invoked if its corresponding key does not exist in the evolved object.
|
1739 | *
|
1740 | * @example
|
1741 | * ```typescript
|
1742 | * const tomato = {firstName: ' Tomato ', data: {elapsed: 100, remaining: 1400}, id:123};
|
1743 | * const transformations = {
|
1744 | * firstName: R.trim,
|
1745 | * lastName: R.trim,
|
1746 | * data: {elapsed: R.add(1), remaining: R.add(-1)}
|
1747 | * };
|
1748 | * R.evolve(transformations, tomato);
|
1749 | * ```
|
1750 | */
|
1751 | export function evolve<E extends Evolver, V extends Evolvable<E>>(transformations: E, obj: V): Evolve<V, E>;
|
1752 | export function evolve<E extends Evolver>(transformations: E): <V extends Evolvable<E>>(obj: V) => Evolve<V, E>;
|
1753 |
|
1754 | /**
|
1755 | * A function that always returns `false`.
|
1756 | * Any passed in parameters are ignored.
|
1757 | *
|
1758 | * See also {@link T}.
|
1759 | *
|
1760 | * @example
|
1761 | * ```typescript
|
1762 | * R.F();
|
1763 | * ```
|
1764 | */
|
1765 | export function F(...args: unknown[]): false;
|
1766 |
|
1767 | /**
|
1768 | * Takes a predicate and a `Filterable`,
|
1769 | * and returns a new `Filterable` of the same type
|
1770 | * containing the members of the given `Filterable` which satisfy the given predicate.
|
1771 | * Filterable objects include plain objects or any object that has a filter method such as Array.
|
1772 | *
|
1773 | * Dispatches to the `filter` method of the second argument, if present.
|
1774 | *
|
1775 | * Acts as a transducer if a transformer is given in list position.
|
1776 | *
|
1777 | * See also {@link reject}, {@link transduce}, {@link addIndex}.
|
1778 | *
|
1779 | * @example
|
1780 | * ```typescript
|
1781 | * const isEven = (n: number) => n % 2 === 0;
|
1782 | *
|
1783 | * R.filter(isEven, [1, 2, 3, 4]);
|
1784 | *
|
1785 | * R.filter(isEven, {a: 1, b: 2, c: 3, d: 4});
|
1786 | * ```
|
1787 | */
|
1788 | export function filter<A, P extends A>(
|
1789 | pred: (val: A) => val is P,
|
1790 | ): {
|
1791 | <B extends A>(list: readonly B[]): P[];
|
1792 | <B extends A>(dict: Dictionary<B>): Dictionary<P>;
|
1793 | };
|
1794 | export function filter<T>(
|
1795 | pred: (value: T) => boolean,
|
1796 | ): <P extends T, C extends readonly P[] | Dictionary<P>>(collection: C) => C;
|
1797 | export function filter<T, P extends T>(pred: (val: T) => val is P, list: readonly T[]): P[];
|
1798 | export function filter<T, P extends T>(pred: (val: T) => val is P, dict: Dictionary<T>): Dictionary<P>;
|
1799 | export function filter<T, C extends readonly T[] | Dictionary<T>>(pred: (value: T) => boolean, collection: C): C;
|
1800 |
|
1801 | /**
|
1802 | * Returns the first element of the list which matches the predicate,
|
1803 | * or `undefined` if no element matches.
|
1804 | *
|
1805 | * Dispatches to the `find` method of the second argument, if present.
|
1806 | *
|
1807 | * Acts as a transducer if a transformer is given in list position.
|
1808 | *
|
1809 | * See also {@link transduce}.
|
1810 | *
|
1811 | * @example
|
1812 | * ```typescript
|
1813 | * const xs = [{a: 1}, {a: 2}, {a: 3}];
|
1814 | * R.find(R.propEq('a', 2))(xs);
|
1815 | * R.find(R.propEq('a', 4))(xs);
|
1816 | * ```
|
1817 | */
|
1818 | export function find<T, P extends T>(pred: (val: T) => val is P, list: readonly T[]): P | undefined;
|
1819 | export function find<T>(pred: (val: T) => boolean, list: readonly T[]): T | undefined;
|
1820 | export function find<T, P extends T>(pred: (val: T) => val is P): (list: readonly T[]) => P | undefined;
|
1821 | export function find<T>(pred: (val: T) => boolean): (list: readonly T[]) => T | undefined;
|
1822 |
|
1823 | /**
|
1824 | * Returns the index of the first element of the list which matches the predicate,
|
1825 | * or `-1` if no element matches.
|
1826 | *
|
1827 | * Acts as a transducer if a transformer is given in list position.
|
1828 | *
|
1829 | * See also {@link indexOf}, {@link transduce}.
|
1830 | *
|
1831 | * @example
|
1832 | * ```typescript
|
1833 | * const xs = [{a: 1}, {a: 2}, {a: 3}];
|
1834 | * R.findIndex(R.propEq('a', 2))(xs);
|
1835 | * R.findIndex(R.propEq('a', 4))(xs);
|
1836 | * ```
|
1837 | */
|
1838 | export function findIndex<T>(fn: (a: T) => boolean, list: readonly T[]): number;
|
1839 | export function findIndex<T>(fn: (a: T) => boolean): (list: readonly T[]) => number;
|
1840 |
|
1841 | /**
|
1842 | * Returns the last element of the list which matches the predicate, or `undefined` if no element matches.
|
1843 | *
|
1844 | * Acts as a transducer if a transformer is given in list position.
|
1845 | *
|
1846 | * See also {@link transduce}.
|
1847 | *
|
1848 | * @example
|
1849 | * ```typescript
|
1850 | * const xs = [{a: 1, b: 0}, {a:1, b: 1}];
|
1851 | * R.findLast(R.propEq('a', 1))(xs);
|
1852 | * R.findLast(R.propEq('a', 4))(xs);
|
1853 | * ```
|
1854 | */
|
1855 | export function findLast<T, P extends T>(pred: (val: T) => val is P, list: readonly T[]): P | undefined;
|
1856 | export function findLast<T>(pred: (val: T) => boolean, list: readonly T[]): T | undefined;
|
1857 | export function findLast<T, P extends T>(pred: (val: T) => val is P): (list: readonly T[]) => P | undefined;
|
1858 | export function findLast<T>(pred: (val: T) => boolean): (list: readonly T[]) => T | undefined;
|
1859 |
|
1860 | /**
|
1861 | * Returns the index of the last element of the list which matches the predicate,
|
1862 | * or `-1` if no element matches.
|
1863 | *
|
1864 | * Acts as a transducer if a transformer is given in list position.
|
1865 | *
|
1866 | * See also {@link lastIndexOf}, {@link transduce}.
|
1867 | *
|
1868 | * @example
|
1869 | * ```typescript
|
1870 | * const xs = [{a: 1, b: 0}, {a:1, b: 1}];
|
1871 | * R.findLastIndex(R.propEq('a', 1))(xs);
|
1872 | * R.findLastIndex(R.propEq('a', 4))(xs);
|
1873 | * ```
|
1874 | */
|
1875 | export function findLastIndex<T>(fn: (a: T) => boolean, list: readonly T[]): number;
|
1876 | export function findLastIndex<T>(fn: (a: T) => boolean): (list: readonly T[]) => number;
|
1877 |
|
1878 | /**
|
1879 | * Returns a new list by pulling every item out of it (and all its sub-arrays)
|
1880 | * and putting them in a new array, depth-first.
|
1881 | *
|
1882 | * See also {@link unnest}.
|
1883 | *
|
1884 | * @example
|
1885 | * ```typescript
|
1886 | * R.flatten([1, 2, [3, 4], 5, [6, [7, 8, [9, [10, 11], 12]]]]);
|
1887 | *
|
1888 | * ```
|
1889 | */
|
1890 | export function flatten<T extends readonly any[]>(list: T): _.T.Flatten<T>;
|
1891 |
|
1892 | /**
|
1893 | * Flips the order of the first two arguments to the given function.
|
1894 | *
|
1895 | * @example
|
1896 | * ```typescript
|
1897 | * const mergeThree = <T>(a: T, b: T, c: T) => ([] as T[]).concat(a, b, c);
|
1898 | *
|
1899 | * mergeThree(1, 2, 3);
|
1900 | *
|
1901 | * R.flip(mergeThree)(1, 2, 3);
|
1902 | * ```
|
1903 | */
|
1904 | export function flip<T, U, TResult>(fn: (arg0: T, arg1: U) => TResult): (arg1: U, arg0?: T) => TResult;
|
1905 | export function flip<F extends AnyFunction, P extends _.F.Parameters<F>>(
|
1906 | fn: F,
|
1907 | ): _.F.Curry<(...args: _.T.Merge<[P[1], P[0]], P>) => _.F.Return<F>>;
|
1908 |
|
1909 | /**
|
1910 | * Iterate over the given list, calling the given function for each element in the list.
|
1911 | *
|
1912 | * @note `R.forEach` does not skip deleted or unassigned indices (sparse arrays),
|
1913 | * unlike the native `Array.prototype.forEach` method.
|
1914 | *
|
1915 | * Also note that, unlike `Array.prototype.forEach`, `R.forEach` returns the original array.
|
1916 | * In some libraries this function is named `each`.
|
1917 | *
|
1918 | * Dispatches to the `forEach` method of the second argument, if present.
|
1919 | *
|
1920 | * @example
|
1921 | * ```typescript
|
1922 | * const printXPlusFive = (x: number) => console.log(x + 5);
|
1923 | * R.forEach(printXPlusFive, [1, 2, 3]);
|
1924 | *
|
1925 | *
|
1926 | *
|
1927 | * ```
|
1928 | */
|
1929 | export function forEach<T>(fn: (x: T) => void, list: readonly T[]): T[];
|
1930 | export function forEach<T>(fn: (x: T) => void): (list: readonly T[]) => T[];
|
1931 | export function forEach<T>(fn: (x: T) => void, list: readonly T[]): T[];
|
1932 | export function forEach<T>(fn: (x: T) => void): (list: readonly T[]) => T[];
|
1933 |
|
1934 | /**
|
1935 | * Iterate over the given object, calling the given function for each key and value in the object.
|
1936 | *
|
1937 | * @example
|
1938 | * ```typescript
|
1939 | * const printKeyConcatValue = (value: unknown, key: string) => console.log(key + ':' + value);
|
1940 | * R.forEachObjIndexed(printKeyConcatValue, {x: 1, y: 2});
|
1941 | *
|
1942 | *
|
1943 | * ```
|
1944 | */
|
1945 | export function forEachObjIndexed<T>(fn: (value: T[keyof T], key: keyof T, obj: T) => void, obj: T): T;
|
1946 | export function forEachObjIndexed<T>(fn: (value: T[keyof T], key: keyof T, obj: T) => void): (obj: T) => T;
|
1947 |
|
1948 | /**
|
1949 | * Creates a new object from a list key-value pairs.
|
1950 | * If a key appears in multiple pairs,
|
1951 | * the rightmost pair is included in the object.
|
1952 | *
|
1953 | * See also {@link toPairs}, {@link pair}.
|
1954 | *
|
1955 | * @example
|
1956 | * ```typescript
|
1957 | * R.fromPairs([['a', 1], ['b', 2], ['c', 3]]);
|
1958 | * ```
|
1959 | */
|
1960 | export function fromPairs<V>(
|
1961 | pairs: ReadonlyArray<Readonly<KeyValuePair<string, V>>> | ReadonlyArray<Readonly<KeyValuePair<number, V>>>,
|
1962 | ): { [index: string]: V };
|
1963 |
|
1964 | /**
|
1965 | * Splits a list into sub-lists stored in an object,
|
1966 | * based on the result of calling a key-returning function on each element,
|
1967 | * and grouping the results according to values returned.
|
1968 | *
|
1969 | * Dispatches to the `groupBy` method of the second argument, if present.
|
1970 | *
|
1971 | * Acts as a transducer if a transformer is given in list position.
|
1972 | *
|
1973 | * See also {@link reduceBy}, {@link indexBy}, {@link transduce}.
|
1974 | *
|
1975 | * @example
|
1976 | * ```typescript
|
1977 | * type Student = { name: string; score: number; }
|
1978 | *
|
1979 | * const byGrade = R.groupBy((student: Student) => {
|
1980 | * const score = student.score;
|
1981 | * return score < 65 ? 'F' :
|
1982 | * score < 70 ? 'D' :
|
1983 | * score < 80 ? 'C' :
|
1984 | * score < 90 ? 'B' : 'A';
|
1985 | * });
|
1986 | * const students = [{name: 'Abby', score: 84},
|
1987 | * {name: 'Eddy', score: 58},
|
1988 | *
|
1989 | * {name: 'Jack', score: 69}];
|
1990 | * byGrade(students);
|
1991 | *
|
1992 | *
|
1993 | *
|
1994 | *
|
1995 | *
|
1996 | *
|
1997 | * ```
|
1998 | */
|
1999 | export function groupBy<T, K extends string = string>(fn: (a: T) => K, list: readonly T[]): Record<K, T[]>;
|
2000 | export function groupBy<T, K extends string = string>(fn: (a: T) => K): (list: readonly T[]) => Record<K, T[]>;
|
2001 |
|
2002 | /**
|
2003 | * Takes a list and returns a list of lists
|
2004 | * where every adjacent element of each sublist satisfies the given predicate.
|
2005 | *
|
2006 | * @example
|
2007 | * ```typescript
|
2008 | * R.groupWith(R.equals, [0, 1, 1, 2, 3, 5, 8, 13, 21])
|
2009 | *
|
2010 | *
|
2011 | * R.groupWith((a, b) => a + 1 === b, [0, 1, 1, 2, 3, 5, 8, 13, 21])
|
2012 | *
|
2013 | *
|
2014 | * R.groupWith((a, b) => a % 2 === b % 2, [0, 1, 1, 2, 3, 5, 8, 13, 21])
|
2015 | *
|
2016 | *
|
2017 | * const isVowel = R.test(/^[aeiou]$/i);
|
2018 | * R.groupWith(R.eqBy(isVowel), 'aestiou')
|
2019 | *
|
2020 | * ```
|
2021 | */
|
2022 | export function groupWith<T>(fn: (x: T, y: T) => boolean): (list: readonly T[]) => T[][];
|
2023 | export function groupWith<T>(fn: (x: T, y: T) => boolean, list: readonly T[]): T[][];
|
2024 | export function groupWith<T>(fn: (x: T, y: T) => boolean, list: string): string[];
|
2025 |
|
2026 | /**
|
2027 | * Returns `true` if the first parameter is greater than the second; `false` otherwise.
|
2028 | *
|
2029 | * See also {@link gte}, {@link lt}, {@link lte}.
|
2030 | *
|
2031 | * @example
|
2032 | * ```typescript
|
2033 | * R.gt(2, 1);
|
2034 | * R.gt(2, 2);
|
2035 | * R.gt(2, 3);
|
2036 | * R.gt('a', 'z');
|
2037 | * R.gt('z', 'a');
|
2038 | * ```
|
2039 | */
|
2040 | export function gt(__: Placeholder, b: number): (a: number) => boolean;
|
2041 | export function gt(__: Placeholder): (b: number, a: number) => boolean;
|
2042 | export function gt(a: number, b: number): boolean;
|
2043 | export function gt(a: string, b: string): boolean;
|
2044 | export function gt(a: number): (b: number) => boolean;
|
2045 |
|
2046 | /**
|
2047 | * Returns `true` if the first parameter is greater than or equal to the second; `false` otherwise.
|
2048 | *
|
2049 | * See also {@link gt}, {@link lt}, {@link lte}.
|
2050 | *
|
2051 | * @example
|
2052 | * ```typescript
|
2053 | * R.gte(2, 1);
|
2054 | * R.gte(2, 2);
|
2055 | * R.gte(2, 3);
|
2056 | * R.gte('a', 'z');
|
2057 | * R.gte('z', 'a');
|
2058 | * ```
|
2059 | */
|
2060 | export function gte(__: Placeholder, b: number): (a: number) => boolean;
|
2061 | export function gte(__: Placeholder): (b: number, a: number) => boolean;
|
2062 | export function gte(a: number, b: number): boolean;
|
2063 | export function gte(a: string, b: string): boolean;
|
2064 | export function gte(a: number): (b: number) => boolean;
|
2065 |
|
2066 | /**
|
2067 | * Returns whether or not an object has an own property with the specified name.
|
2068 | *
|
2069 | * @example
|
2070 | * ```typescript
|
2071 | * const hasName = R.has('name');
|
2072 | * hasName({name: 'alice'});
|
2073 | * hasName({name: 'bob'});
|
2074 | * hasName({});
|
2075 | *
|
2076 | * const point = {x: 0, y: 0};
|
2077 | * const pointHas = R.has(R.__, point);
|
2078 | * pointHas('x');
|
2079 | * pointHas('y');
|
2080 | * pointHas('z');
|
2081 | * ```
|
2082 | */
|
2083 | export function has(__: Placeholder, obj: unknown): (s: string) => boolean;
|
2084 | export function has(__: Placeholder): <P extends string>(obj: unknown, s: P) => obj is ObjectHavingSome<P>;
|
2085 | export function has<P extends string>(s: P, obj: unknown): obj is ObjectHavingSome<P>;
|
2086 | export function has<P extends string>(s: P): (obj: unknown) => obj is ObjectHavingSome<P>;
|
2087 |
|
2088 | /**
|
2089 | * Returns whether or not an object or its prototype chain has a property with the specified name.
|
2090 | *
|
2091 | * @example
|
2092 | * ```typescript
|
2093 | * class Rectangle {
|
2094 | * constructor(public width: number, public height: number) {}
|
2095 | *
|
2096 | * area() {
|
2097 | * return this.width * this.height;
|
2098 | * }
|
2099 | * }
|
2100 | *
|
2101 | * const square = new Rectangle(2, 2);
|
2102 | * R.hasIn('width', square);
|
2103 | * R.hasIn('area', square);
|
2104 | * ```
|
2105 | */
|
2106 | export function hasIn<T>(s: string, obj: T): boolean;
|
2107 | export function hasIn(s: string): <T>(obj: T) => boolean;
|
2108 |
|
2109 | /**
|
2110 | * Returns whether or not a path exists in an object. Only the object's own properties are checked.
|
2111 | *
|
2112 | * See also {@link has}.
|
2113 | *
|
2114 | * @example
|
2115 | * ```typescript
|
2116 | * R.hasPath(['a', 'b'], {a: {b: 2}});
|
2117 | * R.hasPath(['a', 'b'], {a: {b: undefined}});
|
2118 | * R.hasPath(['a', 'b'], {a: {c: 2}});
|
2119 | * R.hasPath(['a', 'b'], {});
|
2120 | * ```
|
2121 | */
|
2122 | export function hasPath<T>(list: readonly string[], obj: T): boolean;
|
2123 | export function hasPath(list: readonly string[]): <T>(obj: T) => boolean;
|
2124 |
|
2125 | /**
|
2126 | * Returns the first element in a list.
|
2127 | * In some libraries this function is named `first`.
|
2128 | *
|
2129 | * See also {@link tail}, {@link init}, {@link last}.
|
2130 | *
|
2131 | * @example
|
2132 | * ```typescript
|
2133 | * R.head(['fi', 'fo', 'fum']);
|
2134 | * R.head([]);
|
2135 | *
|
2136 | * R.head('abc');
|
2137 | * R.head('');
|
2138 | * ```
|
2139 | */
|
2140 | export function head(str: string): string;
|
2141 | export function head(list: readonly []): undefined;
|
2142 | export function head<T>(list: readonly T[]): T | undefined;
|
2143 |
|
2144 | /**
|
2145 | * Returns `true` if its arguments are identical, `false` otherwise.
|
2146 | * Values are identical if they reference the same memory.
|
2147 | * `NaN` is identical to `NaN`; `0` and `-0` are not identical.
|
2148 | *
|
2149 | * @note This is merely a curried version of ES6 `Object.is`.
|
2150 | *
|
2151 | * @example
|
2152 | * ```typescript
|
2153 | * const o = {};
|
2154 | * R.identical(o, o);
|
2155 | * R.identical(1, 1);
|
2156 | * R.identical<string | number>(1, '1');
|
2157 | * R.identical([], []);
|
2158 | * R.identical(0, -0);
|
2159 | * R.identical(NaN, NaN);
|
2160 | * ```
|
2161 | */
|
2162 | export function identical<T>(a: T, b: T): boolean;
|
2163 | export function identical<T>(a: T): (b: T) => boolean;
|
2164 |
|
2165 | /**
|
2166 | * A function that returns its argument.
|
2167 | * Good as a default or placeholder function.
|
2168 | *
|
2169 | * @example
|
2170 | * ```typescript
|
2171 | * R.identity(1);
|
2172 | *
|
2173 | * const obj = {};
|
2174 | * R.identity(obj) === obj;
|
2175 | * ```
|
2176 | */
|
2177 | export function identity<T>(a: T): T;
|
2178 |
|
2179 | /**
|
2180 | * Creates a function that will process either the onTrue or the onFalse function depending upon the result
|
2181 | * of the condition predicate.
|
2182 | *
|
2183 | * See also {@link unless}, {@link when}, {@link cond}.
|
2184 | *
|
2185 | * @example
|
2186 | * ```typescript
|
2187 | * const incCount = R.ifElse(
|
2188 | * R.has('count'),
|
2189 | * R.over(R.lensProp<{ count: number; }>('count'), R.inc),
|
2190 | * R.assoc('count', 1)
|
2191 | * );
|
2192 | * incCount({ count: 1 });
|
2193 | * ```
|
2194 | */
|
2195 | export function ifElse<T, TF extends T, TOnTrueResult, TOnFalseResult>(
|
2196 | pred: PredTypeguard<T, TF>,
|
2197 | onTrue: (a: TF) => TOnTrueResult,
|
2198 | onFalse: (a: Exclude<T, TF>) => TOnFalseResult,
|
2199 | ): (a: T) => TOnTrueResult | TOnFalseResult;
|
2200 | export function ifElse<TArgs extends any[], TOnTrueResult, TOnFalseResult>(
|
2201 | fn: Pred<TArgs>,
|
2202 | onTrue: (...args: TArgs) => TOnTrueResult,
|
2203 | onFalse: (...args: TArgs) => TOnFalseResult,
|
2204 | ): (...args: TArgs) => TOnTrueResult | TOnFalseResult;
|
2205 |
|
2206 | /**
|
2207 | * Increments its argument.
|
2208 | *
|
2209 | * See also {@link dec}.
|
2210 | *
|
2211 | * @example
|
2212 | * ```typescript
|
2213 | * R.inc(42);
|
2214 | * ```
|
2215 | */
|
2216 | export function inc(n: number): number;
|
2217 |
|
2218 | /**
|
2219 | * Returns `true` if the specified value is equal, in `R.equals` terms,
|
2220 | * to at least one element of the given list; `false` otherwise.
|
2221 | * Also works with strings.
|
2222 | *
|
2223 | * See also {@link any}.
|
2224 | *
|
2225 | * @example
|
2226 | * ```typescript
|
2227 | * R.includes(3, [1, 2, 3]);
|
2228 | * R.includes(4, [1, 2, 3]);
|
2229 | * R.includes([42], [[42]]);
|
2230 | * R.includes('ba', 'banana');
|
2231 | * R.includes({ name: 'Fred' }, [{ name: 'Fred' }]);
|
2232 | * ```
|
2233 | */
|
2234 | export function includes(__: Placeholder, list: readonly string[] | string): (s: string) => boolean;
|
2235 | export function includes<T>(__: Placeholder, list: readonly T[]): (target: T) => boolean;
|
2236 | export function includes(__: Placeholder): (list: readonly string[] | string, s: string) => boolean;
|
2237 | export function includes<T>(__: Placeholder): (list: readonly T[], target: T) => boolean;
|
2238 | export function includes(s: string, list: readonly string[] | string): boolean;
|
2239 | export function includes(s: string): (list: readonly string[] | string) => boolean;
|
2240 | export function includes<T>(target: T, list: readonly T[]): boolean;
|
2241 | export function includes<T>(target: T): (list: readonly T[]) => boolean;
|
2242 |
|
2243 | /**
|
2244 | * Given a function that generates a key,
|
2245 | * turns a list of objects into an object indexing the objects by the given key.
|
2246 | *
|
2247 | * @note If multiple objects generate the same value for the indexing key
|
2248 | * only the last value will be included in the generated object.
|
2249 | *
|
2250 | * Acts as a transducer if a transformer is given in list position.
|
2251 | *
|
2252 | * See also {@link groupBy}, {@link transduce}.
|
2253 | *
|
2254 | * @example
|
2255 | * ```typescript
|
2256 | * const list = [{id: 'xyz', title: 'A'}, {id: 'abc', title: 'B'}];
|
2257 | * R.indexBy(R.prop('id'), list);
|
2258 | *
|
2259 | * ```
|
2260 | */
|
2261 | export function indexBy<T, K extends string | number = string>(fn: (a: T) => K, list: readonly T[]): { [key in K]: T };
|
2262 | export function indexBy<T, K extends string | number | undefined = string>(
|
2263 | fn: (a: T) => K,
|
2264 | list: readonly T[],
|
2265 | ): { [key in NonNullable<K>]?: T };
|
2266 | export function indexBy<T, K extends string | number = string>(
|
2267 | fn: (a: T) => K,
|
2268 | ): (list: readonly T[]) => { [key in K]: T };
|
2269 | export function indexBy<T, K extends string | number | undefined = string>(
|
2270 | fn: (a: T) => K | undefined,
|
2271 | ): (list: readonly T[]) => { [key in NonNullable<K>]?: T };
|
2272 |
|
2273 | /**
|
2274 | * Returns the position of the first occurrence of an item in an array,
|
2275 | * or -1 if the item is not included in the array.
|
2276 | * {@link equals `R.equals`} is used to determine equality.
|
2277 | *
|
2278 | * See also {@link lastIndexOf}, {@link findIndex}.
|
2279 | *
|
2280 | * @example
|
2281 | * ```typescript
|
2282 | * R.indexOf(3, [1,2,3,4]);
|
2283 | * R.indexOf(10, [1,2,3,4]);
|
2284 | * ```
|
2285 | */
|
2286 | export function indexOf(target: string, list: readonly string[] | string): number;
|
2287 | export function indexOf(target: string): (list: readonly string[] | string) => number;
|
2288 | export function indexOf<T>(target: T, list: readonly T[]): number;
|
2289 | export function indexOf<T>(target: T): (list: readonly T[]) => number;
|
2290 |
|
2291 | /**
|
2292 | * Returns all but the last element of the given list or string.
|
2293 | *
|
2294 | * See also {@link last}, {@link head}, {@link tail}.
|
2295 | *
|
2296 | * @example
|
2297 | * ```typescript
|
2298 | * R.init([1, 2, 3]);
|
2299 | * R.init([1, 2]);
|
2300 | * R.init([1]);
|
2301 | * R.init([]);
|
2302 | *
|
2303 | * R.init('abc');
|
2304 | * R.init('ab');
|
2305 | * R.init('a');
|
2306 | * R.init('');
|
2307 | * ```
|
2308 | */
|
2309 | export function init<T>(list: readonly T[]): T[];
|
2310 | export function init(list: string): string;
|
2311 |
|
2312 | /**
|
2313 | * Takes a predicate `pred`, a list `xs`, and a list `ys`,
|
2314 | * and returns a list `xs'` comprising each of the elements of `xs`
|
2315 | * which is equal to one or more elements of `ys` according to `pred`.
|
2316 | *
|
2317 | * `pred` must be a binary function expecting an element from each list.
|
2318 | *
|
2319 | * `xs`, `ys`, and `xs'` are treated as sets, semantically, so ordering should not be significant,
|
2320 | * but since `xs'` is ordered the implementation guarantees
|
2321 | * that its values are in the same order as they appear in `xs`.
|
2322 | * Duplicates are not removed, so `xs'` may contain duplicates if `xs` contains duplicates.
|
2323 | *
|
2324 | * See also {@link intersection}.
|
2325 | *
|
2326 | * @example
|
2327 | * ```typescript
|
2328 | * R.innerJoin(
|
2329 | * (record, id) => record.id === id,
|
2330 | * [{id: 824, name: 'Richie Furay'},
|
2331 | * {id: 956, name: 'Dewey Martin'},
|
2332 | * {id: 313, name: 'Bruce Palmer'},
|
2333 | * {id: 456, name: 'Stephen Stills'},
|
2334 | * {id: 177, name: 'Neil Young'}],
|
2335 | * [177, 456, 999]
|
2336 | * );
|
2337 | * //=> [{id: 456, name: 'Stephen Stills'}, {id: 177, name: 'Neil Young'}]
|
2338 | * ```
|
2339 | */
|
2340 | export function innerJoin<T1, T2>(pred: (a: T1, b: T2) => boolean, list1: readonly T1[], list2: readonly T2[]): T1[];
|
2341 | export function innerJoin<T1, T2>(
|
2342 | pred: (a: T1, b: T2) => boolean,
|
2343 | ): (list1: readonly T1[], list2: readonly T2[]) => T1[];
|
2344 | export function innerJoin<T1, T2>(
|
2345 | pred: (a: T1, b: T2) => boolean,
|
2346 | list1: readonly T1[],
|
2347 | ): (list2: readonly T2[]) => T1[];
|
2348 |
|
2349 |
|
2350 |
|
2351 |
|
2352 |
|
2353 |
|
2354 |
|
2355 |
|
2356 |
|
2357 | export function insert<T>(index: number, elt: T, list: readonly T[]): T[];
|
2358 | export function insert<T>(index: number, elt: T): (list: readonly T[]) => T[];
|
2359 | export function insert(index: number): <T>(elt: T, list: readonly T[]) => T[];
|
2360 |
|
2361 |
|
2362 |
|
2363 |
|
2364 |
|
2365 |
|
2366 |
|
2367 |
|
2368 |
|
2369 | export function insertAll<T>(index: number, elts: readonly T[], list: readonly T[]): T[];
|
2370 | export function insertAll<T>(index: number, elts: readonly T[]): (list: readonly T[]) => T[];
|
2371 | export function insertAll(index: number): <T>(elts: readonly T[], list: readonly T[]) => T[];
|
2372 |
|
2373 |
|
2374 |
|
2375 |
|
2376 |
|
2377 |
|
2378 |
|
2379 |
|
2380 |
|
2381 |
|
2382 |
|
2383 | export function intersection<T>(list1: readonly T[], list2: readonly T[]): T[];
|
2384 | export function intersection<T>(list1: readonly T[]): (list2: readonly T[]) => T[];
|
2385 |
|
2386 |
|
2387 |
|
2388 |
|
2389 |
|
2390 |
|
2391 |
|
2392 |
|
2393 |
|
2394 |
|
2395 |
|
2396 | export function intersperse<T>(separator: T, list: readonly T[]): T[];
|
2397 | export function intersperse<T>(separator: T): (list: readonly T[]) => T[];
|
2398 |
|
2399 |
|
2400 |
|
2401 |
|
2402 |
|
2403 |
|
2404 |
|
2405 |
|
2406 |
|
2407 |
|
2408 |
|
2409 |
|
2410 |
|
2411 |
|
2412 |
|
2413 |
|
2414 |
|
2415 |
|
2416 |
|
2417 |
|
2418 |
|
2419 |
|
2420 |
|
2421 |
|
2422 |
|
2423 |
|
2424 |
|
2425 |
|
2426 |
|
2427 |
|
2428 |
|
2429 | export function into<T>(acc: any, xf: AnyFunction, list: readonly T[]): T[];
|
2430 | export function into<T, R>(acc: any, xf: (...args: any[]) => R[], list: readonly T[]): R[];
|
2431 | export function into(acc: any, xf: AnyFunction): <T>(list: readonly T[]) => T[];
|
2432 | export function into(acc: any): <T>(xf: AnyFunction, list: readonly T[]) => T[];
|
2433 |
|
2434 |
|
2435 |
|
2436 |
|
2437 |
|
2438 |
|
2439 |
|
2440 |
|
2441 |
|
2442 |
|
2443 |
|
2444 |
|
2445 |
|
2446 |
|
2447 |
|
2448 |
|
2449 |
|
2450 |
|
2451 | export function invert<T>(obj: T): { [index: string]: string[] };
|
2452 |
|
2453 |
|
2454 |
|
2455 |
|
2456 |
|
2457 |
|
2458 |
|
2459 |
|
2460 |
|
2461 |
|
2462 |
|
2463 |
|
2464 |
|
2465 |
|
2466 |
|
2467 |
|
2468 |
|
2469 |
|
2470 |
|
2471 |
|
2472 |
|
2473 |
|
2474 |
|
2475 |
|
2476 | export function invertObj(obj: { [index: string]: string } | { [index: number]: string }): { [index: string]: string };
|
2477 |
|
2478 |
|
2479 |
|
2480 |
|
2481 |
|
2482 |
|
2483 |
|
2484 |
|
2485 |
|
2486 |
|
2487 |
|
2488 |
|
2489 |
|
2490 |
|
2491 |
|
2492 |
|
2493 |
|
2494 |
|
2495 |
|
2496 |
|
2497 |
|
2498 |
|
2499 | export function invoker(arity: number, method: string): (...args: unknown[]) => any;
|
2500 |
|
2501 |
|
2502 |
|
2503 |
|
2504 |
|
2505 |
|
2506 |
|
2507 |
|
2508 | export function is<C extends AnyFunction>(ctor: C, val: any): val is ReturnType<C>;
|
2509 | export function is<C extends AnyConstructor>(ctor: C, val: any): val is InstanceType<C>;
|
2510 | export function is<C extends AnyFunction>(ctor: C): (val: any) => val is ReturnType<C>;
|
2511 | export function is<C extends AnyConstructor>(ctor: C): (val: any) => val is InstanceType<C>;
|
2512 |
|
2513 |
|
2514 |
|
2515 |
|
2516 |
|
2517 |
|
2518 |
|
2519 |
|
2520 |
|
2521 |
|
2522 |
|
2523 |
|
2524 |
|
2525 |
|
2526 |
|
2527 |
|
2528 |
|
2529 | export function isEmpty(value: any): boolean;
|
2530 |
|
2531 |
|
2532 |
|
2533 |
|
2534 |
|
2535 |
|
2536 |
|
2537 |
|
2538 |
|
2539 |
|
2540 |
|
2541 |
|
2542 | export function isNil(value: any): value is null | undefined;
|
2543 |
|
2544 |
|
2545 |
|
2546 |
|
2547 |
|
2548 |
|
2549 |
|
2550 |
|
2551 |
|
2552 |
|
2553 |
|
2554 |
|
2555 |
|
2556 |
|
2557 | export function join(x: string, xs: readonly any[]): string;
|
2558 | export function join(x: string): (xs: readonly any[]) => string;
|
2559 |
|
2560 |
|
2561 |
|
2562 |
|
2563 |
|
2564 |
|
2565 |
|
2566 |
|
2567 |
|
2568 |
|
2569 |
|
2570 |
|
2571 | export function juxt<A extends any[], R1>(fns: [(...args: A) => R1]): (...args: A) => [R1];
|
2572 | export function juxt<A extends any[], R1, R2>(fns: [(...args: A) => R1, (...args: A) => R2]): (...args: A) => [R1, R2];
|
2573 | export function juxt<A extends any[], R1, R2, R3>(
|
2574 | fns: [(...args: A) => R1, (...args: A) => R2, (...args: A) => R3],
|
2575 | ): (...args: A) => [R1, R2, R3];
|
2576 | export function juxt<A extends any[], R1, R2, R3, R4>(
|
2577 | fns: [(...args: A) => R1, (...args: A) => R2, (...args: A) => R3, (...args: A) => R4],
|
2578 | ): (...args: A) => [R1, R2, R3, R4];
|
2579 | export function juxt<A extends any[], R1, R2, R3, R4, R5>(
|
2580 | fns: [(...args: A) => R1, (...args: A) => R2, (...args: A) => R3, (...args: A) => R4, (...args: A) => R5],
|
2581 | ): (...args: A) => [R1, R2, R3, R4, R5];
|
2582 | export function juxt<A extends any[], U>(fns: ReadonlyArray<(...args: A) => U>): (...args: A) => U[];
|
2583 |
|
2584 |
|
2585 |
|
2586 |
|
2587 |
|
2588 |
|
2589 |
|
2590 |
|
2591 |
|
2592 |
|
2593 |
|
2594 |
|
2595 |
|
2596 | export function keys<T extends object>(x: T): Array<keyof T>;
|
2597 | export function keys<T>(x: T): string[];
|
2598 |
|
2599 |
|
2600 |
|
2601 |
|
2602 |
|
2603 |
|
2604 |
|
2605 |
|
2606 |
|
2607 |
|
2608 |
|
2609 |
|
2610 |
|
2611 |
|
2612 |
|
2613 |
|
2614 |
|
2615 |
|
2616 |
|
2617 |
|
2618 | export function keysIn<T>(obj: T): string[];
|
2619 |
|
2620 |
|
2621 |
|
2622 |
|
2623 |
|
2624 |
|
2625 |
|
2626 |
|
2627 |
|
2628 |
|
2629 |
|
2630 |
|
2631 |
|
2632 |
|
2633 |
|
2634 | export function last(str: string): string;
|
2635 | export function last(list: readonly []): undefined;
|
2636 | export function last<T>(list: readonly T[]): T | undefined;
|
2637 |
|
2638 |
|
2639 |
|
2640 |
|
2641 |
|
2642 |
|
2643 |
|
2644 |
|
2645 |
|
2646 |
|
2647 |
|
2648 |
|
2649 |
|
2650 |
|
2651 | export function lastIndexOf(target: string, list: readonly string[] | string): number;
|
2652 | export function lastIndexOf(target: string): (list: readonly string[] | string) => number;
|
2653 | export function lastIndexOf<T>(target: T, list: readonly T[]): number;
|
2654 | export function lastIndexOf<T>(target: T): (list: readonly T[]) => number;
|
2655 |
|
2656 |
|
2657 |
|
2658 |
|
2659 |
|
2660 |
|
2661 |
|
2662 |
|
2663 |
|
2664 |
|
2665 | export function length<T extends ArrayLike<unknown>>(list: T): number;
|
2666 |
|
2667 |
|
2668 |
|
2669 |
|
2670 |
|
2671 |
|
2672 |
|
2673 |
|
2674 | export function lens<S, A>(getter: (s: S) => A, setter: (a: A, s: S) => S): Lens<S, A>;
|
2675 |
|
2676 |
|
2677 |
|
2678 |
|
2679 |
|
2680 |
|
2681 |
|
2682 |
|
2683 |
|
2684 |
|
2685 |
|
2686 |
|
2687 |
|
2688 |
|
2689 |
|
2690 | export function lensIndex<A>(n: number): Lens<A[], A>;
|
2691 | export function lensIndex<A extends any[], N extends number>(n: N): Lens<A, A[N]>;
|
2692 |
|
2693 |
|
2694 |
|
2695 |
|
2696 |
|
2697 |
|
2698 |
|
2699 |
|
2700 |
|
2701 |
|
2702 |
|
2703 |
|
2704 |
|
2705 |
|
2706 |
|
2707 |
|
2708 |
|
2709 |
|
2710 | export function lensPath<S, K0 extends keyof S = keyof S>(path: [K0]): Lens<S, S[K0]>;
|
2711 | export function lensPath<S, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0]>(
|
2712 | path: [K0, K1],
|
2713 | ): Lens<S, S[K0][K1]>;
|
2714 | export function lensPath<
|
2715 | S,
|
2716 | K0 extends keyof S = keyof S,
|
2717 | K1 extends keyof S[K0] = keyof S[K0],
|
2718 | K2 extends keyof S[K0][K1] = keyof S[K0][K1],
|
2719 | >(path: [K0, K1, K2]): Lens<S, S[K0][K1][K2]>;
|
2720 | export function lensPath<
|
2721 | S,
|
2722 | K0 extends keyof S = keyof S,
|
2723 | K1 extends keyof S[K0] = keyof S[K0],
|
2724 | K2 extends keyof S[K0][K1] = keyof S[K0][K1],
|
2725 | K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],
|
2726 | >(path: [K0, K1, K2, K3]): Lens<S, S[K0][K1][K2][K3]>;
|
2727 | export function lensPath<
|
2728 | S,
|
2729 | K0 extends keyof S = keyof S,
|
2730 | K1 extends keyof S[K0] = keyof S[K0],
|
2731 | K2 extends keyof S[K0][K1] = keyof S[K0][K1],
|
2732 | K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],
|
2733 | K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3],
|
2734 | >(path: [K0, K1, K2, K3, K4]): Lens<S, S[K0][K1][K2][K3][K4]>;
|
2735 | export function lensPath<
|
2736 | S,
|
2737 | K0 extends keyof S = keyof S,
|
2738 | K1 extends keyof S[K0] = keyof S[K0],
|
2739 | K2 extends keyof S[K0][K1] = keyof S[K0][K1],
|
2740 | K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],
|
2741 | K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3],
|
2742 | K5 extends keyof S[K0][K1][K2][K3][K4] = keyof S[K0][K1][K2][K3][K4],
|
2743 | >(path: [K0, K1, K2, K3, K4, K5]): Lens<S, S[K0][K1][K2][K3][K4][K5]>;
|
2744 |
|
2745 | export function lensPath<S = any, A = any>(path: Path): Lens<S, A>;
|
2746 |
|
2747 |
|
2748 |
|
2749 |
|
2750 |
|
2751 |
|
2752 |
|
2753 |
|
2754 |
|
2755 |
|
2756 |
|
2757 |
|
2758 |
|
2759 |
|
2760 |
|
2761 |
|
2762 |
|
2763 | export function lensProp<S, K extends keyof S = keyof S>(prop: K): Lens<S, S[K]>;
|
2764 |
|
2765 |
|
2766 |
|
2767 |
|
2768 |
|
2769 |
|
2770 |
|
2771 |
|
2772 |
|
2773 |
|
2774 |
|
2775 |
|
2776 |
|
2777 |
|
2778 |
|
2779 |
|
2780 |
|
2781 |
|
2782 | export function lift<F extends AnyFunction>(
|
2783 | fn: F,
|
2784 | ): {
|
2785 | (...args: ToTupleOfArray<Parameters<F>>): Array<ReturnType<F>>;
|
2786 | <R>(...args: ToTupleOfFunction<R, Parameters<F>>): (arg: R) => ReturnType<F>;
|
2787 | };
|
2788 |
|
2789 |
|
2790 |
|
2791 |
|
2792 |
|
2793 |
|
2794 |
|
2795 |
|
2796 |
|
2797 |
|
2798 |
|
2799 |
|
2800 |
|
2801 |
|
2802 | export function liftN<N extends number, F extends AnyFunction>(
|
2803 | n: N,
|
2804 | fn: F,
|
2805 | ): {
|
2806 | (...args: Take<N, ToTupleOfArray<Parameters<F>>>): Array<ReturnType<F>>;
|
2807 | <R>(...args: Take<N, ToTupleOfFunction<R, Parameters<F>>>): (arg: R) => ReturnType<F>;
|
2808 | };
|
2809 |
|
2810 |
|
2811 |
|
2812 |
|
2813 |
|
2814 |
|
2815 |
|
2816 |
|
2817 |
|
2818 |
|
2819 |
|
2820 |
|
2821 |
|
2822 |
|
2823 |
|
2824 | export function lt(__: Placeholder, b: number): (a: number) => boolean;
|
2825 | export function lt(__: Placeholder): (b: number, a: number) => boolean;
|
2826 | export function lt(a: number, b: number): boolean;
|
2827 | export function lt(a: string, b: string): boolean;
|
2828 | export function lt(a: number): (b: number) => boolean;
|
2829 |
|
2830 |
|
2831 |
|
2832 |
|
2833 |
|
2834 |
|
2835 |
|
2836 |
|
2837 |
|
2838 |
|
2839 |
|
2840 |
|
2841 |
|
2842 |
|
2843 |
|
2844 | export function lte(__: Placeholder, b: number): (a: number) => boolean;
|
2845 | export function lte(__: Placeholder): (b: number, a: number) => boolean;
|
2846 | export function lte(a: number, b: number): boolean;
|
2847 | export function lte(a: string, b: string): boolean;
|
2848 | export function lte(a: number): (b: number) => boolean;
|
2849 |
|
2850 |
|
2851 |
|
2852 |
|
2853 |
|
2854 |
|
2855 |
|
2856 |
|
2857 |
|
2858 |
|
2859 |
|
2860 |
|
2861 |
|
2862 |
|
2863 |
|
2864 |
|
2865 |
|
2866 |
|
2867 |
|
2868 |
|
2869 |
|
2870 |
|
2871 |
|
2872 |
|
2873 |
|
2874 |
|
2875 | export function map<T, U>(fn: (x: T) => U, list: readonly T[]): U[];
|
2876 | export function map<T, U>(fn: (x: T) => U): (list: readonly T[]) => U[];
|
2877 | export function map<T, U>(fn: (x: T[keyof T & keyof U] | ValueOfUnion<T>) => U[keyof T & keyof U], list: T): U;
|
2878 | export function map<T, U>(fn: (x: T[keyof T & keyof U] | ValueOfUnion<T>) => U[keyof T & keyof U]): (list: T) => U;
|
2879 | export function map<T, U>(fn: (x: T) => U, obj: Functor<T>): Functor<U>;
|
2880 | export function map<T, U>(fn: (x: T) => U): (obj: Functor<T>) => Functor<U>;
|
2881 |
|
2882 |
|
2883 |
|
2884 |
|
2885 |
|
2886 |
|
2887 |
|
2888 |
|
2889 |
|
2890 |
|
2891 |
|
2892 |
|
2893 |
|
2894 |
|
2895 |
|
2896 |
|
2897 |
|
2898 |
|
2899 |
|
2900 |
|
2901 | export function mapAccum<T, U, TResult>(
|
2902 | fn: (acc: U, value: T) => [U, TResult],
|
2903 | acc: U,
|
2904 | list: readonly T[],
|
2905 | ): [U, TResult[]];
|
2906 | export function mapAccum<T, U, TResult>(
|
2907 | fn: (acc: U, value: T) => [U, TResult],
|
2908 | ): (acc: U, list: readonly T[]) => [U, TResult[]];
|
2909 | export function mapAccum<T, U, TResult>(
|
2910 | fn: (acc: U, value: T) => [U, TResult],
|
2911 | acc: U,
|
2912 | ): (list: readonly T[]) => [U, TResult[]];
|
2913 |
|
2914 |
|
2915 |
|
2916 |
|
2917 |
|
2918 |
|
2919 |
|
2920 |
|
2921 |
|
2922 |
|
2923 |
|
2924 |
|
2925 |
|
2926 |
|
2927 |
|
2928 |
|
2929 |
|
2930 |
|
2931 |
|
2932 |
|
2933 |
|
2934 | export function mapAccumRight<T, U, TResult>(
|
2935 | fn: (acc: U, value: T) => [U, TResult],
|
2936 | acc: U,
|
2937 | list: readonly T[],
|
2938 | ): [U, TResult[]];
|
2939 | export function mapAccumRight<T, U, TResult>(
|
2940 | fn: (acc: U, value: T) => [U, TResult],
|
2941 | ): (acc: U, list: readonly T[]) => [U, TResult[]];
|
2942 | export function mapAccumRight<T, U, TResult>(
|
2943 | fn: (acc: U, value: T) => [U, TResult],
|
2944 | acc: U,
|
2945 | ): (list: readonly T[]) => [U, TResult[]];
|
2946 |
|
2947 |
|
2948 |
|
2949 |
|
2950 | type PartialRecord<K extends keyof any, T> = {
|
2951 | [P in K]?: T;
|
2952 | };
|
2953 | export function mapObjIndexed<T, TResult, TKey extends string>(
|
2954 | fn: (value: T, key: TKey, obj?: Record<TKey, T>) => TResult,
|
2955 | obj: Record<TKey, T>,
|
2956 | ): Record<TKey, TResult>;
|
2957 | export function mapObjIndexed<T, TResult, TKey extends string>(
|
2958 | fn: (value: T, key: TKey, obj?: Record<TKey, T>) => TResult,
|
2959 | obj: PartialRecord<TKey, T>,
|
2960 | ): PartialRecord<TKey, TResult>;
|
2961 | export function mapObjIndexed<T, TResult, TKey extends string>(
|
2962 | fn: (value: T, key: TKey, obj?: Record<TKey, T>) => TResult,
|
2963 | ): (obj: Record<TKey, T>) => Record<TKey, TResult>;
|
2964 | export function mapObjIndexed<T, TResult, TKey extends string>(
|
2965 | fn: (value: T, key: TKey, obj?: PartialRecord<TKey, T>) => TResult,
|
2966 | ): (obj: Record<TKey, T>) => PartialRecord<TKey, TResult>;
|
2967 | export function mapObjIndexed<T, TResult>(
|
2968 | fn: (
|
2969 | value: T,
|
2970 | key: string,
|
2971 | obj?: {
|
2972 | [key: string]: T;
|
2973 | },
|
2974 | ) => TResult,
|
2975 | obj: {
|
2976 | [key: string]: T;
|
2977 | },
|
2978 | ): {
|
2979 | [key: string]: TResult;
|
2980 | };
|
2981 |
|
2982 |
|
2983 |
|
2984 |
|
2985 |
|
2986 |
|
2987 |
|
2988 |
|
2989 |
|
2990 |
|
2991 |
|
2992 |
|
2993 |
|
2994 | export function match(regexp: RegExp, str: string): string[];
|
2995 | export function match(regexp: RegExp): (str: string) => string[];
|
2996 |
|
2997 |
|
2998 |
|
2999 |
|
3000 |
|
3001 |
|
3002 |
|
3003 |
|
3004 |
|
3005 |
|
3006 |
|
3007 |
|
3008 |
|
3009 |
|
3010 |
|
3011 |
|
3012 |
|
3013 |
|
3014 |
|
3015 |
|
3016 |
|
3017 |
|
3018 |
|
3019 |
|
3020 |
|
3021 |
|
3022 |
|
3023 |
|
3024 |
|
3025 | export function mathMod(__: Placeholder, b: number): (a: number) => number;
|
3026 | export function mathMod(__: Placeholder): (b: number, a: number) => number;
|
3027 | export function mathMod(a: number, b: number): number;
|
3028 | export function mathMod(a: number): (b: number) => number;
|
3029 |
|
3030 |
|
3031 |
|
3032 |
|
3033 |
|
3034 |
|
3035 |
|
3036 |
|
3037 |
|
3038 |
|
3039 |
|
3040 |
|
3041 | export function max<T extends Ord>(a: T, b: T): T;
|
3042 | export function max<T extends Ord>(a: T): (b: T) => T;
|
3043 |
|
3044 |
|
3045 |
|
3046 |
|
3047 |
|
3048 |
|
3049 |
|
3050 |
|
3051 |
|
3052 |
|
3053 |
|
3054 |
|
3055 |
|
3056 |
|
3057 |
|
3058 |
|
3059 |
|
3060 |
|
3061 | export function maxBy<T>(keyFn: (a: T) => Ord, a: T, b: T): T;
|
3062 | export function maxBy<T>(keyFn: (a: T) => Ord, a: T): (b: T) => T;
|
3063 | export function maxBy<T>(keyFn: (a: T) => Ord): _.F.Curry<(a: T, b: T) => T>;
|
3064 |
|
3065 |
|
3066 |
|
3067 |
|
3068 |
|
3069 |
|
3070 |
|
3071 |
|
3072 |
|
3073 |
|
3074 |
|
3075 |
|
3076 | export function mean(list: readonly number[]): number;
|
3077 |
|
3078 |
|
3079 |
|
3080 |
|
3081 |
|
3082 |
|
3083 |
|
3084 |
|
3085 |
|
3086 |
|
3087 |
|
3088 |
|
3089 |
|
3090 | export function median(list: readonly number[]): number;
|
3091 |
|
3092 |
|
3093 |
|
3094 |
|
3095 |
|
3096 |
|
3097 |
|
3098 |
|
3099 |
|
3100 |
|
3101 |
|
3102 |
|
3103 |
|
3104 |
|
3105 |
|
3106 |
|
3107 |
|
3108 |
|
3109 |
|
3110 | export function memoizeWith<T extends AnyFunction>(keyFn: (...v: Parameters<T>) => string, fn: T): T;
|
3111 |
|
3112 |
|
3113 |
|
3114 |
|
3115 |
|
3116 |
|
3117 |
|
3118 |
|
3119 | export function merge<O2 extends object>(__: Placeholder, b: O2): <O1 extends object>(a: O1) => Merge<O2, O1, 'flat'>;
|
3120 | export function merge(__: Placeholder): <O1 extends object, O2 extends object>(b: O2, a: O1) => Merge<O2, O1, 'flat'>;
|
3121 | export function merge<O1 extends object, O2 extends object>(a: O1, b: O2): Merge<O2, O1, 'flat'>;
|
3122 | export function merge<O1 extends object>(a: O1): <O2 extends object>(b: O2) => Merge<O2, O1, 'flat'>;
|
3123 |
|
3124 |
|
3125 |
|
3126 |
|
3127 |
|
3128 |
|
3129 |
|
3130 |
|
3131 |
|
3132 |
|
3133 |
|
3134 |
|
3135 |
|
3136 |
|
3137 | export function mergeAll<Os extends readonly object[]>(list: Os): MergeAll<Os>;
|
3138 |
|
3139 |
|
3140 |
|
3141 |
|
3142 |
|
3143 |
|
3144 |
|
3145 |
|
3146 |
|
3147 |
|
3148 |
|
3149 |
|
3150 |
|
3151 |
|
3152 |
|
3153 |
|
3154 |
|
3155 |
|
3156 | export function mergeDeepLeft<O1 extends object, O2 extends object>(o1: O1, o2: O2): Merge<O1, O2, 'deep'>;
|
3157 | export function mergeDeepLeft<O1 extends object>(o1: O1): <O2 extends object>(o2: O2) => Merge<O1, O2, 'deep'>;
|
3158 |
|
3159 |
|
3160 |
|
3161 |
|
3162 |
|
3163 |
|
3164 |
|
3165 |
|
3166 |
|
3167 |
|
3168 |
|
3169 |
|
3170 |
|
3171 |
|
3172 |
|
3173 |
|
3174 |
|
3175 |
|
3176 | export function mergeDeepRight<O1 extends object, O2 extends object>(o1: O1, o2: O2): Merge<O2, O1, 'deep'>;
|
3177 | export function mergeDeepRight<O1 extends object>(a: O1): <O2 extends object>(o2: O2) => Merge<O2, O1, 'deep'>;
|
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 |
|
3183 |
|
3184 |
|
3185 |
|
3186 |
|
3187 |
|
3188 |
|
3189 |
|
3190 |
|
3191 |
|
3192 |
|
3193 |
|
3194 |
|
3195 |
|
3196 |
|
3197 |
|
3198 |
|
3199 | export function mergeDeepWith<T1, T2>(fn: (x: any, z: any) => any, a: T1, b: T2): any;
|
3200 | export function mergeDeepWith<T1, T2>(fn: (x: any, z: any) => any, a: T1): (b: T2) => any;
|
3201 | export function mergeDeepWith<T1, T2>(fn: (x: any, z: any) => any): (a: T1, b: T2) => any;
|
3202 |
|
3203 |
|
3204 |
|
3205 |
|
3206 |
|
3207 |
|
3208 |
|
3209 |
|
3210 |
|
3211 |
|
3212 |
|
3213 |
|
3214 |
|
3215 |
|
3216 |
|
3217 |
|
3218 |
|
3219 |
|
3220 |
|
3221 | export function mergeDeepWithKey<T1, T2>(fn: (k: string, x: any, z: any) => any, a: T1, b: T2): any;
|
3222 | export function mergeDeepWithKey<T1, T2>(fn: (k: string, x: any, z: any) => any, a: T1): (b: T2) => any;
|
3223 | export function mergeDeepWithKey<T1, T2>(fn: (k: string, x: any, z: any) => any): (a: T1, b: T2) => any;
|
3224 |
|
3225 |
|
3226 |
|
3227 |
|
3228 |
|
3229 |
|
3230 |
|
3231 |
|
3232 |
|
3233 |
|
3234 |
|
3235 |
|
3236 |
|
3237 |
|
3238 |
|
3239 |
|
3240 |
|
3241 |
|
3242 | export function mergeLeft<O1 extends object, O2 extends object>(a: O1, b: O2): Merge<O1, O2, 'flat'>;
|
3243 | export function mergeLeft<O1 extends object>(a: O1): <O2 extends object>(b: O2) => Merge<O1, O2, 'flat'>;
|
3244 |
|
3245 |
|
3246 |
|
3247 |
|
3248 |
|
3249 |
|
3250 |
|
3251 |
|
3252 |
|
3253 |
|
3254 |
|
3255 |
|
3256 |
|
3257 |
|
3258 |
|
3259 |
|
3260 | export function mergeRight<O1 extends object, O2 extends object>(a: O1, b: O2): Merge<O2, O1, 'flat'>;
|
3261 | export function mergeRight<O1 extends object>(a: O1): <O2 extends object>(b: O2) => Merge<O2, O1, 'flat'>;
|
3262 |
|
3263 |
|
3264 |
|
3265 |
|
3266 |
|
3267 |
|
3268 |
|
3269 |
|
3270 |
|
3271 |
|
3272 |
|
3273 |
|
3274 |
|
3275 |
|
3276 |
|
3277 |
|
3278 |
|
3279 |
|
3280 |
|
3281 | export function mergeWith<U, V>(fn: (x: any, z: any) => any, a: U, b: V): any;
|
3282 | export function mergeWith<U>(fn: (x: any, z: any) => any, a: U): <V>(b: V) => any;
|
3283 | export function mergeWith(fn: (x: any, z: any) => any): <U, V>(a: U, b: V) => any;
|
3284 |
|
3285 |
|
3286 |
|
3287 |
|
3288 |
|
3289 |
|
3290 |
|
3291 |
|
3292 |
|
3293 |
|
3294 |
|
3295 |
|
3296 |
|
3297 |
|
3298 |
|
3299 |
|
3300 |
|
3301 |
|
3302 |
|
3303 |
|
3304 | export function mergeWithKey<U, V>(fn: (str: string, x: any, z: any) => any, a: U, b: V): any;
|
3305 | export function mergeWithKey<U>(fn: (str: string, x: any, z: any) => any, a: U): <V>(b: V) => any;
|
3306 | export function mergeWithKey(fn: (str: string, x: any, z: any) => any): <U, V>(a: U, b: V) => any;
|
3307 |
|
3308 |
|
3309 |
|
3310 |
|
3311 |
|
3312 |
|
3313 |
|
3314 |
|
3315 |
|
3316 |
|
3317 |
|
3318 |
|
3319 | export function min<T extends Ord>(a: T, b: T): T;
|
3320 | export function min<T extends Ord>(a: T): (b: T) => T;
|
3321 |
|
3322 |
|
3323 |
|
3324 |
|
3325 |
|
3326 |
|
3327 |
|
3328 |
|
3329 |
|
3330 |
|
3331 |
|
3332 |
|
3333 |
|
3334 |
|
3335 |
|
3336 |
|
3337 |
|
3338 |
|
3339 |
|
3340 | export function minBy<T>(keyFn: (a: T) => Ord, a: T, b: T): T;
|
3341 | export function minBy<T>(keyFn: (a: T) => Ord, a: T): (b: T) => T;
|
3342 | export function minBy<T>(keyFn: (a: T) => Ord): _.F.Curry<(a: T, b: T) => T>;
|
3343 |
|
3344 |
|
3345 |
|
3346 |
|
3347 |
|
3348 |
|
3349 |
|
3350 |
|
3351 |
|
3352 |
|
3353 |
|
3354 |
|
3355 |
|
3356 |
|
3357 |
|
3358 |
|
3359 |
|
3360 |
|
3361 |
|
3362 |
|
3363 |
|
3364 |
|
3365 | export function modulo(__: Placeholder, b: number): (a: number) => number;
|
3366 | export function modulo(__: Placeholder): (b: number, a: number) => number;
|
3367 | export function modulo(a: number, b: number): number;
|
3368 | export function modulo(a: number): (b: number) => number;
|
3369 |
|
3370 |
|
3371 |
|
3372 |
|
3373 |
|
3374 |
|
3375 |
|
3376 |
|
3377 |
|
3378 |
|
3379 |
|
3380 | export function move<T>(from: number, to: number, list: readonly T[]): T[];
|
3381 | export function move(from: number, to: number): <T>(list: readonly T[]) => T[];
|
3382 | export function move(from: number): {
|
3383 | <T>(to: number, list: readonly T[]): T[];
|
3384 | (to: number): <T>(list: readonly T[]) => T[];
|
3385 | };
|
3386 |
|
3387 |
|
3388 |
|
3389 |
|
3390 |
|
3391 |
|
3392 |
|
3393 |
|
3394 |
|
3395 |
|
3396 |
|
3397 |
|
3398 |
|
3399 |
|
3400 |
|
3401 | export function multiply(a: number, b: number): number;
|
3402 | export function multiply(a: number): (b: number) => number;
|
3403 |
|
3404 |
|
3405 |
|
3406 |
|
3407 |
|
3408 |
|
3409 |
|
3410 |
|
3411 |
|
3412 |
|
3413 |
|
3414 |
|
3415 |
|
3416 |
|
3417 |
|
3418 |
|
3419 |
|
3420 |
|
3421 |
|
3422 |
|
3423 | export function nAry<N extends number, T extends AnyFunction>(
|
3424 | n: N,
|
3425 | fn: T,
|
3426 | ): (...arg: _.T.Take<Parameters<T>, _.N.NumberOf<N>>) => ReturnType<T>;
|
3427 | export function nAry<N extends number>(
|
3428 | n: N,
|
3429 | ): <T extends AnyFunction>(fn: T) => (...arg: _.T.Take<Parameters<T>, _.N.NumberOf<N>>) => ReturnType<T>;
|
3430 |
|
3431 |
|
3432 |
|
3433 |
|
3434 |
|
3435 |
|
3436 |
|
3437 |
|
3438 |
|
3439 | export function negate(n: number): number;
|
3440 |
|
3441 |
|
3442 |
|
3443 |
|
3444 |
|
3445 |
|
3446 |
|
3447 |
|
3448 |
|
3449 |
|
3450 |
|
3451 |
|
3452 |
|
3453 |
|
3454 |
|
3455 |
|
3456 |
|
3457 |
|
3458 |
|
3459 | export function none<T>(fn: (a: T) => boolean, list: readonly T[]): boolean;
|
3460 | export function none<T>(fn: (a: T) => boolean): (list: readonly T[]) => boolean;
|
3461 |
|
3462 |
|
3463 |
|
3464 |
|
3465 |
|
3466 |
|
3467 |
|
3468 |
|
3469 |
|
3470 |
|
3471 |
|
3472 |
|
3473 |
|
3474 |
|
3475 |
|
3476 | export function not(value: any): boolean;
|
3477 |
|
3478 |
|
3479 |
|
3480 |
|
3481 |
|
3482 |
|
3483 |
|
3484 |
|
3485 |
|
3486 |
|
3487 |
|
3488 |
|
3489 |
|
3490 |
|
3491 |
|
3492 |
|
3493 |
|
3494 | export function nth<T>(n: number, list: readonly T[]): T | undefined;
|
3495 | export function nth(n: number, list: string): string;
|
3496 | export function nth(
|
3497 | n: number,
|
3498 | ): <T extends readonly any[] | string>(list: T) => (T extends Array<infer E> ? E : string) | undefined;
|
3499 |
|
3500 |
|
3501 |
|
3502 |
|
3503 |
|
3504 |
|
3505 |
|
3506 |
|
3507 |
|
3508 |
|
3509 | export function nthArg(n: number): (...args: unknown[]) => unknown;
|
3510 |
|
3511 |
|
3512 |
|
3513 |
|
3514 |
|
3515 |
|
3516 |
|
3517 |
|
3518 |
|
3519 |
|
3520 |
|
3521 |
|
3522 |
|
3523 |
|
3524 |
|
3525 |
|
3526 |
|
3527 |
|
3528 |
|
3529 |
|
3530 |
|
3531 | export function o<T1, T2, R>(f: (x: T2) => R, g: (x: T1) => T2, v: T1): R;
|
3532 | export function o<T1, T2, R>(f: (x: T2) => R, g: (x: T1) => T2): (v: T1) => R;
|
3533 | export function o<T2, R>(
|
3534 | f: (x: T2) => R,
|
3535 | ): {
|
3536 | <T1>(g: (x: T1) => T2, v: T1): R;
|
3537 | <T1>(g: (x: T1) => T2): (v: T1) => R;
|
3538 | };
|
3539 |
|
3540 |
|
3541 |
|
3542 |
|
3543 |
|
3544 |
|
3545 |
|
3546 |
|
3547 |
|
3548 |
|
3549 |
|
3550 |
|
3551 |
|
3552 |
|
3553 |
|
3554 | export function objOf<T, K extends string>(key: K, value: T): Record<K, T>;
|
3555 | export function objOf<K extends string>(key: K): <T>(value: T) => Record<K, T>;
|
3556 |
|
3557 |
|
3558 |
|
3559 |
|
3560 |
|
3561 |
|
3562 |
|
3563 |
|
3564 |
|
3565 |
|
3566 |
|
3567 |
|
3568 | export function of<T>(x: T): T[];
|
3569 |
|
3570 |
|
3571 |
|
3572 |
|
3573 |
|
3574 |
|
3575 |
|
3576 |
|
3577 |
|
3578 |
|
3579 |
|
3580 | export function omit<T, K extends string>(names: readonly K[], obj: T): Omit<T, K>;
|
3581 | export function omit<K extends string>(names: readonly K[]): <T>(obj: T) => Omit<T, K>;
|
3582 |
|
3583 |
|
3584 |
|
3585 |
|
3586 |
|
3587 |
|
3588 |
|
3589 |
|
3590 |
|
3591 |
|
3592 |
|
3593 |
|
3594 |
|
3595 |
|
3596 |
|
3597 | export function on<T, U, R>(combine: (a: U, b: U) => R, transform: (value: T) => U, a: T, b: T): R;
|
3598 | export function on<T, U, R>(combine: (a: U, b: U) => R, transform: (value: T) => U, a: T): (b: T) => R;
|
3599 | export function on<T, U, R>(
|
3600 | combine: (a: U, b: U) => R,
|
3601 | transform: (value: T) => U,
|
3602 | ): {
|
3603 | (a: T, b: T): R;
|
3604 | (a: T): (b: T) => R;
|
3605 | };
|
3606 | export function on<U, R>(
|
3607 | combine: (a: U, b: U) => R,
|
3608 | ): {
|
3609 | <T>(transform: (value: T) => U, a: T, b: T): R;
|
3610 | <T>(transform: (value: T) => U, a: T): (b: T) => R;
|
3611 | <T>(transform: (value: T) => U): {
|
3612 | (a: T, b: T): R;
|
3613 | (a: T): (b: T) => R;
|
3614 | };
|
3615 | };
|
3616 |
|
3617 | export function on<T, U, R>(
|
3618 | combine: (a: U, b: U) => R,
|
3619 | ): {
|
3620 | (transform: (value: T) => U, a: T, b: T): R;
|
3621 | (transform: (value: T) => U, a: T): (b: T) => R;
|
3622 | (transform: (value: T) => U): {
|
3623 | (a: T, b: T): R;
|
3624 | (a: T): (b: T) => R;
|
3625 | };
|
3626 | };
|
3627 |
|
3628 |
|
3629 |
|
3630 |
|
3631 |
|
3632 |
|
3633 |
|
3634 |
|
3635 |
|
3636 |
|
3637 |
|
3638 |
|
3639 |
|
3640 |
|
3641 | export function once<F extends AnyFunction>(fn: F): F;
|
3642 |
|
3643 |
|
3644 |
|
3645 |
|
3646 |
|
3647 |
|
3648 |
|
3649 |
|
3650 |
|
3651 |
|
3652 |
|
3653 |
|
3654 |
|
3655 |
|
3656 |
|
3657 |
|
3658 |
|
3659 |
|
3660 | export function or<T, U>(a: T | Falsy, b: U): T | U;
|
3661 | export function or<T>(a: T | Falsy): <U>(b: U) => T | U;
|
3662 |
|
3663 |
|
3664 |
|
3665 |
|
3666 |
|
3667 |
|
3668 |
|
3669 |
|
3670 |
|
3671 |
|
3672 |
|
3673 |
|
3674 |
|
3675 |
|
3676 |
|
3677 |
|
3678 |
|
3679 |
|
3680 |
|
3681 | export function otherwise<A, B>(onError: (error: any) => B | Promise<B>, promise: Promise<A>): Promise<B>;
|
3682 | export function otherwise<A, B>(onError: (error: any) => B | Promise<B>): (promise: Promise<A>) => Promise<B>;
|
3683 |
|
3684 |
|
3685 |
|
3686 |
|
3687 |
|
3688 |
|
3689 |
|
3690 |
|
3691 |
|
3692 |
|
3693 |
|
3694 |
|
3695 |
|
3696 |
|
3697 | export function over<S, A>(lens: Lens<S, A>, fn: (a: A) => A, value: S): S;
|
3698 | export function over<S, A>(lens: Lens<S, A>, fn: (a: A) => A): (value: S) => S;
|
3699 | export function over<S, A>(lens: Lens<S, A>): (fn: (a: A) => A, value: S) => S;
|
3700 |
|
3701 |
|
3702 |
|
3703 |
|
3704 |
|
3705 |
|
3706 |
|
3707 |
|
3708 |
|
3709 |
|
3710 |
|
3711 | export function pair<F, S>(fst: F, snd: S): [F, S];
|
3712 | export function pair<F>(fst: F): <S>(snd: S) => [F, S];
|
3713 |
|
3714 |
|
3715 |
|
3716 |
|
3717 |
|
3718 |
|
3719 |
|
3720 |
|
3721 |
|
3722 |
|
3723 |
|
3724 |
|
3725 |
|
3726 |
|
3727 |
|
3728 |
|
3729 |
|
3730 |
|
3731 |
|
3732 |
|
3733 |
|
3734 |
|
3735 | export function partial<V0, V1, T>(fn: (x0: V0, x1: V1) => T, args: [V0]): (x1: V1) => T;
|
3736 | export function partial<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: [V0, V1]): (x2: V2) => T;
|
3737 | export function partial<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: [V0]): (x1: V1, x2: V2) => T;
|
3738 | export function partial<V0, V1, V2, V3, T>(
|
3739 | fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T,
|
3740 | args: [V0, V1, V2],
|
3741 | ): (x2: V3) => T;
|
3742 | export function partial<V0, V1, V2, V3, T>(
|
3743 | fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T,
|
3744 | args: [V0, V1],
|
3745 | ): (x2: V2, x3: V3) => T;
|
3746 | export function partial<V0, V1, V2, V3, T>(
|
3747 | fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T,
|
3748 | args: [V0],
|
3749 | ): (x1: V1, x2: V2, x3: V3) => T;
|
3750 |
|
3751 | export function partial<T>(fn: (...args: any[]) => T, args: unknown[]): (...args: unknown[]) => T;
|
3752 |
|
3753 |
|
3754 |
|
3755 |
|
3756 |
|
3757 |
|
3758 |
|
3759 |
|
3760 |
|
3761 |
|
3762 |
|
3763 |
|
3764 |
|
3765 |
|
3766 |
|
3767 |
|
3768 |
|
3769 |
|
3770 |
|
3771 |
|
3772 |
|
3773 |
|
3774 |
|
3775 |
|
3776 |
|
3777 |
|
3778 |
|
3779 |
|
3780 |
|
3781 |
|
3782 | export function partialObject<T extends P1, P1, R>(fn: (value: T) => R, partial: P1): (value: Omit<T, keyof P1>) => R;
|
3783 | export function partialObject<T, R>(fn: (value: T) => R): <P1>(partial: P1) => (value: Omit<T, keyof P1>) => R;
|
3784 |
|
3785 |
|
3786 |
|
3787 |
|
3788 |
|
3789 |
|
3790 |
|
3791 |
|
3792 |
|
3793 |
|
3794 |
|
3795 |
|
3796 |
|
3797 |
|
3798 |
|
3799 |
|
3800 |
|
3801 |
|
3802 | export function partialRight<V0, V1, T>(fn: (x0: V0, x1: V1) => T, args: [V1]): (x1: V0) => T;
|
3803 | export function partialRight<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: [V1, V2]): (x2: V0) => T;
|
3804 | export function partialRight<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: [V2]): (x1: V0, x2: V1) => T;
|
3805 | export function partialRight<V0, V1, V2, V3, T>(
|
3806 | fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T,
|
3807 | args: [V1, V2, V3],
|
3808 | ): (x0: V0) => T;
|
3809 | export function partialRight<V0, V1, V2, V3, T>(
|
3810 | fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T,
|
3811 | args: [V2, V3],
|
3812 | ): (x0: V0, x1: V1) => T;
|
3813 | export function partialRight<V0, V1, V2, V3, T>(
|
3814 | fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T,
|
3815 | args: [V3],
|
3816 | ): (x0: V0, x1: V1, x2: V2) => T;
|
3817 |
|
3818 | export function partialRight<T>(fn: (...args: any[]) => T, args: unknown[]): (...args: unknown[]) => T;
|
3819 |
|
3820 |
|
3821 |
|
3822 |
|
3823 |
|
3824 |
|
3825 |
|
3826 |
|
3827 |
|
3828 |
|
3829 |
|
3830 |
|
3831 |
|
3832 |
|
3833 |
|
3834 |
|
3835 |
|
3836 |
|
3837 |
|
3838 | export function partition(fn: (a: string) => boolean, list: readonly string[]): [string[], string[]];
|
3839 | export function partition<T>(fn: (a: T) => boolean, list: readonly T[]): [T[], T[]];
|
3840 | export function partition<T>(fn: (a: T) => boolean): (list: readonly T[]) => [T[], T[]];
|
3841 | export function partition(fn: (a: string) => boolean): (list: readonly string[]) => [string[], string[]];
|
3842 |
|
3843 |
|
3844 |
|
3845 |
|
3846 |
|
3847 |
|
3848 |
|
3849 |
|
3850 |
|
3851 |
|
3852 |
|
3853 |
|
3854 |
|
3855 |
|
3856 | export function path<S, K0 extends keyof S = keyof S>(path: [K0], obj: S): S[K0];
|
3857 | export function path<S, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0]>(path: [K0, K1], obj: S): S[K0][K1];
|
3858 | export function path<
|
3859 | S,
|
3860 | K0 extends keyof S = keyof S,
|
3861 | K1 extends keyof S[K0] = keyof S[K0],
|
3862 | K2 extends keyof S[K0][K1] = keyof S[K0][K1]
|
3863 | >(path: [K0, K1, K2], obj: S): S[K0][K1][K2];
|
3864 | export function path<
|
3865 | S,
|
3866 | K0 extends keyof S = keyof S,
|
3867 | K1 extends keyof S[K0] = keyof S[K0],
|
3868 | K2 extends keyof S[K0][K1] = keyof S[K0][K1],
|
3869 | K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],
|
3870 | >(path: [K0, K1, K2, K3], obj: S): S[K0][K1][K2][K3];
|
3871 | export function path<
|
3872 | S,
|
3873 | K0 extends keyof S = keyof S,
|
3874 | K1 extends keyof S[K0] = keyof S[K0],
|
3875 | K2 extends keyof S[K0][K1] = keyof S[K0][K1],
|
3876 | K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],
|
3877 | K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3],
|
3878 | >(path: [K0, K1, K2, K3, K4], obj: S): S[K0][K1][K2][K3][K4];
|
3879 | export function path<
|
3880 | S,
|
3881 | K0 extends keyof S = keyof S,
|
3882 | K1 extends keyof S[K0] = keyof S[K0],
|
3883 | K2 extends keyof S[K0][K1] = keyof S[K0][K1],
|
3884 | K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],
|
3885 | K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3],
|
3886 | K5 extends keyof S[K0][K1][K2][K3][K4] = keyof S[K0][K1][K2][K3][K4],
|
3887 | >(path: [K0, K1, K2, K3, K4, K5], obj: S): S[K0][K1][K2][K3][K4][K5];
|
3888 | export function path<T>(path: Path, obj: any): T | undefined;
|
3889 | export function path<T>(path: Path): (obj: any) => T | undefined;
|
3890 |
|
3891 |
|
3892 |
|
3893 |
|
3894 |
|
3895 |
|
3896 |
|
3897 |
|
3898 |
|
3899 |
|
3900 |
|
3901 |
|
3902 |
|
3903 |
|
3904 |
|
3905 |
|
3906 | export function pathEq(path: Path, val: any, obj: any): boolean;
|
3907 | export function pathEq(path: Path, val: any): (obj: any) => boolean;
|
3908 | export function pathEq(path: Path): _.F.Curry<(a: any, b: any) => boolean>;
|
3909 |
|
3910 |
|
3911 |
|
3912 |
|
3913 |
|
3914 |
|
3915 |
|
3916 |
|
3917 |
|
3918 |
|
3919 |
|
3920 |
|
3921 | export function pathOr<T>(defaultValue: T, path: Path, obj: any): T;
|
3922 | export function pathOr<T>(defaultValue: T, path: Path): (obj: any) => T;
|
3923 | export function pathOr<T>(defaultValue: T): _.F.Curry<(a: Path, b: any) => T>;
|
3924 |
|
3925 |
|
3926 |
|
3927 |
|
3928 |
|
3929 |
|
3930 |
|
3931 |
|
3932 |
|
3933 |
|
3934 |
|
3935 |
|
3936 | export function paths<T>(paths: readonly Path[], obj: any): Array<T | undefined>;
|
3937 | export function paths<T>(paths: readonly Path[]): (obj: any) => Array<T | undefined>;
|
3938 |
|
3939 |
|
3940 |
|
3941 |
|
3942 |
|
3943 |
|
3944 |
|
3945 |
|
3946 |
|
3947 |
|
3948 |
|
3949 |
|
3950 |
|
3951 | export function pathSatisfies<T, U>(pred: (val: T) => boolean, path: Path, obj: U): boolean;
|
3952 | export function pathSatisfies<T, U>(pred: (val: T) => boolean, path: Path): (obj: U) => boolean;
|
3953 | export function pathSatisfies<T, U>(pred: (val: T) => boolean): _.F.Curry<(a: Path, b: U) => boolean>;
|
3954 |
|
3955 |
|
3956 |
|
3957 |
|
3958 |
|
3959 |
|
3960 |
|
3961 |
|
3962 |
|
3963 |
|
3964 |
|
3965 |
|
3966 |
|
3967 | export function pick<T, K extends string | number | symbol>(
|
3968 | names: readonly K[],
|
3969 | obj: T,
|
3970 | ): Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>;
|
3971 | export function pick<K extends string | number | symbol>(
|
3972 | names: readonly K[],
|
3973 | ): <T>(obj: T) => Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>;
|
3974 |
|
3975 |
|
3976 |
|
3977 |
|
3978 |
|
3979 |
|
3980 |
|
3981 |
|
3982 |
|
3983 |
|
3984 | export function pickAll<T, K extends keyof T>(names: readonly K[], obj: T): Pick<T, K>;
|
3985 | export function pickAll<T, U>(names: readonly string[], obj: T): U;
|
3986 | export function pickAll(names: readonly string[]): <T, U>(obj: T) => U;
|
3987 |
|
3988 |
|
3989 |
|
3990 |
|
3991 |
|
3992 |
|
3993 |
|
3994 |
|
3995 |
|
3996 |
|
3997 | export function pickBy<T, U>(pred: ObjPred<T>, obj: T): U;
|
3998 | export function pickBy<T>(pred: ObjPred<T>): <U, V extends T>(obj: V) => U;
|
3999 |
|
4000 |
|
4001 |
|
4002 |
|
4003 |
|
4004 |
|
4005 |
|
4006 |
|
4007 |
|
4008 |
|
4009 |
|
4010 |
|
4011 |
|
4012 |
|
4013 |
|
4014 |
|
4015 |
|
4016 |
|
4017 |
|
4018 |
|
4019 |
|
4020 |
|
4021 | export function pipe<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult>(
|
4022 | ...funcs: [
|
4023 | f1: (...args: TArgs) => R1,
|
4024 | f2: (a: R1) => R2,
|
4025 | f3: (a: R2) => R3,
|
4026 | f4: (a: R3) => R4,
|
4027 | f5: (a: R4) => R5,
|
4028 | f6: (a: R5) => R6,
|
4029 | f7: (a: R6) => R7,
|
4030 | ...func: Array<(a: any) => any>,
|
4031 | fnLast: (a: any) => TResult,
|
4032 | ]
|
4033 | ): (...args: TArgs) => TResult;
|
4034 | export function pipe<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7>(
|
4035 | f1: (...args: TArgs) => R1,
|
4036 | f2: (a: R1) => R2,
|
4037 | f3: (a: R2) => R3,
|
4038 | f4: (a: R3) => R4,
|
4039 | f5: (a: R4) => R5,
|
4040 | f6: (a: R5) => R6,
|
4041 | f7: (a: R6) => R7,
|
4042 | ): (...args: TArgs) => R7;
|
4043 | export function pipe<TArgs extends any[], R1, R2, R3, R4, R5, R6>(
|
4044 | f1: (...args: TArgs) => R1,
|
4045 | f2: (a: R1) => R2,
|
4046 | f3: (a: R2) => R3,
|
4047 | f4: (a: R3) => R4,
|
4048 | f5: (a: R4) => R5,
|
4049 | f6: (a: R5) => R6,
|
4050 | ): (...args: TArgs) => R6;
|
4051 | export function pipe<TArgs extends any[], R1, R2, R3, R4, R5>(
|
4052 | f1: (...args: TArgs) => R1,
|
4053 | f2: (a: R1) => R2,
|
4054 | f3: (a: R2) => R3,
|
4055 | f4: (a: R3) => R4,
|
4056 | f5: (a: R4) => R5,
|
4057 | ): (...args: TArgs) => R5;
|
4058 | export function pipe<TArgs extends any[], R1, R2, R3, R4>(
|
4059 | f1: (...args: TArgs) => R1,
|
4060 | f2: (a: R1) => R2,
|
4061 | f3: (a: R2) => R3,
|
4062 | f4: (a: R3) => R4,
|
4063 | ): (...args: TArgs) => R4;
|
4064 | export function pipe<TArgs extends any[], R1, R2, R3>(
|
4065 | f1: (...args: TArgs) => R1,
|
4066 | f2: (a: R1) => R2,
|
4067 | f3: (a: R2) => R3,
|
4068 | ): (...args: TArgs) => R3;
|
4069 | export function pipe<TArgs extends any[], R1, R2>(
|
4070 | f1: (...args: TArgs) => R1,
|
4071 | f2: (a: R1) => R2,
|
4072 | ): (...args: TArgs) => R2;
|
4073 | export function pipe<TArgs extends any[], R1>(f1: (...args: TArgs) => R1): (...args: TArgs) => R1;
|
4074 |
|
4075 |
|
4076 |
|
4077 |
|
4078 |
|
4079 |
|
4080 |
|
4081 |
|
4082 |
|
4083 | export function pipeK<V0, T1>(fn0: (x0: V0) => T1[]): (x0: V0) => T1[];
|
4084 | export function pipeK<V0, T1, T2>(fn0: (x0: V0) => T1[], fn1: (x: T1) => T2[]): (x0: V0) => T2[];
|
4085 | export function pipeK<V0, T1, T2, T3>(
|
4086 | fn0: (x: V0) => T1[],
|
4087 | fn1: (x: T1) => T2[],
|
4088 | fn2: (x: T2) => T3[],
|
4089 | ): (x: V0) => T3[];
|
4090 | export function pipeK<V0, T1, T2, T3, T4>(
|
4091 | fn0: (x: V0) => T1[],
|
4092 | fn1: (x: T1) => T2[],
|
4093 | fn2: (x: T2) => T3[],
|
4094 | fn3: (x: T3) => T4[],
|
4095 | ): (x: V0) => T4[];
|
4096 | export function pipeK<V0, T1, T2, T3, T4, T5>(
|
4097 | fn0: (x: V0) => T1[],
|
4098 | fn1: (x: T1) => T2[],
|
4099 | fn2: (x: T2) => T3[],
|
4100 | fn3: (x: T3) => T4[],
|
4101 | fn4: (x: T4) => T5[],
|
4102 | ): (x: V0) => T5[];
|
4103 | export function pipeK<V0, T1, T2, T3, T4, T5, T6>(
|
4104 | fn0: (x: V0) => T1[],
|
4105 | fn1: (x: T1) => T2[],
|
4106 | fn2: (x: T2) => T3[],
|
4107 | fn3: (x: T3) => T4[],
|
4108 | fn4: (x: T4) => T5[],
|
4109 | fn5: (x: T5) => T6[],
|
4110 | ): (x: V0) => T6[];
|
4111 | export function pipeK<V0, T1, T2, T3, T4, T5, T6, T7>(
|
4112 | fn0: (x: V0) => T1[],
|
4113 | fn1: (x: T1) => T2[],
|
4114 | fn2: (x: T2) => T3[],
|
4115 | fn3: (x: T3) => T4[],
|
4116 | fn4: (x: T4) => T5[],
|
4117 | fn5: (x: T5) => T6[],
|
4118 | fn: (x: T6) => T7[],
|
4119 | ): (x: V0) => T7[];
|
4120 | export function pipeK<V0, T1, T2, T3, T4, T5, T6, T7, T8>(
|
4121 | fn0: (x: V0) => T1[],
|
4122 | fn1: (x: T1) => T2[],
|
4123 | fn2: (x: T2) => T3[],
|
4124 | fn3: (x: T3) => T4[],
|
4125 | fn4: (x: T4) => T5[],
|
4126 | fn5: (x: T5) => T6[],
|
4127 | fn6: (x: T6) => T7[],
|
4128 | fn: (x: T7) => T8[],
|
4129 | ): (x: V0) => T8[];
|
4130 | export function pipeK<V0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(
|
4131 | fn0: (x0: V0) => T1[],
|
4132 | fn1: (x: T1) => T2[],
|
4133 | fn2: (x: T2) => T3[],
|
4134 | fn3: (x: T3) => T4[],
|
4135 | fn4: (x: T4) => T5[],
|
4136 | fn5: (x: T5) => T6[],
|
4137 | fn6: (x: T6) => T7[],
|
4138 | fn7: (x: T7) => T8[],
|
4139 | fn8: (x: T8) => T9[],
|
4140 | ): (x0: V0) => T9[];
|
4141 | export function pipeK<V0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
|
4142 | fn0: (x0: V0) => T1[],
|
4143 | fn1: (x: T1) => T2[],
|
4144 | fn2: (x: T2) => T3[],
|
4145 | fn3: (x: T3) => T4[],
|
4146 | fn4: (x: T4) => T5[],
|
4147 | fn5: (x: T5) => T6[],
|
4148 | fn6: (x: T6) => T7[],
|
4149 | fn7: (x: T7) => T8[],
|
4150 | fn8: (x: T8) => T9[],
|
4151 | fn9: (x: T9) => T10[],
|
4152 | ): (x0: V0) => T10[];
|
4153 |
|
4154 |
|
4155 |
|
4156 |
|
4157 |
|
4158 |
|
4159 |
|
4160 | export function pipeP<V0, T1>(fn0: (x0: V0) => Promise<T1>): (x0: V0) => Promise<T1>;
|
4161 | export function pipeP<V0, T1, T2>(fn0: (x0: V0) => Promise<T1>, fn1: (x: T1) => Promise<T2>): (x0: V0) => Promise<T2>;
|
4162 | export function pipeP<V0, T1, T2, T3>(
|
4163 | fn0: (x: V0) => Promise<T1>,
|
4164 | fn1: (x: T1) => Promise<T2>,
|
4165 | fn2: (x: T2) => Promise<T3>,
|
4166 | ): (x: V0) => Promise<T3>;
|
4167 | export function pipeP<V0, T1, T2, T3, T4>(
|
4168 | fn0: (x: V0) => Promise<T1>,
|
4169 | fn1: (x: T1) => Promise<T2>,
|
4170 | fn2: (x: T2) => Promise<T3>,
|
4171 | fn3: (x: T3) => Promise<T4>,
|
4172 | ): (x: V0) => Promise<T4>;
|
4173 | export function pipeP<V0, T1, T2, T3, T4, T5>(
|
4174 | fn0: (x: V0) => Promise<T1>,
|
4175 | fn1: (x: T1) => Promise<T2>,
|
4176 | fn2: (x: T2) => Promise<T3>,
|
4177 | fn3: (x: T3) => Promise<T4>,
|
4178 | fn4: (x: T4) => Promise<T5>,
|
4179 | ): (x: V0) => Promise<T5>;
|
4180 | export function pipeP<V0, T1, T2, T3, T4, T5, T6>(
|
4181 | fn0: (x: V0) => Promise<T1>,
|
4182 | fn1: (x: T1) => Promise<T2>,
|
4183 | fn2: (x: T2) => Promise<T3>,
|
4184 | fn3: (x: T3) => Promise<T4>,
|
4185 | fn4: (x: T4) => Promise<T5>,
|
4186 | fn5: (x: T5) => Promise<T6>,
|
4187 | ): (x: V0) => Promise<T6>;
|
4188 | export function pipeP<V0, T1, T2, T3, T4, T5, T6, T7>(
|
4189 | fn0: (x: V0) => Promise<T1>,
|
4190 | fn1: (x: T1) => Promise<T2>,
|
4191 | fn2: (x: T2) => Promise<T3>,
|
4192 | fn3: (x: T3) => Promise<T4>,
|
4193 | fn4: (x: T4) => Promise<T5>,
|
4194 | fn5: (x: T5) => Promise<T6>,
|
4195 | fn: (x: T6) => Promise<T7>,
|
4196 | ): (x: V0) => Promise<T7>;
|
4197 | export function pipeP<V0, T1, T2, T3, T4, T5, T6, T7, T8>(
|
4198 | fn0: (x: V0) => Promise<T1>,
|
4199 | fn1: (x: T1) => Promise<T2>,
|
4200 | fn2: (x: T2) => Promise<T3>,
|
4201 | fn3: (x: T3) => Promise<T4>,
|
4202 | fn4: (x: T4) => Promise<T5>,
|
4203 | fn5: (x: T5) => Promise<T6>,
|
4204 | fn6: (x: T6) => Promise<T7>,
|
4205 | fn: (x: T7) => Promise<T8>,
|
4206 | ): (x: V0) => Promise<T8>;
|
4207 | export function pipeP<V0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(
|
4208 | fn0: (x0: V0) => Promise<T1>,
|
4209 | fn1: (x: T1) => Promise<T2>,
|
4210 | fn2: (x: T2) => Promise<T3>,
|
4211 | fn3: (x: T3) => Promise<T4>,
|
4212 | fn4: (x: T4) => Promise<T5>,
|
4213 | fn5: (x: T5) => Promise<T6>,
|
4214 | fn6: (x: T6) => Promise<T7>,
|
4215 | fn7: (x: T7) => Promise<T8>,
|
4216 | fn8: (x: T8) => Promise<T9>,
|
4217 | ): (x0: V0) => Promise<T9>;
|
4218 | export function pipeP<V0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
|
4219 | fn0: (x0: V0) => Promise<T1>,
|
4220 | fn1: (x: T1) => Promise<T2>,
|
4221 | fn2: (x: T2) => Promise<T3>,
|
4222 | fn3: (x: T3) => Promise<T4>,
|
4223 | fn4: (x: T4) => Promise<T5>,
|
4224 | fn5: (x: T5) => Promise<T6>,
|
4225 | fn6: (x: T6) => Promise<T7>,
|
4226 | fn7: (x: T7) => Promise<T8>,
|
4227 | fn8: (x: T8) => Promise<T9>,
|
4228 | fn9: (x: T9) => Promise<T10>,
|
4229 | ): (x0: V0) => Promise<T10>;
|
4230 |
|
4231 |
|
4232 |
|
4233 |
|
4234 |
|
4235 |
|
4236 |
|
4237 |
|
4238 |
|
4239 |
|
4240 |
|
4241 |
|
4242 |
|
4243 |
|
4244 |
|
4245 |
|
4246 |
|
4247 | export function pipeWith<TArgs extends any[], TResult>(
|
4248 | transformer: (fn: AnyFunction, intermediateResult: any) => any,
|
4249 | fns: AtLeastOneFunctionsFlow<TArgs, TResult>,
|
4250 | ): (...args: TArgs) => TResult;
|
4251 | export function pipeWith(
|
4252 | transformer: (fn: AnyFunction, intermediateResult: any) => any,
|
4253 | ): <TArgs extends any[], TResult>(fns: AtLeastOneFunctionsFlow<TArgs, TResult>) => (...args: TArgs) => TResult;
|
4254 |
|
4255 |
|
4256 |
|
4257 |
|
4258 |
|
4259 |
|
4260 |
|
4261 |
|
4262 |
|
4263 |
|
4264 |
|
4265 |
|
4266 |
|
4267 |
|
4268 |
|
4269 |
|
4270 |
|
4271 |
|
4272 | export function pluck<K extends keyof T, T>(p: K, list: readonly T[]): Array<T[K]>;
|
4273 | export function pluck<T>(p: number, list: ReadonlyArray<{ [k: number]: T }>): T[];
|
4274 | export function pluck<P extends string>(p: P): <T>(list: ReadonlyArray<Record<P, T>>) => T[];
|
4275 | export function pluck(p: number): <T>(list: ReadonlyArray<{ [k: number]: T }>) => T[];
|
4276 |
|
4277 |
|
4278 |
|
4279 |
|
4280 |
|
4281 |
|
4282 |
|
4283 |
|
4284 |
|
4285 |
|
4286 |
|
4287 |
|
4288 | export function prepend<T>(el: T, list: readonly T[]): T[];
|
4289 | export function prepend<T>(el: T): (list: readonly T[]) => T[];
|
4290 |
|
4291 |
|
4292 |
|
4293 |
|
4294 |
|
4295 |
|
4296 |
|
4297 |
|
4298 |
|
4299 |
|
4300 |
|
4301 | export function product(list: readonly number[]): number;
|
4302 |
|
4303 |
|
4304 |
|
4305 |
|
4306 |
|
4307 |
|
4308 |
|
4309 |
|
4310 |
|
4311 |
|
4312 |
|
4313 |
|
4314 |
|
4315 |
|
4316 | export function project<T, U>(props: readonly string[], objs: readonly T[]): U[];
|
4317 | export function project<T, U>(props: readonly string[]): (objs: readonly T[]) => U[];
|
4318 |
|
4319 |
|
4320 |
|
4321 |
|
4322 |
|
4323 |
|
4324 |
|
4325 |
|
4326 |
|
4327 |
|
4328 |
|
4329 |
|
4330 |
|
4331 |
|
4332 |
|
4333 |
|
4334 |
|
4335 | export function promap<A, B, C, D>(pre: (value: A) => B, post: (value: C) => D, fn: (value: B) => C): (value: A) => D;
|
4336 | export function promap<A, B, C, D>(
|
4337 | pre: (value: A) => B,
|
4338 | post: (value: C) => D,
|
4339 | ): (fn: (value: B) => C) => (value: A) => D;
|
4340 | export function promap<A, B>(
|
4341 | pre: (value: A) => B,
|
4342 | ): <C, D>(post: (value: C) => D, fn: (value: B) => C) => (value: A) => D;
|
4343 |
|
4344 |
|
4345 |
|
4346 |
|
4347 |
|
4348 |
|
4349 |
|
4350 |
|
4351 |
|
4352 |
|
4353 |
|
4354 |
|
4355 |
|
4356 |
|
4357 | export function prop<_, T>(__: Placeholder, value: T): {
|
4358 | <P extends keyof Exclude<T, undefined>>(p: P): Prop<T, P>;
|
4359 | <P extends keyof never>(p: P): Prop<T, P>;
|
4360 | };
|
4361 | export function prop<V>(__: Placeholder, value: unknown): (p: keyof never) => V;
|
4362 | export function prop<_, P extends keyof never, T>(p: P, value: T): Prop<T, P>;
|
4363 | export function prop<V>(p: keyof never, value: unknown): V;
|
4364 | export function prop<_, P extends keyof never>(p: P): <T>(value: T) => Prop<T, P>;
|
4365 | export function prop<V>(p: keyof never): (value: unknown) => V;
|
4366 |
|
4367 |
|
4368 |
|
4369 |
|
4370 |
|
4371 |
|
4372 |
|
4373 |
|
4374 |
|
4375 |
|
4376 |
|
4377 |
|
4378 |
|
4379 |
|
4380 |
|
4381 |
|
4382 |
|
4383 |
|
4384 |
|
4385 |
|
4386 |
|
4387 | export function propEq<K extends string | number>(name: K, val: any, obj: Record<K, any>): boolean;
|
4388 | export function propEq<K extends string | number>(name: K, val: any): (obj: Record<K, any>) => boolean;
|
4389 | export function propEq<K extends string | number>(
|
4390 | name: K,
|
4391 | ): {
|
4392 | (val: any, obj: Record<K, any>): boolean;
|
4393 | (val: any): (obj: Record<K, any>) => boolean;
|
4394 | };
|
4395 |
|
4396 |
|
4397 |
|
4398 |
|
4399 |
|
4400 |
|
4401 |
|
4402 |
|
4403 |
|
4404 |
|
4405 |
|
4406 |
|
4407 |
|
4408 | export function propIs<C extends AnyFunction, K extends PropertyKey>(
|
4409 | type: C,
|
4410 | name: K,
|
4411 | obj: any,
|
4412 | ): obj is Record<K, ReturnType<C>>;
|
4413 | export function propIs<C extends AnyConstructor, K extends PropertyKey>(
|
4414 | type: C,
|
4415 | name: K,
|
4416 | obj: any,
|
4417 | ): obj is Record<K, InstanceType<C>>;
|
4418 | export function propIs<C extends AnyFunction, K extends PropertyKey>(
|
4419 | type: C,
|
4420 | name: K,
|
4421 | ): (obj: any) => obj is Record<K, ReturnType<C>>;
|
4422 | export function propIs<C extends AnyConstructor, K extends PropertyKey>(
|
4423 | type: C,
|
4424 | name: K,
|
4425 | ): (obj: any) => obj is Record<K, InstanceType<C>>;
|
4426 | export function propIs<C extends AnyFunction>(
|
4427 | type: C,
|
4428 | ): {
|
4429 | <K extends keyof any>(name: K, obj: any): obj is Record<K, ReturnType<C>>;
|
4430 | <K extends keyof any>(name: K): (obj: any) => obj is Record<K, ReturnType<C>>;
|
4431 | };
|
4432 | export function propIs<C extends AnyConstructor>(
|
4433 | type: C,
|
4434 | ): {
|
4435 | <K extends keyof any>(name: K, obj: any): obj is Record<K, InstanceType<C>>;
|
4436 | <K extends keyof any>(name: K): (obj: any) => obj is Record<K, InstanceType<C>>;
|
4437 | };
|
4438 |
|
4439 |
|
4440 |
|
4441 |
|
4442 |
|
4443 |
|
4444 |
|
4445 |
|
4446 |
|
4447 |
|
4448 |
|
4449 |
|
4450 |
|
4451 |
|
4452 |
|
4453 |
|
4454 |
|
4455 |
|
4456 |
|
4457 |
|
4458 |
|
4459 |
|
4460 | export function propOr<T, U>(val: T, __: Placeholder, obj: U): <V>(p: string) => V;
|
4461 | export function propOr<U>(__: Placeholder, p: string, obj: U): <T, V>(val: T) => V;
|
4462 | export function propOr<T, U, V>(val: T, p: string, obj: U): V;
|
4463 | export function propOr<T>(val: T, p: string): <U, V>(obj: U) => V;
|
4464 | export function propOr<T>(val: T): <U, V>(p: string, obj: U) => V;
|
4465 |
|
4466 |
|
4467 |
|
4468 |
|
4469 |
|
4470 |
|
4471 |
|
4472 |
|
4473 |
|
4474 |
|
4475 |
|
4476 |
|
4477 |
|
4478 |
|
4479 |
|
4480 |
|
4481 | export function props<P extends string, T>(ps: readonly P[], obj: Record<P, T>): T[];
|
4482 | export function props<P extends string>(ps: readonly P[]): <T>(obj: Record<P, T>) => T[];
|
4483 | export function props<P extends string, T>(ps: readonly P[]): (obj: Record<P, T>) => T[];
|
4484 |
|
4485 |
|
4486 |
|
4487 |
|
4488 |
|
4489 |
|
4490 |
|
4491 |
|
4492 |
|
4493 |
|
4494 |
|
4495 |
|
4496 |
|
4497 | export function propSatisfies<P, K extends keyof any>(
|
4498 | pred: (val: any) => val is P,
|
4499 | name: K,
|
4500 | obj: any,
|
4501 | ): obj is Record<K, P>;
|
4502 | export function propSatisfies<P, K extends keyof any>(
|
4503 | pred: (val: any) => val is P,
|
4504 | name: K,
|
4505 | ): (obj: any) => obj is Record<K, P>;
|
4506 | export function propSatisfies<P>(pred: (val: any) => val is P): {
|
4507 | <K extends keyof any>(name: K, obj: any): obj is Record<K, P>;
|
4508 | <K extends keyof any>(name: K): (obj: any) => obj is Record<K, P>;
|
4509 | };
|
4510 | export function propSatisfies(pred: (val: any) => boolean, name: keyof any, obj: any): boolean;
|
4511 | export function propSatisfies(pred: (val: any) => boolean, name: keyof any): (obj: any) => boolean;
|
4512 | export function propSatisfies(pred: (val: any) => boolean): _.F.Curry<(a: keyof any, b: any) => boolean>;
|
4513 |
|
4514 |
|
4515 |
|
4516 |
|
4517 |
|
4518 |
|
4519 |
|
4520 |
|
4521 |
|
4522 |
|
4523 |
|
4524 | export function range(from: number, to: number): number[];
|
4525 | export function range(from: number): (to: number) => number[];
|
4526 |
|
4527 |
|
4528 |
|
4529 |
|
4530 |
|
4531 |
|
4532 |
|
4533 |
|
4534 |
|
4535 |
|
4536 |
|
4537 |
|
4538 |
|
4539 |
|
4540 |
|
4541 |
|
4542 |
|
4543 |
|
4544 |
|
4545 |
|
4546 |
|
4547 |
|
4548 |
|
4549 |
|
4550 |
|
4551 |
|
4552 |
|
4553 |
|
4554 |
|
4555 |
|
4556 | export function reduce<T, TResult>(
|
4557 | fn: (acc: TResult, elem: T) => TResult | Reduced<TResult>,
|
4558 | acc: TResult,
|
4559 | list: readonly T[],
|
4560 | ): TResult;
|
4561 | export function reduce<T, TResult>(
|
4562 | fn: (acc: TResult, elem: T) => TResult | Reduced<TResult>,
|
4563 | ): (acc: TResult, list: readonly T[]) => TResult;
|
4564 | export function reduce<T, TResult>(
|
4565 | fn: (acc: TResult, elem: T) => TResult | Reduced<TResult>,
|
4566 | acc: TResult,
|
4567 | ): (list: readonly T[]) => TResult;
|
4568 |
|
4569 |
|
4570 |
|
4571 |
|
4572 |
|
4573 |
|
4574 |
|
4575 |
|
4576 |
|
4577 |
|
4578 |
|
4579 |
|
4580 |
|
4581 |
|
4582 |
|
4583 |
|
4584 |
|
4585 |
|
4586 |
|
4587 |
|
4588 |
|
4589 |
|
4590 |
|
4591 |
|
4592 |
|
4593 |
|
4594 |
|
4595 |
|
4596 |
|
4597 |
|
4598 |
|
4599 |
|
4600 |
|
4601 |
|
4602 |
|
4603 | export function reduceBy<T, TResult>(
|
4604 | valueFn: (acc: TResult, elem: T) => TResult,
|
4605 | acc: TResult,
|
4606 | keyFn: (elem: T) => string,
|
4607 | list: readonly T[],
|
4608 | ): { [index: string]: TResult };
|
4609 | export function reduceBy<T, TResult>(
|
4610 | valueFn: (acc: TResult, elem: T) => TResult,
|
4611 | acc: TResult,
|
4612 | keyFn: (elem: T) => string,
|
4613 | ): (list: readonly T[]) => { [index: string]: TResult };
|
4614 | export function reduceBy<T, TResult>(
|
4615 | valueFn: (acc: TResult, elem: T) => TResult,
|
4616 | acc: TResult,
|
4617 | ): _.F.Curry<(a: (elem: T) => string, b: readonly T[]) => { [index: string]: TResult }>;
|
4618 | export function reduceBy<T, TResult>(
|
4619 | valueFn: (acc: TResult, elem: T) => TResult,
|
4620 | ): _.F.Curry<(a: TResult, b: (elem: T) => string, c: readonly T[]) => { [index: string]: TResult }>;
|
4621 |
|
4622 |
|
4623 |
|
4624 |
|
4625 |
|
4626 |
|
4627 |
|
4628 |
|
4629 |
|
4630 |
|
4631 |
|
4632 |
|
4633 |
|
4634 |
|
4635 |
|
4636 |
|
4637 |
|
4638 |
|
4639 |
|
4640 |
|
4641 |
|
4642 |
|
4643 |
|
4644 | export function reduced<T>(elem: T): Reduced<T>;
|
4645 |
|
4646 |
|
4647 |
|
4648 |
|
4649 |
|
4650 |
|
4651 |
|
4652 |
|
4653 |
|
4654 |
|
4655 |
|
4656 |
|
4657 |
|
4658 |
|
4659 |
|
4660 |
|
4661 |
|
4662 |
|
4663 |
|
4664 |
|
4665 |
|
4666 |
|
4667 |
|
4668 |
|
4669 |
|
4670 |
|
4671 |
|
4672 |
|
4673 |
|
4674 |
|
4675 |
|
4676 |
|
4677 |
|
4678 | export function reduceRight<T, TResult>(
|
4679 | fn: (elem: T, acc: TResult) => TResult,
|
4680 | acc: TResult,
|
4681 | list: readonly T[],
|
4682 | ): TResult;
|
4683 | export function reduceRight<T, TResult>(
|
4684 | fn: (elem: T, acc: TResult) => TResult,
|
4685 | ): (acc: TResult, list: readonly T[]) => TResult;
|
4686 | export function reduceRight<T, TResult>(
|
4687 | fn: (elem: T, acc: TResult) => TResult,
|
4688 | acc: TResult,
|
4689 | ): (list: readonly T[]) => TResult;
|
4690 |
|
4691 |
|
4692 |
|
4693 |
|
4694 |
|
4695 |
|
4696 |
|
4697 |
|
4698 |
|
4699 |
|
4700 |
|
4701 |
|
4702 |
|
4703 |
|
4704 |
|
4705 |
|
4706 |
|
4707 |
|
4708 |
|
4709 |
|
4710 | export function reduceWhile<T, TResult>(
|
4711 | predicate: (acc: TResult, elem: T) => boolean,
|
4712 | fn: (acc: TResult, elem: T) => TResult,
|
4713 | acc: TResult,
|
4714 | list: readonly T[],
|
4715 | ): TResult;
|
4716 | export function reduceWhile<T, TResult>(
|
4717 | predicate: (acc: TResult, elem: T) => boolean,
|
4718 | fn: (acc: TResult, elem: T) => TResult,
|
4719 | acc: TResult,
|
4720 | ): (list: readonly T[]) => TResult;
|
4721 | export function reduceWhile<T, TResult>(
|
4722 | predicate: (acc: TResult, elem: T) => boolean,
|
4723 | fn: (acc: TResult, elem: T) => TResult,
|
4724 | ): _.F.Curry<(a: TResult, b: readonly T[]) => TResult>;
|
4725 | export function reduceWhile<T, TResult>(
|
4726 | predicate: (acc: TResult, elem: T) => boolean,
|
4727 | ): _.F.Curry<(a: (acc: TResult, elem: T) => TResult, b: TResult, c: readonly T[]) => TResult>;
|
4728 |
|
4729 |
|
4730 |
|
4731 |
|
4732 |
|
4733 |
|
4734 |
|
4735 |
|
4736 |
|
4737 |
|
4738 |
|
4739 |
|
4740 |
|
4741 |
|
4742 |
|
4743 |
|
4744 |
|
4745 |
|
4746 | export function reject<A, P extends A>(
|
4747 | pred: (val: A) => val is P,
|
4748 | ): {
|
4749 | <B extends A>(list: readonly B[]): Array<Exclude<B, P>>;
|
4750 | <B extends A>(dict: Dictionary<B>): Dictionary<Exclude<B, P>>;
|
4751 | };
|
4752 | export function reject<T>(
|
4753 | pred: (value: T) => boolean,
|
4754 | ): <P extends T, C extends readonly P[] | Dictionary<P>>(collection: C) => C;
|
4755 | export function reject<A, B extends A, P extends A>(
|
4756 | pred: (val: A) => val is P,
|
4757 | list: readonly B[],
|
4758 | ): Array<Exclude<B, P>>;
|
4759 | export function reject<A, B extends A, P extends A>(
|
4760 | pred: (val: A) => val is P,
|
4761 | dict: Dictionary<B>,
|
4762 | ): Dictionary<Exclude<B, P>>;
|
4763 | export function reject<T, C extends readonly T[] | Dictionary<T>>(pred: (value: T) => boolean, collection: C): C;
|
4764 |
|
4765 |
|
4766 |
|
4767 |
|
4768 |
|
4769 |
|
4770 |
|
4771 |
|
4772 |
|
4773 |
|
4774 |
|
4775 |
|
4776 |
|
4777 | export function remove<T>(start: number, count: number, list: readonly T[]): T[];
|
4778 | export function remove<T>(start: number): {
|
4779 | (count: number, list: readonly T[]): T[];
|
4780 | (count: number): (list: readonly T[]) => T[];
|
4781 | };
|
4782 | export function remove<T>(start: number, count: number): (list: readonly T[]) => T[];
|
4783 |
|
4784 |
|
4785 |
|
4786 |
|
4787 |
|
4788 |
|
4789 |
|
4790 |
|
4791 |
|
4792 |
|
4793 |
|
4794 |
|
4795 |
|
4796 |
|
4797 |
|
4798 | export function repeat<T>(a: T, n: number): T[];
|
4799 | export function repeat<T>(a: T): (n: number) => T[];
|
4800 |
|
4801 |
|
4802 |
|
4803 |
|
4804 |
|
4805 |
|
4806 |
|
4807 |
|
4808 |
|
4809 |
|
4810 |
|
4811 |
|
4812 |
|
4813 |
|
4814 |
|
4815 |
|
4816 | export function replace(
|
4817 | pattern: RegExp | string,
|
4818 | replacement: string | ((match: string, ...args: readonly any[]) => string),
|
4819 | str: string,
|
4820 | ): string;
|
4821 | export function replace(
|
4822 | pattern: RegExp | string,
|
4823 | replacement: string | ((match: string, ...args: readonly any[]) => string),
|
4824 | ): (str: string) => string;
|
4825 | export function replace(
|
4826 | pattern: RegExp | string,
|
4827 | ): (replacement: string | ((match: string, ...args: readonly any[]) => string)) => (str: string) => string;
|
4828 |
|
4829 |
|
4830 |
|
4831 |
|
4832 |
|
4833 |
|
4834 |
|
4835 |
|
4836 |
|
4837 |
|
4838 |
|
4839 |
|
4840 |
|
4841 |
|
4842 |
|
4843 |
|
4844 |
|
4845 | export function reverse<T>(list: readonly T[]): T[];
|
4846 | export function reverse(str: string): string;
|
4847 |
|
4848 |
|
4849 |
|
4850 |
|
4851 |
|
4852 |
|
4853 |
|
4854 |
|
4855 |
|
4856 |
|
4857 |
|
4858 |
|
4859 | export function scan<T, TResult>(fn: (acc: TResult, elem: T) => any, acc: TResult, list: readonly T[]): TResult[];
|
4860 | export function scan<T, TResult>(fn: (acc: TResult, elem: T) => any, acc: TResult): (list: readonly T[]) => TResult[];
|
4861 | export function scan<T, TResult>(fn: (acc: TResult, elem: T) => any): (acc: TResult, list: readonly T[]) => TResult[];
|
4862 |
|
4863 |
|
4864 |
|
4865 |
|
4866 |
|
4867 |
|
4868 |
|
4869 |
|
4870 |
|
4871 |
|
4872 |
|
4873 |
|
4874 |
|
4875 |
|
4876 |
|
4877 |
|
4878 | export function set<S, A>(lens: Lens<S, A>, a: A, obj: S): S;
|
4879 | export function set<S, A>(lens: Lens<S, A>, a: A): (obj: S) => S;
|
4880 | export function set<S, A>(lens: Lens<S, A>): (a: A, obj: S) => S;
|
4881 |
|
4882 |
|
4883 |
|
4884 |
|
4885 |
|
4886 |
|
4887 |
|
4888 |
|
4889 |
|
4890 |
|
4891 |
|
4892 |
|
4893 |
|
4894 |
|
4895 |
|
4896 |
|
4897 | export function slice(a: number, b: number, list: string): string;
|
4898 | export function slice<T>(a: number, b: number, list: readonly T[]): T[];
|
4899 | export function slice(
|
4900 | a: number,
|
4901 | b: number,
|
4902 | ): {
|
4903 | <T>(list: readonly T[]): T[];
|
4904 | (list: string): string;
|
4905 | };
|
4906 | export function slice(a: number): {
|
4907 | <T>(b: number, list: readonly T[]): T[];
|
4908 | (b: number, list: string): string;
|
4909 | };
|
4910 |
|
4911 |
|
4912 |
|
4913 |
|
4914 |
|
4915 |
|
4916 |
|
4917 |
|
4918 |
|
4919 |
|
4920 |
|
4921 |
|
4922 |
|
4923 |
|
4924 |
|
4925 | export function sort<T>(fn: (a: T, b: T) => number, list: readonly T[]): T[];
|
4926 | export function sort<T>(fn: (a: T, b: T) => number): (list: readonly T[]) => T[];
|
4927 |
|
4928 |
|
4929 |
|
4930 |
|
4931 |
|
4932 |
|
4933 |
|
4934 |
|
4935 |
|
4936 |
|
4937 |
|
4938 |
|
4939 |
|
4940 |
|
4941 |
|
4942 |
|
4943 |
|
4944 |
|
4945 |
|
4946 |
|
4947 |
|
4948 |
|
4949 |
|
4950 |
|
4951 |
|
4952 |
|
4953 |
|
4954 |
|
4955 |
|
4956 |
|
4957 | export function sortBy<T>(fn: (a: T) => Ord, list: readonly T[]): T[];
|
4958 | export function sortBy<T>(fn: (a: T) => Ord): (list: readonly T[]) => T[];
|
4959 | export function sortBy(fn: (a: any) => Ord): <T>(list: readonly T[]) => T[];
|
4960 |
|
4961 |
|
4962 |
|
4963 |
|
4964 |
|
4965 |
|
4966 |
|
4967 |
|
4968 |
|
4969 |
|
4970 |
|
4971 |
|
4972 |
|
4973 |
|
4974 |
|
4975 |
|
4976 |
|
4977 |
|
4978 |
|
4979 |
|
4980 |
|
4981 |
|
4982 |
|
4983 |
|
4984 |
|
4985 |
|
4986 |
|
4987 |
|
4988 |
|
4989 |
|
4990 | export function sortWith<T>(fns: ReadonlyArray<(a: T, b: T) => number>, list: readonly T[]): T[];
|
4991 | export function sortWith<T>(fns: ReadonlyArray<(a: T, b: T) => number>): (list: readonly T[]) => T[];
|
4992 |
|
4993 |
|
4994 |
|
4995 |
|
4996 |
|
4997 |
|
4998 |
|
4999 |
|
5000 |
|
5001 |
|
5002 |
|
5003 |
|
5004 |
|
5005 |
|
5006 | export function split(sep: string | RegExp): (str: string) => string[];
|
5007 | export function split(sep: string | RegExp, str: string): string[];
|
5008 |
|
5009 |
|
5010 |
|
5011 |
|
5012 |
|
5013 |
|
5014 |
|
5015 |
|
5016 |
|
5017 |
|
5018 |
|
5019 | export function splitAt<T>(index: number, list: readonly T[]): [T[], T[]];
|
5020 | export function splitAt(index: number, list: string): [string, string];
|
5021 | export function splitAt(index: number): {
|
5022 | <T>(list: readonly T[]): [T[], T[]];
|
5023 | (list: string): [string, string];
|
5024 | };
|
5025 |
|
5026 |
|
5027 |
|
5028 |
|
5029 |
|
5030 |
|
5031 |
|
5032 |
|
5033 |
|
5034 |
|
5035 | export function splitEvery<T>(a: number, list: readonly T[]): T[][];
|
5036 | export function splitEvery(a: number, list: string): string[];
|
5037 | export function splitEvery(a: number): {
|
5038 | (list: string): string[];
|
5039 | <T>(list: readonly T[]): T[][];
|
5040 | };
|
5041 |
|
5042 |
|
5043 |
|
5044 |
|
5045 |
|
5046 |
|
5047 |
|
5048 |
|
5049 |
|
5050 |
|
5051 |
|
5052 |
|
5053 |
|
5054 | export function splitWhen<T>(pred: (val: T) => boolean, list: readonly T[]): [T[], T[]];
|
5055 | export function splitWhen<T>(pred: (val: T) => boolean): <U extends T>(list: readonly U[]) => [U[], U[]];
|
5056 |
|
5057 |
|
5058 |
|
5059 |
|
5060 |
|
5061 |
|
5062 |
|
5063 |
|
5064 |
|
5065 | export function splitWhenever<T>(pred: (a: T) => boolean, list: T[]): T[][];
|
5066 | export function splitWhenever<T>(pred: (a: T) => boolean): <U extends T>(list: U[]) => U[][];
|
5067 |
|
5068 |
|
5069 |
|
5070 |
|
5071 |
|
5072 |
|
5073 |
|
5074 |
|
5075 |
|
5076 |
|
5077 |
|
5078 |
|
5079 |
|
5080 |
|
5081 |
|
5082 |
|
5083 | export function startsWith(substr: string, str: string): boolean;
|
5084 | export function startsWith(substr: string): (str: string) => boolean;
|
5085 | export function startsWith<T>(subList: readonly T[], list: readonly T[]): boolean;
|
5086 | export function startsWith<T>(subList: readonly T[]): (list: readonly T[]) => boolean;
|
5087 |
|
5088 |
|
5089 |
|
5090 |
|
5091 |
|
5092 |
|
5093 |
|
5094 |
|
5095 |
|
5096 |
|
5097 |
|
5098 |
|
5099 |
|
5100 |
|
5101 |
|
5102 |
|
5103 | export function subtract(__: Placeholder, b: number): (a: number) => number;
|
5104 | export function subtract(__: Placeholder): (b: number, a: number) => number;
|
5105 | export function subtract(a: number, b: number): number;
|
5106 | export function subtract(a: number): (b: number) => number;
|
5107 |
|
5108 |
|
5109 |
|
5110 |
|
5111 |
|
5112 |
|
5113 |
|
5114 |
|
5115 |
|
5116 |
|
5117 |
|
5118 | export function sum(list: readonly number[]): number;
|
5119 |
|
5120 |
|
5121 |
|
5122 |
|
5123 |
|
5124 |
|
5125 |
|
5126 |
|
5127 |
|
5128 |
|
5129 |
|
5130 |
|
5131 |
|
5132 | export function symmetricDifference<T>(list1: readonly T[], list2: readonly T[]): T[];
|
5133 | export function symmetricDifference<T>(list: readonly T[]): <T>(list: readonly T[]) => T[];
|
5134 |
|
5135 |
|
5136 |
|
5137 |
|
5138 |
|
5139 |
|
5140 |
|
5141 |
|
5142 |
|
5143 |
|
5144 |
|
5145 |
|
5146 |
|
5147 | export function symmetricDifferenceWith<T>(
|
5148 | pred: (a: T, b: T) => boolean,
|
5149 | list1: readonly T[],
|
5150 | list2: readonly T[],
|
5151 | ): T[];
|
5152 | export function symmetricDifferenceWith<T>(
|
5153 | pred: (a: T, b: T) => boolean,
|
5154 | ): _.F.Curry<(a: readonly T[], b: readonly T[]) => T[]>;
|
5155 |
|
5156 |
|
5157 |
|
5158 |
|
5159 |
|
5160 |
|
5161 |
|
5162 |
|
5163 |
|
5164 |
|
5165 |
|
5166 | export function T(...args: unknown[]): true;
|
5167 |
|
5168 |
|
5169 |
|
5170 |
|
5171 |
|
5172 |
|
5173 |
|
5174 |
|
5175 |
|
5176 |
|
5177 |
|
5178 |
|
5179 |
|
5180 |
|
5181 |
|
5182 |
|
5183 |
|
5184 | export function tail(list: string): string;
|
5185 | export function tail<T>(list: readonly T[]): T[];
|
5186 |
|
5187 |
|
5188 |
|
5189 |
|
5190 |
|
5191 |
|
5192 |
|
5193 |
|
5194 |
|
5195 |
|
5196 |
|
5197 |
|
5198 |
|
5199 |
|
5200 |
|
5201 |
|
5202 |
|
5203 |
|
5204 |
|
5205 |
|
5206 |
|
5207 |
|
5208 |
|
5209 |
|
5210 |
|
5211 |
|
5212 |
|
5213 |
|
5214 |
|
5215 |
|
5216 |
|
5217 |
|
5218 | export function take<T>(n: number, xs: readonly T[]): T[];
|
5219 | export function take(n: number, xs: string): string;
|
5220 | export function take(n: number): {
|
5221 | (xs: string): string;
|
5222 | <T>(xs: readonly T[]): T[];
|
5223 | };
|
5224 | export function take<T>(n: number): (xs: readonly T[]) => T[];
|
5225 |
|
5226 |
|
5227 |
|
5228 |
|
5229 |
|
5230 |
|
5231 |
|
5232 |
|
5233 |
|
5234 |
|
5235 |
|
5236 |
|
5237 |
|
5238 |
|
5239 |
|
5240 | export function takeLast<T>(n: number, xs: readonly T[]): T[];
|
5241 | export function takeLast(n: number, xs: string): string;
|
5242 | export function takeLast(n: number): {
|
5243 | (xs: string): string;
|
5244 | <T>(xs: readonly T[]): T[];
|
5245 | };
|
5246 |
|
5247 |
|
5248 |
|
5249 |
|
5250 |
|
5251 |
|
5252 |
|
5253 |
|
5254 |
|
5255 | export function takeLastWhile<T>(pred: (a: T) => boolean, list: readonly T[]): T[];
|
5256 | export function takeLastWhile<T>(pred: (a: T) => boolean): <T>(list: readonly T[]) => T[];
|
5257 |
|
5258 |
|
5259 |
|
5260 |
|
5261 |
|
5262 |
|
5263 |
|
5264 |
|
5265 |
|
5266 |
|
5267 |
|
5268 |
|
5269 | export function takeWhile<T>(fn: (x: T) => boolean, list: readonly T[]): T[];
|
5270 | export function takeWhile<T>(fn: (x: T) => boolean): (list: readonly T[]) => T[];
|
5271 |
|
5272 |
|
5273 |
|
5274 |
|
5275 |
|
5276 |
|
5277 |
|
5278 |
|
5279 |
|
5280 |
|
5281 |
|
5282 |
|
5283 | export function tap<T, R extends T = T>(fn: (a: T) => asserts a is R, value: T): R;
|
5284 | export function tap<T, R extends T = T>(fn: (a: T) => asserts a is R): (value: T) => R;
|
5285 | export function tap<T>(fn: (a: T) => void, value: T): T;
|
5286 | export function tap<T>(fn: (a: T) => void): (value: T) => T;
|
5287 |
|
5288 |
|
5289 |
|
5290 |
|
5291 |
|
5292 |
|
5293 |
|
5294 |
|
5295 |
|
5296 |
|
5297 |
|
5298 |
|
5299 | export function test(regexp: RegExp, str: string): boolean;
|
5300 | export function test(regexp: RegExp): (str: string) => boolean;
|
5301 |
|
5302 |
|
5303 |
|
5304 |
|
5305 |
|
5306 |
|
5307 |
|
5308 |
|
5309 |
|
5310 |
|
5311 |
|
5312 |
|
5313 |
|
5314 |
|
5315 | export function thunkify<F extends AnyFunction>(fn: F): _.F.Curry<(...args: Parameters<F>) => () => ReturnType<F>>;
|
5316 |
|
5317 |
|
5318 |
|
5319 |
|
5320 |
|
5321 |
|
5322 |
|
5323 |
|
5324 |
|
5325 |
|
5326 |
|
5327 |
|
5328 |
|
5329 |
|
5330 |
|
5331 |
|
5332 | export function times<T>(fn: (i: number) => T, n: number): T[];
|
5333 | export function times<T>(fn: (i: number) => T): (n: number) => T[];
|
5334 |
|
5335 |
|
5336 |
|
5337 |
|
5338 |
|
5339 |
|
5340 |
|
5341 |
|
5342 |
|
5343 |
|
5344 |
|
5345 | export function toLower<S extends string>(str: S): Lowercase<S>;
|
5346 | export function toLower(str: string): string;
|
5347 |
|
5348 |
|
5349 |
|
5350 |
|
5351 |
|
5352 |
|
5353 |
|
5354 |
|
5355 |
|
5356 | export function toPairs<O extends object, K extends Extract<keyof O, string | number>>(
|
5357 | obj: O,
|
5358 | ): Array<{ [key in K]: [`${key}`, O[key]] }[K]>;
|
5359 | export function toPairs<S>(obj: Record<string | number, S>): Array<[string, S]>;
|
5360 |
|
5361 |
|
5362 |
|
5363 |
|
5364 |
|
5365 |
|
5366 |
|
5367 |
|
5368 |
|
5369 |
|
5370 |
|
5371 |
|
5372 |
|
5373 |
|
5374 |
|
5375 |
|
5376 |
|
5377 |
|
5378 |
|
5379 |
|
5380 |
|
5381 |
|
5382 |
|
5383 |
|
5384 | export function toPairsIn<O extends object, K extends Extract<keyof O, string | number>>(
|
5385 | obj: O,
|
5386 | ): Array<{ [key in K]: [`${key}`, O[key]] }[K]>;
|
5387 | export function toPairsIn<S>(obj: Record<string | number, S>): Array<[string, S]>;
|
5388 |
|
5389 |
|
5390 |
|
5391 |
|
5392 |
|
5393 |
|
5394 |
|
5395 |
|
5396 |
|
5397 |
|
5398 |
|
5399 |
|
5400 |
|
5401 |
|
5402 |
|
5403 |
|
5404 |
|
5405 |
|
5406 |
|
5407 |
|
5408 |
|
5409 |
|
5410 |
|
5411 |
|
5412 |
|
5413 |
|
5414 |
|
5415 |
|
5416 | export function toString(val: unknown): string;
|
5417 |
|
5418 |
|
5419 |
|
5420 |
|
5421 |
|
5422 |
|
5423 |
|
5424 |
|
5425 |
|
5426 |
|
5427 |
|
5428 | export function toUpper<S extends string>(str: S): Uppercase<S>;
|
5429 | export function toUpper(str: string): string;
|
5430 |
|
5431 |
|
5432 |
|
5433 |
|
5434 |
|
5435 |
|
5436 |
|
5437 |
|
5438 |
|
5439 |
|
5440 |
|
5441 |
|
5442 |
|
5443 |
|
5444 |
|
5445 |
|
5446 |
|
5447 |
|
5448 |
|
5449 |
|
5450 |
|
5451 |
|
5452 |
|
5453 |
|
5454 |
|
5455 |
|
5456 |
|
5457 |
|
5458 |
|
5459 |
|
5460 |
|
5461 |
|
5462 |
|
5463 |
|
5464 |
|
5465 |
|
5466 | export function transduce<T, U, V>(
|
5467 | xf: (arg: readonly T[]) => U[],
|
5468 | fn: (acc: V, val: U) => V,
|
5469 | acc: V,
|
5470 | list: readonly T[],
|
5471 | ): V;
|
5472 | export function transduce<T, U, V>(
|
5473 | xf: (arg: readonly T[]) => U[],
|
5474 | ): (fn: (acc: V, val: U) => V, acc: V, list: readonly T[]) => V;
|
5475 | export function transduce<T, U, V>(
|
5476 | xf: (arg: readonly T[]) => U[],
|
5477 | fn: (acc: V, val: U) => V,
|
5478 | ): (acc: readonly T[], list: readonly T[]) => V;
|
5479 | export function transduce<T, U, V>(
|
5480 | xf: (arg: readonly T[]) => U[],
|
5481 | fn: (acc: V, val: U) => V,
|
5482 | acc: readonly T[],
|
5483 | ): (list: readonly T[]) => V;
|
5484 |
|
5485 |
|
5486 |
|
5487 |
|
5488 |
|
5489 |
|
5490 |
|
5491 |
|
5492 |
|
5493 |
|
5494 |
|
5495 |
|
5496 |
|
5497 |
|
5498 |
|
5499 | export function transpose<T>(list: readonly T[][]): T[][];
|
5500 |
|
5501 |
|
5502 |
|
5503 |
|
5504 |
|
5505 |
|
5506 |
|
5507 |
|
5508 |
|
5509 |
|
5510 |
|
5511 |
|
5512 |
|
5513 |
|
5514 |
|
5515 |
|
5516 |
|
5517 |
|
5518 |
|
5519 | export function traverse<A, B>(of: (a: B) => B[], fn: (t: A) => B[], list: readonly A[]): B[][];
|
5520 | export function traverse<A, B>(of: (a: B) => B[], fn: (t: A) => B[]): (list: readonly A[]) => B[][];
|
5521 | export function traverse<A, B>(of: (a: B) => B[]): (fn: (t: A) => B[], list: readonly A[]) => B[][];
|
5522 |
|
5523 |
|
5524 |
|
5525 |
|
5526 |
|
5527 |
|
5528 |
|
5529 |
|
5530 |
|
5531 |
|
5532 | export function trim(str: string): string;
|
5533 |
|
5534 |
|
5535 |
|
5536 |
|
5537 |
|
5538 |
|
5539 |
|
5540 |
|
5541 |
|
5542 |
|
5543 |
|
5544 |
|
5545 |
|
5546 |
|
5547 |
|
5548 |
|
5549 |
|
5550 |
|
5551 |
|
5552 |
|
5553 |
|
5554 | export function tryCatch<F extends AnyFunction, RE = ReturnType<F>, E = unknown>(
|
5555 | tryer: F,
|
5556 | catcher: (error: E, ...args: _.F.Parameters<F>) => RE,
|
5557 | ): F | (() => RE);
|
5558 | export function tryCatch<F extends AnyFunction>(
|
5559 | tryer: F,
|
5560 | ): <RE = ReturnType<F>, E = unknown>(catcher: (error: E, ...args: _.F.Parameters<F>) => RE) => F | (() => RE);
|
5561 |
|
5562 |
|
5563 |
|
5564 |
|
5565 |
|
5566 |
|
5567 |
|
5568 |
|
5569 |
|
5570 |
|
5571 |
|
5572 |
|
5573 |
|
5574 |
|
5575 |
|
5576 |
|
5577 |
|
5578 |
|
5579 |
|
5580 |
|
5581 |
|
5582 |
|
5583 | export function type(
|
5584 | val: any,
|
5585 | ):
|
5586 | | 'Object'
|
5587 | | 'Number'
|
5588 | | 'Boolean'
|
5589 | | 'String'
|
5590 | | 'Null'
|
5591 | | 'Array'
|
5592 | | 'RegExp'
|
5593 | | 'Function'
|
5594 | | 'Undefined'
|
5595 | | 'Symbol'
|
5596 | | 'Error';
|
5597 |
|
5598 |
|
5599 |
|
5600 |
|
5601 |
|
5602 |
|
5603 |
|
5604 |
|
5605 |
|
5606 |
|
5607 |
|
5608 |
|
5609 |
|
5610 |
|
5611 |
|
5612 |
|
5613 |
|
5614 | export function unapply<T>(fn: (args: any[]) => T): (...args: unknown[]) => T;
|
5615 |
|
5616 |
|
5617 |
|
5618 |
|
5619 |
|
5620 |
|
5621 |
|
5622 |
|
5623 |
|
5624 |
|
5625 |
|
5626 |
|
5627 |
|
5628 |
|
5629 |
|
5630 |
|
5631 |
|
5632 |
|
5633 |
|
5634 | export function unary<T, R>(fn: (a: T, ...args: any[]) => R): (a: T) => R;
|
5635 |
|
5636 |
|
5637 |
|
5638 |
|
5639 |
|
5640 |
|
5641 |
|
5642 |
|
5643 |
|
5644 |
|
5645 |
|
5646 |
|
5647 |
|
5648 |
|
5649 |
|
5650 | export function uncurryN<T>(len: number, fn: (a: any) => any): (...args: unknown[]) => T;
|
5651 | export function uncurryN<T>(len: number): (fn: (a: any) => any) => (...args: unknown[]) => T;
|
5652 |
|
5653 |
|
5654 |
|
5655 |
|
5656 |
|
5657 |
|
5658 |
|
5659 |
|
5660 |
|
5661 |
|
5662 |
|
5663 |
|
5664 |
|
5665 | export function unfold<T, TResult>(fn: (seed: T) => [TResult, T] | false, seed: T): TResult[];
|
5666 | export function unfold<T, TResult>(fn: (seed: T) => [TResult, T] | false): (seed: T) => TResult[];
|
5667 |
|
5668 |
|
5669 |
|
5670 |
|
5671 |
|
5672 |
|
5673 |
|
5674 |
|
5675 |
|
5676 | export function union<T>(as: readonly T[], bs: readonly T[]): T[];
|
5677 | export function union<T>(as: readonly T[]): (bs: readonly T[]) => T[];
|
5678 |
|
5679 |
|
5680 |
|
5681 |
|
5682 |
|
5683 |
|
5684 |
|
5685 |
|
5686 |
|
5687 |
|
5688 |
|
5689 |
|
5690 |
|
5691 |
|
5692 |
|
5693 | export function unionWith<T>(pred: (a: T, b: T) => boolean, list1: readonly T[], list2: readonly T[]): T[];
|
5694 | export function unionWith<T>(pred: (a: T, b: T) => boolean): _.F.Curry<(a: readonly T[], b: readonly T[]) => T[]>;
|
5695 |
|
5696 |
|
5697 |
|
5698 |
|
5699 |
|
5700 |
|
5701 |
|
5702 |
|
5703 |
|
5704 |
|
5705 |
|
5706 | export function uniq<T>(list: readonly T[]): T[];
|
5707 |
|
5708 |
|
5709 |
|
5710 |
|
5711 |
|
5712 |
|
5713 |
|
5714 |
|
5715 |
|
5716 |
|
5717 |
|
5718 |
|
5719 | export function uniqBy<T, U>(fn: (a: T) => U, list: readonly T[]): T[];
|
5720 | export function uniqBy<T, U>(fn: (a: T) => U): (list: readonly T[]) => T[];
|
5721 |
|
5722 |
|
5723 |
|
5724 |
|
5725 |
|
5726 |
|
5727 |
|
5728 |
|
5729 |
|
5730 |
|
5731 |
|
5732 |
|
5733 |
|
5734 |
|
5735 |
|
5736 |
|
5737 |
|
5738 |
|
5739 |
|
5740 | export function uniqWith<T, U>(pred: (x: T, y: T) => boolean, list: readonly T[]): T[];
|
5741 | export function uniqWith<T, U>(pred: (x: T, y: T) => boolean): (list: readonly T[]) => T[];
|
5742 |
|
5743 |
|
5744 |
|
5745 |
|
5746 |
|
5747 |
|
5748 |
|
5749 |
|
5750 |
|
5751 |
|
5752 |
|
5753 |
|
5754 |
|
5755 |
|
5756 |
|
5757 |
|
5758 | export function unless<T, U>(pred: (a: T) => boolean, whenFalseFn: (a: T) => U, a: T): T | U;
|
5759 | export function unless<T, U>(pred: (a: T) => boolean, whenFalseFn: (a: T) => U): (a: T) => T | U;
|
5760 |
|
5761 |
|
5762 |
|
5763 |
|
5764 |
|
5765 |
|
5766 |
|
5767 |
|
5768 |
|
5769 |
|
5770 |
|
5771 |
|
5772 |
|
5773 | export function unnest<T extends readonly any[]>(list: T): _.T.UnNest<T>;
|
5774 |
|
5775 |
|
5776 |
|
5777 |
|
5778 |
|
5779 |
|
5780 |
|
5781 |
|
5782 |
|
5783 |
|
5784 |
|
5785 |
|
5786 | export function until<T, U>(pred: (val: T) => boolean, fn: (val: T) => U, init: U): U;
|
5787 | export function until<T, U>(pred: (val: T) => boolean, fn: (val: T) => U): (init: U) => U;
|
5788 |
|
5789 |
|
5790 |
|
5791 |
|
5792 |
|
5793 |
|
5794 |
|
5795 |
|
5796 |
|
5797 |
|
5798 |
|
5799 |
|
5800 | export function update<T>(index: number, value: T, list: readonly T[]): T[];
|
5801 | export function update<T>(index: number, value: T): (list: readonly T[]) => T[];
|
5802 |
|
5803 |
|
5804 |
|
5805 |
|
5806 |
|
5807 |
|
5808 |
|
5809 |
|
5810 |
|
5811 |
|
5812 |
|
5813 |
|
5814 |
|
5815 |
|
5816 |
|
5817 |
|
5818 |
|
5819 |
|
5820 |
|
5821 |
|
5822 |
|
5823 |
|
5824 |
|
5825 |
|
5826 | export function useWith<
|
5827 | TArg1,
|
5828 | TR1,
|
5829 | TArg2,
|
5830 | TR2,
|
5831 | TArg3,
|
5832 | TR3,
|
5833 | TArg4,
|
5834 | TR4,
|
5835 | TArg5,
|
5836 | TR5,
|
5837 | TArg6,
|
5838 | TR6,
|
5839 | TArg7,
|
5840 | TR7,
|
5841 | TResult,
|
5842 | RestFunctions extends AnyFunction[],
|
5843 | TArgs extends [TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, ...InputTypesOfFns<RestFunctions>],
|
5844 | >(
|
5845 | fn: (...args: [TR1, TR2, TR3, TR4, TR5, TR6, TR7, ...ReturnTypesOfFns<RestFunctions>]) => TResult,
|
5846 | transformers: [
|
5847 | (arg: TArg1) => TR1,
|
5848 | (arg: TArg2) => TR2,
|
5849 | (arg: TArg3) => TR3,
|
5850 | (arg: TArg4) => TR4,
|
5851 | (arg: TArg5) => TR5,
|
5852 | (arg: TArg6) => TR6,
|
5853 | (arg: TArg7) => TR7,
|
5854 | ...RestFunctions,
|
5855 | ],
|
5856 | ): (...args: TArgs) => TResult;
|
5857 | export function useWith<TArg1, TR1, TArg2, TR2, TArg3, TR3, TArg4, TR4, TArg5, TR5, TArg6, TR6, TArg7, TR7, TResult>(
|
5858 | fn: (...args: [TR1, TR2, TR3, TR4, TR5, TR6, TR7] & { length: 7 }) => TResult,
|
5859 | transformers: [
|
5860 | (arg: TArg1) => TR1,
|
5861 | (arg: TArg2) => TR2,
|
5862 | (arg: TArg3) => TR3,
|
5863 | (arg: TArg4) => TR4,
|
5864 | (arg: TArg5) => TR5,
|
5865 | (arg: TArg6) => TR6,
|
5866 | (arg: TArg7) => TR7,
|
5867 | ],
|
5868 | ): (...args: [TArg1, TArg2, TArg3, TArg4, TArg5, TArg7]) => TResult;
|
5869 | export function useWith<TArg1, TR1, TArg2, TR2, TArg3, TR3, TArg4, TR4, TArg5, TR5, TArg6, TR6, TResult>(
|
5870 | fn: (...args: [TR1, TR2, TR3, TR4, TR5, TR6] & { length: 6 }) => TResult,
|
5871 | transformers: [
|
5872 | (arg: TArg1) => TR1,
|
5873 | (arg: TArg2) => TR2,
|
5874 | (arg: TArg3) => TR3,
|
5875 | (arg: TArg4) => TR4,
|
5876 | (arg: TArg5) => TR5,
|
5877 | (arg: TArg6) => TR6,
|
5878 | ],
|
5879 | ): (...args: [TArg1, TArg2, TArg3, TArg4, TArg5, TArg6]) => TResult;
|
5880 | export function useWith<TArg1, TR1, TArg2, TR2, TArg3, TR3, TArg4, TR4, TArg5, TR5, TResult>(
|
5881 | fn: (...args: [TR1, TR2, TR3, TR4, TR5] & { length: 5 }) => TResult,
|
5882 | transformers: [
|
5883 | (arg: TArg1) => TR1,
|
5884 | (arg: TArg2) => TR2,
|
5885 | (arg: TArg3) => TR3,
|
5886 | (arg: TArg4) => TR4,
|
5887 | (arg: TArg5) => TR5,
|
5888 | ],
|
5889 | ): (...args: [TArg1, TArg2, TArg3, TArg4, TArg5]) => TResult;
|
5890 | export function useWith<TArg1, TR1, TArg2, TR2, TArg3, TR3, TArg4, TR4, TResult>(
|
5891 | fn: (...args: [TR1, TR2, TR3, TR4] & { length: 4 }) => TResult,
|
5892 | transformers: [(arg: TArg1) => TR1, (arg: TArg2) => TR2, (arg: TArg3) => TR3, (arg: TArg4) => TR4],
|
5893 | ): (...args: [TArg1, TArg2, TArg3, TArg4]) => TResult;
|
5894 | export function useWith<TArg1, TR1, TArg2, TR2, TArg3, TR3, TResult>(
|
5895 | fn: (...args: [TR1, TR2, TR3] & { length: 3 }) => TResult,
|
5896 | transformers: [(arg: TArg1) => TR1, (arg: TArg2) => TR2, (arg: TArg3) => TR3],
|
5897 | ): (...args: [TArg1, TArg2, TArg3]) => TResult;
|
5898 | export function useWith<TArg1, TR1, TArg2, TR2, TResult>(
|
5899 | fn: (...args: [TR1, TR2] & { length: 2 }) => TResult,
|
5900 | transformers: [(arg: TArg1) => TR1, (arg: TArg2) => TR2],
|
5901 | ): (...args: [TArg1, TArg2]) => TResult;
|
5902 | export function useWith<TArg1, TR1, TResult>(
|
5903 | fn: (...args: [TR1]) => TResult,
|
5904 | transformers: [(arg: TArg1) => TR1],
|
5905 | ): (...args: [TArg1]) => TResult;
|
5906 |
|
5907 |
|
5908 |
|
5909 |
|
5910 |
|
5911 |
|
5912 |
|
5913 |
|
5914 |
|
5915 |
|
5916 |
|
5917 |
|
5918 |
|
5919 | export function values<T extends object, K extends keyof T>(obj: T): Array<T[K] | ValueOfUnion<T>>;
|
5920 |
|
5921 |
|
5922 |
|
5923 |
|
5924 |
|
5925 |
|
5926 |
|
5927 |
|
5928 |
|
5929 |
|
5930 |
|
5931 |
|
5932 |
|
5933 |
|
5934 |
|
5935 |
|
5936 |
|
5937 |
|
5938 |
|
5939 |
|
5940 |
|
5941 |
|
5942 | export function valuesIn<T>(obj: any): T[];
|
5943 |
|
5944 |
|
5945 |
|
5946 |
|
5947 |
|
5948 |
|
5949 |
|
5950 |
|
5951 |
|
5952 |
|
5953 |
|
5954 |
|
5955 |
|
5956 |
|
5957 |
|
5958 |
|
5959 |
|
5960 | export function view<S, A>(lens: Lens<S, A>): (obj: S) => A;
|
5961 | export function view<S, A>(lens: Lens<S, A>, obj: S): A;
|
5962 |
|
5963 |
|
5964 |
|
5965 |
|
5966 |
|
5967 |
|
5968 |
|
5969 |
|
5970 |
|
5971 |
|
5972 |
|
5973 |
|
5974 |
|
5975 |
|
5976 |
|
5977 |
|
5978 |
|
5979 |
|
5980 |
|
5981 |
|
5982 | export function when<T, U extends T, V>(pred: (a: T) => a is U, whenTrueFn: (a: U) => V, a: T): T | V;
|
5983 | export function when<T, U>(pred: (a: T) => boolean, whenTrueFn: (a: T) => U, a: T): T | U;
|
5984 | export function when<T, U extends T, V>(pred: (a: T) => a is U, whenTrueFn: (a: U) => V): (a: T) => T | V;
|
5985 | export function when<T, U>(pred: (a: T) => boolean, whenTrueFn: (a: T) => U): (a: T) => T | U;
|
5986 |
|
5987 |
|
5988 |
|
5989 |
|
5990 |
|
5991 |
|
5992 |
|
5993 |
|
5994 |
|
5995 |
|
5996 |
|
5997 |
|
5998 |
|
5999 |
|
6000 |
|
6001 |
|
6002 |
|
6003 |
|
6004 |
|
6005 |
|
6006 |
|
6007 |
|
6008 |
|
6009 |
|
6010 |
|
6011 |
|
6012 |
|
6013 |
|
6014 |
|
6015 |
|
6016 |
|
6017 |
|
6018 |
|
6019 | export function where<T, U>(spec: T, testObj: U): boolean;
|
6020 | export function where<T>(spec: T): <U>(testObj: U) => boolean;
|
6021 | export function where<ObjFunc2, U>(spec: ObjFunc2, testObj: U): boolean;
|
6022 | export function where<ObjFunc2>(spec: ObjFunc2): <U>(testObj: U) => boolean;
|
6023 |
|
6024 |
|
6025 |
|
6026 |
|
6027 |
|
6028 |
|
6029 |
|
6030 |
|
6031 |
|
6032 |
|
6033 |
|
6034 |
|
6035 |
|
6036 |
|
6037 |
|
6038 |
|
6039 |
|
6040 |
|
6041 |
|
6042 |
|
6043 |
|
6044 |
|
6045 | export function whereEq<T, U>(spec: T, obj: U): boolean;
|
6046 | export function whereEq<T>(spec: T): <U>(obj: U) => boolean;
|
6047 |
|
6048 |
|
6049 |
|
6050 |
|
6051 |
|
6052 |
|
6053 |
|
6054 |
|
6055 |
|
6056 |
|
6057 |
|
6058 |
|
6059 |
|
6060 | export function without<T>(list1: readonly unknown[], list2: readonly T[]): T[];
|
6061 | export function without<T>(list1: readonly T[] | readonly unknown[]): (list2: readonly T[]) => T[];
|
6062 |
|
6063 |
|
6064 |
|
6065 |
|
6066 |
|
6067 |
|
6068 |
|
6069 |
|
6070 |
|
6071 |
|
6072 |
|
6073 |
|
6074 |
|
6075 |
|
6076 |
|
6077 |
|
6078 | export function xor(a: any, b: any): boolean;
|
6079 | export function xor(a: any): (b: any) => boolean;
|
6080 |
|
6081 |
|
6082 |
|
6083 |
|
6084 |
|
6085 |
|
6086 |
|
6087 |
|
6088 |
|
6089 |
|
6090 |
|
6091 | export function xprod<K, V>(as: readonly K[], bs: readonly V[]): Array<KeyValuePair<K, V>>;
|
6092 | export function xprod<K>(as: readonly K[]): <V>(bs: readonly V[]) => Array<KeyValuePair<K, V>>;
|
6093 |
|
6094 |
|
6095 |
|
6096 |
|
6097 |
|
6098 |
|
6099 |
|
6100 |
|
6101 |
|
6102 |
|
6103 |
|
6104 |
|
6105 |
|
6106 |
|
6107 | export function zip<K, V>(list1: readonly K[], list2: readonly V[]): Array<KeyValuePair<K, V>>;
|
6108 | export function zip<K>(list1: readonly K[]): <V>(list2: readonly V[]) => Array<KeyValuePair<K, V>>;
|
6109 |
|
6110 |
|
6111 |
|
6112 |
|
6113 |
|
6114 |
|
6115 |
|
6116 |
|
6117 |
|
6118 |
|
6119 |
|
6120 |
|
6121 |
|
6122 | export function zipObj<T, K extends string>(keys: readonly K[], values: readonly T[]): { [P in K]: T };
|
6123 | export function zipObj<K extends string>(keys: readonly K[]): <T>(values: readonly T[]) => { [P in K]: T };
|
6124 | export function zipObj<T, K extends number>(keys: readonly K[], values: readonly T[]): { [P in K]: T };
|
6125 | export function zipObj<K extends number>(keys: readonly K[]): <T>(values: readonly T[]) => { [P in K]: T };
|
6126 |
|
6127 |
|
6128 |
|
6129 |
|
6130 |
|
6131 |
|
6132 |
|
6133 |
|
6134 |
|
6135 |
|
6136 |
|
6137 |
|
6138 | export function zipWith<T, U, TResult>(
|
6139 | fn: (x: T, y: U) => TResult,
|
6140 | list1: readonly T[],
|
6141 | list2: readonly U[],
|
6142 | ): TResult[];
|
6143 | export function zipWith<T, U, TResult>(
|
6144 | fn: (x: T, y: U) => TResult,
|
6145 | list1: readonly T[],
|
6146 | ): (list2: readonly U[]) => TResult[];
|
6147 | export function zipWith<T, U, TResult>(
|
6148 | fn: (x: T, y: U) => TResult,
|
6149 | ): (list1: readonly T[], list2: readonly U[]) => TResult[];
|
6150 |
|
6151 |
|
6152 |
|
6153 |
|
6154 |
|
6155 |
|
6156 |
|
6157 |
|
6158 |
|
6159 |
|
6160 |
|
6161 |
|
6162 |
|
6163 | export function modify<T extends object, K extends keyof T, P>(
|
6164 | prop: K,
|
6165 | fn: (a: T[K]) => P,
|
6166 | obj: T,
|
6167 | ): Omit<T, K> & Record<K, P>;
|
6168 | export function modify<K extends string, A, P>(
|
6169 | prop: K,
|
6170 | fn: (a: A) => P,
|
6171 | ): <T extends Record<K, A>>(target: T) => Omit<T, K> & Record<K, P>;
|
6172 |
|
6173 | export as namespace R;
|