import {CompileFn, FormatFn} from './default' export type SmartlingJson = Record< string, { message: string description?: string } > export const format: FormatFn = msgs => { const results: SmartlingJson = {} for (const [id, msg] of Object.entries(msgs)) { results[id] = { message: msg.defaultMessage!, description: msg.description, } } return results } export const compile: CompileFn = msgs => { const results: Record = {} for (const [id, msg] of Object.entries(msgs)) { if (id === 'smartling') { continue } results[id] = msg.message } return results }