UNPKG

@tsed/schema-formio

Version:

Transform Ts.ED Schema & JsonSchema to a valid Formio schema

22 lines (19 loc) 418 B
import {CustomKey, JsonEntityFn} from "@tsed/schema"; import {Component} from "./component.js"; /** * Change the label field * @decorator * @formio * @property * @schema * @param label */ export function Label(label: string) { return JsonEntityFn((entity) => { return entity.decoratorType === "property" ? Component({ label }) : CustomKey("x-formio-label", label); }); }