MCPcopy Create free account
hub / github.com/ThatGuySam/doesitarm / apiFiles

Method apiFiles

helpers/api/kind.js:97–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95 }
96
97 get apiFiles () {
98 return this.pages.map( kindPage => {
99
100 // If we have a number, we need to add it to the file path
101 const nextPage = kindPage.hasNextPage ? makeKindEndpoint({
102 kindSlug: this.kindSlug,
103 number: kindPage.number + 1
104 }) : ''
105
106 const previousPage = kindPage.hasPreviousPage ? makeKindEndpoint({
107 kindSlug: this.kindSlug,
108 number: kindPage.number - 1
109 }) : ''
110
111 return {
112 path: makeKindFilePath({ kindSlug: this.kindSlug, number: kindPage.number }),
113 content: {
114 number: kindPage.number,
115 previousPage,
116 nextPage,
117 summary: this.summary,
118 items: excludeExtaKindData({
119 rawKindPage: kindPage,
120 }).items
121 }
122 }
123 })
124 }
125
126}
127

Callers

nothing calls this directly

Calls 3

makeKindEndpointFunction · 0.85
makeKindFilePathFunction · 0.85
excludeExtaKindDataFunction · 0.85

Tested by

no test coverage detected