🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

ai-map

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai-map

Map over async iterables

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

ai-map

Travis Build Status NPM downloads

Map over async iterables

The map() function creates a new async iterable with the results of calling a provided function on every element in the async iterable.

This module is part of Async iterable fun, a complete toolset of modules to work with async iterables.

Usage

description of the example

import aiMap from 'ai-map';

for (const item of {aiMap}()) {
  yield item;
};

This will output

API

index

Creates a new async iterable with the results of calling a provided function on every element in the async iterable.

Parameters

  • data AsyncIterable The async iterable to map over

  • transform Function Function to apply to each element in the async iterable, taking 3 arguments: . ``` currentValue - The current element being processed in the async iterable.

    __currentIndex__ - The index of the current element being processed in the async
    iterable. Starts at index 0
    
    __data__ - The async iterable map was called upon.
    ```
    

Returns AyncIterable An iterable that iterates over the transform calls results.

with

Higher order function that partially apply transform to the map function.

Parameters

  • transform Function The transform argument to partially apply to map

Returns Function A map unary function that take a data argument and return a new async iterable.

Install

With npm installed, run

npm install --save ai-map

See Also

License

MIT Licensed Š 2017 Andrea Parodi

Keywords

ai-fun

FAQs

Package last updated on 29 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts