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.3.0 to 1.3.1

2

package.json
{
"name": "iterator-helper",
"version": "1.3.0",
"version": "1.3.1",
"description": "",

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

@@ -140,8 +140,10 @@ # iterator-helper

toIndexedItems<K>(keyGetter: (value: T) => K) : Map<K, T>;
/** Iterate over items present in both current collection and {otherItems} iterable. `O(n*m)` operation that will consume {otherItems} iterator/iterable! */
/** Iterate over items present in both current collection and {otherItems} iterable. `O(n*m)` operation that will consume {otherItems} iterator/iterable! */
intersection<O>(otherItems: IteratorOrIterable<O>, isSameItemCallback: (value: T, other: O) => boolean = Object.is) : HIterator<T>;
/** Iterate over items present only in current collection, not in {otherItems} iterable. `O(n*m)` operation that will consume {otherItems} iterator/iterable! */
/** Iterate over items present only in current collection, not in {otherItems} iterable. `O(n*m)` operation that will consume {otherItems} iterator/iterable! */
difference<O>(otherItems: IteratorOrIterable<O>, isSameItemCallback: (value: T, other: O) => boolean = Object.is) : HIterator<T>;
/** Iterate over items present only in current collection or only in {otherItems} iterable, but not in both. `O(n*m)` operation that will consume {otherItems} iterator/iterable! */
/** Iterate over items present only in current collection or only in {otherItems} iterable, but not in both. `O(n*m)` operation that will consume {otherItems} iterator/iterable! */
symmetricDifference<O>(otherItems: IteratorOrIterable<O>, isSameItemCallback: (value: T, other: O) => boolean = Object.is) : HIterator<T>;
/** Transform current sync iterator to an async one (wrap each new item into a resolved `Promise`) */
toAsyncIterator(): HAsyncIterator<T>;
}

@@ -205,15 +207,15 @@

toIndexedItems<K>(keyGetter: (value: T) => K | PromiseLike<K>) : Promise<Map<K, T>>;
/** Iterate over items present in both current collection and {otherItems} iterable. `O(n*m)` operation that will consume {otherItems} iterator/iterable! */
/** Iterate over items present in both current collection and {otherItems} iterable. `O(n*m)` operation that will consume {otherItems} iterator/iterable! */
intersection<O>(
otherItems: AsyncIteratorOrIterable<O>,
otherItems: AsyncIteratorOrIterable<O>,
isSameItemCallback: (value: T, other: O) => boolean | PromiseLike<boolean> = Object.is
) : HAsyncIterator<T>;
/** Iterate over items present only in current collection, not in {otherItems} iterable. `O(n*m)` operation that will consume {otherItems} iterator/iterable! */
/** Iterate over items present only in current collection, not in {otherItems} iterable. `O(n*m)` operation that will consume {otherItems} iterator/iterable! */
difference<O>(
otherItems: AsyncIteratorOrIterable<O>,
otherItems: AsyncIteratorOrIterable<O>,
isSameItemCallback: (value: T, other: O) => boolean | PromiseLike<boolean> = Object.is
) : HAsyncIterator<T>;
/** Iterate over items present only in current collection or only in {otherItems} iterable, but not in both. `O(n*m)` operation that will consume {otherItems} iterator/iterable! */
/** Iterate over items present only in current collection or only in {otherItems} iterable, but not in both. `O(n*m)` operation that will consume {otherItems} iterator/iterable! */
symmetricDifference<O>(
otherItems: AsyncIteratorOrIterable<O>,
otherItems: AsyncIteratorOrIterable<O>,
isSameItemCallback: (value: T, other: O) => boolean | PromiseLike<boolean> = Object.is

@@ -223,1 +225,27 @@ ) : HAsyncIterator<T>;

```
## Helpers
`iter` function expose some iterator creator helpers:
- `range`
- `repeat`
There's presented as TypeScript types.
```ts
// iter is instance of IIterFunction
interface IIterFunction {
/** Create a new range `HIterator` from {0} to {stop}, 1 by 1. If {stop} is negative, it goes -1 by -1. */
range(stop: number): HIterator<number>;
/** Create a new range `HIterator` from {start} to {stop}, 1 by 1. If {stop} < {start}, it goes -1 by -1. */
range(start: number, stop: number): HIterator<number>;
/** Create a new range `HIterator` from {start} to {stop}, adding {step} at each step. */
range(start: number, stop: number, step: number): HIterator<number>;
/** Create a new `HIterator` that emit only {item} indefinitively. */
repeat<I>(item: I): HIterator<I>;
/** Create a new `HIterator` that emit only {item}, {times} times. */
repeat<I>(item: I, times: number): HIterator<I>;
}
```
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