8000 Provide correct `argsCount` hint to `customizer` functions of clone m… · lodash/lodash@bb78c0e · GitHub
[go: up one dir, main page]

Skip to content

Commit bb78c0e

Browse files
committed
Provide correct argsCount hint to customizer functions of clone methods.
1 parent 1a77202 commit bb78c0e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lodash.src.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -8447,7 +8447,7 @@
84478447
* otherwise they are assigned by reference. If `customizer` is provided it's
84488448
* invoked to produce the cloned values. If `customizer` returns `undefined`
84498449
* cloning is handled by the method instead. The `customizer` is bound to
8450-
* `thisArg` and invoked with two argument; (value [, index|key, object]).
8450+
* `thisArg` and invoked with up to three argument; (value [, index|key, object]).
84518451
*
84528452
* **Note:** This method is loosely based on the
84538453
* [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
@@ -8503,15 +8503,15 @@
85038503
isDeep = false;
85048504
}
85058505
return typeof customizer == 'function'
8506-
? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1))
8506+
? baseClone(value, isDeep, bindCallback(customizer, thisArg, 3))
85078507
: baseClone(value, isDeep);
85088508
}
85098509

85108510
/**
85118511
* Creates a deep clone of `value`. If `customizer` is provided it's invoked
85128512
* to produce the cloned values. If `customizer` returns `undefined` cloning
85138513
* is handled by the method instead. The `customizer` is bound to `thisArg`
8514-
* and invoked with two argument; (value [, index|key, object]).
8514+
* and invoked with up to three argument; (value [, index|key, object]).
85158515
*
85168516
* **Note:** This method is loosely based on the
85178517
* [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
@@ -8554,7 +8554,7 @@
85548554
*/
85558555
function cloneDeep(value, customizer, thisArg) {
85568556
return typeof customizer == 'function'
8557-
? baseClone(value, true, bindCallback(customizer, thisArg, 1))
8557+
? baseClone(value, true, bindCallback(customizer, thisArg, 3))
85588558
: baseClone(value, true);
85598559
}
85608560

@@ -8749,8 +8749,8 @@
87498749
* Performs a deep comparison between two values to determine if they are
87508750
* equivalent. If `customizer` is provided it's invoked to compare values.
87518751
* If `customizer` returns `undefined` comparisons are handled by the method
8752-
* instead. The `customizer` is bound to `thisArg` and invoked with three
8753-
* arguments: (value, other [, index|key]).
8752+
* instead. The `customizer` is bound to `thisArg` and invoked with up to
8753+
* three arguments: (value, other [, index|key]).
87548754
*
87558755
* **Note:** This method supports comparing arrays, booleans, `Date` objects,
87568756
* numbers, `Object` objects, regexes, and strings. Objects are compared by

0 commit comments

Comments
 (0)
0