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

Function buildReferences

ui/src/selectors.js:299–322  ·  view source on GitHub ↗
(references, schema)

Source from the content-addressed store, hash-verified

297}
298
299function buildReferences(references, schema) {
300 if (!schema) {
301 return { ...references, results: [] };
302 }
303 references.results = references.results || [];
304 references.results = references.results.map((ref) => {
305 if (!!ref.schema) {
306 return ref;
307 }
308 const reverse = schema.getProperty(ref.property);
309 const property = reverse.getReverse();
310 return {
311 schema: property.schema,
312 property,
313 reverse,
314 count: ref.count,
315 };
316 });
317 references.results = references.results.filter(
318 (ref) => ref.reverse.stub && !ref.reverse.hidden
319 );
320 references.total = references.results.length;
321 return references;
322}
323
324export function selectEntityExpandResult(state, query) {
325 return selectObject(state, state.results, query.toKey());

Callers 2

selectEntityReferencesFunction · 0.85
selectProfileReferencesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected