@formatjs/cli-lib
Version:
Lib for CLI for formatjs.
23 lines (22 loc) • 598 B
JavaScript
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;
};