MCPcopy Index your code
hub / github.com/json-editor/json-editor / getItemInfo

Method getItemInfo

src/editors/array.js:200–219  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

198 }
199
200 getItemInfo (i) {
201 let schema = this.getItemSchema(i)
202
203 /* Check if it's cached */
204 this.item_info = this.item_info || {}
205 const stringified = JSON.stringify(schema)
206 if (typeof this.item_info[stringified] !== 'undefined') return this.item_info[stringified]
207
208 /* Get the schema for this item */
209 schema = this.jsoneditor.expandRefs(schema)
210
211 this.item_info[stringified] = {
212 title: this.translateProperty(schema.title) || this.translate('default_array_item_title'),
213 default: schema.default,
214 width: 12,
215 child_editors: schema.properties || schema.items
216 }
217
218 return this.item_info[stringified]
219 }
220
221 getElementEditor (i) {
222 const itemInfo = this.getItemInfo(i)

Callers 3

getNumColumnsMethod · 0.95
getElementEditorMethod · 0.95
ensureArraySizeMethod · 0.95

Calls 2

getItemSchemaMethod · 0.95
expandRefsMethod · 0.80

Tested by

no test coverage detected