mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Remove references to _.
This commit is contained in:
@@ -11,13 +11,12 @@ const FUNC_ERROR_TEXT = 'Expected a function';
|
||||
* is invoked with the `this` binding of the memoized function.
|
||||
*
|
||||
* **Note:** The cache is exposed as the `cache` property on the memoized
|
||||
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
||||
* function. Its creation may be customized by replacing the `memoize.Cache`
|
||||
* constructor with one whose instances implement the
|
||||
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
||||
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 0.1.0
|
||||
* @category Function
|
||||
* @param {Function} func The function to have its output memoized.
|
||||
@@ -28,7 +27,7 @@ const FUNC_ERROR_TEXT = 'Expected a function';
|
||||
* var object = { 'a': 1, 'b': 2 };
|
||||
* var other = { 'c': 3, 'd': 4 };
|
||||
*
|
||||
* var values = _.memoize(_.values);
|
||||
* var values = memoize(values);
|
||||
* values(object);
|
||||
* // => [1, 2]
|
||||
*
|
||||
@@ -44,8 +43,8 @@ const FUNC_ERROR_TEXT = 'Expected a function';
|
||||
* values(object);
|
||||
* // => ['a', 'b']
|
||||
*
|
||||
* // Replace `_.memoize.Cache`.
|
||||
* _.memoize.Cache = WeakMap;
|
||||
* // Replace `memoize.Cache`.
|
||||
* memoize.Cache = WeakMap;
|
||||
*/
|
||||
function memoize(func, resolver) {
|
||||
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
||||
|
||||
Reference in New Issue
Block a user