Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ You can pass the following [Ajv options](https://ajv.js.org/options.html):
| `--own-properties` | only validate own properties (not relevant for JSON, but can have effect for JavaScript objects) |
| Code generation |
| `--code-es5` | generate ES5 code |
| `--code-esm` | generate ESM code |
| `--code-lines` | generate multi-line code |
| `--code-optimize=` | disable optimization (`false`) or number of optimization passes (1 pass by default) |
| `--code-formats=` | code to require formats object (only needed if you generate standalone code and do not use [ajv-formats](https://github.com/ajv-validator/ajv-formats)) |
Expand Down
4 changes: 3 additions & 1 deletion src/commands/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ Ajv options (see https://github.com/epoberezkin/ajv#options):

--own-properties only validate own properties (not relevant for JSON, but can have effect for JavaScript objects)

--code-es5 generate ES5 code
--code-es5 generate ES5 code

--code-esm generate ESM code

--code-lines generate multi-line code

Expand Down
1 change: 1 addition & 0 deletions src/commands/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const ajvOptions: SchemaMap = {
multipleOfPrecision: boolOrNat,
messages: {type: "boolean"},
[`${CODE}es5`]: {type: "boolean"},
[`${CODE}esm`]: {type: "boolean"},
[`${CODE}lines`]: {type: "boolean"},
[`${CODE}optimize`]: boolOrNat,
[`${CODE}formats`]: {type: "string"},
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"allowJs": true,
"target": "ES2018",
"resolveJsonModule": true,
"esModuleInterop": false
"esModuleInterop": false,
"useUnknownInCatchVariables": false
}
}