UNPKG
zod-server-actions
Version:
latest (1.6.4)
1.6.4
1.6.3
1.6.2
1.6.0
1.5.4
1.0.0
0.5.4
0.5.3
0.5.2
0.5.1
0.5.0
0.4.11
0.4.10
0.4.9
0.4.8
0.4.7
0.4.6
0.4.5
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.3.2
0.3.1
0.3.0
0.2.4
0.2.3
0.2.2
0.2.1
0.1.1
Simple utility library to create server actions in Next.js
github.com/KalmonJ/zod-server-actions
zod-server-actions
/
dist
/
core
/
validators.js
16 lines
(15 loc)
•
344 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
export
class
ZodValidator
{
constructor
() { } parseInput(
data
) {
return
this
.inputSchema.parse(
data
); } parseOutput(
data
) {
return
this
.outputSchema.parse(
data
); } setInputSchema(schema) {
this
.inputSchema = schema; } setOutputSchema(schema) {
this
.outputSchema = schema; } }