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

iterator-helper

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iterator-helper - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

dist/async-iterator/HAsyncIterator.js

4

dist/index.js

@@ -13,2 +13,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./ItHelper"), exports);
__exportStar(require("./wrappers"), exports);
__exportStar(require("./iterator"), exports);
__exportStar(require("./async-iterator"), exports);
{
"name": "iterator-helper",
"version": "1.1.3",
"version": "1.2.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -79,21 +79,2 @@ # iterator-helper

## Generators helpers
If you have some (a)sync generators, you can wrap them with the appropriate wrapper:
```ts
import { wrap, awrap } from 'iterator-helper';
function* generateNumbers() {
yield 1;
yield* [2, 3, 4];
}
// wrap for sync generators, awrap for async generators.
generateNumbers = wrap(generateNumbers);
// It works!
generateNumbers().filter(e => e % 2 === 0).toArray();
```
## API

@@ -150,5 +131,5 @@

findIndex(callback: (value: T) => boolean) : number;
/** Only works if it. is a number iterator. Returns the maximum of iterator. */
/** Only works if it is a number iterator. Returns the maximum of iterator. */
max() : number;
/** Only works if it. is a number iterator. Returns the minimum of iterator. */
/** Only works if it is a number iterator. Returns the minimum of iterator. */
min() : number;

@@ -155,0 +136,0 @@ /** When iterator ends, go back to the first item then loop. Indefinitively. */

@@ -29,3 +29,3 @@ {

"strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */

@@ -32,0 +32,0 @@ // "strictFunctionTypes": true, /* Enable strict checking of function types. */

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