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