mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Ensure resolver provided to _.memoize is a function if it's truthy.
This commit is contained in:
2
dist/lodash.underscore.js
vendored
2
dist/lodash.underscore.js
vendored
@@ -3460,7 +3460,7 @@
|
||||
* // => { 'name': 'penelope', 'age': 1 }
|
||||
*/
|
||||
function memoize(func, resolver) {
|
||||
if (!isFunction(func)) {
|
||||
if (!isFunction(func) || (resolver && !isFunction(resolver))) {
|
||||
throw new TypeError;
|
||||
}
|
||||
var cache = {};
|
||||
|
||||
Reference in New Issue
Block a user