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

Method getEditorClass

src/core.js:217–229  ·  view source on GitHub ↗
(schema)

Source from the content-addressed store, hash-verified

215 }
216
217 getEditorClass (schema) {
218 let classname
219
220 schema = this.expandSchema(schema)
221
222 JSONEditor.defaults.resolvers.find(resolver => {
223 classname = resolver(schema, this)
224 return classname && JSONEditor.defaults.editors[classname]
225 })
226 if (!classname) throw new Error(`Unknown editor for schema ${JSON.stringify(schema)}`)
227 if (!JSONEditor.defaults.editors[classname]) throw new Error(`Unknown editor ${classname}`)
228 return JSONEditor.defaults.editors[classname]
229 }
230
231 createEditor (editorClass, options, depthCounter = 1) {
232 options = extend({}, editorClass.options || {}, options)

Callers 7

loadMethod · 0.95
getElementEditorMethod · 0.80
buildChildEditorMethod · 0.80
preBuildMethod · 0.80
addObjectPropertyMethod · 0.80
buildChildEditorMethod · 0.80
getElementEditorMethod · 0.80

Calls 1

expandSchemaMethod · 0.80

Tested by

no test coverage detected