UNPKG

@formatjs/cli-lib

Version:
20 lines (19 loc) 536 B
export const format = msgs => { const results = {}; for (const [id, msg] of Object.entries(msgs)) { results[id] = { string: msg.defaultMessage, developer_comment: 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)) { results[id] = msg.string; } return results; };