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

arc-array

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arc-array - npm Package Compare versions

Comparing version 4.3.0 to 4.3.1

6

package.json
{
"name": "arc-array",
"version": "4.3.0",
"version": "4.3.1",
"description": "An array convenience subclass",

@@ -23,6 +23,6 @@ "main": "index.js",

"dependencies": {
"arc-is": "1.0.5"
"arc-is": "^1.0.8"
},
"devDependencies": {
"jest": "^27.3.1"
"jest": "^27.5.1"
},

@@ -29,0 +29,0 @@ "jest": {

@@ -19,5 +19,26 @@ # arc-array [![Build Status](https://travis-ci.org/anyuzer/arc-array.svg?branch=master)](https://travis-ci.org/anyuzer/arc-array)

### static ArcArray.wrap(array:Array)
Accept an array, and if it is already an ArcArray return the same object, otherwise create a new ArcArray utilizing the passed in array
### new ArcArray(...args)
Create a new `ArcArray` object. Requires `new`
### .shuffle()
Shuffles an array in place.
### .rand()
Returns a random element from the array
### async .pMap(async callable)
Iterates over an array like a map, but treating each callable as async, awaits for all to resolve like a Promise.all
```js
const someArray = ArcArray.wrap([1,2,3]);
const someResolvedResponse = await someArray.pMap(async (val) => {
const response = await someRemoteCall(val);
return response;
})
```
### .joinCallback(callback:Function [, separator:String])

@@ -28,6 +49,6 @@ Create a string based on the returned values from a callback on each index of an array.

```
```js
//Example of joinCallback
var items = new ArcArray('item1','item2','item3');
var string = items.joinCallback(function(_val){
const items = new ArcArray('item1','item2','item3');
const string = items.joinCallback(function(_val){
return '<li>'+_val+'</li>'

@@ -39,16 +60,5 @@ },'');

###ArcArray.nativeBind()
This is a static method that binds a method to the native global array prototype that transforms any array into an ArcArray object. This has a global effect and should be used carefully.
## Testing
```
ArcArray.nativeBind();
var items = [1,'a','b',false].arc(); //This returns an ArcArray object
```
###ArcArray.wrap(array:Array)
Accept an array, and if it is already an ArcArray return the same object, otherwise create a new ArcArray utilizing the passed in array
##Testing
```
npm test
```
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