vue-app-sdk
Version:
22 lines (21 loc) • 943 B
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const _apply = require("./_apply.cjs");
const _createCtor = require("./_createCtor.cjs");
const _root = require("./_root.cjs");
var WRAP_BIND_FLAG = 1;
function createPartial(func, bitmask, thisArg, partials) {
var isBind = bitmask & WRAP_BIND_FLAG, Ctor = _createCtor.default(func);
function wrapper() {
var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = this && this !== _root.default && this instanceof wrapper ? Ctor : func;
while (++leftIndex < leftLength) {
args[leftIndex] = partials[leftIndex];
}
while (argsLength--) {
args[leftIndex++] = arguments[++argsIndex];
}
return _apply.default(fn, isBind ? thisArg : this, args);
}
return wrapper;
}
exports.default = createPartial;