From 68a809e5e9ab2556b23d523b6b47f3100fb19752 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:41:47 +0100 Subject: [PATCH] deps(dev): bump aegir from 38.1.8 to 40.0.0 (#91) Bumps [aegir](https://github.com/ipfs/aegir) from 38.1.8 to 40.0.0. - [Release notes](https://github.com/ipfs/aegir/releases) - [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md) - [Commits](https://github.com/ipfs/aegir/compare/v38.1.8...v40.0.0) --- updated-dependencies: - dependency-name: aegir dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: achingbrain --- package.json | 4 ++-- src/decode.ts | 6 +++--- src/encode.ts | 4 ++-- src/utils.ts | 1 - test/decode.from-reader.spec.ts | 12 ++++++------ test/decode.spec.ts | 18 +++++++++--------- test/e2e.spec.ts | 14 +++++++------- test/encode.single.spec.ts | 2 +- test/encode.spec.ts | 6 +++--- test/helpers/index.ts | 2 +- 10 files changed, 34 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 0e9af4e..3f7ee90 100644 --- a/package.json +++ b/package.json @@ -173,6 +173,7 @@ }, "dependencies": { "err-code": "^3.0.1", + "it-reader": "^6.0.1", "it-stream-types": "^2.0.1", "uint8-varint": "^1.0.1", "uint8arraylist": "^2.0.0", @@ -180,7 +181,7 @@ }, "devDependencies": { "@types/varint": "^6.0.0", - "aegir": "^38.1.8", + "aegir": "^40.0.0", "iso-random-stream": "^2.0.0", "it-all": "^3.0.0", "it-block": "^6.0.0", @@ -189,7 +190,6 @@ "it-map": "^3.0.0", "it-pipe": "^3.0.0", "it-pushable": "^3.0.0", - "it-reader": "^6.0.1", "p-defer": "^4.0.0", "random-int": "^3.0.0", "varint": "^6.0.0" diff --git a/src/decode.ts b/src/decode.ts index 5ea3b27..eb4b66b 100644 --- a/src/decode.ts +++ b/src/decode.ts @@ -1,11 +1,11 @@ /* eslint max-depth: ["error", 6] */ -import { Uint8ArrayList } from 'uint8arraylist' -import { unsigned } from 'uint8-varint' import errCode from 'err-code' +import { unsigned } from 'uint8-varint' +import { Uint8ArrayList } from 'uint8arraylist' +import { isAsyncIterable } from './utils.js' import type { LengthDecoderFunction } from './index.js' import type { Reader } from 'it-reader' -import { isAsyncIterable } from './utils.js' import type { Source } from 'it-stream-types' export interface ReadState { diff --git a/src/encode.ts b/src/encode.ts index 1d741b8..ace52bc 100644 --- a/src/encode.ts +++ b/src/encode.ts @@ -1,8 +1,8 @@ -import { Uint8ArrayList } from 'uint8arraylist' import { unsigned } from 'uint8-varint' -import type { LengthEncoderFunction } from './index.js' +import { Uint8ArrayList } from 'uint8arraylist' import { allocUnsafe } from 'uint8arrays/alloc' import { isAsyncIterable } from './utils.js' +import type { LengthEncoderFunction } from './index.js' import type { Source } from 'it-stream-types' interface EncoderOptions { diff --git a/src/utils.ts b/src/utils.ts index 1497493..5b0e982 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,4 +1,3 @@ - export function isAsyncIterable (thing: any): thing is AsyncIterable { return thing[Symbol.asyncIterator] != null } diff --git a/test/decode.from-reader.spec.ts b/test/decode.from-reader.spec.ts index 36ec22e..6ee00a7 100644 --- a/test/decode.from-reader.spec.ts +++ b/test/decode.from-reader.spec.ts @@ -1,13 +1,13 @@ import { expect } from 'aegir/chai' -import { pipe } from 'it-pipe' -import { reader } from 'it-reader' import randomBytes from 'iso-random-stream/src/random.js' import all from 'it-all' -import varint from 'varint' -import { times, someBytes } from './helpers/index.js' -import * as lp from '../src/index.js' +import { pipe } from 'it-pipe' +import { reader } from 'it-reader' import { Uint8ArrayList } from 'uint8arraylist' import { concat as uint8ArrayConcat } from 'uint8arrays/concat' +import varint from 'varint' +import * as lp from '../src/index.js' +import { times, someBytes } from './helpers/index.js' describe('decode from reader', () => { it('should be able to decode from an it-reader', async () => { @@ -41,7 +41,7 @@ describe('decode from reader', () => { await expect( pipe( lp.decode.fromReader(stream, { maxDataLength: 100 }), - async (source) => await all(source) + async (source) => all(source) ) ).to.eventually.be.rejected.with.property('code', 'ERR_MSG_DATA_TOO_LONG') }) diff --git a/test/decode.spec.ts b/test/decode.spec.ts index 83330bc..573187b 100644 --- a/test/decode.spec.ts +++ b/test/decode.spec.ts @@ -1,18 +1,18 @@ import { expect } from 'aegir/chai' -import { pipe } from 'it-pipe' -import randomInt from 'random-int' import randomBytes from 'iso-random-stream/src/random.js' import all from 'it-all' -import varint from 'varint' -import { Uint8ArrayList } from 'uint8arraylist' +import { block } from 'it-block' +import { pipe } from 'it-pipe' import defer from 'p-defer' +import randomInt from 'random-int' +import { unsigned } from 'uint8-varint' +import { Uint8ArrayList } from 'uint8arraylist' import { concat as uint8ArrayConcat } from 'uint8arrays/concat' -import { times } from './helpers/index.js' -import * as lp from '../src/index.js' +import varint from 'varint' import { MAX_LENGTH_LENGTH, MAX_DATA_LENGTH } from '../src/decode.js' +import * as lp from '../src/index.js' +import { times } from './helpers/index.js' import { int32BEDecode } from './helpers/int32BE-decode.js' -import { block } from 'it-block' -import { unsigned } from 'uint8-varint' describe('decode', () => { it('should decode single message', async () => { @@ -37,7 +37,7 @@ describe('decode', () => { bytes ) - const [output] = await pipe([input], block(1), (source) => lp.decode(source), async (source) => await all(source)) + const [output] = await pipe([input], block(1), (source) => lp.decode(source), async (source) => all(source)) expect(output.slice(-byteLength)).to.deep.equal(bytes) }) diff --git a/test/e2e.spec.ts b/test/e2e.spec.ts index 7f7cce7..6a69898 100644 --- a/test/e2e.spec.ts +++ b/test/e2e.spec.ts @@ -1,17 +1,17 @@ import { expect } from 'aegir/chai' -import varint from 'varint' -import { pipe } from 'it-pipe' -import { block } from 'it-block' -import { pushable } from 'it-pushable' import all from 'it-all' -import map from 'it-map' +import { block } from 'it-block' import each from 'it-foreach' +import map from 'it-map' +import { pipe } from 'it-pipe' +import { pushable } from 'it-pushable' import { Uint8ArrayList } from 'uint8arraylist' -import * as lp from '../src/index.js' import { concat as uint8ArrayConcat } from 'uint8arrays/concat' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' -import { int32BEEncode } from './helpers/int32BE-encode.js' +import varint from 'varint' +import * as lp from '../src/index.js' import { int32BEDecode } from './helpers/int32BE-decode.js' +import { int32BEEncode } from './helpers/int32BE-encode.js' describe('e2e', () => { it('basics', async () => { diff --git a/test/encode.single.spec.ts b/test/encode.single.spec.ts index acaa91c..31e0ea8 100644 --- a/test/encode.single.spec.ts +++ b/test/encode.single.spec.ts @@ -1,7 +1,7 @@ import { expect } from 'aegir/chai' import varint from 'varint' -import { someBytes } from './helpers/index.js' import * as lp from '../src/index.js' +import { someBytes } from './helpers/index.js' import { int32BEEncode } from './helpers/int32BE-encode.js' describe('encode.single', () => { diff --git a/test/encode.spec.ts b/test/encode.spec.ts index 19428ac..bbe849c 100644 --- a/test/encode.spec.ts +++ b/test/encode.spec.ts @@ -1,12 +1,12 @@ import { expect } from 'aegir/chai' +import all from 'it-all' import { pipe } from 'it-pipe' import randomInt from 'random-int' -import all from 'it-all' import { unsigned } from 'uint8-varint' -import { times, someBytes } from './helpers/index.js' +import { Uint8ArrayList } from 'uint8arraylist' import * as lp from '../src/index.js' +import { times, someBytes } from './helpers/index.js' import { int32BEEncode } from './helpers/int32BE-encode.js' -import { Uint8ArrayList } from 'uint8arraylist' describe('encode', () => { it('should encode length as prefix', async () => { diff --git a/test/helpers/index.ts b/test/helpers/index.ts index e24df1e..72ded3d 100644 --- a/test/helpers/index.ts +++ b/test/helpers/index.ts @@ -1,5 +1,5 @@ -import randomInt from 'random-int' import randomBytes from 'iso-random-stream/src/random.js' +import randomInt from 'random-int' export function times (n: number, fn: (...args: any[]) => T): T[] { return Array.from(Array(n)).fill(fn())