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

Function getKeys

packages/decap-cms-widget-code/src/CodeControl.js:182–195  ·  view source on GitHub ↗
(field)

Source from the content-addressed store, hash-verified

180
181 // If the value is a map, keys can be customized via config.
182 getKeys(field) {
183 const defaults = {
184 code: 'code',
185 lang: 'lang',
186 };
187
188 // Force default keys if widget is an editor component code block.
189 if (this.props.isEditorComponent) {
190 return defaults;
191 }
192
193 const keys = field.get('keys', Map()).toJS();
194 return { ...defaults, ...keys };
195 }
196
197 // Determine if the persisted value is a map rather than a plain string. A map
198 // value allows both the code string and the language to be persisted.

Callers

nothing calls this directly

Calls 3

MapInterface · 0.85
toJSMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected