Skip to content

Commit

Permalink
Update albumParser.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
simon300000 committed Nov 24, 2023
1 parent e488a7d commit 34abaa2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/albumParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type AvailableLocales = typeof availableLocales[number]

async function parseFile<T>(file: string): Promise<T> {
// eslint-disable-next-line no-control-regex
return JSON.parse(String(await fs.readFile(join(__dirname, 'albums', `${file}.json`))).replace(/\n/g, '').replace(/,( |\x09)*}/g, '}').replace(/,( |\x09)*]/g, ']'))
return JSON.parse(String(await fs.readFile(join(__dirname, 'albums', `${file}.json`))).split('\n').filter(line => !line.startsWith('//')).join('').replace(/,( |\x09)*}/g, '}').replace(/,( |\x09)*]/g, ']'))
}

async function readLocale<S, T>(file: string) {
Expand Down

0 comments on commit 34abaa2

Please sign in to comment.