Skip to content

Add utilities for creating optional types #10

@skoshx

Description

@skoshx

In the same way as in Prisma we have createdAt DateTime @default(now()),

we should have in Pentagon something along the lines of:

const User = z.object({
  createdAt: default(z.date(), () => new Date()),
  id: default(z.string(), () => crypto.randomUUID())
  // or
  createdAt: default(z.date(), "now"),
  id: default(z.string(), "uuid")
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions