(csdlNavProperty, schema)
| 7250 | // -> association |
| 7251 | |
| 7252 | function getAssociation(csdlNavProperty, schema) { |
| 7253 | var assocName = parseTypeName(csdlNavProperty.relationship, schema).shortTypeName; |
| 7254 | var assocs = schema.association; |
| 7255 | if (!assocs) return null; |
| 7256 | if (!Array.isArray(assocs)) { |
| 7257 | assocs = [assocs]; |
| 7258 | } |
| 7259 | var association = __arrayFirst(assocs, function (assoc) { |
| 7260 | return assoc.name === assocName; |
| 7261 | }); |
| 7262 | return association; |
| 7263 | } |
| 7264 | |
| 7265 | // schema is only needed for navProperty type name |
| 7266 | function parseTypeName(entityTypeName, schema) { |
no test coverage detected