| 337 | export const fromKebab = x => x.replace(/-/g, '_') |
| 338 | |
| 339 | function createJsonTransform(fn) { |
| 340 | return function jsonTransform(x, column) { |
| 341 | return typeof x === 'object' && x !== null && (column.type === 114 || column.type === 3802) |
| 342 | ? Array.isArray(x) |
| 343 | ? x.map(x => jsonTransform(x, column)) |
| 344 | : Object.entries(x).reduce((acc, [k, v]) => Object.assign(acc, { [fn(k)]: jsonTransform(v, column) }), {}) |
| 345 | : x |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | toCamel.column = { from: toCamel } |
| 350 | toCamel.value = { from: createJsonTransform(toCamel) } |