X-Git-Url: https://git.josue.xyz/?p=dotfiles%2F.git;a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Flodash%2Flodash.js;h=1fd7116f426a2801ee5ac3bb3c86236c11637403;hp=9b95dfefe87f73a4cafe39d89558c003cfc4c0e9;hb=4d07c77cf4d78cab8639e13ddc3c22495e585b0b;hpb=b3950616b54221c40a7dab9099bda675007e5b6e diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/lodash/lodash.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/lodash/lodash.js index 9b95dfef..1fd7116f 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/lodash/lodash.js +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/lodash/lodash.js @@ -12,7 +12,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.17.15'; + var VERSION = '4.17.20'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; @@ -3719,8 +3719,21 @@ * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } + } + return iteratee; + }); + } else { + iteratees = [identity]; + } + var index = -1; - iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { @@ -3977,6 +3990,10 @@ var key = toKey(path[index]), newValue = value; + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; @@ -4129,11 +4146,14 @@ * into `array`. */ function baseSortedIndexBy(array, value, iteratee, retHighest) { - value = iteratee(value); - var low = 0, - high = array == null ? 0 : array.length, - valIsNaN = value !== value, + high = array == null ? 0 : array.length; + if (high === 0) { + return 0; + } + + value = iteratee(value); + var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined; @@ -5618,10 +5638,11 @@ if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked && stack.get(other)) { - return stacked == other; + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; } var index = -1, result = true, @@ -5783,10 +5804,11 @@ return false; } } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked && stack.get(other)) { - return stacked == other; + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; } var result = true; stack.set(object, other); @@ -9167,6 +9189,10 @@ * // The `_.property` iteratee shorthand. * _.filter(users, 'active'); * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] */ function filter(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; @@ -9916,15 +9942,15 @@ * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, + * { 'user': 'fred', 'age': 30 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, [function(o) { return o.user; }]); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] * * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] */ var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { @@ -14799,11 +14825,11 @@ // Use a sourceURL for easier debugging. // The sourceURL gets injected into the source that's eval-ed, so be careful - // with lookup (in case of e.g. prototype pollution), and strip newlines if any. - // A newline wouldn't be a valid sourceURL anyway, and it'd enable code injection. + // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in + // and escape the comment, thus injecting code that gets evaled. var sourceURL = '//# sourceURL=' + (hasOwnProperty.call(options, 'sourceURL') - ? (options.sourceURL + '').replace(/[\r\n]/g, ' ') + ? (options.sourceURL + '').replace(/\s/g, ' ') : ('lodash.templateSources[' + (++templateCounter) + ']') ) + '\n'; @@ -14836,8 +14862,6 @@ // If `variable` is not specified wrap a with-statement around the generated // code to add the data object to the top of the scope chain. - // Like with sourceURL, we take care to not check the option's prototype, - // as this configuration is a code injection vector. var variable = hasOwnProperty.call(options, 'variable') && options.variable; if (!variable) { source = 'with (obj) {\n' + source + '\n}\n'; @@ -15544,6 +15568,9 @@ * values against any array or object value, respectively. See `_.isEqual` * for a list of supported value comparisons. * + * **Note:** Multiple values can be checked by combining several matchers + * using `_.overSome` + * * @static * @memberOf _ * @since 3.0.0 @@ -15559,6 +15586,10 @@ * * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); * // => [{ 'a': 4, 'b': 5, 'c': 6 }] + * + * // Checking for several possible values + * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); + * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] */ function matches(source) { return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); @@ -15573,6 +15604,9 @@ * `srcValue` values against any array or object value, respectively. See * `_.isEqual` for a list of supported value comparisons. * + * **Note:** Multiple values can be checked by combining several matchers + * using `_.overSome` + * * @static * @memberOf _ * @since 3.2.0 @@ -15589,6 +15623,10 @@ * * _.find(objects, _.matchesProperty('a', 4)); * // => { 'a': 4, 'b': 5, 'c': 6 } + * + * // Checking for several possible values + * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)])); + * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] */ function matchesProperty(path, srcValue) { return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); @@ -15812,6 +15850,10 @@ * Creates a function that checks if **all** of the `predicates` return * truthy when invoked with the arguments it receives. * + * Following shorthands are possible for providing predicates. + * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. + * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. + * * @static * @memberOf _ * @since 4.0.0 @@ -15838,6 +15880,10 @@ * Creates a function that checks if **any** of the `predicates` return * truthy when invoked with the arguments it receives. * + * Following shorthands are possible for providing predicates. + * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. + * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. + * * @static * @memberOf _ * @since 4.0.0 @@ -15857,6 +15903,9 @@ * * func(NaN); * // => false + * + * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }]) + * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]]) */ var overSome = createOver(arraySome);