mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
14 lines
358 B
TypeScript
14 lines
358 B
TypeScript
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)
|
|
}
|