Skip to content

Commit

Permalink
1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fishcharlie committed Nov 18, 2017
1 parent ceb621e commit c16d489
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/browser/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions dist/node/array/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@ Array.prototype.remove = function () {
var _arguments = arguments,
_this = this;

Object.keys(arguments).forEach(function (key) {
var index = _arguments[key];
if (_this[index]) {
// If no arguments passed into remove function
if (arguments.length <= 0) {
// Should do nothing
return this;
}
delete arguments.length;
var indexesToRemove = Object.keys(arguments).map(function (key) {
return _arguments[key];
}).sort(function (a, b) {
return b - a; // sort descending order
});
indexesToRemove.forEach(function (index) {
if (_this[index] != undefined && _this[index] != null && index >= 0 && index < _this.length) {
_this.splice(index, 1);
}
});
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scriptutils",
"version": "1.1.0",
"version": "1.1.1",
"description": "Utilities to make Javascript Easy",
"main": "dist/node/index.js",
"scripts": {
Expand Down

0 comments on commit c16d489

Please sign in to comment.