Sha256: 278c481b9789490774928a47929949ea81529eb40945bc36a859dc034e6783a8

Contents?: true

Size: 931 Bytes

Versions: 153

Compression:

Stored size: 931 Bytes

Contents

var arrayConcat = require('../internal/arrayConcat'),
    baseFlatten = require('../internal/baseFlatten'),
    isArray = require('../lang/isArray'),
    restParam = require('../function/restParam'),
    toObject = require('../internal/toObject');

/**
 * Creates a new array joining a wrapped array with any additional arrays
 * and/or values.
 *
 * @name concat
 * @memberOf _
 * @category Chain
 * @param {...*} [values] The values to concatenate.
 * @returns {Array} Returns the new concatenated array.
 * @example
 *
 * var array = [1];
 * var wrapped = _(array).concat(2, [3], [[4]]);
 *
 * console.log(wrapped.value());
 * // => [1, 2, 3, [4]]
 *
 * console.log(array);
 * // => [1]
 */
var wrapperConcat = restParam(function(values) {
  values = baseFlatten(values);
  return this.thru(function(array) {
    return arrayConcat(isArray(array) ? array : [toObject(array)], values);
  });
});

module.exports = wrapperConcat;

Version data entries

153 entries across 80 versions & 8 rubygems

Version Path
ilog-0.4.1 node_modules/contents/node_modules/lodash/chain/wrapperConcat.js
ilog-0.4.1 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/chain/wrapperConcat.js
ilog-0.4.1 node_modules/babel/node_modules/lodash/chain/wrapperConcat.js
ilog-0.4.0 node_modules/babel/node_modules/lodash/chain/wrapperConcat.js
ilog-0.4.0 node_modules/contents/node_modules/lodash/chain/wrapperConcat.js
ilog-0.4.0 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/chain/wrapperConcat.js
ilog-0.3.3 node_modules/babel/node_modules/lodash/chain/wrapperConcat.js
ilog-0.3.3 node_modules/contents/node_modules/lodash/chain/wrapperConcat.js
ilog-0.3.3 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/chain/wrapperConcat.js
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperConcat.js
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/inquirer/node_modules/lodash/chain/wrapperConcat.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperConcat.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/inquirer/node_modules/lodash/chain/wrapperConcat.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperConcat.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/inquirer/node_modules/lodash/chain/wrapperConcat.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/lodash/chain/wrapperConcat.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperConcat.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/inquirer/node_modules/lodash/chain/wrapperConcat.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperConcat.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/inquirer/node_modules/lodash/chain/wrapperConcat.js