You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

array-sugar

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-sugar - npm Package Compare versions

Comparing version

to
1.2.1

.idea/codeStyleSettings.xml

12

array-sugar.js

@@ -10,7 +10,14 @@ (function(arr) {

* @param {Number} high
* @returns {Array}
* @returns {Array} including low and high
*/
arr.range = function(low, high) {
var r = [];
var holder;
if (isNumber(low) && (isNumber(high))) {
if (low > high) {
holder = low;
low = high;
high = holder;
}
while (high >= low) {

@@ -20,2 +27,5 @@ r.push(low);

}
if (isNumber(holder)) {
r.reverse();
}
}

@@ -22,0 +32,0 @@ return r;

{
"name": "array-sugar",
"version": "1.2.0",
"version": "1.2.1",
"private": false,

@@ -19,9 +19,16 @@ "author": "capaj <capajj@gmail.com>",

"extend",
"array.contains",
"ecmascript",
"array.prototype",
"sugar",
"syntactic sugar"
],
"scripts": {
"test": "mocha"
},
"license": "MIT",
"devDependencies": {
"nodeunit": "~0.9"
"mocha": "^2.1.0",
"chai": "^1.10.0"
}
}

8

README.md

@@ -26,8 +26,9 @@ array-sugar

Available through npm and bower, just require(or include in index.html) and you should be good to go.
Available through npm and bower, just require(or include with regular script tag) and you should be good to go.
npm install array-sugar
bower install array-sugar
jspm install npm:array-sugar
Tests via nodeunit included.
Then require('array-sugar'); and you're done.

@@ -39,2 +40,5 @@ #known incompatibilities

##Is it a good idea to extend array.prototype?
If I am writing a web app, NOT a library/framework, I don't consider this a bad practice. I have quite few libraries and I do not use array-sugar in them even if It would be helpful most of the time. Users of these libraries would have their Array unexpectedly modified and we can't have that. But if you are building an end product used by end-user, I think it is quite allright to do that.
Missing any sugar? Please do submit a pull or feature request.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet