mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 17:25:59 +02:00
11 lines
352 B
TypeScript
11 lines
352 B
TypeScript
import { IAllResourcesQuery, IFileQuery } from "../../types"
|
|
import { join, traversePathsToFiles } from "../../utils"
|
|
|
|
export default function useBuildTree(resources: IAllResourcesQuery) {
|
|
const objects = resources.allFile.edges.map(({ node: file }: IFileQuery) =>
|
|
traversePathsToFiles(file.relativePath.split("/"))
|
|
)
|
|
|
|
return join(objects)
|
|
}
|