lodash.concat
Advanced tools
+81
-13
| /** | ||
| * lodash 4.1.1 (Custom Build) <https://lodash.com/> | ||
| * lodash 4.2.0 (Custom Build) <https://lodash.com/> | ||
| * Build: `lodash modularize exports="npm" -o ./` | ||
| * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
| * Copyright jQuery Foundation and other contributors <https://jquery.org/> | ||
| * Released under MIT license <https://lodash.com/license> | ||
| * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
| * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
| * Available under MIT license <https://lodash.com/license> | ||
| * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
| */ | ||
| var baseFlatten = require('lodash._baseflatten'), | ||
| rest = require('lodash.rest'); | ||
| var baseFlatten = require('lodash._baseflatten'); | ||
@@ -37,2 +36,21 @@ /** | ||
| /** | ||
| * Copies the values of `source` to `array`. | ||
| * | ||
| * @private | ||
| * @param {Array} source The array to copy values from. | ||
| * @param {Array} [array=[]] The array to copy values to. | ||
| * @returns {Array} Returns `array`. | ||
| */ | ||
| function copyArray(source, array) { | ||
| var index = -1, | ||
| length = source.length; | ||
| array || (array = Array(length)); | ||
| while (++index < length) { | ||
| array[index] = source[index]; | ||
| } | ||
| return array; | ||
| } | ||
| /** | ||
| * Creates a new array concatenating `array` with any additional arrays | ||
@@ -43,2 +61,3 @@ * and/or values. | ||
| * @memberOf _ | ||
| * @since 4.0.0 | ||
| * @category Array | ||
@@ -59,11 +78,58 @@ * @param {Array} array The array to concatenate. | ||
| */ | ||
| var concat = rest(function(array, values) { | ||
| if (!isArray(array)) { | ||
| array = array == null ? [] : [Object(array)]; | ||
| function concat() { | ||
| var length = arguments.length, | ||
| array = castArray(arguments[0]); | ||
| if (length < 2) { | ||
| return length ? copyArray(array) : []; | ||
| } | ||
| values = baseFlatten(values, 1); | ||
| return arrayConcat(array, values); | ||
| }); | ||
| var args = Array(length - 1); | ||
| while (length--) { | ||
| args[length - 1] = arguments[length]; | ||
| } | ||
| return arrayConcat(array, baseFlatten(args, 1)); | ||
| } | ||
| /** | ||
| * Casts `value` as an array if it's not one. | ||
| * | ||
| * @static | ||
| * @memberOf _ | ||
| * @since 4.4.0 | ||
| * @category Lang | ||
| * @param {*} value The value to inspect. | ||
| * @returns {Array} Returns the cast array. | ||
| * @example | ||
| * | ||
| * _.castArray(1); | ||
| * // => [1] | ||
| * | ||
| * _.castArray({ 'a': 1 }); | ||
| * // => [{ 'a': 1 }] | ||
| * | ||
| * _.castArray('abc'); | ||
| * // => ['abc'] | ||
| * | ||
| * _.castArray(null); | ||
| * // => [null] | ||
| * | ||
| * _.castArray(undefined); | ||
| * // => [undefined] | ||
| * | ||
| * _.castArray(); | ||
| * // => [] | ||
| * | ||
| * var array = [1, 2, 3]; | ||
| * console.log(_.castArray(array) === array); | ||
| * // => true | ||
| */ | ||
| function castArray() { | ||
| if (!arguments.length) { | ||
| return []; | ||
| } | ||
| var value = arguments[0]; | ||
| return isArray(value) ? value : [value]; | ||
| } | ||
| /** | ||
| * Checks if `value` is classified as an `Array` object. | ||
@@ -73,6 +139,8 @@ * | ||
| * @memberOf _ | ||
| * @since 0.1.0 | ||
| * @type {Function} | ||
| * @category Lang | ||
| * @param {*} value The value to check. | ||
| * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
| * @returns {boolean} Returns `true` if `value` is correctly classified, | ||
| * else `false`. | ||
| * @example | ||
@@ -79,0 +147,0 @@ * |
+42
-18
@@ -1,23 +0,47 @@ | ||
| The MIT License (MIT) | ||
| Copyright jQuery Foundation and other contributors <https://jquery.org/> | ||
| Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
| Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, | ||
| Based on Underscore.js, copyright Jeremy Ashkenas, | ||
| DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| This software consists of voluntary contributions made by many | ||
| individuals. For exact contribution history, see the revision history | ||
| available at https://github.com/lodash/lodash | ||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
| The following license applies to all parts of this software except as | ||
| documented below: | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. | ||
| ==== | ||
| Permission is hereby granted, free of charge, to any person obtaining | ||
| a copy of this software and associated documentation files (the | ||
| "Software"), to deal in the Software without restriction, including | ||
| without limitation the rights to use, copy, modify, merge, publish, | ||
| distribute, sublicense, and/or sell copies of the Software, and to | ||
| permit persons to whom the Software is furnished to do so, subject to | ||
| the following conditions: | ||
| The above copyright notice and this permission notice shall be | ||
| included in all copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| ==== | ||
| Copyright and related rights for sample code are waived via CC0. Sample | ||
| code is defined as all source code displayed within the prose of the | ||
| documentation. | ||
| CC0: http://creativecommons.org/publicdomain/zero/1.0/ | ||
| ==== | ||
| Files located in the node_modules and vendor directories are externally | ||
| maintained libraries used by this software which have their own | ||
| licenses; we recommend you read them, as their terms may differ from the | ||
| terms above. |
+2
-3
| { | ||
| "name": "lodash.concat", | ||
| "version": "4.1.1", | ||
| "version": "4.2.0", | ||
| "description": "The lodash method `_.concat` exported as a module.", | ||
@@ -18,5 +18,4 @@ "homepage": "https://lodash.com/", | ||
| "dependencies": { | ||
| "lodash._baseflatten": "~4.1.0", | ||
| "lodash.rest": "^4.0.0" | ||
| "lodash._baseflatten": "~4.1.0" | ||
| } | ||
| } |
+2
-2
@@ -1,2 +0,2 @@ | ||
| # lodash.concat v4.1.1 | ||
| # lodash.concat v4.2.0 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.concat` exported as a [Node.js](https://nodejs.org/) module. | ||
| See the [documentation](https://lodash.com/docs#concat) or [package source](https://github.com/lodash/lodash/blob/4.1.1-npm-packages/lodash.concat) for more details. | ||
| See the [documentation](https://lodash.com/docs#concat) or [package source](https://github.com/lodash/lodash/blob/4.2.0-npm-packages/lodash.concat) for more details. |
Mixed license
LicensePackage contains multiple licenses.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
6706
39.59%1
-50%149
75.29%2
-33.33%1
Infinity%- Removed
- Removed