array-shift
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -11,3 +11,3 @@ const shift = (array, old_index, new_index) => { | ||
const down = (array, index)=>{ | ||
if(array && index > 0 && index < array.length) | ||
if(array && index >= 0 && index < array.length-1) | ||
shift(array, index, index+1) | ||
@@ -17,3 +17,3 @@ }; | ||
const up = (array, index)=>{ | ||
if(array && index >= 0) | ||
if(array && index > 0) | ||
shift(array, index, index-1) | ||
@@ -20,0 +20,0 @@ }; |
{ | ||
"name": "array-shift", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Shift array element up, down or custom", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
877