source: node_modules/es-toolkit/dist/compat/array/pullAllBy.d.ts@ ba17441

Last change on this file since ba17441 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 3.4 KB
Line 
1import { MutableList } from '../_internal/MutableList.d.js';
2import { RejectReadonly } from '../_internal/RejectReadonly.d.js';
3import { ValueIteratee } from '../_internal/ValueIteratee.js';
4
5/**
6 * Removes all specified values from an array using an iteratee function.
7 *
8 * This function changes `arr` in place.
9 * If you want to remove values without modifying the original array, use `differenceBy`.
10 *
11 * @template T
12 * @param {T[]} array - The array to modify.
13 * @param {ArrayLike<T>} [values] - The values to remove.
14 * @param {((value: T) => unknown) | PropertyKey | [PropertyKey, any] | Partial<T>} [iteratee] - The iteratee invoked per element.
15 * @returns {T[]} Returns `array`.
16 *
17 * @example
18 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
19 *
20 * pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
21 * console.log(array);
22 * // => [{ 'x': 2 }]
23 */
24declare function pullAllBy<T>(array: T[], values?: ArrayLike<T>, iteratee?: ValueIteratee<T>): T[];
25/**
26 * Removes all specified values from an array using an iteratee function.
27 *
28 * This function changes `arr` in place.
29 * If you want to remove values without modifying the original array, use `differenceBy`.
30 *
31 * @template L
32 * @param {RejectReadonly<L>} array - The array to modify.
33 * @param {ArrayLike<L[0]>} [values] - The values to remove.
34 * @param {ValueIteratee<L[0]>} [iteratee] - The iteratee invoked per element.
35 * @returns {L} Returns `array`.
36 *
37 * @example
38 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
39 *
40 * pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
41 * console.log(array);
42 * // => [{ 'x': 2 }]
43 */
44declare function pullAllBy<L extends MutableList<any>>(array: RejectReadonly<L>, values?: ArrayLike<L[0]>, iteratee?: ValueIteratee<L[0]>): L;
45/**
46 * Removes all specified values from an array using an iteratee function.
47 *
48 * This function changes `arr` in place.
49 * If you want to remove values without modifying the original array, use `differenceBy`.
50 *
51 * @template T, U
52 * @param {T[]} array - The array to modify.
53 * @param {ArrayLike<U>} values - The values to remove.
54 * @param {((value: T | U) => unknown) | PropertyKey | [PropertyKey, any] | Partial<T | U>} iteratee - The iteratee invoked per element.
55 * @returns {T[]} Returns `array`.
56 *
57 * @example
58 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
59 *
60 * pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
61 * console.log(array);
62 * // => [{ 'x': 2 }]
63 */
64declare function pullAllBy<T, U>(array: T[], values: ArrayLike<U>, iteratee: ValueIteratee<T | U>): T[];
65/**
66 * Removes all specified values from an array using an iteratee function.
67 *
68 * This function changes `arr` in place.
69 * If you want to remove values without modifying the original array, use `differenceBy`.
70 *
71 * @template L, U
72 * @param {L} array - The array to modify.
73 * @param {ArrayLike<U>} values - The values to remove.
74 * @param {((value: L[0] | U) => unknown) | PropertyKey | [PropertyKey, any] | Partial<L[0] | U>} iteratee - The iteratee invoked per element.
75 * @returns {L} Returns `array`.
76 *
77 * @example
78 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
79 *
80 * pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
81 * console.log(array);
82 * // => [{ 'x': 2 }]
83 */
84declare function pullAllBy<L extends ArrayLike<any>, U>(array: L extends readonly any[] ? never : L, values: ArrayLike<U>, iteratee: ValueIteratee<L[0] | U>): L;
85
86export { pullAllBy };
Note: See TracBrowser for help on using the repository browser.