Sha256: ca8160c8c9d81a69f23f4b5d803a56243221a15e8b7bf65e0f9e73d5818ca5f2
Contents?: true
Size: 520 Bytes
Versions: 82
Compression:
Stored size: 520 Bytes
Contents
// optional / simple context binding var aFunction = require('./_a-function'); module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; };
Version data entries
82 entries across 38 versions & 8 rubygems