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