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

arraymap

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arraymap

Curried function deriving new array values by applying provided function to each item/index of provided array. Fast and compatible with modern or old browsers.

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

arraymap

Curried function deriving new array values by applying provided function to each item/index of provided array. Fast and compatible with modern or old browsers.

Build Status Code Climate js-standard-style

npm install arraymap --save

You can also use Duo, Bower or download the files manually.

npm stats

npm NPM downloads David

Overview

Optionally, a dot-notation formatted string may be provided for item property access.

API Example

Pointful
var map = require('arraymap')
var characters = ['a', 'b', 'c']
var codepoints = (letter) => punycode.ucs2.decode(letter)[0]

map(codepoints, characters)
//=> [ 97, 98, 99 ]
Pointful (dot-notation object access)
var map = require('arraymap')
var collection = [ { letter: 'a' }, { letter: 'b' }, { letter: 'c' }  ]

map('letter', collection)
//=> ['a', 'b', 'c']
Pointfree Style
var map = require('arraymap')
var collection = [ { letter: 'a' }, { letter: 'b' }, { letter: 'c' }  ]
var promise = Promise.resolve(collection)

promise.then(map('letter'))
//=> ['a', 'b', 'c']

API

map(fn, list)

arguments
  • fn (Function|String).
  • list (array).
returns
  • (array) Array resulting from applying provided function fn to each item of list.

Alternatives

Contributing

SEE: contributing.md

Licenses

GitHub license

Keywords

FAQs

Package last updated on 10 Jan 2016

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

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