Function
createFilterSelection
(sectionName, data, prefix = 'tag')
Source from the content-addressed store, hash-verified
| 60 | ` |
| 61 | |
| 62 | function createFilterSelection(sectionName, data, prefix = 'tag') { |
| 63 | return { |
| 64 | name: sectionName, |
| 65 | items: data.map((tag) => { |
| 66 | let item = { |
| 67 | id: prefix + ':' + tag, |
| 68 | name: tag, |
| 69 | } |
| 70 | if (tag.toString() === '[object Object]') { |
| 71 | item.name = tag.name |
| 72 | item.id = prefix + ':' + tag.id |
| 73 | item.parent = tag.parent ? prefix + ':' + tag.parent.id : null |
| 74 | } |
| 75 | return item |
| 76 | }), |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | const REMOVABLE_TAGS = [ |
| 81 | 'Aperture', |
Tested by
no test coverage detected