# NestjsParser

**Kind:** Class

**Source:** [`atloria-monorepo/libs/parser-core/src/parsers/backend/nestjs.parser.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/parser-core/src/parsers/backend/nestjs.parser.ts#L73)

NestJS Parser implementation

**Implements:** `IParser`

## Methods

| Method | Signature | Returns |
|---|---|---|
| `initialize` | `initialize(config: ParserConfig)` | `Promise<void>` |
| `canParse` | `canParse(filePath: string)` | `boolean` |
| `parseFile` | `parseFile(filePath: string, content: string)` | `Promise<ParseResult>` |
| `parseFiles` | `parseFiles(files: ParseFileInput[])` | `Promise<ParseResult[]>` |
| `destroy` | `destroy()` | `Promise<void>` |

## Properties

| Property | Type |
|---|---|
| `name` | `any` |
| `version` | `any` |
| `supportedPatterns` | `any` |

## Where it refuses work

- `NestjsParser` stops the work with an early return when `!ts.isCallExpression(decorator.expression)`, in 2 places.
- `NestjsParser` stops the work with an early return when `!/\.(controller|service|module|guard|interceptor|pipe|middleware|gateway|resolver)\.ts$/.…`.
- `NestjsParser` stops the work with an early return when `/\.(controller|guard|interceptor|middleware|gateway|resolver)\.ts$/.test(filePath)`.
- `NestjsParser` stops the work with an early return when `!fileContent.trim()`.
- `NestjsParser` stops the work with an early return when `!httpMethod`.
- `NestjsParser` stops the work with an early return when `args.length === 0 || !ts.isObjectLiteralExpression(args[0])`.

## When something fails

- `NestjsParser` handles failure in 1 place: it turns it into a return value in all 1.
