UNPKG

eslint-plugin-obsidian

Version:

ESLint rules for Obsidian

26 lines 906 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Variable = void 0; const types_1 = require("@typescript-eslint/types"); const assert_1 = __importDefault(require("assert")); class Variable { constructor(node) { this.node = node; } get name() { return this.node.id.name; } get isArrowFunction() { var _a; return ((_a = this.node.init) === null || _a === void 0 ? void 0 : _a.type) === types_1.TSESTree.AST_NODE_TYPES.ArrowFunctionExpression; } get arrowFunction() { (0, assert_1.default)(this.isArrowFunction, 'Variable does not represent an arrow function'); return this.node.init; } } exports.Variable = Variable; //# sourceMappingURL=variable.js.map