st-bundle
Version:
CLI for watching and bundling SpringType projects.
58 lines (57 loc) • 1.97 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ExportReferenceType;
(function (ExportReferenceType) {
ExportReferenceType["ImportReference"] = "ImportReference";
ExportReferenceType["Object"] = "Object";
ExportReferenceType["DefaultAssignment"] = "DefaultAssignment";
})(ExportReferenceType = exports.ExportReferenceType || (exports.ExportReferenceType = {}));
class ExportReference {
constructor(link) {
this.link = link;
this.dependantVariables = [];
this.dependantExports = [];
}
hasExternalDependants() {
for (const _exp of this.dependantExports) {
if (_exp.link.productionModule.productionPackage !== this.link.productionModule.productionPackage) {
return true;
}
}
for (const _var of this.dependantVariables) {
if (_var.link.productionModule.productionPackage !== this.link.productionModule.productionPackage) {
return true;
}
}
}
findObject() { }
getText() {
if (this.objectNode) {
return this.objectNode.getText();
}
if (this.exportSpecifierNode) {
return this.exportSpecifierNode.getText();
}
if (this.objectLiteralExpressionNode) {
return this.objectLiteralExpressionNode.getText();
}
}
toJSON() {
const obj = {};
if (this.type)
obj.type = this.type;
if (this.name)
obj.name = this.name;
if (this.objectNode) {
obj.objectNode = this.objectNode.getKindName();
}
if (this.exported)
obj.exported = this.exported;
if (this.exportSpecifierNode)
obj.exportSpecifierNode = true;
if (this.objectLiteralExpressionNode)
obj.objectLiteralExpressionNode = true;
return obj;
}
}
exports.ExportReference = ExportReference;