Socket
Socket
Sign inDemoInstall

iterable-operator

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iterable-operator - npm Package Compare versions

Comparing version 2.3.0 to 2.4.0

lib/es2015/join-async.d.ts

2

lib/es2015/index.d.ts

@@ -33,2 +33,4 @@ export * from './is-iterable';

export * from './slice';
export * from './join-async';
export * from './join';
export * from './split-async';

@@ -35,0 +37,0 @@ export * from './split-by-async';

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

__exportStar(require("./slice"), exports);
__exportStar(require("./join-async"), exports);
__exportStar(require("./join"), exports);
__exportStar(require("./split-async"), exports);

@@ -51,0 +53,0 @@ __exportStar(require("./split-by-async"), exports);

@@ -33,2 +33,4 @@ export * from './is-iterable';

export * from './slice';
export * from './join-async';
export * from './join';
export * from './split-async';

@@ -35,0 +37,0 @@ export * from './split-by-async';

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

__exportStar(require("./slice"), exports);
__exportStar(require("./join-async"), exports);
__exportStar(require("./join"), exports);
__exportStar(require("./split-async"), exports);

@@ -51,0 +53,0 @@ __exportStar(require("./split-by-async"), exports);

2

package.json
{
"name": "iterable-operator",
"version": "2.3.0",
"version": "2.4.0",
"description": "Utilities for JavaScript Iterable and AsyncIterable",

@@ -5,0 +5,0 @@ "keywords": [

@@ -12,3 +12,3 @@ # iterable-operator

## Usage
```js
```ts
import { map, toArray } from 'iterable-operator'

@@ -52,3 +52,3 @@

```js
```ts
chunk([1, 2, 3], 2) // [[1, 2], [3]]

@@ -75,3 +75,3 @@ chunk([1, 2, 3], 3) // [[1, 2, 3]]

```js
```ts
chunkBy([1, 2, 3], x => x === 2) // [[1, 2], [3]]

@@ -96,3 +96,3 @@ chunkBy([1, 2, 3], x => x === 3) // [[1, 2, 3]]

```js
```ts
concat([1, 2, 3]) // [1, 2, 3]

@@ -111,3 +111,3 @@ concat([1, 2, 3], ['a', 'b', 'c']) // [1, 2, 3, 'a', 'b', 'c']

```js
```ts
difference([1, 2, 3], [3, 4, 5]) // [1, 2]

@@ -130,3 +130,3 @@ ```

```js
```ts
drop([1, 2, 3], 0) // [1, 2, 3]

@@ -151,3 +151,3 @@ drop([1, 2, 3], 2) // [3]

```js
```ts
dropRight([1, 2, 3], 0) // [1, 2, 3]

@@ -174,3 +174,3 @@ dropRight([1, 2, 3], 2) // [1]

```js
```ts
dropUntil([1, 2, 3], x => x === 2) // [2, 3]

@@ -193,3 +193,3 @@ ```

```js
```ts
filter([1, 2, 3], x => x % 2 === 1) // [1, 3]

@@ -204,3 +204,3 @@ ```

```js
```ts
flatten([]) // []

@@ -223,3 +223,3 @@ flatten('123') // ['1', '2', '3']

```js
```ts
flattenDeep([]) // []

@@ -244,3 +244,3 @@ flattenDeep('123') // ['1', '2', '3']

```js
```ts
flattenBy(['one', ['two'], 0, [1]], x => typeof x !== 'string') // ['one', 'two', 0, 1]

@@ -262,2 +262,6 @@ flattenBy([], () => true) // []

```ts
intersection([1, 2], [2, 3]) // [2]
```
### map, mapAsync

@@ -275,3 +279,3 @@ ```ts

```js
```ts
map([1, 2, 3], x => x * 2) // [2, 4, 6]

@@ -292,3 +296,3 @@ ```

```js
```ts
repeat([1, 2, 3], 2) // [1, 2, 3, 1, 2, 3]

@@ -315,3 +319,3 @@ repeat([1, 2, 3], 0) // []

```js
```ts
slice([1, 2, 3], -1, 1) // throw Error

@@ -324,2 +328,15 @@ slice([1, 2, 3], 3, 5) // []

### join, joinAsync
```ts
function join<T, U = T>(iterable: Iterable<T>, separator: U): IterableIterator<T | U>
function joinAsync<T, U = T>(
iterable: AsyncIterable<T>
, separator: U
): AsyncIterableIterator<T | U>
```
```ts
join([1, 2, 3], '+') // [1, '+', 2, '+', 3]
```
### split, splitAsync

@@ -334,3 +351,3 @@ ```ts

```js
```ts
split([1, 2, 3, 4, 5], 3) // [[1, 2], [4, 5]]

@@ -356,3 +373,3 @@ split([1, 2, 3, 4, 5], 1) // [[], [2, 3, 4, 5]]

```js
```ts
splitBy([1, 2, 3, 4, 5], x => x === 3) // [[1, 2], [4, 5]]

@@ -375,3 +392,3 @@ splitBy([1, 2, 3, 4, 5], x => x === 1) // [[], [2, 3, 4, 5]]

```js
```ts
take([1, 2, 3], 5) // [1, 2, 3]

@@ -392,3 +409,3 @@ take([1, 2, 3], 2) // [1, 2]

```js
```ts
takeRight([1, 2, 3], 2) // [2, 3]

@@ -414,3 +431,3 @@ takeRight([1, 2, 3], 5) // [1, 2, 3]

```js
```ts
takeUntil([1, 2, 3], x => x === 2) // [1]

@@ -431,3 +448,3 @@ ```

```js
```ts
tap([1, 2, 3], x => console.log(x)) // [1, 2, 3]

@@ -441,3 +458,3 @@ ```

```js
```ts
toAsyncIterable([1, 2, 3]) // AsyncIterable [1, 2, 3]

@@ -462,3 +479,3 @@ ```

```js
```ts
transform([1, 2, 3], function* double(iter) {

@@ -477,3 +494,3 @@ for (const element of iter) {

```js
```ts
uniq([1, 1, 2, 2, 3, 3]) // [1, 2, 3]

@@ -496,3 +513,3 @@ ```

```js
```ts
uniqBy([1, 2, 3], x => x % 2) // [1, 2]

@@ -515,3 +532,3 @@ ```

```js
```ts
zip([1, 2, 3], ['a', 'b', 'c']) // [[1, 'a'], [2, 'b'], [3, 'c']]

@@ -535,3 +552,3 @@ zip([1, 2, 3], ['a', 'b']) // [[1, 'a'], [2, 'b']

```js
```ts
consume([1, 2, 3], xs => new Set(xs)) // Set [1, 2, 3]

@@ -552,3 +569,3 @@ ```

```js
```ts
each([1, 2, 3], x => console.log(x)) // void

@@ -569,3 +586,3 @@ ```

```js
```ts
every([1, 2, 3], x => x < 5) // true

@@ -587,3 +604,3 @@ every([1, 2, 3], x => x <= 2) // false

```js
```ts
find([1, 2, 3], x => x === 2) // 2

@@ -601,3 +618,3 @@ find([1, 2, 3], x => x === 4) // undefined

```js
```ts
findAllIndexes([1, 2, 3], x => x % 2 === 1) // [0, 2]

@@ -612,3 +629,3 @@ ```

```js
```ts
first([1, 2, 3]) // 1

@@ -624,3 +641,3 @@ first([]) // undefined

```js
```ts
includes([1, 2, 3], 2) // true

@@ -636,3 +653,3 @@ includes([1, 2, 3], 4) // false

```js
```ts
last([1, 2, 3]) // 3

@@ -664,3 +681,3 @@ last([]) // undefined

```js
```ts
reduce([], (acc, cur) => acc + cur) // throw Error

@@ -688,3 +705,3 @@ reduce([1], (acc, cur) => acc + cur) // 1

```js
```ts
some([1, 2, 3], x => x === 2) // true

@@ -700,3 +717,3 @@ some([1, 2, 3], x => x === 4) // false

```js
```ts
toArray([1, 2, 3]) // Array [1, 2, 3]

@@ -711,3 +728,3 @@ ```

```js
```ts
toSet([1, 1, 2, 2, 3, 3]) // Set [1, 2, 3]

@@ -722,3 +739,3 @@ ```

```js
```ts
count([1, 2, 3]) // 3

@@ -739,4 +756,4 @@ ```

```js
```ts
groupBy([1, 2, 3], x => x % 2) // { 1: [1, 3], 0: [2] }
```

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