MCPcopy Create free account
hub / github.com/eclipsesource/jsonforms / enumToEnumOptionMapper

Function enumToEnumOptionMapper

packages/core/src/mappers/renderer.ts:325–339  ·  view source on GitHub ↗
(
  e: any,
  t?: Translator,
  i18nKey?: string
)

Source from the content-addressed store, hash-verified

323}
324
325export const enumToEnumOptionMapper = (
326 e: any,
327 t?: Translator,
328 i18nKey?: string
329): EnumOption => {
330 let label = typeof e === 'string' ? e : JSON.stringify(e);
331 if (t) {
332 if (i18nKey) {
333 label = t(`${i18nKey}.${label}`, label);
334 } else {
335 label = t(label, label);
336 }
337 }
338 return { label, value: e };
339};
340
341export const oneOfToEnumOptionMapper = (
342 e: any,

Callers 5

cell.test.tsFile · 0.90
computeChildLabelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…