{"_id":"arr-swap","_rev":"161716","name":"arr-swap","description":"Swap two items in an array. Does not modify the Array prototype.","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T11:41:01.000Z","created":"2017-05-26T02:05:00.397Z","1.0.1":"2017-05-26T02:10:57.374Z","1.0.0":"2017-05-26T02:05:00.397Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/arr-swap.git"},"versions":{"1.0.1":{"name":"arr-swap","description":"Swap two items in an array. Does not modify the Array prototype.","version":"1.0.1","homepage":"https://github.com/jonschlinkert/arr-swap","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/arr-swap.git"},"bugs":{"url":"https://github.com/jonschlinkert/arr-swap/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"is-number":"^3.0.0"},"devDependencies":{"gulp-format-md":"^0.1.12","mocha":"^3.4.2"},"keywords":["arr","array","swap"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["arr-flatten","arr-union","array-unique"]},"lint":{"reflinks":true}},"gitHead":"b584f561681cb58839e55c8148faa43f23eb9e00","_id":"arr-swap@1.0.1","_shasum":"147590ed65fc815bc07fef0997c2e5823d643534","_from":".","_npmVersion":"4.6.1","_nodeVersion":"7.7.3","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"147590ed65fc815bc07fef0997c2e5823d643534","size":2525,"noattachment":false,"key":"/arr-swap/-/arr-swap-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/arr-swap/download/arr-swap-1.0.1.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/arr-swap-1.0.1.tgz_1495764656459_0.23885946325026453"},"directories":{},"publish_time":1495764657374,"_hasShrinkwrap":false,"_cnpm_publish_time":1495764657374},"1.0.0":{"name":"arr-swap","description":"Swap two items in an array. Does not modify the Array prototype.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/arr-swap","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/arr-swap.git"},"bugs":{"url":"https://github.com/jonschlinkert/arr-swap/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=4"},"scripts":{"test":"mocha"},"keywords":["array","swap"],"devDependencies":{"gulp-format-md":"^0.1.12","mocha":"^3.4.2"},"dependencies":{"is-number":"^3.0.0"},"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["arr-flatten","array-unique","arr-union"]},"lint":{"reflinks":true}},"gitHead":"c60508d95e73dad0124bef92bcd259454ceb5084","_id":"arr-swap@1.0.0","_shasum":"9e5f7732c505d87a3de982b4bc1c7f5b54e3d94e","_from":".","_npmVersion":"4.6.1","_nodeVersion":"7.7.3","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"9e5f7732c505d87a3de982b4bc1c7f5b54e3d94e","size":2518,"noattachment":false,"key":"/arr-swap/-/arr-swap-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/arr-swap/download/arr-swap-1.0.0.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/arr-swap-1.0.0.tgz_1495764298345_0.6311862831935287"},"directories":{},"publish_time":1495764300397,"_hasShrinkwrap":false,"_cnpm_publish_time":1495764300397}},"readme":"# arr-swap [![NPM version](https://img.shields.io/npm/v/arr-swap.svg?style=flat)](https://www.npmjs.com/package/arr-swap) [![NPM monthly downloads](https://img.shields.io/npm/dm/arr-swap.svg?style=flat)](https://npmjs.org/package/arr-swap) [![NPM total downloads](https://img.shields.io/npm/dt/arr-swap.svg?style=flat)](https://npmjs.org/package/arr-swap) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/arr-swap.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/arr-swap)\n\n> Swap two items in an array. Does not modify the Array prototype.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save arr-swap\n```\n\n## Usage\n\n```js\nvar swap = require('arr-swap');\n```\n\n**By index**\n\nSwap by array index:\n\n```js\nvar arr = ['a', 'b', 'c'];\nconsole.log(swap(arr, 0, 1));\n//=> ['b', 'a', 'c'];\n```\n\n**By element**\n\nSwap by array elements:\n\n```js\nvar arr = ['a', 'b', 'c'];\nconsole.log(swap(arr, 'a', 'b'));\n//=> ['b', 'a', 'c'];\n```\n\n## About\n\n### Related projects\n\n* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. | [homepage](https://github.com/jonschlinkert/arr-flatten \"Recursively flatten an array or arrays.\")\n* [arr-union](https://www.npmjs.com/package/arr-union): Combines a list of arrays, returning a single array with unique values, using strict equality… [more](https://github.com/jonschlinkert/arr-union) | [homepage](https://github.com/jonschlinkert/arr-union \"Combines a list of arrays, returning a single array with unique values, using strict equality for comparisons.\")\n* [array-unique](https://www.npmjs.com/package/array-unique): Remove duplicate values from an array. Fastest ES5 implementation. | [homepage](https://github.com/jonschlinkert/array-unique \"Remove duplicate values from an array. Fastest ES5 implementation.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 25, 2017._","_attachments":{},"homepage":"https://github.com/jonschlinkert/arr-swap","bugs":{"url":"https://github.com/jonschlinkert/arr-swap/issues"},"license":"MIT"}