Remove noop.

This commit is contained in:
John-David Dalton
2017-01-09 18:38:36 -08:00
parent 82e681a191
commit 395a81058b
7 changed files with 10 additions and 24 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -22,7 +22,7 @@ import isLength from './isLength.js';
* isArrayLike('abc');
* // => true
*
* isArrayLike(noop);
* isArrayLike(Function);
* // => false
*/
function isArrayLike(value) {

View File

@@ -22,7 +22,7 @@ import isObjectLike from './isObjectLike.js';
* isArrayLikeObject('abc');
* // => false
*
* isArrayLikeObject(noop);
* isArrayLikeObject(Function);
* // => false
*/
function isArrayLikeObject(value) {

View File

@@ -16,7 +16,7 @@
* isObject([1, 2, 3]);
* // => true
*
* isObject(noop);
* isObject(Function);
* // => true
*
* isObject(null);

View File

@@ -15,7 +15,7 @@
* isObjectLike([1, 2, 3]);
* // => true
*
* isObjectLike(noop);
* isObjectLike(Function);
* // => false
*
* isObjectLike(null);

16
noop.js
View File

@@ -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;