From 395a81058ba73d944e916762c42e527a9811455b Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 9 Jan 2017 18:38:36 -0800 Subject: [PATCH] Remove `noop`. --- _createSet.js | 5 +++-- _getData.js | 5 +++-- isArrayLike.js | 2 +- isArrayLikeObject.js | 2 +- isObject.js | 2 +- isObjectLike.js | 2 +- noop.js | 16 ---------------- 7 files changed, 10 insertions(+), 24 deletions(-) delete mode 100644 noop.js diff --git a/_createSet.js b/_createSet.js index a103e0c28..e2a869817 100644 --- a/_createSet.js +++ b/_createSet.js @@ -1,5 +1,4 @@ import Set from './_Set.js'; -import noop from './noop.js'; import setToArray from './_setToArray.js'; /** Used as references for various `Number` constants. */ @@ -12,6 +11,8 @@ const INFINITY = 1 / 0; * @param {Array} values The values to add to the set. * @returns {Object} Returns the new set. */ -const createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : values => new Set(values); +const createSet = (Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) + ? values => new Set(values) + : () => {}; export default createSet; diff --git a/_getData.js b/_getData.js index b27eb8706..99b4ca012 100644 --- a/_getData.js +++ b/_getData.js @@ -1,5 +1,4 @@ import metaMap from './_metaMap.js'; -import noop from './noop.js'; /** * Gets metadata for `func`. @@ -8,6 +7,8 @@ import noop from './noop.js'; * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ -const getData = !metaMap ? noop : func => metaMap.get(func); +const getData = metaMap + ? func => metaMap.get(func) + : () => {}; export default getData; diff --git a/isArrayLike.js b/isArrayLike.js index 973f22ac2..2fc6225f6 100644 --- a/isArrayLike.js +++ b/isArrayLike.js @@ -22,7 +22,7 @@ import isLength from './isLength.js'; * isArrayLike('abc'); * // => true * - * isArrayLike(noop); + * isArrayLike(Function); * // => false */ function isArrayLike(value) { diff --git a/isArrayLikeObject.js b/isArrayLikeObject.js index d8f8b21a6..6587d0723 100644 --- a/isArrayLikeObject.js +++ b/isArrayLikeObject.js @@ -22,7 +22,7 @@ import isObjectLike from './isObjectLike.js'; * isArrayLikeObject('abc'); * // => false * - * isArrayLikeObject(noop); + * isArrayLikeObject(Function); * // => false */ function isArrayLikeObject(value) { diff --git a/isObject.js b/isObject.js index 3dba5809d..fe12a942a 100644 --- a/isObject.js +++ b/isObject.js @@ -16,7 +16,7 @@ * isObject([1, 2, 3]); * // => true * - * isObject(noop); + * isObject(Function); * // => true * * isObject(null); diff --git a/isObjectLike.js b/isObjectLike.js index 045cbd1bb..6c972f5ce 100644 --- a/isObjectLike.js +++ b/isObjectLike.js @@ -15,7 +15,7 @@ * isObjectLike([1, 2, 3]); * // => true * - * isObjectLike(noop); + * isObjectLike(Function); * // => false * * isObjectLike(null); diff --git a/noop.js b/noop.js deleted file mode 100644 index 3c14ee2df..000000000 --- a/noop.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This method returns `undefined`. - * - * @static - * @since 2.3.0 - * @category Util - * @example - * - * times(2, noop); - * // => [undefined, undefined] - */ -function noop() { - // No operation performed. -} - -export default noop;