Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Sep 15, 2020
1 parent e7b8ff7 commit f86f950
Show file tree
Hide file tree
Showing 38 changed files with 142 additions and 112 deletions.
2 changes: 1 addition & 1 deletion packages/blob-to-it/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
"*": {
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-readablestream-to-it/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
"*": {
Expand Down
6 changes: 3 additions & 3 deletions packages/it-all/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"author": "Alex Potsides <alex@achingbrain.net>",
"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": {
"*": {
Expand Down
4 changes: 2 additions & 2 deletions packages/it-all/test.js
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
6 changes: 3 additions & 3 deletions packages/it-batch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"author": "Alex Potsides <alex@achingbrain.net>",
"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": {
"*": {
Expand Down
6 changes: 3 additions & 3 deletions packages/it-batch/test.js
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
22 changes: 15 additions & 7 deletions packages/it-buffer-stream/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ const randomBytes = require('iso-random-stream/src/random')
* @property {function(number):Promise<Buffer>|Buffer} [generator]
*/

/** @type {Options} */
/**
* @typedef {Object} ActualOptions
* @property {number} chunkSize
* @property {function(Buffer):void} collector
* @property {function(number):Promise<Buffer>|Buffer} generator
*/

/** @type {ActualOptions} */
const defaultOptions = {
chunkSize: 4096,
collector: () => {},
Expand All @@ -25,25 +32,26 @@ const defaultOptions = {
* @returns {AsyncIterable<Buffer>}
*/
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
Expand Down
21 changes: 21 additions & 0 deletions packages/it-buffer-stream/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions packages/it-buffer-stream/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
"author": "Alex Potsides <alex@achingbrain.net>",
"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": {
"*": {
Expand All @@ -35,4 +36,4 @@
]
}
}
}
}
6 changes: 3 additions & 3 deletions packages/it-buffer-stream/test.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions packages/it-drain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"author": "Alex Potsides <alex@achingbrain.net>",
"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": {
"*": {
Expand Down
4 changes: 2 additions & 2 deletions packages/it-drain/test.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions packages/it-filter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"author": "Alex Potsides <alex@achingbrain.net>",
"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": {
"*": {
Expand Down
6 changes: 3 additions & 3 deletions packages/it-filter/test.js
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
6 changes: 3 additions & 3 deletions packages/it-first/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"author": "Alex Potsides <alex@achingbrain.net>",
"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": {
"*": {
Expand Down
4 changes: 2 additions & 2 deletions packages/it-first/test.js
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
6 changes: 3 additions & 3 deletions packages/it-flat-batch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"author": "Alex Potsides <alex@achingbrain.net>",
"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": {
"*": {
Expand Down
6 changes: 3 additions & 3 deletions packages/it-flat-batch/test.js
Original file line number Diff line number Diff line change
@@ -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]]
Expand Down
8 changes: 4 additions & 4 deletions packages/it-glob/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"author": "Alex Potsides <alex@achingbrain.net>",
"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
Expand Down
8 changes: 4 additions & 4 deletions packages/it-glob/test.js
Original file line number Diff line number Diff line change
@@ -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('.', '**/*'))
Expand Down
6 changes: 3 additions & 3 deletions packages/it-last/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"author": "Alex Potsides <alex@achingbrain.net>",
"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": {
"*": {
Expand Down
4 changes: 2 additions & 2 deletions packages/it-last/test.js
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
6 changes: 3 additions & 3 deletions packages/it-length/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"author": "Alex Potsides <alex@achingbrain.net>",
"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"
}
}
4 changes: 2 additions & 2 deletions packages/it-length/test.js
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
6 changes: 3 additions & 3 deletions packages/it-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"author": "Alex Potsides <alex@achingbrain.net>",
"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": {
"*": {
Expand Down
4 changes: 2 additions & 2 deletions packages/it-map/test.js
Original file line number Diff line number Diff line change
@@ -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 * () {
Expand Down
8 changes: 4 additions & 4 deletions packages/it-multipart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
"*": {
Expand Down
Loading

0 comments on commit f86f950

Please sign in to comment.