MCPcopy Create free account
hub / github.com/alephdata/aleph / validate

Method validate

ui/src/components/MappingEditor/MappingList.js:246–264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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);

Callers 8

createMethod · 0.80
check_entity_idFunction · 0.80
check_urlFunction · 0.80
check_languageFunction · 0.80
check_country_codeFunction · 0.80
check_partial_dateFunction · 0.80
validate_entityFunction · 0.80
validateMappingsMethod · 0.80

Calls 2

getMappingKeysMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected