Sha256: 78ad772217866cb80e29af22d5a151c0732658e6443641a7c4d0e22514c5cb18

Contents?: true

Size: 737 Bytes

Versions: 26

Compression:

Stored size: 737 Bytes

Contents

/**
 * A faster alternative to `Function#apply`, this function invokes `func`
 * with the `this` binding of `thisArg` and the arguments of `args`.
 *
 * @private
 * @param {Function} func The function to invoke.
 * @param {*} thisArg The `this` binding of `func`.
 * @param {Array} args The arguments to invoke `func` with.
 * @returns {*} Returns the result of `func`.
 */
function apply(func, thisArg, args) {
  var length = args.length;
  switch (length) {
    case 0: return func.call(thisArg);
    case 1: return func.call(thisArg, args[0]);
    case 2: return func.call(thisArg, args[0], args[1]);
    case 3: return func.call(thisArg, args[0], args[1], args[2]);
  }
  return func.apply(thisArg, args);
}

module.exports = apply;

Version data entries

26 entries across 4 versions & 2 rubygems

Version Path
babel-schmooze-sprockets-0.1.3 node_modules/lodash/_apply.js
blackboard-3.1.9 lib/site_template/node_modules/browser-sync/node_modules/lodash/_apply.js
blackboard-3.1.9 lib/site_template/node_modules/sass-graph/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.2 node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-function-name/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-get-function-arity/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-hoist-variables/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-optimise-call-expression/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-regex/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-replace-supers/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-block-scoping/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-classes/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-duplicate-keys/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-core/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-modules-commonjs/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-parameters/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-shorthand-properties/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-sticky-regex/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-regenerator/node_modules/lodash/_apply.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-strict-mode/node_modules/lodash/_apply.js