Skip to content

Commit

Permalink
sort namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
rawand-faraidun committed Nov 27, 2023
1 parent e5b3313 commit 562c912
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ export const getPath = (...paths: string[]) => resolve(rootPath, config.localesP
* @returns array of namespaces
*/
export const getNamespaces = () =>
config.useSingleFile
(config.useSingleFile
? Object.keys(JSON.parse(readFileSync(getPath(`${config.defaultLocale}.json`), 'utf-8')))
: readdirSync(getPath(config.defaultLocale)).filter(file => extname(file) == '.json')
).sort()

/**
* gets content of a file as json
Expand Down

0 comments on commit 562c912

Please sign in to comment.