MCPcopy Create free account
hub / github.com/decaporg/decap-cms / valueToOption

Function valueToOption

packages/decap-cms-widget-code/src/CodeControl.js:49–54  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

47const defaultLang = { name: '', mode: '', label: 'none' };
48
49function valueToOption(val) {
50 if (typeof val === 'string') {
51 return { value: val, label: val };
52 }
53 return { value: val.name, label: val.label || val.name };
54}
55
56const modes = languages.map(valueToOption);
57

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected