/
opt
/
canhelp
/
node_modules
/
better-auth
/
dist
/
db
/
/opt/canhelp/node_modules/better-auth/dist/db
mkdir
upload
Name
Size
Mode
Actions
adapter-base.d.mts
425
0644
edit
dl
rm
adapter-base.mjs
994
0644
edit
dl
rm
adapter-base.mjs.map
2020
0644
edit
dl
rm
adapter-kysely.d.mts
328
0644
edit
dl
rm
adapter-kysely.mjs
846
0644
edit
dl
rm
adapter-kysely.mjs.map
1501
0644
edit
dl
rm
field-converter.d.mts
444
0644
edit
dl
rm
field-converter.mjs
627
0644
edit
dl
rm
field-converter.mjs.map
1423
0644
edit
dl
rm
field.d.mts
3703
0644
edit
dl
rm
get-migration.d.mts
804
0644
edit
dl
rm
get-migration.mjs
12311
0644
edit
dl
rm
get-migration.mjs.map
26016
0644
edit
dl
rm
get-schema.d.mts
359
0644
edit
dl
rm
get-schema.mjs
996
0644
edit
dl
rm
get-schema.mjs.map
2029
0644
edit
dl
rm
index.d.mts
1215
0644
edit
dl
rm
index.mjs
1830
0644
edit
dl
rm
index.mjs.map
385
0644
edit
dl
rm
internal-adapter.d.mts
639
0644
edit
dl
rm
internal-adapter.mjs
21762
0644
edit
dl
rm
internal-adapter.mjs.map
51002
0644
edit
dl
rm
schema.d.mts
2586
0644
edit
dl
rm
schema.mjs
4983
0644
edit
dl
rm
schema.mjs.map
10377
0644
edit
dl
rm
to-zod.d.mts
1583
0644
edit
dl
rm
to-zod.mjs
865
0644
edit
dl
rm
to-zod.mjs.map
3401
0644
edit
dl
rm
verification-token-storage.mjs
1084
0644
edit
dl
rm
verification-token-storage.mjs.map
2179
0644
edit
dl
rm
with-hooks.d.mts
1730
0644
edit
dl
rm
with-hooks.mjs
7140
0644
edit
dl
rm
with-hooks.mjs.map
16287
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/better-auth/dist/db/to-zod.mjs
(865B)
import * as z from "zod"; //#region src/db/to-zod.ts function toZodSchema({ fields, isClientSide }) { const zodFields = Object.keys(fields).reduce((acc, key) => { const field = fields[key]; if (!field) return acc; if (isClientSide && field.input === false) return acc; let schema; if (field.type === "json") schema = z.json ? z.json() : z.any(); else if (field.type === "string[]" || field.type === "number[]") schema = z.array(field.type === "string[]" ? z.string() : z.number()); else if (Array.isArray(field.type)) schema = z.any(); else schema = z[field.type](); if (field?.required === false) schema = schema.optional(); if (!isClientSide && field?.returned === false) return acc; return { ...acc, [key]: schema }; }, {}); return z.object(zodFields); } //#endregion export { toZodSchema }; //# sourceMappingURL=to-zod.mjs.map
Save
cmd:
run