Sha256: 486703ebdd06044d5aa5e845607a49f529db9aa916b2f64b23fb7ab19e9cb3c2

Contents?: true

Size: 857 Bytes

Versions: 261

Compression:

Stored size: 857 Bytes

Contents

var createWrap = require('./_createWrap');

/** Used to compose bitmasks for function metadata. */
var WRAP_ARY_FLAG = 128;

/**
 * Creates a function that invokes `func`, with up to `n` arguments,
 * ignoring any additional arguments.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category Function
 * @param {Function} func The function to cap arguments for.
 * @param {number} [n=func.length] The arity cap.
 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
 * @returns {Function} Returns the new capped function.
 * @example
 *
 * _.map(['6', '8', '10'], _.ary(parseInt, 1));
 * // => [6, 8, 10]
 */
function ary(func, n, guard) {
  n = guard ? undefined : n;
  n = (func && n == null) ? func.length : n;
  return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
}

module.exports = ary;

Version data entries

261 entries across 260 versions & 28 rubygems

Version Path
trusty-cms-6.3.1 node_modules/lodash/ary.js
immosquare-cleaner-0.1.51 node_modules/lodash/ary.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/ary.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/ary.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/ary.js
immosquare-cleaner-0.1.50 node_modules/lodash/ary.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/ary.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/ary.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/lodash/ary.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/lodash/ary.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/lodash/ary.js
clapton-0.0.19 lib/clapton/javascripts/node_modules/lodash/ary.js
clapton-0.0.18 lib/clapton/javascripts/node_modules/lodash/ary.js
clapton-0.0.17 lib/clapton/javascripts/node_modules/lodash/ary.js
clapton-0.0.16 lib/clapton/javascripts/node_modules/lodash/ary.js
clapton-0.0.15 lib/clapton/javascripts/node_modules/lodash/ary.js
immosquare-cleaner-0.1.49 node_modules/lodash/ary.js
clapton-0.0.14 lib/clapton/javascripts/node_modules/lodash/ary.js
immosquare-cleaner-0.1.48 node_modules/lodash/ary.js
clapton-0.0.13 lib/clapton/javascripts/node_modules/lodash/ary.js