surreal-zod 0.0.0-alpha.11 → 0.0.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,3 @@
1
- import type { SurrealZodTableFields } from "./schema";
2
- export declare const optionalFields: (fields: SurrealZodTableFields) => string[];
1
+ export type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
2
+ export type LastOf<U> = UnionToIntersection<U extends any ? () => U : never> extends () => infer L ? L : never;
3
+ export type UnionToTuple<U, T extends any[] = []> = [U] extends [never] ? T : UnionToTuple<Exclude<U, LastOf<U>>, [LastOf<U>, ...T]>;
package/lib/zod/utils.js CHANGED
@@ -1,2 +0,0 @@
1
- import * as core from "zod/v4/core";
2
- export const optionalFields = core.util.optionalKeys;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "surreal-zod",
3
- "version": "0.0.0-alpha.11",
3
+ "version": "0.0.0-alpha.12",
4
4
  "scripts": {
5
- "build": "tsc",
5
+ "build": "tsc -p tsconfig.build.json",
6
6
  "prepack": "bun run build"
7
7
  },
8
8
  "files": [
@@ -18,20 +18,18 @@
18
18
  }
19
19
  },
20
20
  "devDependencies": {
21
- "@biomejs/biome": "^2.3.3",
21
+ "@biomejs/biome": "^2.3.11",
22
22
  "@types/bun": "latest",
23
23
  "chalk": "^5.6.2",
24
24
  "get-port": "^7.1.0",
25
- "zod": "^3.25.0 || ^4.0.0"
25
+ "typescript": "^5"
26
26
  },
27
27
  "peerDependencies": {
28
- "typescript": "^5",
28
+ "surrealdb": "^2.0.0-alpha.16",
29
29
  "zod": "^3.25.0 || ^4.0.0"
30
30
  },
31
31
  "type": "module",
32
32
  "dependencies": {
33
- "@surrealdb/node": "2.3.4",
34
- "dedent": "^1.7.0",
35
- "surrealdb": "^2.0.0-alpha.14"
33
+ "dedent": "^1.7.1"
36
34
  }
37
35
  }
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
- import * as sz from "./zod/schema";
2
- export { sz };
3
- export default sz;
1
+ import * as z from "./zod";
2
+ export { z };
3
+ export * from "./zod";
4
+ export default z;
@@ -0,0 +1,9 @@
1
+ import z from "zod/v4";
2
+
3
+ export type SurrealZodCacheMeta = { type: string };
4
+
5
+ const tables = z.registry();
6
+
7
+ export const registries = Object.freeze({
8
+ tables,
9
+ });