MCPcopy Create free account
hub / github.com/json-editor/json-editor / getGlobalPropertyFromString

Method getGlobalPropertyFromString

src/editors/string.js:289–305  ·  view source on GitHub ↗
(strValue)

Source from the content-addressed store, hash-verified

287 }
288
289 getGlobalPropertyFromString (strValue) {
290 if (!strValue.includes('.')) {
291 if (typeof window[strValue] !== 'undefined') {
292 return window[strValue]
293 }
294 } else {
295 const arrParts = strValue.split('.')
296 const obj = arrParts[0]
297 const prop = arrParts[1]
298
299 if (typeof window[obj] !== 'undefined' && typeof window[obj][prop] !== 'undefined') {
300 return window[obj][prop]
301 }
302 }
303 /* just a string */
304 return strValue
305 }
306
307 shouldBeUnset () {
308 return !this.jsoneditor.options.use_default_values && !this.is_dirty

Callers 1

ajustIMaskOptionsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected