sucrase
Version:
Super-fast alternative to Babel for when you can target modern JS runtimes
20 lines (19 loc) • 665 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const Transformer_1 = require("./Transformer");
class FlowTransformer extends Transformer_1.default {
constructor(rootTransformer, tokens) {
super();
this.rootTransformer = rootTransformer;
this.tokens = tokens;
}
process() {
// We need to handle all classes specially in order to remove `implements`.
if (this.tokens.matchesKeyword("class")) {
this.rootTransformer.processClass();
return true;
}
return this.rootTransformer.processPossibleTypeRange();
}
}
exports.default = FlowTransformer;