Skip to content

Instantly share code, notes, and snippets.

@gouxlord
gouxlord / interface-decorator.js
Created August 16, 2016 10:54
Interface by decorator implementation test
// thx to David Walsh blog
function getArgs(func) {
var args = func.toString().match(/function\s.*?\(([^)]*)\)/)[1];
return args.split(',').map(function(arg) {
return arg.replace(/\/\*.*\*\//, '').trim();
}).filter(function(arg) {
return arg;
});
}