Kind: Class
Source: atloria-monorepo/apps/frontend-parser/src/parsers/nextjs.parser.ts
Extends: ReactParser
Methods
| Method | Signature | Returns |
|---|---|---|
parseFile | parseFile(filePath: string, content: string) | Promise<ParseResult> |
Properties
| Property | Type |
|---|---|
name | string |
version | string |
supportedPatterns | string[] |
Where it refuses work
NextjsParserstops the work with an early return whenthis.isRouteHandler(filePath).NextjsParserstops the work with an early return when!content.trim().NextjsParserstops the work with an early return whenroute === '/'.NextjsParserstops the work with an early return when/\/app\/page\.(tsx|jsx|ts|js)$/.test(filePath).NextjsParserstops the work with an early return whenroute === 'index'.NextjsParserstops the work with an early return whenmatch.
When something fails
NextjsParserhandles failure in 2 places: it turns it into a return value in 1, and discards it silently in 1. A failure discarded silently leaves no trace for whoever debugs this later.
Was this page helpful?