@antv/layout
Version:
graph layout algorithm
34 lines (29 loc) • 937 B
JavaScript
/**
* 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`.
*/
var _apply;
var hasRequired_apply;
function require_apply () {
if (hasRequired_apply) return _apply;
hasRequired_apply = 1;
function apply(func, thisArg, args) {
switch (args.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);
}
_apply = apply;
return _apply;
}
export { require_apply as __require };
//# sourceMappingURL=_apply.js.map