@@ -5,9 +5,10 @@ import { pull as pullToolkit } from '../../array/pull.ts';
55 *
66 * **Note:** Unlike `_.without`, this method mutates `array`.
77 *
8- * @template T
8+ * @template T - The type of elements in the array.
9+ * @template U - The type of values to remove from the array.
910 * @param {T[]} array - The array to modify.
10- * @param {...T []} values - The values to remove.
11+ * @param {...U []} values - The values to remove.
1112 * @returns {T[]} Returns `array`.
1213 *
1314 * @example
@@ -17,14 +18,14 @@ import { pull as pullToolkit } from '../../array/pull.ts';
1718 * console.log(array);
1819 * // => [1, 1]
1920 */
20- export function pull<T>(array: T[], ...values: T []): T[];
21+ export function pull<T, U extends T >(array: T[], ...values: U []): T[];
2122
2223/**
2324 * Removes all provided values from array using SameValueZero for equality comparisons.
2425 *
2526 * **Note:** Unlike `_.without`, this method mutates `array`.
2627 *
27- * @template L
28+ * @template L - The type of elements in the array-like object.
2829 * @param {L} array - The array to modify.
2930 * @param {...L[0][]} values - The values to remove.
3031 * @returns {L} Returns `array`.
@@ -44,16 +45,17 @@ export function pull<L extends ArrayLike<any>>(array: L extends readonly any[] ?
4445 * This function changes `arr` in place.
4546 * If you want to remove values without modifying the original array, use `difference`.
4647 *
47- * @template T, U
48+ * @template T - The type of elements in the array.
49+ * @template U - The type of values to remove from the array.
4850 * @param {T[]} arr - The array to modify.
49- * @param {...unknown []} valuesToRemove - The values to remove from the array.
51+ * @param {U []} valuesToRemove - The values to remove from the array.
5052 * @returns {T[]} The modified array with the specified values removed.
5153 *
5254 * @example
5355 * const numbers = [1, 2, 3, 4, 5, 2, 4];
5456 * pull(numbers, [2, 4]);
5557 * console.log(numbers); // [1, 3, 5]
5658 */
57- export function pull<T>(arr: T[], ...valuesToRemove: readonly unknown []): T[] {
59+ export function pull<T, U extends T >(arr: T[], ...valuesToRemove: readonly U []): T[] {
5860 return pullToolkit(arr, valuesToRemove);
5961}
0 commit comments