Skip to content

Commit fe17771

Browse files
committed
document emitDetailedErrors
1 parent 50b277f commit fe17771

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ There are some options to configure the transformer.
137137
| `ignoreFunctions` *(deprecated, use `functionBehavior` instead)* | Boolean (default: `false`). If `true`, when the transformer encounters a function, it will ignore it and simply return `true`. If `false`, an error is generated at compile time. |
138138
| `functionBehavior` | One of `error`, `ignore`, or `basic` (default: `error`). Determines the behavior of transformer when encountering a function. `error` will cause a compile-time error, `ignore` will cause the validation function to always return `true`, and `basic` will do a simple function-type-check. Overrides `ignoreFunctions`. |
139139
| `disallowSuperfluousObjectProperties` | Boolean (default: `false`). If `true`, objects are checked for having superfluous properties and will cause the validation to fail if they do. If `false`, no check for superfluous properties is made. |
140+
| `emitDetailedErrors` | Boolean or `auto` (default: `auto`). The generated validation functions can return detailed error messages, pointing out where and why validation failed. These messages are used by `assertType<T>()`, but are ignored by `is<T>()`. If `false`, validation functions return empty error messages, decreasing code size. `auto` will generate detailed error messages for assertions, but not for type checks. `true` will always generate detailed error messages, matching the behaviour of version 0.18.3 and older. |
140141

141142
If you are using `ttypescript`, you can include the options in your `tsconfig.json`:
142143

@@ -150,7 +151,8 @@ If you are using `ttypescript`, you can include the options in your `tsconfig.js
150151
"ignoreClasses": true,
151152
"ignoreMethods": true,
152153
"functionBehavior": "ignore",
153-
"disallowSuperfluousObjectProperties": true
154+
"disallowSuperfluousObjectProperties": true,
155+
"emitDetailedErrors": "auto"
154156
}
155157
]
156158
}

0 commit comments

Comments
 (0)