From e52c421c1d706aab9f05db8e4ad067c364c2165c Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 10 Jan 2017 17:45:08 -0800 Subject: [PATCH] Remove `overArg`. --- .internal/nativeKeys.js | 16 ++++++++++++---- .internal/overArg.js | 13 ------------- 2 files changed, 12 insertions(+), 17 deletions(-) delete mode 100644 .internal/overArg.js diff --git a/.internal/nativeKeys.js b/.internal/nativeKeys.js index a059d80b9..159dabece 100644 --- a/.internal/nativeKeys.js +++ b/.internal/nativeKeys.js @@ -1,6 +1,14 @@ -import overArg from './.internal/overArg.js'; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeKeys = overArg(Object.keys, Object); +/** + * This function is a thin wrapper around + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * 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; diff --git a/.internal/overArg.js b/.internal/overArg.js deleted file mode 100644 index d286b7fb3..000000000 --- a/.internal/overArg.js +++ /dev/null @@ -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;