Skip to content

v0.4.0

Latest

Choose a tag to compare

@AndrewBastin AndrewBastin released this 30 Jul 18:01

This release introduces direct access to the latest entity schema and includes development tooling improvements.

The new latestSchema getter property allows you to access the Zod schema of the latest version of an entity directly. This is useful when you need to work with the raw Zod schema in existing validation workflows:

const Environment = createVersionedEntity({
  latestVersion: 2,
  versionMap: { /* ... */ },
  getVersion: (data) => data.v
})

// Access the latest schema directly
const latestSchema = Environment.latestSchema // Returns the z.object() schema for version 2

// Use it with existing Zod workflows
const result = latestSchema.safeParse(someData)

What's Changed

Contributors

Full Changelog: v0.3.0...v0.4.0