eslint-plugin-obsidian
Version:
ESLint rules for Obsidian
29 lines • 911 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SingleType = void 0;
const lodash_1 = require("lodash");
const identifier_1 = require("../identifier");
class SingleType {
constructor(props) {
this.props = props;
}
toString() {
var _a, _b;
const typeRef = (_b = (_a = this.props) === null || _a === void 0 ? void 0 : _a.typeAnnotation) === null || _b === void 0 ? void 0 : _b.typeAnnotation;
return [new identifier_1.Identifier(typeRef.typeName).name];
}
isEmpty() {
return false;
}
equals(types) {
return types.length === 1 && types[0].toString() === this.toString();
}
includes(type) {
return type.some((t) => (0, lodash_1.isEqual)(t.toString(), this.toString()));
}
size() {
return 1;
}
}
exports.SingleType = SingleType;
//# sourceMappingURL=singleType.js.map