New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

response-iterator

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

response-iterator - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

18

dist/esm/index.js
function streamIterator(stream) {
const iterator = stream[Symbol.asyncIterator]();
return {
next: function () {
next() {
return iterator.next();
},
[Symbol.asyncIterator]: function () {
[Symbol.asyncIterator]() {
return this;
}
};

@@ -17,8 +19,10 @@ }

return {
next: function () {
next() {
return reader.read();
},
[Symbol.asyncIterator]: function () {
[Symbol.asyncIterator]() {
return this;
}
};

@@ -30,3 +34,3 @@ }

return {
next: function () {
next() {
if (resolved) return Promise.resolve({

@@ -46,5 +50,7 @@ value: undefined,

},
[Symbol.asyncIterator]: function () {
[Symbol.asyncIterator]() {
return this;
}
};

@@ -51,0 +57,0 @@ }

@@ -5,10 +5,6 @@ import { Response as NodeResponse } from "node-fetch";

}
export interface IterableIterator<T> {
next(): Promise<IteratorResult<T, boolean>>;
[Symbol.asyncIterator](): Promise<IteratorResult<T, boolean>>;
}
/**
* @param response A response. Supports fetch, node-fetch, and cross-fetch
*/
export default function responseIterator<T>(response: Response | NodeResponse | CrossFetchResponse): IterableIterator<T>;
export default function responseIterator<T>(response: Response | NodeResponse | CrossFetchResponse): AsyncIterableIterator<T>;
export {};
{
"name": "response-iterator",
"description": "Creates an async iterator for a variety of inputs in the browser and node. Supports fetch, node-fetch, and cross-fetch",
"version": "0.1.0",
"version": "0.1.1",
"author": {

@@ -6,0 +6,0 @@ "email": "kmalakoff@gmail.com",

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

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