MCPcopy Create free account
hub / github.com/Lazack28/Lazack-Device / parse

Function parse

lib/cloudDBAdapter.js:4–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2
3const stringify = obj => JSON.stringify(obj, null, 2)
4const 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})
16class CloudDBAdapter {
17 constructor(url, {
18 serialize = stringify,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected