lodash._baseuniq
Advanced tools
Comparing version 4.4.0 to 4.5.0
205
index.js
/** | ||
* lodash 4.4.0 (Custom Build) <https://lodash.com/> | ||
* lodash 4.5.0 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
@@ -10,3 +10,3 @@ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
var SetCache = require('lodash._setcache'), | ||
root = require('lodash._root'); | ||
createSet = require('lodash._createset'); | ||
@@ -19,12 +19,2 @@ /** Used as the size to enable large array optimizations. */ | ||
/** `Object#toString` result references. */ | ||
var funcTag = '[object Function]', | ||
genTag = '[object GeneratorFunction]'; | ||
/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ | ||
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; | ||
/** Used to detect host constructors (Safari > 5). */ | ||
var reIsHostCtor = /^\[object .+?Constructor\]$/; | ||
/** | ||
@@ -112,21 +102,2 @@ * A specialized version of `_.includes` for arrays without support for | ||
/** | ||
* Checks if `value` is a host object in IE < 9. | ||
* | ||
* @private | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is a host object, else `false`. | ||
*/ | ||
function isHostObject(value) { | ||
// Many host objects are `Object` objects that can coerce to strings | ||
// despite having improperly defined `toString` methods. | ||
var result = false; | ||
if (value != null && typeof value.toString != 'function') { | ||
try { | ||
result = !!(value + ''); | ||
} catch (e) {} | ||
} | ||
return result; | ||
} | ||
/** | ||
* Converts `set` to an array. | ||
@@ -148,27 +119,3 @@ * | ||
/** Used for built-in method references. */ | ||
var objectProto = Object.prototype; | ||
/** Used to resolve the decompiled source of functions. */ | ||
var funcToString = Function.prototype.toString; | ||
/** Used to check objects for own properties. */ | ||
var hasOwnProperty = objectProto.hasOwnProperty; | ||
/** | ||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) | ||
* of values. | ||
*/ | ||
var objectToString = objectProto.toString; | ||
/** Used to detect if a method is native. */ | ||
var reIsNative = RegExp('^' + | ||
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') | ||
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' | ||
); | ||
/* Built-in method references that are verified to be native. */ | ||
var Set = getNative(root, 'Set'); | ||
/** | ||
* Checks if `value` is in `cache`. | ||
@@ -253,26 +200,2 @@ * | ||
/** | ||
* Creates a set of `values`. | ||
* | ||
* @private | ||
* @param {Array} values The values to add to the set. | ||
* @returns {Object} Returns the new set. | ||
*/ | ||
var createSet = !(Set && new Set([1, 2]).size === 2) ? noop : function(values) { | ||
return new Set(values); | ||
}; | ||
/** | ||
* Gets the native function at `key` of `object`. | ||
* | ||
* @private | ||
* @param {Object} object The object to query. | ||
* @param {string} key The key of the method to get. | ||
* @returns {*} Returns the function if it's native, else `undefined`. | ||
*/ | ||
function getNative(object, key) { | ||
var value = object == null ? undefined : object[key]; | ||
return isNative(value) ? value : undefined; | ||
} | ||
/** | ||
* Checks if `value` is suitable for use as unique object key. | ||
@@ -290,126 +213,2 @@ * | ||
/** | ||
* Checks if `value` is classified as a `Function` object. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
* @example | ||
* | ||
* _.isFunction(_); | ||
* // => true | ||
* | ||
* _.isFunction(/abc/); | ||
* // => false | ||
*/ | ||
function isFunction(value) { | ||
// The use of `Object#toString` avoids issues with the `typeof` operator | ||
// in Safari 8 which returns 'object' for typed array constructors, and | ||
// PhantomJS 1.9 which returns 'function' for `NodeList` instances. | ||
var tag = isObject(value) ? objectToString.call(value) : ''; | ||
return tag == funcTag || tag == genTag; | ||
} | ||
/** | ||
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. | ||
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is an object, else `false`. | ||
* @example | ||
* | ||
* _.isObject({}); | ||
* // => true | ||
* | ||
* _.isObject([1, 2, 3]); | ||
* // => true | ||
* | ||
* _.isObject(_.noop); | ||
* // => true | ||
* | ||
* _.isObject(null); | ||
* // => false | ||
*/ | ||
function isObject(value) { | ||
var type = typeof value; | ||
return !!value && (type == 'object' || type == 'function'); | ||
} | ||
/** | ||
* Checks if `value` is object-like. A value is object-like if it's not `null` | ||
* and has a `typeof` result of "object". | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. | ||
* @example | ||
* | ||
* _.isObjectLike({}); | ||
* // => true | ||
* | ||
* _.isObjectLike([1, 2, 3]); | ||
* // => true | ||
* | ||
* _.isObjectLike(_.noop); | ||
* // => false | ||
* | ||
* _.isObjectLike(null); | ||
* // => false | ||
*/ | ||
function isObjectLike(value) { | ||
return !!value && typeof value == 'object'; | ||
} | ||
/** | ||
* Checks if `value` is a native function. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is a native function, else `false`. | ||
* @example | ||
* | ||
* _.isNative(Array.prototype.push); | ||
* // => true | ||
* | ||
* _.isNative(_); | ||
* // => false | ||
*/ | ||
function isNative(value) { | ||
if (value == null) { | ||
return false; | ||
} | ||
if (isFunction(value)) { | ||
return reIsNative.test(funcToString.call(value)); | ||
} | ||
return isObjectLike(value) && | ||
(isHostObject(value) ? reIsNative : reIsHostCtor).test(value); | ||
} | ||
/** | ||
* A no-operation function that returns `undefined` regardless of the | ||
* arguments it receives. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Util | ||
* @example | ||
* | ||
* var object = { 'user': 'fred' }; | ||
* | ||
* _.noop(object) === undefined; | ||
* // => true | ||
*/ | ||
function noop() { | ||
// No operation performed. | ||
} | ||
module.exports = baseUniq; |
{ | ||
"name": "lodash._baseuniq", | ||
"version": "4.4.0", | ||
"version": "4.5.0", | ||
"description": "The internal lodash function `baseUniq` exported as a module.", | ||
@@ -17,5 +17,5 @@ "homepage": "https://lodash.com/", | ||
"dependencies": { | ||
"lodash._root": "^3.0.0", | ||
"lodash._createset": "^4.0.0", | ||
"lodash._setcache": "^4.0.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# lodash._baseuniq v4.4.0 | ||
# lodash._baseuniq v4.5.0 | ||
@@ -18,2 +18,2 @@ The internal [lodash](https://lodash.com/) function `baseUniq` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [package source](https://github.com/lodash/lodash/blob/4.4.0-npm-packages/lodash._baseuniq) for more details. | ||
See the [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash._baseuniq) for more details. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
8062
190
+ Addedlodash._createset@^4.0.0
+ Addedlodash._createset@4.0.3(transitive)
- Removedlodash._root@^3.0.0
- Removedlodash._root@3.0.1(transitive)