X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2F_createBaseWrapper.js;fp=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2F_createBaseWrapper.js;h=fd3bb9a695ee394e138118d8ee60b1c84694c0b9;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/_createBaseWrapper.js b/node_modules/grunt-legacy-util/node_modules/lodash/_createBaseWrapper.js new file mode 100644 index 000000000..fd3bb9a69 --- /dev/null +++ b/node_modules/grunt-legacy-util/node_modules/lodash/_createBaseWrapper.js @@ -0,0 +1,28 @@ +var createCtorWrapper = require('./_createCtorWrapper'), + root = require('./_root'); + +/** Used to compose bitmasks for wrapper metadata. */ +var BIND_FLAG = 1; + +/** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createBaseWrapper(func, bitmask, thisArg) { + var isBind = bitmask & BIND_FLAG, + Ctor = createCtorWrapper(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; +} + +module.exports = createBaseWrapper;