UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

20 lines (19 loc) 544 B
import { z as o } from "zod"; import { isEmpty as e } from "lodash-es"; import l from "./getZodSchemaForColumnType.js"; function s(i) { const t = l(i); return o.union([ o.array(t), o.null(), o.string().length(0).transform(() => null), t.transform((r) => [r]) ]).optional().transform((r) => { if (r != null && (r = r.filter((n) => n !== "" && n != null), !e(r))) return r.map((n) => typeof n == "string" ? n : JSON.stringify(n)); }); } export { s as default }; //# sourceMappingURL=EnumValuesValidator.js.map