index.jsView |
---|
1 | 1 … | const Graph = require('ipld-graph-builder') |
| 2 … | +const Buffer = require('safe-buffer').Buffer |
2 | 3 … | const Uint1Array = require('uint1array') |
3 | 4 … | const TextEncoder = require('text-encoding').TextEncoder |
4 | 5 … | |
5 | 6 … | const encoder = new TextEncoder('utf-8') |
286 | 287 … | } |
287 | 288 … | |
288 | 289 … | function setExtension (node, ex) { |
289 | 290 … | if (ex && ex.length) { |
290 | | - node['/'][EXTENSION] = [ex.length, new Buffer(ex.buffer)] |
| 291 … | + node['/'][EXTENSION] = [ex.length, Buffer.from(ex.buffer)] |
291 | 292 … | } else { |
292 | 293 … | if (getValue(node) === undefined && node['/'][EXTENSION] !== undefined) { |
293 | 294 … | node['/'].pop() |
294 | 295 … | } else if (node['/'][EXTENSION] !== undefined) { |