New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

arr-map

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arr-map - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

LICENSE

17

index.js
/*!
* arr-map <https://github.com/jonschlinkert/arr-map>
*
* Copyright (c) 2015 Jon Schlinkert, contributors.
* Licensed under the MIT license.
* Copyright (c) 2015, Jon Schlinkert.
* Licensed under the MIT License.
*/

@@ -10,16 +10,15 @@

module.exports = function map(arr, fn) {
if (arr == null) {
return [];
}
var iterator = require('make-iterator');
module.exports = function map(arr, fn, thisArg) {
if (arr == null) return [];
fn = iterator(fn, thisArg);
var len = arr.length;
var res = new Array(len);
var i = -1;
while (++i < len) {
for (var i = 0; i < len; i++) {
res[i] = fn(arr[i], i, arr);
}
return res;
};
{
"name": "arr-map",
"description": "Faster, node.js focused alternative to JavaScript's native array map.",
"version": "1.0.0",
"version": "2.0.0",
"homepage": "https://github.com/jonschlinkert/arr-map",

@@ -19,4 +19,7 @@ "author": {

"type": "MIT",
"url": "https://github.com/jonschlinkert/arr-map/blob/master/LICENSE-MIT"
"url": "https://github.com/jonschlinkert/arr-map/blob/master/LICENSE"
},
"files": [
"index.js"
],
"main": "index.js",

@@ -26,9 +29,9 @@ "engines": {

},
"files": [
"index.js"
],
"scripts": {
"test": "mocha -R spec",
"test": "mocha",
"benchmark": "node benchmark"
},
"dependencies": {
"make-iterator": "^0.1.1"
},
"devDependencies": {

@@ -41,4 +44,3 @@ "array-map": "0.0.0",

"micromatch": "^1.2.2",
"mocha": "*",
"should": "*"
"mocha": "*"
},

@@ -49,2 +51,2 @@ "keywords": [

]
}
}

@@ -1,2 +0,2 @@

# arr-map [![NPM version](https://badge.fury.io/js/arr-map.svg)](http://badge.fury.io/js/arr-map)
# arr-map [![NPM version](https://badge.fury.io/js/arr-map.svg)](http://badge.fury.io/js/arr-map) [![Build Status](https://travis-ci.org/jonschlinkert/arr-map.svg)](https://travis-ci.org/jonschlinkert/arr-map)

@@ -29,10 +29,2 @@ > Faster, node.js focused alternative to JavaScript's native array map.

## Run tests
Install dev dependencies:
```bash
node i -d && mocha
```
## Run benchmarks

@@ -46,22 +38,37 @@

[Benchmarks](./benchmark) from January 30, 2015
[Benchmarks](./benchmark) from March 24, 2015
```bash
#1: long.js
arr-map.js x 19,418 ops/sec ±0.62% (98 runs sampled)
native.js x 8,312 ops/sec ±0.80% (98 runs sampled)
arr-map.js x 17,326 ops/sec ±0.74% (90 runs sampled)
array-map.js x 15,219 ops/sec ±0.72% (97 runs sampled)
native.js x 14,985 ops/sec ±0.66% (93 runs sampled)
#2: med.js
arr-map.js x 402,100 ops/sec ±0.72% (97 runs sampled)
native.js x 156,813 ops/sec ±1.74% (91 runs sampled)
arr-map.js x 356,497 ops/sec ±0.79% (90 runs sampled)
array-map.js x 285,448 ops/sec ±0.78% (95 runs sampled)
native.js x 284,534 ops/sec ±0.82% (97 runs sampled)
#3: short.js
arr-map.js x 1,445,561 ops/sec ±0.67% (97 runs sampled)
native.js x 480,518 ops/sec ±1.64% (86 runs sampled)
arr-map.js x 1,576,773 ops/sec ±0.72% (93 runs sampled)
array-map.js x 1,129,016 ops/sec ±0.67% (97 runs sampled)
native.js x 1,141,300 ops/sec ±0.71% (97 runs sampled)
```
## Run tests
Install dev dependencies.
```bash
npm i -d && npm test
```
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/arr-map/issues)
## Related
* [arr-flatten](https://github.com/jonschlinkert/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten.
* [arr-diff](https://github.com/jonschlinkert/arr-diff): Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.
* [arr-filter](https://github.com/jonschlinkert/arr-filter): Faster alternative to javascript's native filter method.
* [arr-reduce](https://github.com/jonschlinkert/arr-reduce): Fast array reduce that also loops over sparse elements.
## Author

@@ -80,2 +87,2 @@

_This file was generated by [verb](https://github.com/assemble/verb) on January 30, 2015._
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 24, 2015._
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