@genesis-xyz/overlay
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "@genesis-xyz/overlay", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"main": "src/index.ts", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
@@ -23,2 +23,8 @@ import { Database } from 'bun:sqlite'; | ||
/** Data binding field schema for inserts to SQLite that casts Date objects to ISO strings */ | ||
const BindingFieldSchema = z | ||
.unknown() | ||
.transform((value) => (value instanceof Date ? value.toISOString() : value)) | ||
.pipe(z.coerce.string().nullish()); | ||
/** Helper function for converting a row schema to insert bindings */ | ||
@@ -31,3 +37,3 @@ function schemaToNamedBindingsSchema(schema: SomeZodObject) { | ||
...acc, | ||
[`$${schemaKey}`]: z.coerce.string().nullish(), | ||
[`$${schemaKey}`]: BindingFieldSchema, | ||
}), | ||
@@ -34,0 +40,0 @@ {} |
113979
768