From 893f86066ef0c07e07689b52b9f84f2c58ca9254 Mon Sep 17 00:00:00 2001 From: Solomon English Date: Mon, 14 Jan 2019 13:43:34 -0800 Subject: [PATCH] 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 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index fff5074..565119a 100644 --- a/index.js +++ b/index.js @@ -102,7 +102,7 @@ module.exports = async (locales, pattern, buildDir, opts) => { const fomattedLocaleMap = opts.flat ? sortKeys(localeMap, { deep: true }) - : unflatten(sortKeys(localeMap), { delimiter }) + : unflatten(sortKeys(localeMap), { delimiter, object: true }) const fn = isJson(opts.format) ? writeJson : writeYaml