Sha256: e3221c570f9a7f052c9d34322346b78e14a68f58a38b85e7b010aa50245ea5f7
Contents?: true
Size: 474 Bytes
Versions: 109
Compression:
Stored size: 474 Bytes
Contents
/** * Slice reference. */ var slice = [].slice; /** * Bind `obj` to `fn`. * * @param {Object} obj * @param {Function|String} fn or string * @return {Function} * @api public */ module.exports = function(obj, fn){ if ('string' == typeof fn) fn = obj[fn]; if ('function' != typeof fn) throw new Error('bind() requires a function'); var args = slice.call(arguments, 2); return function(){ return fn.apply(obj, args.concat(slice.call(arguments))); } };
Version data entries
109 entries across 107 versions & 5 rubygems