3 ms·
I didn’t know that a lot of these schema systems use eval. Surprising, why is that? As far as I can tell, my go-to schema system doesn’t. https://github.com/co
by girvo 4y ago
I didn’t know that a lot of these schema systems use eval. Surprising, why is that?
As far as I can tell, my go-to schema system doesn’t. https://github.com/colinhacks/zod https://github.com/colinhacks/zod
- no_wizard 4y agoAnything that uses `ajv` under the hood and doesn't use their compile schema options. They use `eval`[0] for a number of things. Quite a lot of schema validators use `ajv` under the hood. Some, like I believe `yup`, `zod` and `superstruct` do not. I'm not sure why one approach is more advantageous than another, to be honest. I'd think eval would also be a performance issue. [0]: https://ajv.js.org/security.html#content-security-policy https://ajv.js.org/security.html#content-security-policy