(stream, { hint = null } = {})
| 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 = []; |
no test coverage detected