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

Function toValue

packages/decap-cms-widget-code/src/CodePreview.js:6–14  ·  view source on GitHub ↗
(value, field)

Source from the content-addressed store, hash-verified

4import { WidgetPreviewContainer } from 'decap-cms-ui-default';
5
6function toValue(value, field) {
7 if (isString(value)) {
8 return value;
9 }
10 if (Map.isMap(value)) {
11 return value.get(field.getIn(['keys', 'code'], 'code'), '');
12 }
13 return '';
14}
15
16function CodePreview(props) {
17 return (

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
getInMethod · 0.80

Tested by

no test coverage detected