@eristack/entity-id
Version:
UUID v7 entity identifiers — sortable, parseable, Drizzle column helper
21 lines (20 loc) • 434 B
JavaScript
import {
parseEntityId
} from "../chunk-7V2KY5JP.js";
// src/zod/schemas.ts
import { z } from "zod";
var entityIdSchema = z.string().transform((value, ctx) => {
try {
return parseEntityId(value);
} catch (err) {
ctx.addIssue({
code: "custom",
message: err instanceof Error ? err.message : "Invalid entity id"
});
return z.NEVER;
}
});
export {
entityIdSchema
};
//# sourceMappingURL=index.js.map