ui5plugin-parser
Version:
30 lines (29 loc) • 783 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextDocument = void 0;
const AbstractFileReader_1 = require("../filereader/AbstractFileReader");
class TextDocument {
constructor(text, fileName) {
this._text = text;
this.fileName = (0, AbstractFileReader_1.toNative)(fileName);
}
getText() {
return this._text;
}
isView() {
return this.fileName.endsWith(".view.xml");
}
isFragment() {
return this.fileName.endsWith(".fragment.xml");
}
isXML() {
return this.isFragment() || this.isView();
}
isJS() {
return this.fileName.endsWith(".js");
}
isTS() {
return this.fileName.endsWith(".ts");
}
}
exports.TextDocument = TextDocument;