response-iterator
Advanced tools
Comparing version
/** | ||
* @param response A response. Supports fetch, node-fetch, and cross-fetch | ||
*/ | ||
export default function responseIterator<T>(response: unknown): AsyncIterableIterator<T>; | ||
export default function responseIterator<T, TReturn = unknown, TNext = unknown>(response: unknown): AsyncIterableIterator<T, TReturn, TNext>; |
@@ -1,1 +0,1 @@ | ||
export default function asyncIterator<T>(source: any): AsyncIterableIterator<T>; | ||
export default function asyncIterator<T, TReturn = unknown, TNext = unknown>(source: AsyncIterableIterator<T, TReturn, TNext>): AsyncIterableIterator<T, TReturn, TNext>; |
import type { Readable as NodeReadableStream } from 'stream'; | ||
export default function nodeStreamIterator<T>(stream: NodeReadableStream): AsyncIterableIterator<T>; | ||
export default function nodeStreamIterator<T, TReturn = unknown, TNext = unknown>(stream: NodeReadableStream): AsyncIterableIterator<T, TReturn, TNext>; |
@@ -1,1 +0,1 @@ | ||
export default function promiseIterator<T>(promise: any): AsyncIterableIterator<T>; | ||
export default function promiseIterator<T, TReturn = unknown, TNext = unknown>(promise: Promise<T>): AsyncIterableIterator<T, TReturn, TNext>; |
@@ -1,1 +0,1 @@ | ||
export default function readerIterator<T>(reader: any): AsyncIterableIterator<T>; | ||
export default function readerIterator<T, TReturn = unknown, TNext = unknown>(reader: ReadableStreamReader<T>): AsyncIterableIterator<T, TReturn, TNext>; |
@@ -15,3 +15,3 @@ "use strict"; | ||
next: function next() { | ||
return reader.read(); | ||
return reader.read(undefined); | ||
} | ||
@@ -18,0 +18,0 @@ }; |
/** | ||
* @param response A response. Supports fetch, node-fetch, and cross-fetch | ||
*/ | ||
export default function responseIterator<T>(response: unknown): AsyncIterableIterator<T>; | ||
export default function responseIterator<T, TReturn = unknown, TNext = unknown>(response: unknown): AsyncIterableIterator<T, TReturn, TNext>; |
@@ -1,1 +0,1 @@ | ||
export default function asyncIterator<T>(source: any): AsyncIterableIterator<T>; | ||
export default function asyncIterator<T, TReturn = unknown, TNext = unknown>(source: AsyncIterableIterator<T, TReturn, TNext>): AsyncIterableIterator<T, TReturn, TNext>; |
import type { Readable as NodeReadableStream } from 'stream'; | ||
export default function nodeStreamIterator<T>(stream: NodeReadableStream): AsyncIterableIterator<T>; | ||
export default function nodeStreamIterator<T, TReturn = unknown, TNext = unknown>(stream: NodeReadableStream): AsyncIterableIterator<T, TReturn, TNext>; |
@@ -1,1 +0,1 @@ | ||
export default function promiseIterator<T>(promise: any): AsyncIterableIterator<T>; | ||
export default function promiseIterator<T, TReturn = unknown, TNext = unknown>(promise: Promise<T>): AsyncIterableIterator<T, TReturn, TNext>; |
@@ -1,1 +0,1 @@ | ||
export default function readerIterator<T>(reader: any): AsyncIterableIterator<T>; | ||
export default function readerIterator<T, TReturn = unknown, TNext = unknown>(reader: ReadableStreamReader<T>): AsyncIterableIterator<T, TReturn, TNext>; |
@@ -5,3 +5,3 @@ const hasIterator = typeof Symbol !== 'undefined' && Symbol.asyncIterator; | ||
next () { | ||
return reader.read(); | ||
return reader.read(undefined); | ||
} | ||
@@ -8,0 +8,0 @@ }; |
{ | ||
"name": "response-iterator", | ||
"version": "0.2.22", | ||
"version": "0.2.23", | ||
"description": "Creates an async iterator for a variety of inputs in the browser and node. Supports fetch, node-fetch, and cross-fetch", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
70636
5.48%0
-100%