UNPKG

@formatjs/cli-lib

Version:
23 lines (22 loc) 598 B
export const format = msgs => { const results = {}; for (const [id, msg] of Object.entries(msgs)) { results[id] = { message: msg.defaultMessage, description: typeof msg.description === 'string' ? msg.description : JSON.stringify(msg.description), }; } return results; }; export const compile = msgs => { const results = {}; for (const [id, msg] of Object.entries(msgs)) { if (id === 'smartling') { continue; } results[id] = msg.message; } return results; };