-function pageToStartAndCount (page: number, itemsPerPage: number) {
- const start = (page - 1) * itemsPerPage
-
- return { start, count: itemsPerPage }
-}
-
-function mapToJSON (map: Map<any, any>) {
- const obj: any = {}
-
- for (const [ k, v ] of map) {
- obj[k] = v
- }
-
- return obj
-}
-
-function buildPath (path: string) {
- if (isAbsolute(path)) return path
-
- return join(root(), path)
-}