sucrase
Version:
Super-fast alternative to Babel for when you can target modern JS runtimes
14 lines (13 loc) • 502 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* For an import or export statement, check if this might be actually a property
* name like in `{import: 1}`. If not, then we can trust that it's a real import
* or export.
*/
function isMaybePropertyName(tokens, index) {
return tokens.matchesAtIndex(index - 1, ['.']) ||
tokens.matchesAtIndex(index + 1, [':']) ||
tokens.matchesAtIndex(index + 1, ['(']);
}
exports.default = isMaybePropertyName;