source: frontend/node_modules/sucrase/dist/esm/util/isExportFrom.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago

Fix frontend appearance

  • Property mode set to 100644
File size: 628 bytes
Line 
1import {ContextualKeyword} from "../parser/tokenizer/keywords";
2import {TokenType as tt} from "../parser/tokenizer/types";
3
4
5/**
6 * Starting at `export {`, look ahead and return `true` if this is an
7 * `export {...} from` statement and `false` if this is a plain multi-export.
8 */
9export default function isExportFrom(tokens) {
10 let closeBraceIndex = tokens.currentIndex();
11 while (!tokens.matches1AtIndex(closeBraceIndex, tt.braceR)) {
12 closeBraceIndex++;
13 }
14 return (
15 tokens.matchesContextualAtIndex(closeBraceIndex + 1, ContextualKeyword._from) &&
16 tokens.matches1AtIndex(closeBraceIndex + 2, tt.string)
17 );
18}
Note: See TracBrowser for help on using the repository browser.