()
| 244 | } |
| 245 | |
| 246 | validate() { |
| 247 | const errors = []; |
| 248 | this.mappingItems.forEach(({ id, properties, schema }) => { |
| 249 | if (this.getMappingKeys(id).length === 0) { |
| 250 | errors.push({ error: 'keyError', values: { id } }); |
| 251 | } |
| 252 | if (schema.isEdge) { |
| 253 | const { source, target } = schema.edge; |
| 254 | |
| 255 | if (!properties[source] || !properties[target]) { |
| 256 | errors.push({ |
| 257 | error: 'relationshipError', |
| 258 | values: { id, source, target }, |
| 259 | }); |
| 260 | } |
| 261 | } |
| 262 | }); |
| 263 | return errors; |
| 264 | } |
| 265 | |
| 266 | clone() { |
| 267 | return MappingList.fromApiFormat(this.model, this.mappingItems); |
no test coverage detected