@remotion/studio
Version:
APIs for interacting with the Remotion Studio
19 lines (18 loc) • 698 B
JavaScript
;
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;