(data, options)
| 32 | }; |
| 33 | |
| 34 | const convert = (data, options) => { |
| 35 | if (data.length === 1) data = data[0]; |
| 36 | options = Object.assign({}, defaultOptions, options); |
| 37 | options._lc = { [options.defaultLocale]: true }; |
| 38 | const translations = convertData(data, options.defaultLocale, options); |
| 39 | return { |
| 40 | locales: Object.keys(options._lc).filter(lc => lc), |
| 41 | translations |
| 42 | }; |
| 43 | }; |
| 44 | |
| 45 | module.exports = convert; |