MCPcopy Create free account
hub / github.com/TanStack/router / parseAst

Function parseAst

packages/router-utils/src/ast.ts:18–32  ·  view source on GitHub ↗
({
  code,
  filename,
  sourceFilename,
  plugins,
  ...opts
}: ParseAstOptions)

Source from the content-addressed store, hash-verified

16
17export type ParseAstResult = ParseResult<_babel_types.File>
18export function parseAst({
19 code,
20 filename,
21 sourceFilename,
22 plugins,
23 ...opts
24}: ParseAstOptions): ParseAstResult {
25 const inferredFilename = filename ?? sourceFilename
26 return parse(code, {
27 plugins: plugins ?? getDefaultParserPluginsForFilename(inferredFilename),
28 sourceType: 'module',
29 sourceFilename,
30 ...opts,
31 })
32}
33
34function getDefaultParserPluginsForFilename(
35 filename: string | undefined,

Callers 15

transformFunction · 0.90
getVariableInitFunction · 0.90
transformFunction · 0.90
loadHydrateVirtualModuleFunction · 0.90
getOrParseAstFunction · 0.90
rewriteDeniedImportsFunction · 0.90
ingestModuleMethod · 0.90

Calls 2

parseFunction · 0.85

Tested by 11

transformFunction · 0.72
getVariableInitFunction · 0.72
compileHydrateFunction · 0.72
compileFunction · 0.72
parseFunction · 0.72
getLocalBindingsFunction · 0.72
getProgramPathFunction · 0.72