Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

it-stream-types

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

it-stream-types - npm Package Compare versions

Comparing version 1.0.5 to 2.0.0

16

dist/src/index.d.ts

@@ -7,3 +7,3 @@ /**

export interface Transform<A, B = A> {
(source: Source<A>): Source<B>;
(source: A): B;
}

@@ -15,7 +15,13 @@ /**

*/
export interface Sink<T, R = Promise<void>> {
(source: Source<T>): R;
export interface Sink<Source, R = Promise<void>> {
(source: Source): R;
}
/**
* A "source" is something that can be consumed. It is an iterable object.
*
* This type is a union of both sync and async sources - it is useful to keep
* code concise but declared types should prefer to specify whether they
* accept sync or async sources since treating a synchronous source as an
* asynchronous one can lead to performance degradation due to artificially
* induced asynchronous behaviour.
*/

@@ -28,6 +34,6 @@ export type Source<T> = AsyncIterable<T> | Iterable<T>;

*/
export interface Duplex<TSource, TSink = TSource, RSink = Promise<void>> {
source: Source<TSource>;
export interface Duplex<TSource = unknown, TSink = TSource, RSink = Promise<void>> {
source: TSource;
sink: Sink<TSink, RSink>;
}
//# sourceMappingURL=index.d.ts.map
{
"name": "it-stream-types",
"version": "1.0.5",
"version": "2.0.0",
"description": "Typescript types for AsyncIterable sink/source/duplex streams",

@@ -125,2 +125,3 @@ "author": "Alex Potsides <alex@achingbrain.net>",

"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",

@@ -133,4 +134,4 @@ "dep-check": "aegir dep-check",

"devDependencies": {
"aegir": "^37.7.8"
"aegir": "^38.1.8"
}
}

@@ -7,3 +7,3 @@ /**

export interface Transform<A, B = A> {
(source: Source<A>): Source<B>
(source: A): B
}

@@ -16,4 +16,4 @@

*/
export interface Sink<T, R = Promise<void>> {
(source: Source<T>): R
export interface Sink<Source, R = Promise<void>> {
(source: Source): R
}

@@ -23,2 +23,8 @@

* A "source" is something that can be consumed. It is an iterable object.
*
* This type is a union of both sync and async sources - it is useful to keep
* code concise but declared types should prefer to specify whether they
* accept sync or async sources since treating a synchronous source as an
* asynchronous one can lead to performance degradation due to artificially
* induced asynchronous behaviour.
*/

@@ -32,5 +38,5 @@ export type Source<T> = AsyncIterable<T> | Iterable<T>

*/
export interface Duplex<TSource, TSink = TSource, RSink = Promise<void>> {
source: Source<TSource>
export interface Duplex<TSource = unknown, TSink = TSource, RSink = Promise<void>> {
source: TSource
sink: Sink<TSink, RSink>
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc