mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-11-10 15:04:45 +00:00
13 lines
346 B
JavaScript
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));
|
||
|
}
|
||
|
};
|
||
|
};
|