We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d1dd828 commit 819a787Copy full SHA for 819a787
packages/schema/src/plugins/zod/generator.ts
@@ -224,13 +224,14 @@ export class ZodSchemaGenerator {
224
import { z } from 'zod';
225
export const DecimalSchema = z.any().refine((val) => {
226
if (typeof val === 'string' || typeof val === 'number') {
227
- return val;
+ return true;
228
}
229
// Decimal.js shape
230
if (typeof val === 'object' && val && Array.isArray(val.d) && typeof val.e === 'number' && typeof val.s === 'number') {
231
232
233
- });
+ return false;
234
+ }, { message: 'Not a valid Decimal value'});
235
`,
236
{ overwrite: true }
237
)
0 commit comments