Skip to content

Commit

Permalink
Add note about oneOfProp to stringProp section in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
FloEdelmann authored Aug 30, 2022
1 parent 2b0c2f8 commit 2e34747
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ For convenience, some common validator functions are included in the library and
### `stringProp<T>(validator?: Validator)`

Allows any string. No further runtime validation is performed by default.
Type parameter `T` can be used to restrict the type at compile time with a union type.
Type parameter `T` can be used to restrict the type at compile time with a union type. (Consider using [`oneOfProp`](#oneofproptallowedvalues-readonly-any-validator-validator) in this case.)

```ts
stringProp().optional
Expand Down

0 comments on commit 2e34747

Please sign in to comment.