(res, fileMetadata)
| 18 | } |
| 19 | |
| 20 | export 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 | |
| 41 | export async function linksHandler (req, res, next) { |
| 42 | const ldp = req.app.locals.ldp |
no test coverage detected