diff --git a/package.json b/package.json index d7c80eb..22d792d 100644 --- a/package.json +++ b/package.json @@ -122,6 +122,7 @@ ] }, "scripts": { + "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", "build": "aegir build", @@ -129,6 +130,6 @@ "docs": "aegir docs" }, "devDependencies": { - "aegir": "^37.7.8" + "aegir": "^38.1.8" } } diff --git a/src/index.ts b/src/index.ts index 64ddaa8..b9512a3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ * It is a function that takes a source and returns a source. */ export interface Transform { - (source: Source): Source + (source: A): B } /** @@ -12,12 +12,18 @@ export interface Transform { * function that takes a source and iterates over it. It optionally returns * a value. */ -export interface Sink> { - (source: Source): R +export interface Sink> { + (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. */ export type Source = AsyncIterable | Iterable @@ -26,7 +32,7 @@ export type Source = AsyncIterable | Iterable * necessarily connected to the values that can be consumed from it. It is * an object with two properties, sink and source. */ -export interface Duplex> { - source: Source +export interface Duplex> { + source: TSource sink: Sink }