You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Disable schema code generation in runtime. Use this if your runtime
32
+
* environment restricts the use of `eval` or `new Function`, for e.g., in
33
+
* CloudFlare workers.
34
+
*/
35
+
exportfunctiondisableSchemaCodeGeneration(){
36
+
logger.warn(
37
+
"It looks like you're trying to disable schema code generation. Please ensure that the '@cfworker/json-schema' package is installed: `npm i --save @cfworker/json-schema`"
38
+
);
39
+
global[SCHEMA_VALIDATION_MODE]='interpret';
40
+
}
41
+
42
+
/** Visible for testing */
43
+
exportfunctionresetSchemaCodeGeneration(){
44
+
global[SCHEMA_VALIDATION_MODE]=undefined;
45
+
}
46
+
26
47
export{z};// provide a consistent zod to use throughout genkit
0 commit comments