@d3vtool/ex-frame
Version:
This library enhances Express.js by providing a more organized structure for web API projects, along with improved control and error handling capabilities.
16 lines (15 loc) • 540 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStaticMethods = getStaticMethods;
exports.getFunctionArgs = getFunctionArgs;
exports.getClassArgs = getClassArgs;
function getStaticMethods(cls) {
return Object.getOwnPropertyNames(cls)
.filter((item) => typeof cls[item] === "function");
}
function getFunctionArgs(fn) {
return fn.toString().match(/\b\((.+)\b\)/)[1].split(", ");
}
function getClassArgs(fn) {
return fn.toString().match(/\bconstructor\((.+)\b\)/)[1].split(", ");
}