MCPcopy Index your code
hub / github.com/codecombat/codecombat / getReferencedModel

Method getReferencedModel

app/core/treema-ext.js:708–720  ·  view source on GitHub ↗
(data, schema)

Source from the content-addressed store, hash-verified

706 }
707
708 getReferencedModel (data, schema) {
709 if (schema.links == null) { return null }
710 const linkObject = _.find(schema.links, { rel: 'db' })
711 if (!linkObject) { return null }
712 if (linkObject.href.match('thang.type') && !CocoModel.isObjectID(data)) { return null } // Skip loading hardcoded Thang Types for now (TODO)
713
714 // not fully extensible, but we can worry about that later
715 let link = linkObject.href
716 link = link.replace('{(original)}', data.original)
717 link = link.replace('{(majorVersion)}', '' + (data.majorVersion != null ? data.majorVersion : 0))
718 link = link.replace('{($)}', data)
719 return this.getOrMakeModelFromLink(link, linkObject)
720 }
721
722 getOrMakeModelFromLink (link, linkObj) {
723 let Model

Callers 1

formatDocumentMethod · 0.95

Calls 2

isObjectIDMethod · 0.80

Tested by

no test coverage detected