{"name":"array-move","version":"3.0.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":"https://sindresorhus.com"},"engines":{"node":">=10"},"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":"03af3d2987e2a1fbb0c8c08ab5b3733c29658710","bugs":{"url":"https://github.com/sindresorhus/array-move/issues"},"homepage":"https://github.com/sindresorhus/array-move#readme","_id":"array-move@3.0.1","_nodeVersion":"14.5.0","_npmVersion":"6.14.7","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-H3Of6NIn2nNU1gsVDqDnYKY/LCdWvCMMOWifNGhKcVQgiZ6nOek39aESOvro6zmueP07exSl93YLvkN4fZOkSg==","shasum":"179645cc0987b65953a4fc06b6df9045e4ba9618","tarball":"http://registry-npm.ywwl.com/array-move/download/array-move-3.0.1.tgz","fileCount":5,"unpackedSize":4814,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLo9YCRA9TVsSAnZWagAAGAwQAI4CZsz1771Tf7n++BL2\n3PeCGf+Nshg0zvT0B9b08t/Ly/N1o3Mda/X43Wk+/MiKd5KW6t6CiIpD7BVL\n717j57tbDDhTjhyOEt8EbbZ51ZuP74Dp3XYA9F+2VH4AlR4j9IMxnV0viUyk\ntebnH7SbCGpHcjkXVV0lNW/SLwFWngAliD12dOtASovcn0QFTP5tSqacLXfb\nnnHZ6q0NrWwNxh5PB98vZxCRs4VOdZ13RculyN0ZsHWxBJ5maCBKExarFqIC\nstAOa9joY1mYGdeRiPqMYGrWfAkSJyU+DMBjW4nT3q2bBRt+42Go0+PlDEyG\nZAvf82DuOlUQOZtCDgbkwBLuVTuiXeok/urQed1clClmRdu55RouHoWmv+4z\nHNJVz1j9SVbI5aZGwLmD5RnGm9wOQcg4nO58pFF7apwe/OxFF3aXIrLlHdUg\nqnz/iuT2/W6WdEzcDAyxPffQM3SUXF53rYDWHSQKgGquQB+cDsDYSPo47MAN\nOKraLKV/duXsgv6BminEOqeBBRVkrxJa5xKYvUkfW1xjMcCLGfx4wZbUma3J\nIlXyb9a8lIjqRkkVUXfjosliX6w10JWrD062Lue/YIiizZRyf0/GfIJya0F9\nNUeton3dHo6XcIFZKeZL5FUQgTtDSw75XCDka0twcbxKcI8LJFO4Jvq7toWc\nYYuY\r\n=4tif\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB4zGrdEc58GWOZY9RvjubIPlAf/KhKp3nwjPhq/ZA6qAiEA6bIn01teBY7juIBLwHARn3T52nSS9fPcOy/e3WweSIg="}],"size":2026,"noattachment":false,"key":"/array-move/-/array-move-3.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/array-move_3.0.1_1596886871548_0.5522972765629377"},"_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":1596886871672,"_cnpm_publish_time":1596886871672,"dist-tags":{"latest":"4.0.0"}}