mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 03:47:50 +00:00
Remove noop.
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import Set from './_Set.js';
|
import Set from './_Set.js';
|
||||||
import noop from './noop.js';
|
|
||||||
import setToArray from './_setToArray.js';
|
import setToArray from './_setToArray.js';
|
||||||
|
|
||||||
/** Used as references for various `Number` constants. */
|
/** 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.
|
* @param {Array} values The values to add to the set.
|
||||||
* @returns {Object} Returns the new 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;
|
export default createSet;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import metaMap from './_metaMap.js';
|
import metaMap from './_metaMap.js';
|
||||||
import noop from './noop.js';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets metadata for `func`.
|
* Gets metadata for `func`.
|
||||||
@@ -8,6 +7,8 @@ import noop from './noop.js';
|
|||||||
* @param {Function} func The function to query.
|
* @param {Function} func The function to query.
|
||||||
* @returns {*} Returns the metadata for `func`.
|
* @returns {*} Returns the metadata for `func`.
|
||||||
*/
|
*/
|
||||||
const getData = !metaMap ? noop : func => metaMap.get(func);
|
const getData = metaMap
|
||||||
|
? func => metaMap.get(func)
|
||||||
|
: () => {};
|
||||||
|
|
||||||
export default getData;
|
export default getData;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import isLength from './isLength.js';
|
|||||||
* isArrayLike('abc');
|
* isArrayLike('abc');
|
||||||
* // => true
|
* // => true
|
||||||
*
|
*
|
||||||
* isArrayLike(noop);
|
* isArrayLike(Function);
|
||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isArrayLike(value) {
|
function isArrayLike(value) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import isObjectLike from './isObjectLike.js';
|
|||||||
* isArrayLikeObject('abc');
|
* isArrayLikeObject('abc');
|
||||||
* // => false
|
* // => false
|
||||||
*
|
*
|
||||||
* isArrayLikeObject(noop);
|
* isArrayLikeObject(Function);
|
||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isArrayLikeObject(value) {
|
function isArrayLikeObject(value) {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
* isObject([1, 2, 3]);
|
* isObject([1, 2, 3]);
|
||||||
* // => true
|
* // => true
|
||||||
*
|
*
|
||||||
* isObject(noop);
|
* isObject(Function);
|
||||||
* // => true
|
* // => true
|
||||||
*
|
*
|
||||||
* isObject(null);
|
* isObject(null);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* isObjectLike([1, 2, 3]);
|
* isObjectLike([1, 2, 3]);
|
||||||
* // => true
|
* // => true
|
||||||
*
|
*
|
||||||
* isObjectLike(noop);
|
* isObjectLike(Function);
|
||||||
* // => false
|
* // => false
|
||||||
*
|
*
|
||||||
* isObjectLike(null);
|
* isObjectLike(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user