Files
story-studio/remotion/node_modules/@remotion/studio/dist/api/get-zod-schema-from-primitive.js
2026-02-21 10:33:18 +01:00

19 lines
698 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getZodSchemaFromPrimitive = void 0;
const getZodSchemaFromPrimitive = (value, z) => {
if (typeof value === 'string') {
return z.string();
}
if (typeof value === 'number') {
return z.number();
}
let stringified;
try {
stringified = JSON.stringify(value);
}
catch (_a) { }
throw new Error(`visualControl(): Specify a schema for this value: ${stringified !== null && stringified !== void 0 ? stringified : '[non-serializable value]'}. See https://remotion.dev/docs/studio/visual-control`);
};
exports.getZodSchemaFromPrimitive = getZodSchemaFromPrimitive;