From f86f950c78ac918477454c7ec32d864181912db2 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Tue, 15 Sep 2020 15:52:23 +0100 Subject: [PATCH] chore: update deps --- packages/blob-to-it/package.json | 2 +- .../browser-readablestream-to-it/package.json | 2 +- packages/it-all/package.json | 6 ++--- packages/it-all/test.js | 4 ++-- packages/it-batch/package.json | 6 ++--- packages/it-batch/test.js | 6 ++--- packages/it-buffer-stream/index.js | 22 +++++++++++++------ packages/it-buffer-stream/package-lock.json | 21 ++++++++++++++++++ packages/it-buffer-stream/package.json | 11 +++++----- packages/it-buffer-stream/test.js | 6 ++--- packages/it-drain/package.json | 6 ++--- packages/it-drain/test.js | 4 ++-- packages/it-filter/package.json | 6 ++--- packages/it-filter/test.js | 6 ++--- packages/it-first/package.json | 6 ++--- packages/it-first/test.js | 4 ++-- packages/it-flat-batch/package.json | 6 ++--- packages/it-flat-batch/test.js | 6 ++--- packages/it-glob/package.json | 8 +++---- packages/it-glob/test.js | 8 +++---- packages/it-last/package.json | 6 ++--- packages/it-last/test.js | 4 ++-- packages/it-length/package.json | 6 ++--- packages/it-length/test.js | 4 ++-- packages/it-map/package.json | 6 ++--- packages/it-map/test.js | 4 ++-- packages/it-multipart/package.json | 8 +++---- packages/it-multipart/test.js | 12 +++++----- packages/it-parallel-batch/package.json | 6 ++--- packages/it-parallel-batch/test.js | 8 +++---- packages/it-peekable/package.json | 6 ++--- packages/it-peekable/test.js | 6 ++--- packages/it-reduce/package.json | 6 ++--- packages/it-reduce/test.js | 4 ++-- .../it-to-browser-readablestream/package.json | 8 +++---- packages/it-to-browser-readablestream/test.js | 4 ++-- packages/it-to-buffer/package.json | 6 ++--- packages/it-to-buffer/test.js | 4 ++-- 38 files changed, 142 insertions(+), 112 deletions(-) create mode 100644 packages/it-buffer-stream/package-lock.json diff --git a/packages/blob-to-it/package.json b/packages/blob-to-it/package.json index 99a33f28..d8d23515 100644 --- a/packages/blob-to-it/package.json +++ b/packages/blob-to-it/package.json @@ -28,7 +28,7 @@ "mocha": "8.0.1", "playwright-test": "^0.7.1", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "typesVersions": { "*": { diff --git a/packages/browser-readablestream-to-it/package.json b/packages/browser-readablestream-to-it/package.json index aa2a58a7..fc8cfa1e 100644 --- a/packages/browser-readablestream-to-it/package.json +++ b/packages/browser-readablestream-to-it/package.json @@ -23,7 +23,7 @@ "mocha": "8.0.1", "playwright-test": "^0.7.1", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "typesVersions": { "*": { diff --git a/packages/it-all/package.json b/packages/it-all/package.json index d276798f..2e2cc072 100644 --- a/packages/it-all/package.json +++ b/packages/it-all/package.json @@ -18,10 +18,10 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", - "nyc": "^14.0.0", + "ava": "^3.12.1", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "typesVersions": { "*": { diff --git a/packages/it-all/test.js b/packages/it-all/test.js index 96314fa9..30914a75 100644 --- a/packages/it-all/test.js +++ b/packages/it-all/test.js @@ -1,5 +1,5 @@ -import all from './' -import test from 'ava' +const all = require('./') +const test = require('ava') test('Should collect all entries of an async iterator as an array', async (t) => { const values = [0, 1, 2, 3, 4] diff --git a/packages/it-batch/package.json b/packages/it-batch/package.json index f5fe19ce..fb38c5ef 100644 --- a/packages/it-batch/package.json +++ b/packages/it-batch/package.json @@ -18,11 +18,11 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", + "ava": "^3.12.1", "it-all": "^1.0.2", - "nyc": "^14.0.0", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "typesVersions": { "*": { diff --git a/packages/it-batch/test.js b/packages/it-batch/test.js index 527ed87c..57b694c9 100644 --- a/packages/it-batch/test.js +++ b/packages/it-batch/test.js @@ -1,6 +1,6 @@ -import batch from './' -import test from 'ava' -import all from 'it-all' +const batch = require('./') +const test = require('ava') +const all = require('it-all') test('Should batch up entries', async (t) => { const values = [0, 1, 2, 3, 4] diff --git a/packages/it-buffer-stream/index.js b/packages/it-buffer-stream/index.js index d7b61ebb..1ada1c97 100644 --- a/packages/it-buffer-stream/index.js +++ b/packages/it-buffer-stream/index.js @@ -10,7 +10,14 @@ const randomBytes = require('iso-random-stream/src/random') * @property {function(number):Promise|Buffer} [generator] */ -/** @type {Options} */ + /** + * @typedef {Object} ActualOptions + * @property {number} chunkSize + * @property {function(Buffer):void} collector + * @property {function(number):Promise|Buffer} generator + */ + +/** @type {ActualOptions} */ const defaultOptions = { chunkSize: 4096, collector: () => {}, @@ -25,25 +32,26 @@ const defaultOptions = { * @returns {AsyncIterable} */ async function * bufferStream (limit, options = {}) { - options = Object.assign({}, defaultOptions, options) + /** @type {ActualOptions} */ + const opts = Object.assign({}, defaultOptions, options) let emitted = 0 const arr = [] - arr.length = Math.ceil(limit / options.chunkSize) + arr.length = Math.ceil(limit / opts.chunkSize) while (emitted < limit) { - const nextLength = emitted + options.chunkSize - let nextChunkSize = options.chunkSize + const nextLength = emitted + opts.chunkSize + let nextChunkSize = opts.chunkSize if (nextLength > limit) { // emit the final chunk nextChunkSize = limit - emitted } - let bytes = await options.generator(nextChunkSize) + let bytes = await opts.generator(nextChunkSize) bytes = bytes.slice(0, nextChunkSize) - options.collector(bytes) + opts.collector(bytes) emitted += nextChunkSize yield bytes diff --git a/packages/it-buffer-stream/package-lock.json b/packages/it-buffer-stream/package-lock.json new file mode 100644 index 00000000..7d64aa0c --- /dev/null +++ b/packages/it-buffer-stream/package-lock.json @@ -0,0 +1,21 @@ +{ + "name": "it-buffer-stream", + "version": "1.0.3", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" + }, + "merge-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.2.tgz", + "integrity": "sha512-7TM9KD5J6TfT7Frs7PUnhA7Agkuag/vG9BdDbFtP54mrquqflOTJ30QXzlpI/ZX2cLDi6lw96eRF3ZhxkUVgKw==", + "requires": { + "is-plain-obj": "^2.1.0" + } + } + } +} diff --git a/packages/it-buffer-stream/package.json b/packages/it-buffer-stream/package.json index 00bc8844..d7914226 100644 --- a/packages/it-buffer-stream/package.json +++ b/packages/it-buffer-stream/package.json @@ -18,14 +18,15 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", + "ava": "^3.12.1", "buffer": "^5.5.0", - "nyc": "^14.0.0", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "dependencies": { - "iso-random-stream": "^1.1.1" + "iso-random-stream": "^1.1.1", + "merge-options": "^3.0.2" }, "typesVersions": { "*": { @@ -35,4 +36,4 @@ ] } } -} \ No newline at end of file +} diff --git a/packages/it-buffer-stream/test.js b/packages/it-buffer-stream/test.js index f978bbca..a54f4726 100644 --- a/packages/it-buffer-stream/test.js +++ b/packages/it-buffer-stream/test.js @@ -1,6 +1,6 @@ -import bufferStream from './' -import test from 'ava' -import { Buffer } from 'buffer' +const bufferStream = require('./') +const test = require('ava') +const { Buffer } = require('buffer') test('Should emit bytes', async (t) => { const expected = 100 diff --git a/packages/it-drain/package.json b/packages/it-drain/package.json index 011c492a..adaf5178 100644 --- a/packages/it-drain/package.json +++ b/packages/it-drain/package.json @@ -18,10 +18,10 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", - "nyc": "^14.0.0", + "ava": "^3.12.1", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "typesVersions": { "*": { diff --git a/packages/it-drain/test.js b/packages/it-drain/test.js index fbc11b52..8f9abbdb 100644 --- a/packages/it-drain/test.js +++ b/packages/it-drain/test.js @@ -1,5 +1,5 @@ -import drain from './' -import test from 'ava' +const drain = require('./') +const test = require('ava') test('Should empty an async iterator', async (t) => { let done = false diff --git a/packages/it-filter/package.json b/packages/it-filter/package.json index 759edd2c..371b30e9 100644 --- a/packages/it-filter/package.json +++ b/packages/it-filter/package.json @@ -18,11 +18,11 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", + "ava": "^3.12.1", "it-all": "^1.0.2", - "nyc": "^14.0.0", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "typesVersions": { "*": { diff --git a/packages/it-filter/test.js b/packages/it-filter/test.js index 47349b56..2c157e59 100644 --- a/packages/it-filter/test.js +++ b/packages/it-filter/test.js @@ -1,6 +1,6 @@ -import all from 'it-all' -import filter from './' -import test from 'ava' +const all = require('it-all') +const filter = require('./') +const test = require('ava') test('Should filter all values greater than 2', async (t) => { const values = [0, 1, 2, 3, 4] diff --git a/packages/it-first/package.json b/packages/it-first/package.json index 662757e2..bf50aef6 100644 --- a/packages/it-first/package.json +++ b/packages/it-first/package.json @@ -18,10 +18,10 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", - "nyc": "^14.0.0", + "ava": "^3.12.1", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "typesVersions": { "*": { diff --git a/packages/it-first/test.js b/packages/it-first/test.js index cb64fb13..dcdc6f0d 100644 --- a/packages/it-first/test.js +++ b/packages/it-first/test.js @@ -1,5 +1,5 @@ -import first from './' -import test from 'ava' +const first = require('./') +const test = require('ava') test('Should return only the first result from an async iterator', async (t) => { const values = [0, 1, 2, 3, 4] diff --git a/packages/it-flat-batch/package.json b/packages/it-flat-batch/package.json index b8d54cd2..fe844068 100644 --- a/packages/it-flat-batch/package.json +++ b/packages/it-flat-batch/package.json @@ -18,11 +18,11 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", + "ava": "^3.12.1", "it-all": "^1.0.2", - "nyc": "^14.0.0", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "typesVersions": { "*": { diff --git a/packages/it-flat-batch/test.js b/packages/it-flat-batch/test.js index 70c8d389..3a9c3b30 100644 --- a/packages/it-flat-batch/test.js +++ b/packages/it-flat-batch/test.js @@ -1,6 +1,6 @@ -import batch from './' -import test from 'ava' -import all from 'it-all' +const batch = require('./') +const test = require('ava') +const all = require('it-all') test('Should batch up emitted arrays', async (t) => { const values = [[0, 1, 2], [3], [4]] diff --git a/packages/it-glob/package.json b/packages/it-glob/package.json index 56369732..3d2a52fe 100644 --- a/packages/it-glob/package.json +++ b/packages/it-glob/package.json @@ -18,15 +18,15 @@ "author": "Alex Potsides ", "license": "ISC", "dependencies": { - "fs-extra": "^8.1.0", + "fs-extra": "^9.0.1", "minimatch": "^3.0.4" }, "devDependencies": { - "ava": "^2.4.0", + "ava": "^3.12.1", "it-all": "^1.0.2", - "nyc": "^14.0.0", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "browser": { "fs-extra": false diff --git a/packages/it-glob/test.js b/packages/it-glob/test.js index 0942cf03..e28465a7 100644 --- a/packages/it-glob/test.js +++ b/packages/it-glob/test.js @@ -1,7 +1,7 @@ -import test from 'ava' -import all from 'it-all' -import glob from '.' -import path from 'path' +const test = require('ava') +const all = require('it-all') +const glob = require('.') +const path = require('path') test('it should match file', async t => { const files = await all(glob('.', '**/*')) diff --git a/packages/it-last/package.json b/packages/it-last/package.json index 752b7977..b56f8627 100644 --- a/packages/it-last/package.json +++ b/packages/it-last/package.json @@ -18,10 +18,10 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", - "nyc": "^14.0.0", + "ava": "^3.12.1", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "typesVersions": { "*": { diff --git a/packages/it-last/test.js b/packages/it-last/test.js index 28e5a002..fcdc7e8d 100644 --- a/packages/it-last/test.js +++ b/packages/it-last/test.js @@ -1,5 +1,5 @@ -import last from './' -import test from 'ava' +const last = require('./') +const test = require('ava') test('Should return only the last result from an async iterator', async (t) => { const values = [0, 1, 2, 3, 4] diff --git a/packages/it-length/package.json b/packages/it-length/package.json index e6892e62..b977cf3d 100644 --- a/packages/it-length/package.json +++ b/packages/it-length/package.json @@ -18,9 +18,9 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", - "nyc": "^14.0.0", + "ava": "^3.12.1", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" } } diff --git a/packages/it-length/test.js b/packages/it-length/test.js index e97e3b05..8d4f6191 100644 --- a/packages/it-length/test.js +++ b/packages/it-length/test.js @@ -1,5 +1,5 @@ -import length from './' -import test from 'ava' +const length = require('./') +const test = require('ava') test('Should count the items in an async iterator', async (t) => { const values = [0, 1, 2, 3, 4] diff --git a/packages/it-map/package.json b/packages/it-map/package.json index b97f7b1c..7d75521a 100644 --- a/packages/it-map/package.json +++ b/packages/it-map/package.json @@ -18,10 +18,10 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", - "nyc": "^14.0.0", + "ava": "^3.12.1", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "typesVersions": { "*": { diff --git a/packages/it-map/test.js b/packages/it-map/test.js index 18f7907d..38dc4521 100644 --- a/packages/it-map/test.js +++ b/packages/it-map/test.js @@ -1,5 +1,5 @@ -import map from './' -import test from 'ava' +const map = require('./') +const test = require('ava') test('Should map an async iterator', async (t) => { const iter = function * () { diff --git a/packages/it-multipart/package.json b/packages/it-multipart/package.json index e6096380..025a1644 100644 --- a/packages/it-multipart/package.json +++ b/packages/it-multipart/package.json @@ -23,12 +23,12 @@ "parse-headers": "^2.0.2" }, "devDependencies": { - "ava": "^2.4.0", - "form-data": "^2.5.0", + "ava": "^3.12.1", + "form-data": "^3.0.0", "node-fetch": "^2.6.0", - "nyc": "^14.0.0", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "typesVersions": { "*": { diff --git a/packages/it-multipart/test.js b/packages/it-multipart/test.js index 017ddbcc..aa527fcd 100644 --- a/packages/it-multipart/test.js +++ b/packages/it-multipart/test.js @@ -1,9 +1,9 @@ -import test from 'ava' -import http from 'http' -import handler from '.' +const test = require('ava') +const http = require('http') +const handler = require('.') // @ts-ignore -import fetch from 'node-fetch' -import FormData from 'form-data' +const fetch = require('node-fetch') +const FormData = require('form-data') /** @type {string} */ let port @@ -122,5 +122,5 @@ test('it throws if not handed a multipart request', async (t) => { for await (const _ of handler()) { // eslint-disable-line no-unused-vars } - }, 'Not a multipart request') + }, { message: 'Not a multipart request' }) }) diff --git a/packages/it-parallel-batch/package.json b/packages/it-parallel-batch/package.json index f138aef2..ab6495df 100644 --- a/packages/it-parallel-batch/package.json +++ b/packages/it-parallel-batch/package.json @@ -19,12 +19,12 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", + "ava": "^3.12.1", "delay": "^4.3.0", "it-all": "^1.0.2", - "nyc": "^14.0.0", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "dependencies": { "it-batch": "^1.0.4" diff --git a/packages/it-parallel-batch/test.js b/packages/it-parallel-batch/test.js index 05b268f2..bc2b7b2c 100644 --- a/packages/it-parallel-batch/test.js +++ b/packages/it-parallel-batch/test.js @@ -1,9 +1,9 @@ 'use strict' -import parallelBatch from './' -import test from 'ava' -import all from 'it-all' -import delay from 'delay' +const parallelBatch = require('./') +const test = require('ava') +const all = require('it-all') +const delay = require('delay') test('Should batch up emitted arrays', async (t) => { const input = [ diff --git a/packages/it-peekable/package.json b/packages/it-peekable/package.json index a377b6fa..db3c87a1 100644 --- a/packages/it-peekable/package.json +++ b/packages/it-peekable/package.json @@ -18,11 +18,11 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", + "ava": "^3.12.1", "it-all": "^1.0.2", - "nyc": "^14.0.0", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "typesVersions": { "*": { diff --git a/packages/it-peekable/test.js b/packages/it-peekable/test.js index bb92cf14..5faa3a10 100644 --- a/packages/it-peekable/test.js +++ b/packages/it-peekable/test.js @@ -1,6 +1,6 @@ -import peekableIt from './' -import test from 'ava' -import all from 'it-all' +const peekableIt = require('./') +const test = require('ava') +const all = require('it-all') test('Should peek at an iterable', async (t) => { const iterable = [0, 1, 2, 3] diff --git a/packages/it-reduce/package.json b/packages/it-reduce/package.json index 94f787fa..2547a1c2 100644 --- a/packages/it-reduce/package.json +++ b/packages/it-reduce/package.json @@ -18,10 +18,10 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", - "nyc": "^14.0.0", + "ava": "^3.12.1", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "typesVersions": { "*": { diff --git a/packages/it-reduce/test.js b/packages/it-reduce/test.js index d07d7b65..07e0192c 100644 --- a/packages/it-reduce/test.js +++ b/packages/it-reduce/test.js @@ -1,5 +1,5 @@ -import reduce from './' -import test from 'ava' +const reduce = require('./') +const test = require('ava') test('Should reduce the values yielded from an async iterator', async (t) => { const iter = function * () { diff --git a/packages/it-to-browser-readablestream/package.json b/packages/it-to-browser-readablestream/package.json index 99631100..9aa8895a 100644 --- a/packages/it-to-browser-readablestream/package.json +++ b/packages/it-to-browser-readablestream/package.json @@ -18,13 +18,13 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", - "nyc": "^14.0.0", + "ava": "^3.12.1", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "dependencies": { - "@ungap/global-this": "^0.3.1" + "@ungap/global-this": "^0.4.0" }, "typesVersions": { "*": { diff --git a/packages/it-to-browser-readablestream/test.js b/packages/it-to-browser-readablestream/test.js index 6c5e4e9e..674adf71 100644 --- a/packages/it-to-browser-readablestream/test.js +++ b/packages/it-to-browser-readablestream/test.js @@ -1,5 +1,5 @@ -import toBrowserReadbleStream from './' -import test from 'ava' +const toBrowserReadbleStream = require('./') +const test = require('ava') test('Should export something', async (t) => { t.true(typeof toBrowserReadbleStream === 'function') diff --git a/packages/it-to-buffer/package.json b/packages/it-to-buffer/package.json index 90637c98..71bf8775 100644 --- a/packages/it-to-buffer/package.json +++ b/packages/it-to-buffer/package.json @@ -18,10 +18,10 @@ "author": "Alex Potsides ", "license": "ISC", "devDependencies": { - "ava": "^2.4.0", - "nyc": "^14.0.0", + "ava": "^3.12.1", + "nyc": "^15.1.0", "standard": "^14.3.1", - "typescript": "^3.9.7" + "typescript": "^4.0.2" }, "dependencies": { "buffer": "^5.5.0" diff --git a/packages/it-to-buffer/test.js b/packages/it-to-buffer/test.js index 384bd6b7..034a88f2 100644 --- a/packages/it-to-buffer/test.js +++ b/packages/it-to-buffer/test.js @@ -1,5 +1,5 @@ -import toBuffer from './' -import test from 'ava' +const toBuffer = require('./') +const test = require('ava') test('Should turn a generator that yields buffers into a buffer', async (t) => { const iter = function * () {