( superblock: string, structure: unknown )
| 204 | } |
| 205 | |
| 206 | export async function writeSuperblockStructure( |
| 207 | superblock: string, |
| 208 | structure: unknown |
| 209 | ) { |
| 210 | // dynamically importing prettier because Gatsby build and develop fail when |
| 211 | // it's required. |
| 212 | const prettier = await import('prettier'); |
| 213 | const content = await prettier.format(JSON.stringify(structure), { |
| 214 | parser: 'json' |
| 215 | }); |
| 216 | await writeFile(getSuperblockStructurePath(superblock), content); |
| 217 | } |
| 218 | |
| 219 | export function getSuperblockStructure(superblockFilename: string) { |
| 220 | const superblockPath = getSuperblockStructurePath(superblockFilename); |
no test coverage detected