MCPcopy
hub / github.com/entropic-dev/entropic / add

Method add

services/storage/lib/object-storage.js:18–28  ·  view source on GitHub ↗
(stream, { hint = null } = {})

Source from the content-addressed store, hash-verified

16 }
17
18 async add(stream, { hint = null } = {}) {
19 stream.resume();
20 const chunks = [];
21 stream.on('data', chunk => chunks.push(chunk));
22 const integrity = await ssri.fromStream(stream, {
23 algorithms: this.algorithms
24 });
25 const data = Buffer.concat(chunks);
26 const result = await this.addBuffer(integrity, data, { hint });
27 return result;
28 }
29
30 async addBuffer(integrity, data, { hint = null } = {}) {
31 const targets = [];

Callers 6

mainFunction · 0.45
visitPackageFunction · 0.45
addBufferMethod · 0.45
addMethod · 0.45
syncVersionFunction · 0.45
versionCreateFunction · 0.45

Calls 1

addBufferMethod · 0.95

Tested by

no test coverage detected