{"name":"array-move","version":"2.1.0","description":"Move an array item to a different position","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/array-move.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["array","move","change","position","index"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.1","xo":"^0.24.0"},"gitHead":"629d1164b6631e146c3fbe8d5a4f77edee89a1b0","bugs":{"url":"https://github.com/sindresorhus/array-move/issues"},"homepage":"https://github.com/sindresorhus/array-move#readme","_id":"array-move@2.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-BXEIud+F7/ech2HcSfo+6bpgSCRlNnVTqQhGKdMov9iJkHq+vu9IP9qRXDpZvQpc1WWpDLiEfjs6Lfvvac+fDA==","shasum":"b4e9fc8d6a580bc97dcad408e0539c61b4b7ed7e","tarball":"http://registry-npm.ywwl.com/array-move/download/array-move-2.1.0.tgz","fileCount":5,"unpackedSize":4383,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcoswCCRA9TVsSAnZWagAA+1IQAI9GtdgVkli5mYl3Y/yK\nwTSgDdwz3sYgxfVQShdNKTu24kuIMMufRJHH359gRx6ArgJ3yPixOoUXocSX\nRtUP9I2zHfGcN2wVQLpmrjfYOjTXgcgzcXATMxHDUEZlQzm5rRmh+i+ZB54P\nHBqn6ZrcjF623Ruy48tF6sZUnyMNoXbpMOJXuBGDera2t3LM77DWqtOLfSTv\nfDLMqOZPS+N4lFSrr70X8Vdv7sCJFcEjjfHiyQGzlHQCzT2TVDhvyFOS+Fzq\nZbsmpYQ7geL50eHknhwjbtQNiXcDvcQgX7C0de9PFHf4lgaR78fgWM8SvjYt\nBPVnC9+kW6dKs55iCE+JWVYJ50R5Z0tKdMR8EUqFrIHrU17p2ybbfiHTWtCh\ns+IPWKC9OldGqF8oTj1ep/XMExD+wz8tScmvLEFDjcHp2ENSpAGJiX8+RHuv\n6wUQ92A+SGOYf6bWyvR7TBcTj6C2sKFbDm5gqg8yXmdnX7s99ewqEY4RIVjW\n/72KNtNKLYfDTT+xi9Quf5ivZ1+kjBUiJH85G4sIk7O5Z5qckMKPLRsRO4n1\nxwggPTL/1lL1gdSl52gGYGexWCNgSRF3kTAwkDm1I9CMxIkwtcdRpJ9p6xHr\n6LAIm+iB9clUwkrK8TDrP+qt1Fm7tMplxqyHHNEOMKJlNVKE6wHRyUEq96/2\nxLqL\r\n=zf+F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICgHj+fmuacPGuU5r5InqINpHrBJsBjm3uzobDsIMoYNAiB1QPpwlJAwe28dCAxnNQ3zsnRG4hYY3eaHEiiKvZBfXA=="}],"size":1912,"noattachment":false,"key":"/array-move/-/array-move-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/array-move_2.1.0_1554172929464_0.35918934901461586"},"_hasShrinkwrap":false,"readme":"# array-move\n\n> Move an array item to a different position\n\n## Install\n\n```\n$ npm install array-move\n```\n\n## Usage\n\n```js\nimport {arrayMoveImmutable} from 'array-move';\n\nconst input = ['a', 'b', 'c'];\n\nconst array1 = arrayMoveImmutable(input, 1, 2);\nconsole.log(array1);\n//=> ['a', 'c', 'b']\n\nconst array2 = arrayMoveImmutable(input, -1, 0);\nconsole.log(array2);\n//=> ['c', 'a', 'b']\n\nconst array3 = arrayMoveImmutable(input, -2, -3);\nconsole.log(array3);\n//=> ['b', 'a', 'c']\n```\n\n## API\n\n### arrayMoveImmutable(array, fromIndex, toIndex)\n\nClones the given `array`, moves the item to a new position in the new array, and then returns the new array. The given `array` is not mutated.\n\n### arrayMoveMutable(array, fromIndex, toIndex)\n\nMoves the item to the new position in the `array` array. Useful for huge arrays where absolute performance is needed.\n\n#### array\n\nType: `Array`\n\n#### fromIndex\n\nType: `number`\n\nThe index of item to move.\n\nIf negative, it will begin that many elements from the end.\n\n#### toIndex\n\nType: `number`\n\nThe index of where to move the item.\n\nIf negative, it will begin that many elements from the end.\n","publish_time":1554172929586,"_cnpm_publish_time":1554172929586,"dist-tags":{"latest":"4.0.0"}}