diff --git a/index.js b/index.js index 2fa82f2..491f76e 100644 --- a/index.js +++ b/index.js @@ -79,7 +79,11 @@ module.exports = function(babel) delete strings[path.hub.file.opts.filename]; const arrays = { ...strings }; for (let k in arrays) + { arrays[k] = Object.keys(arrays[k]); + if (!arrays[k].length) + delete arrays[k]; + } fs.writeFileSync( path.hub.file.opts.root+'/'+(state.opts['output'] || 'react-translate-output.json'), JSON.stringify(arrays, null, 2) diff --git a/package.json b/package.json index a9c9bd3..2e1a39a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-react-translate", - "version": "1.0.1", + "version": "1.0.2", "description": "Babel-based JS/JSX auto-translator for Russian language", "main": "index.js", "scripts": {