Comparing version 3.1.16 to 3.1.17
@@ -24,5 +24,3 @@ 'use strict'; | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
get: function () { return e[k]; } | ||
}); | ||
@@ -32,3 +30,3 @@ } | ||
} | ||
n['default'] = e; | ||
n["default"] = e; | ||
return Object.freeze(n); | ||
@@ -50,4 +48,4 @@ } | ||
} | ||
chai__default['default'].use(chaiAsPromised__default['default']); | ||
const {assert} = chai__default['default']; | ||
chai__default["default"].use(chaiAsPromised__default["default"]); | ||
const {assert} = chai__default["default"]; | ||
let rawBlocks; | ||
@@ -54,0 +52,0 @@ const pbBlocks = []; |
@@ -20,4 +20,4 @@ 'use strict'; | ||
const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('browser-test/node-test-file-streams.js', document.baseURI).href))); | ||
const __dirname$1 = path__default['default'].dirname(__filename$1); | ||
const tmpCarPath = path__default['default'].join(__dirname$1, 'tmp.car'); | ||
const __dirname$1 = path__default["default"].dirname(__filename$1); | ||
const tmpCarPath = path__default["default"].join(__dirname$1, 'tmp.car'); | ||
describe('Node Streams CarReader.fromIterable()', () => { | ||
@@ -35,3 +35,3 @@ let allBlocksFlattened; | ||
try { | ||
await fs__default['default'].promises.unlink(tmpCarPath); | ||
await fs__default["default"].promises.unlink(tmpCarPath); | ||
} catch (e) { | ||
@@ -41,3 +41,3 @@ } | ||
it('from fixture file', async () => { | ||
const inStream = fs__default['default'].createReadStream(path__default['default'].join(__dirname$1, './go.car')); | ||
const inStream = fs__default["default"].createReadStream(path__default["default"].join(__dirname$1, './go.car')); | ||
const reader = await readerBrowser.CarReader.fromIterable(inStream); | ||
@@ -52,3 +52,3 @@ await verifyStoreReader.verifyRoots(reader); | ||
const {writer, out} = writerBrowser.CarWriter.create(roots); | ||
const pipe = util.promisify(stream.pipeline)(stream.Readable.from(out), fs__default['default'].createWriteStream(tmpCarPath)); | ||
const pipe = util.promisify(stream.pipeline)(stream.Readable.from(out), fs__default["default"].createWriteStream(tmpCarPath)); | ||
for (const block of allBlocksFlattened) { | ||
@@ -63,6 +63,6 @@ await writer.put(block); | ||
].map(async car => { | ||
return (await fs__default['default'].promises.stat(path__default['default'].join(__dirname$1, car))).size; | ||
return (await fs__default["default"].promises.stat(path__default["default"].join(__dirname$1, car))).size; | ||
})); | ||
common.assert.strictEqual(sizes[0], sizes[1]); | ||
const inStream = fs__default['default'].createReadStream(tmpCarPath); | ||
const inStream = fs__default["default"].createReadStream(tmpCarPath); | ||
const reader = await readerBrowser.CarReader.fromIterable(inStream); | ||
@@ -74,4 +74,4 @@ await verifyStoreReader.verifyRoots(reader); | ||
await verifyStoreReader.verifyCids(reader.cids(), true); | ||
await fs__default['default'].promises.unlink(tmpCarPath); | ||
await fs__default["default"].promises.unlink(tmpCarPath); | ||
}); | ||
}); |
@@ -14,6 +14,6 @@ 'use strict'; | ||
const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('browser-test/node-test-indexed-reader.js', document.baseURI).href))); | ||
const __dirname$1 = path__default['default'].dirname(__filename$1); | ||
const __dirname$1 = path__default["default"].dirname(__filename$1); | ||
describe('CarIndexedReader fromFile()', () => { | ||
it('complete', async () => { | ||
const reader = await indexedReaderBrowser.CarIndexedReader.fromFile(path__default['default'].join(__dirname$1, 'go.car')); | ||
const reader = await indexedReaderBrowser.CarIndexedReader.fromFile(path__default["default"].join(__dirname$1, 'go.car')); | ||
await verifyStoreReader.verifyRoots(reader); | ||
@@ -20,0 +20,0 @@ await verifyStoreReader.verifyHas(reader); |
@@ -28,5 +28,3 @@ 'use strict'; | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
get: function () { return e[k]; } | ||
}); | ||
@@ -36,3 +34,3 @@ } | ||
} | ||
n['default'] = e; | ||
n["default"] = e; | ||
return Object.freeze(n); | ||
@@ -51,3 +49,3 @@ } | ||
const {writer, out} = writerBrowser.CarWriter.create([]); | ||
stream.Readable.from(out).pipe(fs__default['default'].createWriteStream('./test.car')); | ||
stream.Readable.from(out).pipe(fs__default["default"].createWriteStream('./test.car')); | ||
let offset = dagCbor__namespace.encode({ | ||
@@ -57,3 +55,3 @@ version: 1, | ||
}).length; | ||
offset += varint__default['default'].encode(offset).length; | ||
offset += varint__default["default"].encode(offset).length; | ||
for (let i = 0; i < 500; i++) { | ||
@@ -68,3 +66,3 @@ const obj = ipldGarbage.garbage(1000); | ||
let length = cid$1.bytes.length + blockLength; | ||
const lengthLength = varint__default['default'].encode(length).length; | ||
const lengthLength = varint__default["default"].encode(length).length; | ||
length += lengthLength; | ||
@@ -88,3 +86,3 @@ const blockOffset = offset + lengthLength + cid$1.bytes.length; | ||
it('CarIndexer.fromIterable', async () => { | ||
const indexer$1 = await indexer.CarIndexer.fromIterable(fs__default['default'].createReadStream('./test.car')); | ||
const indexer$1 = await indexer.CarIndexer.fromIterable(fs__default["default"].createReadStream('./test.car')); | ||
common.assert.deepStrictEqual(await indexer$1.getRoots(), []); | ||
@@ -98,3 +96,3 @@ let i = 0; | ||
it('CarIndexer.fromBytes', async () => { | ||
const indexer$1 = await indexer.CarIndexer.fromBytes(await fs__default['default'].promises.readFile('./test.car')); | ||
const indexer$1 = await indexer.CarIndexer.fromBytes(await fs__default["default"].promises.readFile('./test.car')); | ||
common.assert.deepStrictEqual(await indexer$1.getRoots(), []); | ||
@@ -108,3 +106,3 @@ let i = 0; | ||
it('CarReader.fromBytes', async () => { | ||
const reader = await readerBrowser.CarReader.fromBytes(await fs__default['default'].promises.readFile('./test.car')); | ||
const reader = await readerBrowser.CarReader.fromBytes(await fs__default["default"].promises.readFile('./test.car')); | ||
common.assert.deepStrictEqual(await reader.getRoots(), []); | ||
@@ -120,3 +118,3 @@ let i = 0; | ||
it('CarReader.fromIterable', async () => { | ||
const reader = await readerBrowser.CarReader.fromIterable(fs__default['default'].createReadStream('./test.car')); | ||
const reader = await readerBrowser.CarReader.fromIterable(fs__default["default"].createReadStream('./test.car')); | ||
common.assert.deepStrictEqual(await reader.getRoots(), []); | ||
@@ -143,5 +141,5 @@ let i = 0; | ||
after(async () => { | ||
return fs__default['default'].promises.unlink('./test.car').catch(() => { | ||
return fs__default["default"].promises.unlink('./test.car').catch(() => { | ||
}); | ||
}); | ||
}); |
@@ -17,7 +17,7 @@ 'use strict'; | ||
const fsopen = util.promisify(fs__default['default'].open); | ||
const fsclose = util.promisify(fs__default['default'].close); | ||
const fsopen = util.promisify(fs__default["default"].open); | ||
const fsclose = util.promisify(fs__default["default"].close); | ||
const {toHex} = multiformats.bytes; | ||
const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('browser-test/node-test-raw.js', document.baseURI).href))); | ||
const __dirname$1 = path__default['default'].dirname(__filename$1); | ||
const __dirname$1 = path__default["default"].dirname(__filename$1); | ||
describe('CarReader.readRaw', () => { | ||
@@ -46,3 +46,3 @@ let allBlocksFlattened; | ||
it('read raw using index (fd)', async () => { | ||
const fd = await fsopen(path__default['default'].join(__dirname$1, 'go.car'), 'r'); | ||
const fd = await fsopen(path__default["default"].join(__dirname$1, 'go.car'), 'r'); | ||
await verifyRead(fd); | ||
@@ -52,3 +52,3 @@ await fsclose(fd); | ||
it('read raw using index (FileHandle)', async () => { | ||
const fd = await fs__default['default'].promises.open(path__default['default'].join(__dirname$1, 'go.car'), 'r'); | ||
const fd = await fs__default["default"].promises.open(path__default["default"].join(__dirname$1, 'go.car'), 'r'); | ||
await verifyRead(fd); | ||
@@ -64,3 +64,3 @@ await fd.close(); | ||
badBlock.blockLength += 10; | ||
const fd = await fsopen(path__default['default'].join(__dirname$1, 'go.car'), 'r'); | ||
const fd = await fsopen(path__default["default"].join(__dirname$1, 'go.car'), 'r'); | ||
await common.assert.isRejected(readerBrowser.CarReader.readRaw(fd, badBlock), { | ||
@@ -67,0 +67,0 @@ name: 'Error', |
@@ -18,8 +18,8 @@ 'use strict'; | ||
const fsopen = util.promisify(fs__default['default'].open); | ||
const fsclose = util.promisify(fs__default['default'].close); | ||
const fsopen = util.promisify(fs__default["default"].open); | ||
const fsclose = util.promisify(fs__default["default"].close); | ||
const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('browser-test/node-test-updateroots.js', document.baseURI).href))); | ||
const __dirname$1 = path__default['default'].dirname(__filename$1); | ||
const goCarPath = path__default['default'].join(__dirname$1, 'go.car'); | ||
const tmpCarPath = path__default['default'].join(__dirname$1, 'tmp.car'); | ||
const __dirname$1 = path__default["default"].dirname(__filename$1); | ||
const goCarPath = path__default["default"].join(__dirname$1, 'go.car'); | ||
const tmpCarPath = path__default["default"].join(__dirname$1, 'tmp.car'); | ||
const newRoots = [ | ||
@@ -30,3 +30,3 @@ cid.CID.parse('bafkreidbxzk2ryxwwtqxem4l3xyyjvw35yu4tcct4cqeqxwo47zhxgxqwq'), | ||
async function verify() { | ||
const reader = await readerBrowser.CarReader.fromIterable(fs__default['default'].createReadStream(tmpCarPath)); | ||
const reader = await readerBrowser.CarReader.fromIterable(fs__default["default"].createReadStream(tmpCarPath)); | ||
await common.assert.isRejected(verifyStoreReader.verifyRoots(reader)); | ||
@@ -42,3 +42,3 @@ common.assert.deepEqual(await reader.getRoots(), newRoots); | ||
try { | ||
await fs__default['default'].promises.unlink(tmpCarPath); | ||
await fs__default["default"].promises.unlink(tmpCarPath); | ||
} catch (e) { | ||
@@ -48,6 +48,6 @@ } | ||
beforeEach(async () => { | ||
await fs__default['default'].promises.copyFile(goCarPath, tmpCarPath); | ||
await fs__default["default"].promises.copyFile(goCarPath, tmpCarPath); | ||
}); | ||
afterEach(async () => { | ||
await fs__default['default'].promises.unlink(tmpCarPath); | ||
await fs__default["default"].promises.unlink(tmpCarPath); | ||
}); | ||
@@ -61,3 +61,3 @@ it('update roots (fd)', async () => { | ||
it('update roots (FileHandle)', async () => { | ||
const fd = await fs__default['default'].promises.open(tmpCarPath, 'r+'); | ||
const fd = await fs__default["default"].promises.open(tmpCarPath, 'r+'); | ||
await writerBrowser.CarWriter.updateRootsInFile(fd, newRoots); | ||
@@ -74,3 +74,3 @@ await fd.close(); | ||
it('error: wrong header size', async () => { | ||
const fd = await fs__default['default'].promises.open(tmpCarPath, 'r+'); | ||
const fd = await fs__default["default"].promises.open(tmpCarPath, 'r+'); | ||
await common.assert.isRejected(writerBrowser.CarWriter.updateRootsInFile(fd, [ | ||
@@ -77,0 +77,0 @@ ...newRoots, |
@@ -20,5 +20,3 @@ 'use strict'; | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
get: function () { return e[k]; } | ||
}); | ||
@@ -28,3 +26,3 @@ } | ||
} | ||
n['default'] = e; | ||
n["default"] = e; | ||
return Object.freeze(n); | ||
@@ -31,0 +29,0 @@ } |
@@ -18,5 +18,3 @@ 'use strict'; | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
get: function () { return e[k]; } | ||
}); | ||
@@ -26,3 +24,3 @@ } | ||
} | ||
n['default'] = e; | ||
n["default"] = e; | ||
return Object.freeze(n); | ||
@@ -29,0 +27,0 @@ } |
@@ -21,5 +21,3 @@ 'use strict'; | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
get: function () { return e[k]; } | ||
}); | ||
@@ -29,3 +27,3 @@ } | ||
} | ||
n['default'] = e; | ||
n["default"] = e; | ||
return Object.freeze(n); | ||
@@ -44,4 +42,4 @@ } | ||
const bytes = await reader.upTo(8); | ||
const i = varint__default['default'].decode(bytes); | ||
reader.seek(varint__default['default'].decode.bytes); | ||
const i = varint__default["default"].decode(bytes); | ||
reader.seek(varint__default["default"].decode.bytes); | ||
return i; | ||
@@ -76,6 +74,6 @@ } | ||
const bytes = await reader.upTo(8); | ||
varint__default['default'].decode(bytes); | ||
const codeLength = varint__default['default'].decode.bytes; | ||
const length = varint__default['default'].decode(bytes.subarray(varint__default['default'].decode.bytes)); | ||
const lengthLength = varint__default['default'].decode.bytes; | ||
varint__default["default"].decode(bytes); | ||
const codeLength = varint__default["default"].decode.bytes; | ||
const length = varint__default["default"].decode(bytes.subarray(varint__default["default"].decode.bytes)); | ||
const lengthLength = varint__default["default"].decode.bytes; | ||
const mhLength = codeLength + lengthLength + length; | ||
@@ -82,0 +80,0 @@ const multihash = await reader.exactly(mhLength); |
@@ -17,3 +17,3 @@ 'use strict'; | ||
}); | ||
const varintBytes = varint__default['default'].encode(headerBytes.length); | ||
const varintBytes = varint__default["default"].encode(headerBytes.length); | ||
const header = new Uint8Array(varintBytes.length + headerBytes.length); | ||
@@ -32,3 +32,3 @@ header.set(varintBytes, 0); | ||
const {cid, bytes} = block; | ||
await writer.write(new Uint8Array(varint__default['default'].encode(cid.bytes.length + bytes.length))); | ||
await writer.write(new Uint8Array(varint__default["default"].encode(cid.bytes.length + bytes.length))); | ||
await writer.write(cid.bytes); | ||
@@ -35,0 +35,0 @@ if (bytes.length) { |
@@ -39,3 +39,3 @@ 'use strict'; | ||
if (!this._fd) { | ||
this._fd = await fs__default['default'].promises.open(this._path, 'r'); | ||
this._fd = await fs__default["default"].promises.open(this._path, 'r'); | ||
} | ||
@@ -74,3 +74,3 @@ const readIndex = { | ||
} | ||
const iterable = await indexer.CarIndexer.fromIterable(stream.Readable.from(fs__default['default'].createReadStream(path))); | ||
const iterable = await indexer.CarIndexer.fromIterable(stream.Readable.from(fs__default["default"].createReadStream(path))); | ||
const index = new Map(); | ||
@@ -77,0 +77,0 @@ const order = []; |
@@ -13,3 +13,3 @@ 'use strict'; | ||
const fsread = util.promisify(fs__default['default'].read); | ||
const fsread = util.promisify(fs__default["default"].read); | ||
class CarReader extends readerBrowser.CarReader { | ||
@@ -16,0 +16,0 @@ static async readRaw(fd, blockIndex) { |
@@ -15,4 +15,4 @@ 'use strict'; | ||
const fsread = util.promisify(fs__default['default'].read); | ||
const fswrite = util.promisify(fs__default['default'].write); | ||
const fsread = util.promisify(fs__default["default"].read); | ||
const fswrite = util.promisify(fs__default["default"].write); | ||
class CarWriter extends writerBrowser.CarWriter { | ||
@@ -19,0 +19,0 @@ static async updateRootsInFile(fd, roots) { |
@@ -24,5 +24,3 @@ 'use strict'; | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
get: function () { return e[k]; } | ||
}); | ||
@@ -32,3 +30,3 @@ } | ||
} | ||
n['default'] = e; | ||
n["default"] = e; | ||
return Object.freeze(n); | ||
@@ -50,4 +48,4 @@ } | ||
} | ||
chai__default['default'].use(chaiAsPromised__default['default']); | ||
const {assert} = chai__default['default']; | ||
chai__default["default"].use(chaiAsPromised__default["default"]); | ||
const {assert} = chai__default["default"]; | ||
let rawBlocks; | ||
@@ -54,0 +52,0 @@ const pbBlocks = []; |
@@ -20,4 +20,4 @@ 'use strict'; | ||
const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('node-test/node-test-file-streams.js', document.baseURI).href))); | ||
const __dirname$1 = path__default['default'].dirname(__filename$1); | ||
const tmpCarPath = path__default['default'].join(__dirname$1, 'tmp.car'); | ||
const __dirname$1 = path__default["default"].dirname(__filename$1); | ||
const tmpCarPath = path__default["default"].join(__dirname$1, 'tmp.car'); | ||
describe('Node Streams CarReader.fromIterable()', () => { | ||
@@ -35,3 +35,3 @@ let allBlocksFlattened; | ||
try { | ||
await fs__default['default'].promises.unlink(tmpCarPath); | ||
await fs__default["default"].promises.unlink(tmpCarPath); | ||
} catch (e) { | ||
@@ -41,3 +41,3 @@ } | ||
it('from fixture file', async () => { | ||
const inStream = fs__default['default'].createReadStream(path__default['default'].join(__dirname$1, './go.car')); | ||
const inStream = fs__default["default"].createReadStream(path__default["default"].join(__dirname$1, './go.car')); | ||
const reader$1 = await reader.CarReader.fromIterable(inStream); | ||
@@ -52,3 +52,3 @@ await verifyStoreReader.verifyRoots(reader$1); | ||
const {writer: writer$1, out} = writer.CarWriter.create(roots); | ||
const pipe = util.promisify(stream.pipeline)(stream.Readable.from(out), fs__default['default'].createWriteStream(tmpCarPath)); | ||
const pipe = util.promisify(stream.pipeline)(stream.Readable.from(out), fs__default["default"].createWriteStream(tmpCarPath)); | ||
for (const block of allBlocksFlattened) { | ||
@@ -63,6 +63,6 @@ await writer$1.put(block); | ||
].map(async car => { | ||
return (await fs__default['default'].promises.stat(path__default['default'].join(__dirname$1, car))).size; | ||
return (await fs__default["default"].promises.stat(path__default["default"].join(__dirname$1, car))).size; | ||
})); | ||
common.assert.strictEqual(sizes[0], sizes[1]); | ||
const inStream = fs__default['default'].createReadStream(tmpCarPath); | ||
const inStream = fs__default["default"].createReadStream(tmpCarPath); | ||
const reader$1 = await reader.CarReader.fromIterable(inStream); | ||
@@ -74,4 +74,4 @@ await verifyStoreReader.verifyRoots(reader$1); | ||
await verifyStoreReader.verifyCids(reader$1.cids(), true); | ||
await fs__default['default'].promises.unlink(tmpCarPath); | ||
await fs__default["default"].promises.unlink(tmpCarPath); | ||
}); | ||
}); |
@@ -14,6 +14,6 @@ 'use strict'; | ||
const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('node-test/node-test-indexed-reader.js', document.baseURI).href))); | ||
const __dirname$1 = path__default['default'].dirname(__filename$1); | ||
const __dirname$1 = path__default["default"].dirname(__filename$1); | ||
describe('CarIndexedReader fromFile()', () => { | ||
it('complete', async () => { | ||
const reader = await indexedReader.CarIndexedReader.fromFile(path__default['default'].join(__dirname$1, 'go.car')); | ||
const reader = await indexedReader.CarIndexedReader.fromFile(path__default["default"].join(__dirname$1, 'go.car')); | ||
await verifyStoreReader.verifyRoots(reader); | ||
@@ -20,0 +20,0 @@ await verifyStoreReader.verifyHas(reader); |
@@ -28,5 +28,3 @@ 'use strict'; | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
get: function () { return e[k]; } | ||
}); | ||
@@ -36,3 +34,3 @@ } | ||
} | ||
n['default'] = e; | ||
n["default"] = e; | ||
return Object.freeze(n); | ||
@@ -51,3 +49,3 @@ } | ||
const {writer: writer$1, out} = writer.CarWriter.create([]); | ||
stream.Readable.from(out).pipe(fs__default['default'].createWriteStream('./test.car')); | ||
stream.Readable.from(out).pipe(fs__default["default"].createWriteStream('./test.car')); | ||
let offset = dagCbor__namespace.encode({ | ||
@@ -57,3 +55,3 @@ version: 1, | ||
}).length; | ||
offset += varint__default['default'].encode(offset).length; | ||
offset += varint__default["default"].encode(offset).length; | ||
for (let i = 0; i < 500; i++) { | ||
@@ -68,3 +66,3 @@ const obj = ipldGarbage.garbage(1000); | ||
let length = cid$1.bytes.length + blockLength; | ||
const lengthLength = varint__default['default'].encode(length).length; | ||
const lengthLength = varint__default["default"].encode(length).length; | ||
length += lengthLength; | ||
@@ -88,3 +86,3 @@ const blockOffset = offset + lengthLength + cid$1.bytes.length; | ||
it('CarIndexer.fromIterable', async () => { | ||
const indexer$1 = await indexer.CarIndexer.fromIterable(fs__default['default'].createReadStream('./test.car')); | ||
const indexer$1 = await indexer.CarIndexer.fromIterable(fs__default["default"].createReadStream('./test.car')); | ||
common.assert.deepStrictEqual(await indexer$1.getRoots(), []); | ||
@@ -98,3 +96,3 @@ let i = 0; | ||
it('CarIndexer.fromBytes', async () => { | ||
const indexer$1 = await indexer.CarIndexer.fromBytes(await fs__default['default'].promises.readFile('./test.car')); | ||
const indexer$1 = await indexer.CarIndexer.fromBytes(await fs__default["default"].promises.readFile('./test.car')); | ||
common.assert.deepStrictEqual(await indexer$1.getRoots(), []); | ||
@@ -108,3 +106,3 @@ let i = 0; | ||
it('CarReader.fromBytes', async () => { | ||
const reader$1 = await reader.CarReader.fromBytes(await fs__default['default'].promises.readFile('./test.car')); | ||
const reader$1 = await reader.CarReader.fromBytes(await fs__default["default"].promises.readFile('./test.car')); | ||
common.assert.deepStrictEqual(await reader$1.getRoots(), []); | ||
@@ -120,3 +118,3 @@ let i = 0; | ||
it('CarReader.fromIterable', async () => { | ||
const reader$1 = await reader.CarReader.fromIterable(fs__default['default'].createReadStream('./test.car')); | ||
const reader$1 = await reader.CarReader.fromIterable(fs__default["default"].createReadStream('./test.car')); | ||
common.assert.deepStrictEqual(await reader$1.getRoots(), []); | ||
@@ -143,5 +141,5 @@ let i = 0; | ||
after(async () => { | ||
return fs__default['default'].promises.unlink('./test.car').catch(() => { | ||
return fs__default["default"].promises.unlink('./test.car').catch(() => { | ||
}); | ||
}); | ||
}); |
@@ -17,7 +17,7 @@ 'use strict'; | ||
const fsopen = util.promisify(fs__default['default'].open); | ||
const fsclose = util.promisify(fs__default['default'].close); | ||
const fsopen = util.promisify(fs__default["default"].open); | ||
const fsclose = util.promisify(fs__default["default"].close); | ||
const {toHex} = multiformats.bytes; | ||
const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('node-test/node-test-raw.js', document.baseURI).href))); | ||
const __dirname$1 = path__default['default'].dirname(__filename$1); | ||
const __dirname$1 = path__default["default"].dirname(__filename$1); | ||
describe('CarReader.readRaw', () => { | ||
@@ -46,3 +46,3 @@ let allBlocksFlattened; | ||
it('read raw using index (fd)', async () => { | ||
const fd = await fsopen(path__default['default'].join(__dirname$1, 'go.car'), 'r'); | ||
const fd = await fsopen(path__default["default"].join(__dirname$1, 'go.car'), 'r'); | ||
await verifyRead(fd); | ||
@@ -52,3 +52,3 @@ await fsclose(fd); | ||
it('read raw using index (FileHandle)', async () => { | ||
const fd = await fs__default['default'].promises.open(path__default['default'].join(__dirname$1, 'go.car'), 'r'); | ||
const fd = await fs__default["default"].promises.open(path__default["default"].join(__dirname$1, 'go.car'), 'r'); | ||
await verifyRead(fd); | ||
@@ -64,3 +64,3 @@ await fd.close(); | ||
badBlock.blockLength += 10; | ||
const fd = await fsopen(path__default['default'].join(__dirname$1, 'go.car'), 'r'); | ||
const fd = await fsopen(path__default["default"].join(__dirname$1, 'go.car'), 'r'); | ||
await common.assert.isRejected(reader.CarReader.readRaw(fd, badBlock), { | ||
@@ -67,0 +67,0 @@ name: 'Error', |
@@ -18,8 +18,8 @@ 'use strict'; | ||
const fsopen = util.promisify(fs__default['default'].open); | ||
const fsclose = util.promisify(fs__default['default'].close); | ||
const fsopen = util.promisify(fs__default["default"].open); | ||
const fsclose = util.promisify(fs__default["default"].close); | ||
const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('node-test/node-test-updateroots.js', document.baseURI).href))); | ||
const __dirname$1 = path__default['default'].dirname(__filename$1); | ||
const goCarPath = path__default['default'].join(__dirname$1, 'go.car'); | ||
const tmpCarPath = path__default['default'].join(__dirname$1, 'tmp.car'); | ||
const __dirname$1 = path__default["default"].dirname(__filename$1); | ||
const goCarPath = path__default["default"].join(__dirname$1, 'go.car'); | ||
const tmpCarPath = path__default["default"].join(__dirname$1, 'tmp.car'); | ||
const newRoots = [ | ||
@@ -30,3 +30,3 @@ cid.CID.parse('bafkreidbxzk2ryxwwtqxem4l3xyyjvw35yu4tcct4cqeqxwo47zhxgxqwq'), | ||
async function verify() { | ||
const reader$1 = await reader.CarReader.fromIterable(fs__default['default'].createReadStream(tmpCarPath)); | ||
const reader$1 = await reader.CarReader.fromIterable(fs__default["default"].createReadStream(tmpCarPath)); | ||
await common.assert.isRejected(verifyStoreReader.verifyRoots(reader$1)); | ||
@@ -42,3 +42,3 @@ common.assert.deepEqual(await reader$1.getRoots(), newRoots); | ||
try { | ||
await fs__default['default'].promises.unlink(tmpCarPath); | ||
await fs__default["default"].promises.unlink(tmpCarPath); | ||
} catch (e) { | ||
@@ -48,6 +48,6 @@ } | ||
beforeEach(async () => { | ||
await fs__default['default'].promises.copyFile(goCarPath, tmpCarPath); | ||
await fs__default["default"].promises.copyFile(goCarPath, tmpCarPath); | ||
}); | ||
afterEach(async () => { | ||
await fs__default['default'].promises.unlink(tmpCarPath); | ||
await fs__default["default"].promises.unlink(tmpCarPath); | ||
}); | ||
@@ -61,3 +61,3 @@ it('update roots (fd)', async () => { | ||
it('update roots (FileHandle)', async () => { | ||
const fd = await fs__default['default'].promises.open(tmpCarPath, 'r+'); | ||
const fd = await fs__default["default"].promises.open(tmpCarPath, 'r+'); | ||
await writer.CarWriter.updateRootsInFile(fd, newRoots); | ||
@@ -74,3 +74,3 @@ await fd.close(); | ||
it('error: wrong header size', async () => { | ||
const fd = await fs__default['default'].promises.open(tmpCarPath, 'r+'); | ||
const fd = await fs__default["default"].promises.open(tmpCarPath, 'r+'); | ||
await common.assert.isRejected(writer.CarWriter.updateRootsInFile(fd, [ | ||
@@ -77,0 +77,0 @@ ...newRoots, |
@@ -20,5 +20,3 @@ 'use strict'; | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
get: function () { return e[k]; } | ||
}); | ||
@@ -28,3 +26,3 @@ } | ||
} | ||
n['default'] = e; | ||
n["default"] = e; | ||
return Object.freeze(n); | ||
@@ -31,0 +29,0 @@ } |
@@ -18,5 +18,3 @@ 'use strict'; | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
get: function () { return e[k]; } | ||
}); | ||
@@ -26,3 +24,3 @@ } | ||
} | ||
n['default'] = e; | ||
n["default"] = e; | ||
return Object.freeze(n); | ||
@@ -29,0 +27,0 @@ } |
{ | ||
"name": "@ipld/car", | ||
"version": "3.1.16", | ||
"version": "3.1.17", | ||
"description": "Content Addressable aRchive format reader and writer", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/car.js", |
@@ -17,2 +17,3 @@ { | ||
"strict": true, | ||
"useUnknownInCatchVariables": false, | ||
"alwaysStrict": true, | ||
@@ -19,0 +20,0 @@ "esModuleInterop": true, |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
744458
18351