@marko/compiler
Version:
Marko template to JS compiler.
25 lines (19 loc) • 625 B
JavaScript
;exports.__esModule = true;exports.getFile = getFile;exports.getFileInternal = getFileInternal;exports.getProgram = getProgram;exports.setFileInternal = setFileInternal;let currentFile;
function getFile() {
if (currentFile) {
return currentFile;
}
throw new Error("Unable to access Marko File outside of a compilation");
}
function getProgram() {
if (currentFile) {
return currentFile.path;
}
throw new Error("Unable to access Marko Program outside of a compilation");
}
function getFileInternal() {
return currentFile;
}
function setFileInternal(file) {
return currentFile = file;
}