Comparing version 4.3.0 to 4.3.1
{ | ||
"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 | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9403
62
+ Addedarc-is@1.0.8(transitive)
- Removedarc-is@1.0.5(transitive)
Updatedarc-is@^1.0.8