Skip to content

Commit 893f860

Browse files
authored
Handle keys that use numbers
When using the auto id generator id's get get generated as numbers. These will cause arrays to be built when using unflatten. By sending in `object: true` the arrays won't be generated
1 parent 002f852 commit 893f860

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ module.exports = async (locales, pattern, buildDir, opts) => {
102102

103103
const fomattedLocaleMap = opts.flat
104104
? sortKeys(localeMap, { deep: true })
105-
: unflatten(sortKeys(localeMap), { delimiter })
105+
: unflatten(sortKeys(localeMap), { delimiter, object: true })
106106

107107
const fn = isJson(opts.format) ? writeJson : writeYaml
108108

0 commit comments

Comments
 (0)