{"name":"array-move","version":"2.2.1","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":"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":"f3645e5b3ac7ad1d8fe42d380365a4c58c0b66b4","bugs":{"url":"https://github.com/sindresorhus/array-move/issues"},"homepage":"https://github.com/sindresorhus/array-move#readme","_id":"array-move@2.2.1","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-qQpEHBnVT6HAFgEVUwRdHVd8TYJThrZIT5wSXpEUTPwBaYhPLclw12mEpyUvRWVdl1VwPOqnIy6LqTFN3cSeUQ==","shasum":"16d5b68cb949c43e8821d63e4622f3a3336f254d","tarball":"http://registry-npm.ywwl.com/array-move/download/array-move-2.2.1.tgz","fileCount":5,"unpackedSize":4442,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd4/QrCRA9TVsSAnZWagAAve8P+gIIfuDpQn2152fq8/AQ\numyBXzHe15dcB9g7L5ZKnLAyqMJS3v9am/jcWUtJjy5XJ9LZXxOc9mXU4LYo\n+jUYbDJhqDEE6YTILmP5MYaJXeP+v7+x/+cu4D35ZfZwlZM169DQJkwUdY92\nTIOLnpE1zUO63jhQJB/B4stts4eyyHwhBZIqsv1Lul3/de7uv+LOdyqs8JEK\nfT94KR+5wr1jBip3R4GA1f/8bbeHLl0A7CBv73dtSpVE0yYDswU9vzaie7lX\njplX97YpEV2C534xZz6EgDL4B56K0ziNiFj+Iglcc15o0N2jqNj2MuXnESm7\n9boBr8dz+078iZTPbdGScpK0y0cI8Ph+Vr1FnxLl+CYKAT07kdEWAwBvuOhQ\nVK2jCdzLBSoPP98JTEqqPjD1MFz6TSbO7hmwTpYLXOLhXfzdu4jj2uEq5e/q\nh7qxxQ+WE7CGiwXLm99Y0qZBhCHi1TXtmz9kCjhnbbeu1KbYPlwttUJPF61F\nHNBw6GhTX5RnfYJqzBCUhCNQ2/MFVJyWCFLU85abPkCOGqFFdgnN5qryyS63\nQ70oZBB4qX0siim1QS8B6XcfCDtUD5MQIp55VS5lPPcQ2uZ73NwqfRi1Wd39\n3kYSzaRYxmQn345msNlrqVXbqSvlIzBez8mb94cLnOTGk86eVcMA31tKcWWQ\nM0IF\r\n=8Gez\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEgbAgVRVpUjdzRuJ0vAgmXf/KUKmE5QR7JGrUjwFHPGAiBozefK7CBJQovFNLaPYTmiTJDxdhWbCasCckEuLJxN/Q=="}],"size":1959,"noattachment":false,"key":"/array-move/-/array-move-2.2.1.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/array-move_2.2.1_1575220267334_0.9117059312660383"},"_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":1575220267462,"_cnpm_publish_time":1575220267462,"dist-tags":{"latest":"4.0.0"}}