tra-analysis/website/functions/node_modules/methmeth/index.js
2019-01-06 13:14:45 -06:00

13 lines
346 B
JavaScript

'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));
}
};
};