mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2754e0b9b |
@@ -1,4 +1,4 @@
|
|||||||
# lodash v3.9.0
|
# lodash v3.9.2
|
||||||
|
|
||||||
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
|
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
|
||||||
|
|
||||||
@@ -13,8 +13,8 @@ $ lodash modern exports=amd -d -o ./main.js
|
|||||||
Using bower or volo:
|
Using bower or volo:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ bower i lodash#3.9.0-amd
|
$ bower i lodash#3.9.2-amd
|
||||||
$ volo add lodash/3.9.0-amd
|
$ volo add lodash/3.9.2-amd
|
||||||
```
|
```
|
||||||
|
|
||||||
Defining a build as `'lodash'`.
|
Defining a build as `'lodash'`.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
define(['../internal/baseDifference', '../internal/baseFlatten', '../internal/isArrayLike', '../function/restParam'], function(baseDifference, baseFlatten, isArrayLike, restParam) {
|
define(['../internal/baseDifference', '../internal/baseFlatten', '../internal/isArrayLike', '../function/restParam'], function(baseDifference, baseFlatten, isArrayLike, restParam) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array excluding all values of the provided arrays using
|
* Creates an array of unique `array` values not included in the other
|
||||||
* [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
* provided arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
||||||
* for equality comparisons.
|
* for equality comparisons.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
define(['../internal/baseIndexOf', '../internal/cacheIndexOf', '../internal/createCache', '../internal/isArrayLike', '../function/restParam'], function(baseIndexOf, cacheIndexOf, createCache, isArrayLike, restParam) {
|
define(['../internal/baseIndexOf', '../internal/cacheIndexOf', '../internal/createCache', '../internal/isArrayLike', '../function/restParam'], function(baseIndexOf, cacheIndexOf, createCache, isArrayLike, restParam) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array of unique values in all provided arrays using
|
* Creates an array of unique values that are included in all of the provided
|
||||||
* [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
* arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
||||||
* for equality comparisons.
|
* for equality comparisons.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
define(['../internal/baseFlatten', '../internal/baseUniq', '../function/restParam'], function(baseFlatten, baseUniq, restParam) {
|
define(['../internal/baseFlatten', '../internal/baseUniq', '../function/restParam'], function(baseFlatten, baseUniq, restParam) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array of unique values, in order, of the provided arrays using
|
* Creates an array of unique values, in order, from all of the provided arrays
|
||||||
* [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
* using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
||||||
* for equality comparisons.
|
* for equality comparisons.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
define(['../internal/baseDifference', '../internal/baseUniq', '../internal/isArrayLike'], function(baseDifference, baseUniq, isArrayLike) {
|
define(['../internal/baseDifference', '../internal/baseUniq', '../internal/isArrayLike'], function(baseDifference, baseUniq, isArrayLike) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
|
* Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
|
||||||
* of the provided arrays.
|
* of the provided arrays.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['../internal/baseRandom', '../internal/isIterateeCall', './shuffle', '../internal/toIterable'], function(baseRandom, isIterateeCall, shuffle, toIterable) {
|
define(['../internal/baseRandom', '../internal/isIterateeCall', '../lang/toArray', '../internal/toIterable'], function(baseRandom, isIterateeCall, toArray, toIterable) {
|
||||||
|
|
||||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||||
var undefined;
|
var undefined;
|
||||||
@@ -30,8 +30,20 @@ define(['../internal/baseRandom', '../internal/isIterateeCall', './shuffle', '..
|
|||||||
var length = collection.length;
|
var length = collection.length;
|
||||||
return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
|
return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
|
||||||
}
|
}
|
||||||
var result = shuffle(collection);
|
var index = -1,
|
||||||
result.length = nativeMin(n < 0 ? 0 : (+n || 0), result.length);
|
result = toArray(collection),
|
||||||
|
length = result.length,
|
||||||
|
lastIndex = length - 1;
|
||||||
|
|
||||||
|
n = nativeMin(n < 0 ? 0 : (+n || 0), length);
|
||||||
|
while (++index < n) {
|
||||||
|
var rand = baseRandom(index, lastIndex),
|
||||||
|
value = result[rand];
|
||||||
|
|
||||||
|
result[rand] = result[index];
|
||||||
|
result[index] = value;
|
||||||
|
}
|
||||||
|
result.length = n;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
define(['../internal/baseRandom', '../internal/toIterable'], function(baseRandom, toIterable) {
|
define(['./sample'], function(sample) {
|
||||||
|
|
||||||
|
/** Used as references for `-Infinity` and `Infinity`. */
|
||||||
|
var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array of shuffled values, using a version of the
|
* Creates an array of shuffled values, using a version of the
|
||||||
@@ -15,20 +18,7 @@ define(['../internal/baseRandom', '../internal/toIterable'], function(baseRandom
|
|||||||
* // => [4, 1, 3, 2]
|
* // => [4, 1, 3, 2]
|
||||||
*/
|
*/
|
||||||
function shuffle(collection) {
|
function shuffle(collection) {
|
||||||
collection = toIterable(collection);
|
return sample(collection, POSITIVE_INFINITY);
|
||||||
|
|
||||||
var index = -1,
|
|
||||||
length = collection.length,
|
|
||||||
result = Array(length);
|
|
||||||
|
|
||||||
while (++index < length) {
|
|
||||||
var rand = baseRandom(0, index);
|
|
||||||
if (index != rand) {
|
|
||||||
result[index] = result[rand];
|
|
||||||
}
|
|
||||||
result[rand] = collection[index];
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return shuffle;
|
return shuffle;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
define([], function() {
|
define([], function() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A specialized version of `baseExtremum` for arrays whichs invokes `iteratee`
|
* A specialized version of `baseExtremum` for arrays which invokes `iteratee`
|
||||||
* with one argument: (value).
|
* with one argument: (value).
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./baseIsEqualDeep', '../lang/isObject'], function(baseIsEqualDeep, isObject) {
|
define(['./baseIsEqualDeep', '../lang/isObject', './isObjectLike'], function(baseIsEqualDeep, isObject, isObjectLike) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.isEqual` without support for `this` binding
|
* The base implementation of `_.isEqual` without support for `this` binding
|
||||||
@@ -17,7 +17,7 @@ define(['./baseIsEqualDeep', '../lang/isObject'], function(baseIsEqualDeep, isOb
|
|||||||
if (value === other) {
|
if (value === other) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (value == null || other == null || (!isObject(value) && !isObject(other))) {
|
if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
|
||||||
return value !== value && other !== other;
|
return value !== value && other !== other;
|
||||||
}
|
}
|
||||||
return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
|
return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ define(['./baseGet', './baseIsEqual', './baseSlice', '../lang/isArray', './isKey
|
|||||||
var undefined;
|
var undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.matchesProperty` which does not which does
|
* The base implementation of `_.matchesProperty` which does not clone `srcValue`.
|
||||||
* not clone `value`.
|
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {string} path The path of the property to get.
|
* @param {string} path The path of the property to get.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./LazyWrapper', './getFuncName', '../chain/lodash'], function(LazyWrapper, getFuncName, lodash) {
|
define(['./LazyWrapper', './getData', './getFuncName', '../chain/lodash'], function(LazyWrapper, getData, getFuncName, lodash) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `func` has a lazy counterpart.
|
* Checks if `func` has a lazy counterpart.
|
||||||
@@ -9,7 +9,15 @@ define(['./LazyWrapper', './getFuncName', '../chain/lodash'], function(LazyWrapp
|
|||||||
*/
|
*/
|
||||||
function isLaziable(func) {
|
function isLaziable(func) {
|
||||||
var funcName = getFuncName(func);
|
var funcName = getFuncName(func);
|
||||||
return !!funcName && func === lodash[funcName] && funcName in LazyWrapper.prototype;
|
if (!(funcName in LazyWrapper.prototype)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var other = lodash[funcName];
|
||||||
|
if (func === other) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var data = getData(other);
|
||||||
|
return !!data && func === data[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
return isLaziable;
|
return isLaziable;
|
||||||
|
|||||||
143
main.js
143
main.js
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @license
|
* @license
|
||||||
* lodash 3.9.0 (Custom Build) <https://lodash.com/>
|
* lodash 3.9.2 (Custom Build) <https://lodash.com/>
|
||||||
* Build: `lodash modern exports="amd" -d -o ./main.js`
|
* Build: `lodash modern exports="amd" -d -o ./main.js`
|
||||||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
var undefined;
|
var undefined;
|
||||||
|
|
||||||
/** Used as the semantic version number. */
|
/** Used as the semantic version number. */
|
||||||
var VERSION = '3.9.0';
|
var VERSION = '3.9.2';
|
||||||
|
|
||||||
/** Used to compose bitmasks for wrapper metadata. */
|
/** Used to compose bitmasks for wrapper metadata. */
|
||||||
var BIND_FLAG = 1,
|
var BIND_FLAG = 1,
|
||||||
@@ -277,6 +277,8 @@
|
|||||||
*/
|
*/
|
||||||
var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
|
var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `compareAscending` which compares values and
|
* The base implementation of `compareAscending` which compares values and
|
||||||
* sorts them in ascending order without guaranteeing a stable sort.
|
* sorts them in ascending order without guaranteeing a stable sort.
|
||||||
@@ -645,6 +647,8 @@
|
|||||||
return htmlUnescapes[chr];
|
return htmlUnescapes[chr];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new pristine `lodash` function using the given `context` object.
|
* Create a new pristine `lodash` function using the given `context` object.
|
||||||
*
|
*
|
||||||
@@ -770,7 +774,8 @@
|
|||||||
nativeRandom = Math.random;
|
nativeRandom = Math.random;
|
||||||
|
|
||||||
/** Used as references for `-Infinity` and `Infinity`. */
|
/** Used as references for `-Infinity` and `Infinity`. */
|
||||||
var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
|
var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY,
|
||||||
|
POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
|
||||||
|
|
||||||
/** Used as references for the maximum length and index of an array. */
|
/** Used as references for the maximum length and index of an array. */
|
||||||
var MAX_ARRAY_LENGTH = 4294967295,
|
var MAX_ARRAY_LENGTH = 4294967295,
|
||||||
@@ -792,6 +797,8 @@
|
|||||||
/** Used to lookup unminified function names. */
|
/** Used to lookup unminified function names. */
|
||||||
var realNames = {};
|
var realNames = {};
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a `lodash` object which wraps `value` to enable implicit chaining.
|
* Creates a `lodash` object which wraps `value` to enable implicit chaining.
|
||||||
* Methods that operate on and return arrays, collections, and functions can
|
* Methods that operate on and return arrays, collections, and functions can
|
||||||
@@ -1012,6 +1019,8 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
|
* Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
|
||||||
*
|
*
|
||||||
@@ -1140,6 +1149,8 @@
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a cache object to store key/value pairs.
|
* Creates a cache object to store key/value pairs.
|
||||||
*
|
*
|
||||||
@@ -1208,6 +1219,8 @@
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Creates a cache object to store unique values.
|
* Creates a cache object to store unique values.
|
||||||
@@ -1257,6 +1270,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies the values of `source` to `array`.
|
* Copies the values of `source` to `array`.
|
||||||
*
|
*
|
||||||
@@ -1340,7 +1355,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A specialized version of `baseExtremum` for arrays whichs invokes `iteratee`
|
* A specialized version of `baseExtremum` for arrays which invokes `iteratee`
|
||||||
* with one argument: (value).
|
* with one argument: (value).
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
@@ -2112,7 +2127,7 @@
|
|||||||
if (value === other) {
|
if (value === other) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (value == null || other == null || (!isObject(value) && !isObject(other))) {
|
if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
|
||||||
return value !== value && other !== other;
|
return value !== value && other !== other;
|
||||||
}
|
}
|
||||||
return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
|
return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
|
||||||
@@ -2289,8 +2304,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.matchesProperty` which does not which does
|
* The base implementation of `_.matchesProperty` which does not clone `srcValue`.
|
||||||
* not clone `value`.
|
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {string} path The path of the property to get.
|
* @param {string} path The path of the property to get.
|
||||||
@@ -4112,7 +4126,15 @@
|
|||||||
*/
|
*/
|
||||||
function isLaziable(func) {
|
function isLaziable(func) {
|
||||||
var funcName = getFuncName(func);
|
var funcName = getFuncName(func);
|
||||||
return !!funcName && func === lodash[funcName] && funcName in LazyWrapper.prototype;
|
if (!(funcName in LazyWrapper.prototype)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var other = lodash[funcName];
|
||||||
|
if (func === other) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var data = getData(other);
|
||||||
|
return !!data && func === data[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -4428,6 +4450,8 @@
|
|||||||
: new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
|
: new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array of elements split into groups the length of `size`.
|
* Creates an array of elements split into groups the length of `size`.
|
||||||
* If `collection` can't be split evenly, the final chunk will be the remaining
|
* If `collection` can't be split evenly, the final chunk will be the remaining
|
||||||
@@ -4495,8 +4519,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array excluding all values of the provided arrays using
|
* Creates an array of unique `array` values not included in the other
|
||||||
* [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
* provided arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
||||||
* for equality comparisons.
|
* for equality comparisons.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
@@ -4969,8 +4993,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array of unique values in all provided arrays using
|
* Creates an array of unique values that are included in all of the provided
|
||||||
* [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
* arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
||||||
* for equality comparisons.
|
* for equality comparisons.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
@@ -5523,8 +5547,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array of unique values, in order, of the provided arrays using
|
* Creates an array of unique values, in order, from all of the provided arrays
|
||||||
* [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
* using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
||||||
* for equality comparisons.
|
* for equality comparisons.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
@@ -5705,7 +5729,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
|
* Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
|
||||||
* of the provided arrays.
|
* of the provided arrays.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
@@ -5822,6 +5846,8 @@
|
|||||||
return unzipWith(arrays, iteratee, thisArg);
|
return unzipWith(arrays, iteratee, thisArg);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a `lodash` object that wraps `value` with explicit method
|
* Creates a `lodash` object that wraps `value` with explicit method
|
||||||
* chaining enabled.
|
* chaining enabled.
|
||||||
@@ -6072,6 +6098,8 @@
|
|||||||
return baseWrapperValue(this.__wrapped__, this.__actions__);
|
return baseWrapperValue(this.__wrapped__, this.__actions__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array of elements corresponding to the given keys, or indexes,
|
* Creates an array of elements corresponding to the given keys, or indexes,
|
||||||
* of `collection`. Keys may be specified as individual arguments or as arrays
|
* of `collection`. Keys may be specified as individual arguments or as arrays
|
||||||
@@ -6879,8 +6907,20 @@
|
|||||||
var length = collection.length;
|
var length = collection.length;
|
||||||
return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
|
return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
|
||||||
}
|
}
|
||||||
var result = shuffle(collection);
|
var index = -1,
|
||||||
result.length = nativeMin(n < 0 ? 0 : (+n || 0), result.length);
|
result = toArray(collection),
|
||||||
|
length = result.length,
|
||||||
|
lastIndex = length - 1;
|
||||||
|
|
||||||
|
n = nativeMin(n < 0 ? 0 : (+n || 0), length);
|
||||||
|
while (++index < n) {
|
||||||
|
var rand = baseRandom(index, lastIndex),
|
||||||
|
value = result[rand];
|
||||||
|
|
||||||
|
result[rand] = result[index];
|
||||||
|
result[index] = value;
|
||||||
|
}
|
||||||
|
result.length = n;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6899,20 +6939,7 @@
|
|||||||
* // => [4, 1, 3, 2]
|
* // => [4, 1, 3, 2]
|
||||||
*/
|
*/
|
||||||
function shuffle(collection) {
|
function shuffle(collection) {
|
||||||
collection = toIterable(collection);
|
return sample(collection, POSITIVE_INFINITY);
|
||||||
|
|
||||||
var index = -1,
|
|
||||||
length = collection.length,
|
|
||||||
result = Array(length);
|
|
||||||
|
|
||||||
while (++index < length) {
|
|
||||||
var rand = baseRandom(0, index);
|
|
||||||
if (index != rand) {
|
|
||||||
result[index] = result[rand];
|
|
||||||
}
|
|
||||||
result[rand] = collection[index];
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -7193,6 +7220,8 @@
|
|||||||
return filter(collection, baseMatches(source));
|
return filter(collection, baseMatches(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the number of milliseconds that have elapsed since the Unix epoch
|
* Gets the number of milliseconds that have elapsed since the Unix epoch
|
||||||
* (1 January 1970 00:00:00 UTC).
|
* (1 January 1970 00:00:00 UTC).
|
||||||
@@ -7211,6 +7240,8 @@
|
|||||||
return new Date().getTime();
|
return new Date().getTime();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The opposite of `_.before`; this method creates a function that invokes
|
* The opposite of `_.before`; this method creates a function that invokes
|
||||||
* `func` once it is called `n` or more times.
|
* `func` once it is called `n` or more times.
|
||||||
@@ -8191,6 +8222,8 @@
|
|||||||
return createWrapper(wrapper, PARTIAL_FLAG, null, [value], []);
|
return createWrapper(wrapper, PARTIAL_FLAG, null, [value], []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned,
|
* Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned,
|
||||||
* otherwise they are assigned by reference. If `customizer` is provided it is
|
* otherwise they are assigned by reference. If `customizer` is provided it is
|
||||||
@@ -9022,6 +9055,8 @@
|
|||||||
return baseCopy(value, keysIn(value));
|
return baseCopy(value, keysIn(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assigns own enumerable properties of source object(s) to the destination
|
* Assigns own enumerable properties of source object(s) to the destination
|
||||||
* object. Subsequent sources overwrite property assignments of previous sources.
|
* object. Subsequent sources overwrite property assignments of previous sources.
|
||||||
@@ -9855,13 +9890,13 @@
|
|||||||
|
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = path.length,
|
length = path.length,
|
||||||
endIndex = length - 1,
|
lastIndex = length - 1,
|
||||||
nested = object;
|
nested = object;
|
||||||
|
|
||||||
while (nested != null && ++index < length) {
|
while (nested != null && ++index < length) {
|
||||||
var key = path[index];
|
var key = path[index];
|
||||||
if (isObject(nested)) {
|
if (isObject(nested)) {
|
||||||
if (index == endIndex) {
|
if (index == lastIndex) {
|
||||||
nested[key] = value;
|
nested[key] = value;
|
||||||
} else if (nested[key] == null) {
|
} else if (nested[key] == null) {
|
||||||
nested[key] = isIndex(path[index + 1]) ? [] : {};
|
nested[key] = isIndex(path[index + 1]) ? [] : {};
|
||||||
@@ -9979,6 +10014,8 @@
|
|||||||
return baseValues(object, keysIn(object));
|
return baseValues(object, keysIn(object));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `n` is between `start` and up to but not including, `end`. If
|
* Checks if `n` is between `start` and up to but not including, `end`. If
|
||||||
* `end` is not specified it is set to `start` with `start` then set to `0`.
|
* `end` is not specified it is set to `start` with `start` then set to `0`.
|
||||||
@@ -10083,6 +10120,8 @@
|
|||||||
return baseRandom(min, max);
|
return baseRandom(min, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
|
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
|
||||||
*
|
*
|
||||||
@@ -10948,6 +10987,8 @@
|
|||||||
return string.match(pattern || reWords) || [];
|
return string.match(pattern || reWords) || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to invoke `func`, returning either the result or the caught error
|
* Attempts to invoke `func`, returning either the result or the caught error
|
||||||
* object. Any additional arguments are provided to `func` when it is invoked.
|
* object. Any additional arguments are provided to `func` when it is invoked.
|
||||||
@@ -11065,7 +11106,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function which performs a deep comparison between a given object
|
* Creates a function that performs a deep comparison between a given object
|
||||||
* and `source`, returning `true` if the given object has equivalent property
|
* and `source`, returning `true` if the given object has equivalent property
|
||||||
* values, else `false`.
|
* values, else `false`.
|
||||||
*
|
*
|
||||||
@@ -11094,7 +11135,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function which compares the property value of `path` on a given
|
* Creates a function that compares the property value of `path` on a given
|
||||||
* object to `value`.
|
* object to `value`.
|
||||||
*
|
*
|
||||||
* **Note:** This method supports comparing arrays, booleans, `Date` objects,
|
* **Note:** This method supports comparing arrays, booleans, `Date` objects,
|
||||||
@@ -11122,12 +11163,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function which invokes the method at `path` on a given object.
|
* Creates a function that invokes the method at `path` on a given object.
|
||||||
|
* Any additional arguments are provided to the invoked method.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @category Utility
|
* @category Utility
|
||||||
* @param {Array|string} path The path of the method to invoke.
|
* @param {Array|string} path The path of the method to invoke.
|
||||||
|
* @param {...*} [args] The arguments to invoke the method with.
|
||||||
* @returns {Function} Returns the new function.
|
* @returns {Function} Returns the new function.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
@@ -11149,13 +11192,15 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The opposite of `_.method`; this method creates a function which invokes
|
* The opposite of `_.method`; this method creates a function that invokes
|
||||||
* the method at a given path on `object`.
|
* the method at a given path on `object`. Any additional arguments are
|
||||||
|
* provided to the invoked method.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @category Utility
|
* @category Utility
|
||||||
* @param {Object} object The object to query.
|
* @param {Object} object The object to query.
|
||||||
|
* @param {...*} [args] The arguments to invoke the method with.
|
||||||
* @returns {Function} Returns the new function.
|
* @returns {Function} Returns the new function.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
@@ -11281,7 +11326,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A no-operation function which returns `undefined` regardless of the
|
* A no-operation function that returns `undefined` regardless of the
|
||||||
* arguments it receives.
|
* arguments it receives.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
@@ -11299,7 +11344,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function which returns the property value at `path` on a
|
* Creates a function that returns the property value at `path` on a
|
||||||
* given object.
|
* given object.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
@@ -11325,7 +11370,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The opposite of `_.property`; this method creates a function which returns
|
* The opposite of `_.property`; this method creates a function that returns
|
||||||
* the property value at a given path on `object`.
|
* the property value at a given path on `object`.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
@@ -11479,6 +11524,8 @@
|
|||||||
return baseToString(prefix) + id;
|
return baseToString(prefix) + id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds two numbers.
|
* Adds two numbers.
|
||||||
*
|
*
|
||||||
@@ -11544,7 +11591,7 @@
|
|||||||
* _.max(users, 'age');
|
* _.max(users, 'age');
|
||||||
* // => { 'user': 'fred', 'age': 40 }
|
* // => { 'user': 'fred', 'age': 40 }
|
||||||
*/
|
*/
|
||||||
var max = createExtremum(gt, -Infinity);
|
var max = createExtremum(gt, NEGATIVE_INFINITY);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the minimum value of `collection`. If `collection` is empty or falsey
|
* Gets the minimum value of `collection`. If `collection` is empty or falsey
|
||||||
@@ -11593,7 +11640,7 @@
|
|||||||
* _.min(users, 'age');
|
* _.min(users, 'age');
|
||||||
* // => { 'user': 'barney', 'age': 36 }
|
* // => { 'user': 'barney', 'age': 36 }
|
||||||
*/
|
*/
|
||||||
var min = createExtremum(lt, Infinity);
|
var min = createExtremum(lt, POSITIVE_INFINITY);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the sum of the values in `collection`.
|
* Gets the sum of the values in `collection`.
|
||||||
@@ -11643,6 +11690,8 @@
|
|||||||
: baseSum(collection, iteratee);
|
: baseSum(collection, iteratee);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// Ensure wrappers are instances of `baseLodash`.
|
// Ensure wrappers are instances of `baseLodash`.
|
||||||
lodash.prototype = baseLodash.prototype;
|
lodash.prototype = baseLodash.prototype;
|
||||||
|
|
||||||
@@ -11790,6 +11839,8 @@
|
|||||||
// Add functions to `lodash.prototype`.
|
// Add functions to `lodash.prototype`.
|
||||||
mixin(lodash, lodash);
|
mixin(lodash, lodash);
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// Add functions that return unwrapped values when chaining.
|
// Add functions that return unwrapped values when chaining.
|
||||||
lodash.add = add;
|
lodash.add = add;
|
||||||
lodash.attempt = attempt;
|
lodash.attempt = attempt;
|
||||||
@@ -11898,6 +11949,8 @@
|
|||||||
return source;
|
return source;
|
||||||
}()), false);
|
}()), false);
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// Add functions capable of returning wrapped and unwrapped values when chaining.
|
// Add functions capable of returning wrapped and unwrapped values when chaining.
|
||||||
lodash.sample = sample;
|
lodash.sample = sample;
|
||||||
|
|
||||||
@@ -11910,6 +11963,8 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The semantic version number.
|
* The semantic version number.
|
||||||
*
|
*
|
||||||
@@ -12137,6 +12192,8 @@
|
|||||||
return lodash;
|
return lodash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// Export lodash.
|
// Export lodash.
|
||||||
var _ = runInContext();
|
var _ = runInContext();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
define(['../internal/createExtremum', '../lang/gt'], function(createExtremum, gt) {
|
define(['../internal/createExtremum', '../lang/gt'], function(createExtremum, gt) {
|
||||||
|
|
||||||
|
/** Used as references for `-Infinity` and `Infinity`. */
|
||||||
|
var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the maximum value of `collection`. If `collection` is empty or falsey
|
* Gets the maximum value of `collection`. If `collection` is empty or falsey
|
||||||
* `-Infinity` is returned. If an iteratee function is provided it is invoked
|
* `-Infinity` is returned. If an iteratee function is provided it is invoked
|
||||||
@@ -47,7 +50,7 @@ define(['../internal/createExtremum', '../lang/gt'], function(createExtremum, gt
|
|||||||
* _.max(users, 'age');
|
* _.max(users, 'age');
|
||||||
* // => { 'user': 'fred', 'age': 40 }
|
* // => { 'user': 'fred', 'age': 40 }
|
||||||
*/
|
*/
|
||||||
var max = createExtremum(gt, -Infinity);
|
var max = createExtremum(gt, NEGATIVE_INFINITY);
|
||||||
|
|
||||||
return max;
|
return max;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
define(['../internal/createExtremum', '../lang/lt'], function(createExtremum, lt) {
|
define(['../internal/createExtremum', '../lang/lt'], function(createExtremum, lt) {
|
||||||
|
|
||||||
|
/** Used as references for `-Infinity` and `Infinity`. */
|
||||||
|
var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the minimum value of `collection`. If `collection` is empty or falsey
|
* Gets the minimum value of `collection`. If `collection` is empty or falsey
|
||||||
* `Infinity` is returned. If an iteratee function is provided it is invoked
|
* `Infinity` is returned. If an iteratee function is provided it is invoked
|
||||||
@@ -47,7 +50,7 @@ define(['../internal/createExtremum', '../lang/lt'], function(createExtremum, lt
|
|||||||
* _.min(users, 'age');
|
* _.min(users, 'age');
|
||||||
* // => { 'user': 'barney', 'age': 36 }
|
* // => { 'user': 'barney', 'age': 36 }
|
||||||
*/
|
*/
|
||||||
var min = createExtremum(lt, Infinity);
|
var min = createExtremum(lt, POSITIVE_INFINITY);
|
||||||
|
|
||||||
return min;
|
return min;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -32,13 +32,13 @@ define(['../internal/isIndex', '../internal/isKey', '../lang/isObject', '../inte
|
|||||||
|
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = path.length,
|
length = path.length,
|
||||||
endIndex = length - 1,
|
lastIndex = length - 1,
|
||||||
nested = object;
|
nested = object;
|
||||||
|
|
||||||
while (nested != null && ++index < length) {
|
while (nested != null && ++index < length) {
|
||||||
var key = path[index];
|
var key = path[index];
|
||||||
if (isObject(nested)) {
|
if (isObject(nested)) {
|
||||||
if (index == endIndex) {
|
if (index == lastIndex) {
|
||||||
nested[key] = value;
|
nested[key] = value;
|
||||||
} else if (nested[key] == null) {
|
} else if (nested[key] == null) {
|
||||||
nested[key] = isIndex(path[index + 1]) ? [] : {};
|
nested[key] = isIndex(path[index + 1]) ? [] : {};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash",
|
"name": "lodash",
|
||||||
"version": "3.9.0",
|
"version": "3.9.2",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
"volo": {
|
"volo": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
define(['../internal/baseClone', '../internal/baseMatches'], function(baseClone, baseMatches) {
|
define(['../internal/baseClone', '../internal/baseMatches'], function(baseClone, baseMatches) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function which performs a deep comparison between a given object
|
* Creates a function that performs a deep comparison between a given object
|
||||||
* and `source`, returning `true` if the given object has equivalent property
|
* and `source`, returning `true` if the given object has equivalent property
|
||||||
* values, else `false`.
|
* values, else `false`.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
define(['../internal/baseClone', '../internal/baseMatchesProperty'], function(baseClone, baseMatchesProperty) {
|
define(['../internal/baseClone', '../internal/baseMatchesProperty'], function(baseClone, baseMatchesProperty) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function which compares the property value of `path` on a given
|
* Creates a function that compares the property value of `path` on a given
|
||||||
* object to `value`.
|
* object to `value`.
|
||||||
*
|
*
|
||||||
* **Note:** This method supports comparing arrays, booleans, `Date` objects,
|
* **Note:** This method supports comparing arrays, booleans, `Date` objects,
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
define(['../internal/invokePath', '../function/restParam'], function(invokePath, restParam) {
|
define(['../internal/invokePath', '../function/restParam'], function(invokePath, restParam) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function which invokes the method at `path` on a given object.
|
* Creates a function that invokes the method at `path` on a given object.
|
||||||
|
* Any additional arguments are provided to the invoked method.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @category Utility
|
* @category Utility
|
||||||
* @param {Array|string} path The path of the method to invoke.
|
* @param {Array|string} path The path of the method to invoke.
|
||||||
|
* @param {...*} [args] The arguments to invoke the method with.
|
||||||
* @returns {Function} Returns the new function.
|
* @returns {Function} Returns the new function.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
define(['../internal/invokePath', '../function/restParam'], function(invokePath, restParam) {
|
define(['../internal/invokePath', '../function/restParam'], function(invokePath, restParam) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The opposite of `_.method`; this method creates a function which invokes
|
* The opposite of `_.method`; this method creates a function that invokes
|
||||||
* the method at a given path on `object`.
|
* the method at a given path on `object`. Any additional arguments are
|
||||||
|
* provided to the invoked method.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @category Utility
|
* @category Utility
|
||||||
* @param {Object} object The object to query.
|
* @param {Object} object The object to query.
|
||||||
|
* @param {...*} [args] The arguments to invoke the method with.
|
||||||
* @returns {Function} Returns the new function.
|
* @returns {Function} Returns the new function.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
define([], function() {
|
define([], function() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A no-operation function which returns `undefined` regardless of the
|
* A no-operation function that returns `undefined` regardless of the
|
||||||
* arguments it receives.
|
* arguments it receives.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
define(['../internal/baseProperty', '../internal/basePropertyDeep', '../internal/isKey'], function(baseProperty, basePropertyDeep, isKey) {
|
define(['../internal/baseProperty', '../internal/basePropertyDeep', '../internal/isKey'], function(baseProperty, basePropertyDeep, isKey) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function which returns the property value at `path` on a
|
* Creates a function that returns the property value at `path` on a
|
||||||
* given object.
|
* given object.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
define(['../internal/baseGet', '../internal/toPath'], function(baseGet, toPath) {
|
define(['../internal/baseGet', '../internal/toPath'], function(baseGet, toPath) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The opposite of `_.property`; this method creates a function which returns
|
* The opposite of `_.property`; this method creates a function that returns
|
||||||
* the property value at a given path on `object`.
|
* the property value at a given path on `object`.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
Reference in New Issue
Block a user