mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 20:07:49 +00:00
Remove overArg.
This commit is contained in:
@@ -1,6 +1,14 @@
|
|||||||
import overArg from './.internal/overArg.js';
|
/**
|
||||||
|
* This function is a thin wrapper around
|
||||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
||||||
const nativeKeys = overArg(Object.keys, Object);
|
* which ensures non-object values are coerced to objects beforehand.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object} object The object to query.
|
||||||
|
* @returns {Array} Returns the array of property names.
|
||||||
|
*/
|
||||||
|
function nativeKeys(object) {
|
||||||
|
return Object.keys(Object(object));
|
||||||
|
}
|
||||||
|
|
||||||
export default nativeKeys;
|
export default nativeKeys;
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
/**
|
|
||||||
* Creates a unary function that invokes `func` with its argument transformed.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {Function} func The function to wrap.
|
|
||||||
* @param {Function} transform The argument transform.
|
|
||||||
* @returns {Function} Returns the new function.
|
|
||||||
*/
|
|
||||||
function overArg(func, transform) {
|
|
||||||
return arg => func(transform(arg));
|
|
||||||
}
|
|
||||||
|
|
||||||
export default overArg;
|
|
||||||
Reference in New Issue
Block a user