Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: bump it-stream-types from 1.0.5 to 2.0.1 #55

Merged
merged 4 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
node_modules
coverage
.nyc_output
package-lock.json
build
dist
.docs
.coverage
node_modules
package-lock.json
yarn.lock
.vscode
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# it-pair <!-- omit in toc -->

[![codecov](https://img.shields.io/codecov/c/github/alanshaw/it-pair.svg?style=flat-square)](https://codecov.io/gh/alanshaw/it-pair)
[![CI](https://img.shields.io/github/workflow/status/alanshaw/it-pair/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/alanshaw/it-pair/actions/workflows/js-test-and-release.yml)
[![CI](https://img.shields.io/github/actions/workflow/status/alanshaw/it-pair/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/alanshaw/it-pair/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)

> pair a source async iterable stream and a sink async iterable stream

## Table of contents <!-- omit in toc -->

- [Install](#install)
- [Browser `<script>` tag](#browser-script-tag)
- [API Docs](#api-docs)
- [License](#license)
- [Contribution](#contribution)

Expand All @@ -17,6 +19,14 @@
$ npm i it-pair
```

### Browser `<script>` tag

Loading this module through a script tag will make it's exports available as `ItPair` in the global namespace.

```html
<script src="https://unpkg.com/it-pair/dist/index.min.js"></script>
```

A pair of {source, sink} streams that are internally connected,
(what goes into the sink comes out the source)

Expand Down Expand Up @@ -76,6 +86,10 @@ pipe(
)
```

## API Docs

- <https://alanshaw.github.io/it-pair>

## License

Licensed under either of
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"files": [
"src",
"dist/src",
"dist",
"!dist/test",
"!**/*.tsbuildinfo"
],
Expand Down Expand Up @@ -142,6 +142,7 @@
]
},
"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",
"dep-check": "aegir dep-check",
"build": "aegir build",
Expand All @@ -152,10 +153,11 @@
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
"test:node": "aegir test -t node --cov",
"test:electron-main": "aegir test -t electron-main",
"release": "aegir release"
"release": "aegir release",
"docs": "aegir docs"
},
"dependencies": {
"it-stream-types": "^1.0.3",
"it-stream-types": "^2.0.1",
"p-defer": "^4.0.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/duplex.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { pair } from './index.js'
import type { Duplex } from 'it-stream-types'
import type { Duplex, Source } from 'it-stream-types'

/**
* Two duplex streams that are attached to each other
*/
export function duplexPair <T> (): [Duplex<T>, Duplex<T>] {
export function duplexPair <T> (): [Duplex<AsyncGenerator<T>, Source<T>, Promise<void>>, Duplex<AsyncGenerator<T>, Source<T>, Promise<void>>] {
const a = pair<T>()
const b = pair<T>()
return [
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Source, Duplex } from 'it-stream-types'
/**
* A pair of streams where one drains from the other
*/
export function pair <T> (): Duplex<T> {
export function pair <T> (): Duplex<AsyncGenerator<T>, Source<T>, Promise<void>> {
const deferred = defer<Source<T>>()
let piped = false

Expand Down