mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
43
react-app/node_modules/lodash/internal/createPartialWrapper.js
generated
vendored
Normal file
43
react-app/node_modules/lodash/internal/createPartialWrapper.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
var createCtorWrapper = require('./createCtorWrapper');
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_FLAG = 1;
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` and invokes it with the optional `this`
|
||||
* binding of `thisArg` and the `partials` prepended to those provided to
|
||||
* the wrapper.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to partially apply arguments to.
|
||||
* @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
|
||||
* @param {*} thisArg The `this` binding of `func`.
|
||||
* @param {Array} partials The arguments to prepend to those provided to the new function.
|
||||
* @returns {Function} Returns the new bound function.
|
||||
*/
|
||||
function createPartialWrapper(func, bitmask, thisArg, partials) {
|
||||
var isBind = bitmask & BIND_FLAG,
|
||||
Ctor = createCtorWrapper(func);
|
||||
|
||||
function wrapper() {
|
||||
// Avoid `arguments` object use disqualifying optimizations by
|
||||
// converting it to an array before providing it `func`.
|
||||
var argsIndex = -1,
|
||||
argsLength = arguments.length,
|
||||
leftIndex = -1,
|
||||
leftLength = partials.length,
|
||||
args = Array(leftLength + argsLength);
|
||||
|
||||
while (++leftIndex < leftLength) {
|
||||
args[leftIndex] = partials[leftIndex];
|
||||
}
|
||||
while (argsLength--) {
|
||||
args[leftIndex++] = arguments[++argsIndex];
|
||||
}
|
||||
var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
|
||||
return fn.apply(isBind ? thisArg : this, args);
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
module.exports = createPartialWrapper;
|
Reference in New Issue
Block a user