diff options
Diffstat (limited to 'vnfmarket/src/main/webapp/vnfmarket/node_modules/socket.io-client/components/component-bind/index.js')
-rw-r--r-- | vnfmarket/src/main/webapp/vnfmarket/node_modules/socket.io-client/components/component-bind/index.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/socket.io-client/components/component-bind/index.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/socket.io-client/components/component-bind/index.js new file mode 100644 index 00000000..9808fc06 --- /dev/null +++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/socket.io-client/components/component-bind/index.js @@ -0,0 +1,24 @@ + +/** + * 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))); + } +}; |