eslint-plugin-obsidian
Version:
ESLint rules for Obsidian
29 lines • 936 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Method = void 0;
const decorator_1 = require("./decorator");
const parameter_1 = require("./parameter");
class Method {
constructor(node) {
this.node = node;
}
get name() {
return this.node.key.name;
}
get parameters() {
return this.node.value.params.map((param) => new parameter_1.Parameter(param));
}
isDecoratedWithIgnoreCase(decoratorName) {
return this.decorators.some((decorator) => {
return decorator.expression.callee.name.toLowerCase() === decoratorName.toLowerCase();
});
}
get decorators() {
var _a;
return ((_a = this.node.decorators) !== null && _a !== void 0 ? _a : []).map((decorator) => {
return new decorator_1.Decorator(decorator);
}) || [];
}
}
exports.Method = Method;
//# sourceMappingURL=method.js.map