gunshi / combinators / string
Function: string()
ts
function string(opts?): CombinatorSchema<string>;Experimental
Create a string argument schema with optional validation.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts? | StringOptions | Validation options. |
Returns
CombinatorSchema<string>
A combinator schema that resolves to string.
Example
ts
const args = {
name: string({ minLength: 1, maxLength: 50 })
}