feat(archives): bootstrap what-is-archives from Github

This commit is contained in:
Jean-Philippe Sirois
2019-11-11 15:40:52 -08:00
parent 51eeb489e5
commit 7cc1e4c899
33 changed files with 578 additions and 242 deletions
+13
View File
@@ -0,0 +1,13 @@
import { IAllFilesQuery, IFileQuery } from "../types"
import { join, traversePaths } from "../utils"
export default function useBuildTree(
resources: IAllFilesQuery,
basePath: string
) {
const objects = resources.allFile.edges.map(({ node: file }: IFileQuery) =>
traversePaths(file.relativePath.split("/"), basePath)
)
return join(objects)
}