Zod Snippets for VSCode Editor
This extension for Visual Studio Code adds snippets for Zod.
Requirements
Usage
Snippets
Type part of snippet, press Tab or Enter , and the snippet unfolds. Below is a list of the most important shortcuts.
Snippet |
Purpose |
zod_array_nonempty |
z.array(z.string()).nonempty() |
zod_bigint_positive |
z.bigint().positive() |
zod_date_max |
z.date().max(new Date()) |
zod_deep_partial |
const ... = ....deepPartial(); |
zod_enum |
z.enum(...) |
zod_schema_keyof |
const ... = ....keyof(); |
zod_string_nullable |
z.nullable(z.string()) |
zod_number_int_positive |
z.number().int().positive() |
zod_string_optional |
z.optional(z.string()) |
zod_schema_partial |
const ... = ....partial(); |
zod_schema_passthrough |
....passthrough().parse() |
zod_schema_strip |
....strip().parse() |
zod_schema_strict |
....strict().parse() |
zod_promise |
z.promise(z.string()) |
zod_function_parameters |
....parameters() |
zod_function_returnType |
....returnType() |
zod_string_max |
z.string().max(...) |
zod_string_min |
z.string().min(...) |
zod_string_length |
z.string().length(...) |
zod_string_email |
z.string().email() |
zod_string_url |
z.string().url().nullish() |
zod_string_emoji |
z.string().emoji() |
zod_string_uuid |
z.string().uuid() |
zod_string_cuid |
z.string().cuid() |
zod_string_cuid2 |
z.string().cuid2() |
zod_string_ulid |
z.string().ulid() |
zod_string_regex |
z.string().regex(...) |
zod_string_includes |
z.string().includes(...) |
zod_string_startsWith |
z.string().startsWith(...) |
zod_string_endsWith |
z.string().endsWith(...) |
zod_string_datetime |
z.string().datetime() |
zod_string_ip |
z.string().ip({ version: '...' }) |
zod_string_trim |
z.string().trim() |
zod_string_toLowerCase |
z.string().toLowerCase() |
zod_string_toUpperCase |
z.string().toUpperCase() |
Connect with me
Other Extensions
Changelog
See CHANGELOG.md
Authors
See also the list of contributors who participated in this project.
License
Zod Snippets for VSCode is licensed under the MIT License - see the MIT License for details.
| |