Socket
Socket
Sign inDemoInstall

it-map

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

it-map - npm Package Compare versions

Comparing version 3.0.4 to 3.0.5

32

dist/src/index.d.ts
/**
* @packageDocumentation
*
* Convert one value from an (async)iterator into another.
*
* @example
*
* ```javascript
* import map from 'it-map'
*
* // This can also be an iterator, generator, etc
* const values = [0, 1, 2, 3, 4]
*
* const result = map(values, (val) => val++)
*
* console.info(result) // [1, 2, 3, 4, 5]
* ```
*
* Async sources and transforms must be awaited:
*
* ```javascript
* import map from 'it-map'
*
* const values = async function * () {
* yield * [0, 1, 2, 3, 4]
* }
*
* const result = await map(values(), async (val) => val++)
*
* console.info(result) // [1, 2, 3, 4, 5]
* ```
*/
/**
* Takes an (async) iterable and returns one with each item mapped by the passed

@@ -3,0 +35,0 @@ * function

@@ -0,1 +1,33 @@

/**
* @packageDocumentation
*
* Convert one value from an (async)iterator into another.
*
* @example
*
* ```javascript
* import map from 'it-map'
*
* // This can also be an iterator, generator, etc
* const values = [0, 1, 2, 3, 4]
*
* const result = map(values, (val) => val++)
*
* console.info(result) // [1, 2, 3, 4, 5]
* ```
*
* Async sources and transforms must be awaited:
*
* ```javascript
* import map from 'it-map'
*
* const values = async function * () {
* yield * [0, 1, 2, 3, 4]
* }
*
* const result = await map(values(), async (val) => val++)
*
* console.info(result) // [1, 2, 3, 4, 5]
* ```
*/
import peek from 'it-peekable';

@@ -2,0 +34,0 @@ function isAsyncIterable(thing) {

5

package.json
{
"name": "it-map",
"version": "3.0.4",
"version": "3.0.5",
"description": "Maps the values yielded by an async iterator",

@@ -32,2 +32,3 @@ "author": "Alex Potsides <alex@achingbrain.net>",

"parserOptions": {
"project": true,
"sourceType": "module"

@@ -138,5 +139,5 @@ }

"devDependencies": {
"aegir": "^40.0.11",
"aegir": "^41.1.9",
"it-all": "^3.0.0"
}
}

44

README.md

@@ -1,3 +0,1 @@

# it-map <!-- omit in toc -->
[![codecov](https://img.shields.io/codecov/c/github/achingbrain/it.svg?style=flat-square)](https://codecov.io/gh/achingbrain/it)

@@ -8,26 +6,8 @@ [![CI](https://img.shields.io/github/actions/workflow/status/achingbrain/it/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/achingbrain/it/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)

## Table of contents <!-- omit in toc -->
# About
- [Install](#install)
- [Browser `<script>` tag](#browser-script-tag)
- [Usage](#usage)
- [License](#license)
- [Contribution](#contribution)
Convert one value from an (async)iterator into another.
## Install
## Example
```console
$ npm i it-map
```
### Browser `<script>` tag
Loading this module through a script tag will make it's exports available as `ItMap` in the global namespace.
```html
<script src="https://unpkg.com/it-map/dist/index.min.js"></script>
```
## Usage
```javascript

@@ -58,4 +38,18 @@ import map from 'it-map'

## License
# Install
```console
$ npm i it-map
```
## Browser `<script>` tag
Loading this module through a script tag will make it's exports available as `ItMap` in the global namespace.
```html
<script src="https://unpkg.com/it-map/dist/index.min.js"></script>
```
# License
Licensed under either of

@@ -66,4 +60,4 @@

## Contribution
# Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

@@ -0,1 +1,34 @@

/**
* @packageDocumentation
*
* Convert one value from an (async)iterator into another.
*
* @example
*
* ```javascript
* import map from 'it-map'
*
* // This can also be an iterator, generator, etc
* const values = [0, 1, 2, 3, 4]
*
* const result = map(values, (val) => val++)
*
* console.info(result) // [1, 2, 3, 4, 5]
* ```
*
* Async sources and transforms must be awaited:
*
* ```javascript
* import map from 'it-map'
*
* const values = async function * () {
* yield * [0, 1, 2, 3, 4]
* }
*
* const result = await map(values(), async (val) => val++)
*
* console.info(result) // [1, 2, 3, 4, 5]
* ```
*/
import peek from 'it-peekable'

@@ -2,0 +35,0 @@

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