1 2 3 4 5 6 7 8 9 10 11 12 | 2x 3x 6x 6x 2x 3x 2x | export function formatMatter< C extends {data: {[prop: string]: object | string}} >(ctx: C): C { Object.keys(ctx.data).forEach(item => { const target = ctx.data[item]; if ((item !== 'NOTE' && typeof target !== 'object') || target === null) { ctx.data[item] = {default: target}; } }); return ctx; } |