Home > @opengovsg/validators > createPathSchema
createPathSchema() function
Create a schema that validates user-supplied pathnames for filesystem operations.
Signature:
typescript
createPathSchema: (options: PathValidatorOptions) => z.ZodType<string>Parameters
| Parameter | Type | Description |
|---|---|---|
| options | PathValidatorOptions | The options to use for validation |
Returns:
z.ZodType<string>
A Zod schema that validates paths.
Exceptions
OptionsError If the options are invalid