{"name":"array-move","version":"2.2.2","description":"Move an array item to a different position","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/array-move.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["array","move","change","position","index"],"devDependencies":{"ava":"^2.4.0","tsd":"^0.9.0","xo":"^0.25.3"},"gitHead":"e4b7365346e4489841a4aaef671cd22a328cb1e1","bugs":{"url":"https://github.com/sindresorhus/array-move/issues"},"homepage":"https://github.com/sindresorhus/array-move#readme","_id":"array-move@2.2.2","_nodeVersion":"10.20.1","_npmVersion":"6.14.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-lKc6C+nsOSA1o7eHSP/HshlGDYUI7QKyaus5kPDm2zEEPQID9xlspnraLR8l+rDlqg9mGo8ziE7F8TEnF6D3Tw==","shasum":"c125f84d64e2f4bc09147f91f900a1bf58bb25d1","tarball":"http://registry-npm.ywwl.com/array-move/download/array-move-2.2.2.tgz","fileCount":5,"unpackedSize":4864,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJey9WICRA9TVsSAnZWagAAMaIP/i+2hUG6bPmtd71dzGtp\niKhSkw38BUNiK4lCJL323kn7mYw59f4j6G9LefpQmB+1s3W535zxebe1VSYL\n6htUq+qntf8RbT8QYhGSPos2c3S8sU7HHxN+Y9ANeRsRWb8e0FUXItD8hjVC\n+btzhqYyByvGq2w8QNTBfOXIJ3v0ndPJlTQZcQUEGf0dPyboUBFm9I640okW\ndeF46WOGYu104iXI6SSyaBKNmtlfBnF4zxncfL7kqRMVz0fOYsWLHY1cWXJ1\nlmv9PdF46Dmjn4T05iVw3YfB2O86uhTe3LaF3v68g/tsU9ZX2o+xBCTSgj9f\nnNO15xMWD/qR8fY1d1fwDDpPLtD1Lt5fSPs1FFsO2HsnASgWFv6UpltW6AI5\nxLKwgpZRFdgNgwSP1Xv0KKoVPFKhbKaX+8wdgqMptxGcnhMbK66pXToDdiVR\nWOHKE+UDJ/dY4qmb/yp06s9ni7FJwGwf3qzhhrcaT0MXd3jWpuZ0SPfrnRTU\nnkR0tDHkT5dxJ+skrrx3VcKb+Ljv1ihpHgT6nCeriFaMH/TGkQhEFtSP9no5\nglDcK1VtWUmD86M0tpTLbSFZDnd10h5HlAstLhh07+T9KF9BHMKzrbNkiR9f\nHDH2wLBCyHRgA+wMrDuGJB/Xp5ibdGFcRfKFYx1St3yJZa2AnGm4l3g6TWLx\nXOJn\r\n=k2YI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCe/stWajSiJovK69VxCG66SMpscfmcnZMpj+aobr2oEgIhANVWkBFMd+BVVyv9FmqbS6d2otCA4JafYkFifiN789St"}],"size":2040,"noattachment":false,"key":"/array-move/-/array-move-2.2.2.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/array-move_2.2.2_1590416776293_0.5103364265225092"},"_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":1590416776409,"_cnpm_publish_time":1590416776409,"dist-tags":{"latest":"4.0.0"}}