Comparing version 2.0.3 to 2.1.0
12
index.js
@@ -115,4 +115,16 @@ "use strict"; | ||
} | ||
static wrap(_array){ | ||
if(is(_array,true) === 'ArcArray'){ | ||
return _array; | ||
} | ||
else if(is(_array) === 'array'){ | ||
return new ArcArray(..._array); | ||
} | ||
else{ | ||
throw new TypeError('Cannot wrap value, valid array expected'); | ||
} | ||
} | ||
} | ||
module.exports = ArcArray; |
{ | ||
"name": "arc-array", | ||
"version": "2.0.3", | ||
"version": "2.1.0", | ||
"description": "An array convenience subclass", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -103,2 +103,5 @@ # arc-array [![Build Status](https://travis-ci.org/anyuzer/arc-array.svg?branch=master)](https://travis-ci.org/anyuzer/arc-array) | ||
###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 | ||
@@ -105,0 +108,0 @@ ``` |
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
12595
12
228
110