| 2 | |
| 3 | const stringify = obj => JSON.stringify(obj, null, 2) |
| 4 | const parse = str => JSON.parse(str, (_, v) => { |
| 5 | if ( |
| 6 | v !== null && |
| 7 | typeof v === 'object' && |
| 8 | 'type' in v && |
| 9 | v.type === 'Buffer' && |
| 10 | 'data' in v && |
| 11 | Array.isArray(v.data)) { |
| 12 | return Buffer.from(v.data) |
| 13 | } |
| 14 | return v |
| 15 | }) |
| 16 | class CloudDBAdapter { |
| 17 | constructor(url, { |
| 18 | serialize = stringify, |
nothing calls this directly
no outgoing calls
no test coverage detected