Function
excludeExtaKindData
( { rawKindPage, excludes = defaultExludedProperties } = {} )
Source from the content-addressed store, hash-verified
| 20 | ] |
| 21 | |
| 22 | function excludeExtaKindData ( { rawKindPage, excludes = defaultExludedProperties } = {} ) { |
| 23 | |
| 24 | return { |
| 25 | ...rawKindPage, |
| 26 | items: rawKindPage.items.map( item => { |
| 27 | for ( const exclude of excludes ) { |
| 28 | delete item[ exclude ] |
| 29 | } |
| 30 | |
| 31 | return item |
| 32 | }) |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | function makeKindEndpoint ({ kindSlug, number = null }) { |
| 37 | if ( number ) { |
Tested by
no test coverage detected