(superblockFilename: string)
| 217 | } |
| 218 | |
| 219 | export function getSuperblockStructure(superblockFilename: string) { |
| 220 | const superblockPath = getSuperblockStructurePath(superblockFilename); |
| 221 | |
| 222 | if (!existsSync(superblockPath)) { |
| 223 | throw Error(`Superblock file not found: ${superblockPath}`); |
| 224 | } |
| 225 | |
| 226 | return JSON.parse(readFileSync(superblockPath, 'utf8')) as { |
| 227 | blocks?: string[]; |
| 228 | chapters?: Chapter[]; |
| 229 | }; |
| 230 | } |
| 231 | |
| 232 | export function getSuperblockStructurePath(superblockFilename: string) { |
| 233 | return resolve(STRUCTURE_DIR, 'superblocks', `${superblockFilename}.json`); |
no test coverage detected