mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
Remove noop.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -22,7 +22,7 @@ import isLength from './isLength.js';
|
||||
* isArrayLike('abc');
|
||||
* // => true
|
||||
*
|
||||
* isArrayLike(noop);
|
||||
* isArrayLike(Function);
|
||||
* // => false
|
||||
*/
|
||||
function isArrayLike(value) {
|
||||
|
||||
@@ -22,7 +22,7 @@ import isObjectLike from './isObjectLike.js';
|
||||
* isArrayLikeObject('abc');
|
||||
* // => false
|
||||
*
|
||||
* isArrayLikeObject(noop);
|
||||
* isArrayLikeObject(Function);
|
||||
* // => false
|
||||
*/
|
||||
function isArrayLikeObject(value) {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* isObject([1, 2, 3]);
|
||||
* // => true
|
||||
*
|
||||
* isObject(noop);
|
||||
* isObject(Function);
|
||||
* // => true
|
||||
*
|
||||
* isObject(null);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* isObjectLike([1, 2, 3]);
|
||||
* // => true
|
||||
*
|
||||
* isObjectLike(noop);
|
||||
* isObjectLike(Function);
|
||||
* // => false
|
||||
*
|
||||
* isObjectLike(null);
|
||||
|
||||
Reference in New Issue
Block a user