Sha256: 139a04988fed27807d7b9b2457a6ca6a772e4551a0d2dc0d516f592870466482
Contents?: true
Size: 709 Bytes
Versions: 422
Compression:
Stored size: 709 Bytes
Contents
// fast apply, http://jsperf.lnkit.com/fast-apply/5 module.exports = function(fn, args, that){ var un = that === undefined; switch(args.length){ case 0: return un ? fn() : fn.call(that); case 1: return un ? fn(args[0]) : fn.call(that, args[0]); case 2: return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); case 3: return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); case 4: return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); } return fn.apply(that, args); };
Version data entries
422 entries across 50 versions & 9 rubygems