Returns a new array in which one or more consectutive items within a source array are moved to a new index
This module makes use of a
Makefile for building/testing purposes. After obtaining a copy of the repo, run the following commands to make sure everything is in working condition before you start your work:
make install make test
Before committing a change to your fork/branch, run the following commands to make sure nothing is broken:
make test make test-cov
Don't forget to bump the version in the
package.json using the semver spec as a guide for which part to bump. Submit a pull request when your work is complete.
- Please do your best to ensure the code coverage does not drop. If new unit tests are required to maintain the same level of coverage, please include those in your pull request.
- Please follow the same coding/formatting practices that have been established in the module.
npm install array-move-many
var move = require('array-move-many'); var result = move(['a', 'b', 'c', 'd'], 0, 2, 1); // result = ['c', 'a', 'b', 'd']
The MIT License (MIT)