@tsed/schema-formio
Version:
Transform Ts.ED Schema & JsonSchema to a valid Formio schema
12 lines (11 loc) • 417 B
JavaScript
import { cleanObject } from "@tsed/core";
import { execMapper, registerFormioMapper } from "../registries/FormioMappersContainer.js";
function booleanToComponent(schema, options) {
const component = execMapper("default", schema, options);
return cleanObject({
...component,
input: true,
type: component.type || "checkbox"
});
}
registerFormioMapper("boolean", booleanToComponent);