INNER CODE UNIT · JavaScript

parseFile

react-native-tvos/react-native-tvos · packages/babel-plugin-codegen/index.js:39

function parseFile(filename /*: string */, code /*: string */) {
  if (filename.endsWith('js')) {
    return flowParser.parseString(code);
  }

  if (filename.endsWith('ts')) {
    return typeScriptParser.parseString(code);
  }

  throw new Error(
    `Unable to parse file '${filename}'. Unsupported filename extension.`,
  );
}

function generateViewConfig(filename /*: string */, code /*: string */) {
  const schema = parseFile(filename, code);

  const libraryName = basename(filename).replace(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…