tra-analysis/website/functions/node_modules/methmeth/index.js

13 lines
346 B
JavaScript
Raw Normal View History

2019-01-06 19:14:45 +00:00
'use strict';
module.exports = function (methodName) {
var initialArguments = [].slice.call(arguments, 1);
return function (item) {
if (typeof item[methodName] === 'function') {
var invokedArguments = [].slice.call(arguments, 1);
return item[methodName].apply(item, initialArguments.concat(invokedArguments));
}
};
};