MCPcopy Index your code
hub / github.com/nodeSolidServer/node-solid-server / addLinks

Function addLinks

lib/header.mjs:20–39  ·  view source on GitHub ↗
(res, fileMetadata)

Source from the content-addressed store, hash-verified

18}
19
20export function addLinks (res, fileMetadata) {
21 if (fileMetadata.isResource) {
22 addLink(res, 'http://www.w3.org/ns/ldp#Resource', 'type')
23 }
24 if (fileMetadata.isSourceResource) {
25 addLink(res, 'http://www.w3.org/ns/ldp#RDFSource', 'type')
26 }
27 if (fileMetadata.isContainer) {
28 addLink(res, 'http://www.w3.org/ns/ldp#Container', 'type')
29 }
30 if (fileMetadata.isBasicContainer) {
31 addLink(res, 'http://www.w3.org/ns/ldp#BasicContainer', 'type')
32 }
33 if (fileMetadata.isDirectContainer) {
34 addLink(res, 'http://www.w3.org/ns/ldp#DirectContainer', 'type')
35 }
36 if (fileMetadata.isStorage) {
37 addLink(res, 'http://www.w3.org/ns/pim/space#Storage', 'type')
38 }
39}
40
41export async function linksHandler (req, res, next) {
42 const ldp = req.app.locals.ldp

Callers 1

linksHandlerFunction · 0.85

Calls 1

addLinkFunction · 0.85

Tested by

no test coverage detected