{"name":"array-move","version":"2.2.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":"^2.4.0","tsd":"^0.9.0","xo":"^0.25.3"},"gitHead":"27d179ec56f65044116051255c348a8f811f9b7c","bugs":{"url":"https://github.com/sindresorhus/array-move/issues"},"homepage":"https://github.com/sindresorhus/array-move#readme","_id":"array-move@2.2.0","_nodeVersion":"10.16.3","_npmVersion":"6.12.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-n9Wlbjl9tb9c7qoKjminaLwyUR5y4UV+DXcCu428yUSvBD7WWmfskEB98zdrgMPKFDUrzfZtdJuZ3Pzi3k5IbA==","shasum":"28f39b915df05ce8b00c43100d20b5a6385f7606","tarball":"http://registry-npm.ywwl.com/array-move/download/array-move-2.2.0.tgz","fileCount":5,"unpackedSize":4334,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdroY5CRA9TVsSAnZWagAAql4P/12x1il/19ZGn5Oi2GFF\n1ktWsxgpFeWJS/Id1qm2O73G5vL1t9vaLH4L0lFPdYrFEt1wt9PVZfv5d2Kb\nXcoIs0QalgtTzXYyqgWANWwA2ql23/0AsNENB9PnCpfpBcTigByICY2hI1d2\n//zkUu2OBgIZ2BBiluylA53GOZzB8iEWsUKxEhzeUGi9AcVtmsOFS/2frJzt\nb92xrVuAbIjwJ+AB7r22b+klsAwYTa9b5Wf9TfbYwlUWdD0xgxbszRrm5ShK\nMhoWDHTMsEU3SQ4XNFdQ0GNiPE+j1GxJyYDwNhD2NGKtTQ+7NVPzR+Yt5wEX\nkd69K+/mMU1hrUziRsmPzENk+isDqIrsj7z/yuqv/rAPWWekptW/sAErwKt2\nQ6fz7iyu10apK7Gn6LGIVKQcb2KAU4iF8LO7w4CjlvXYUjEdyh3F1Q7jCob1\ni8LqHjxUh/QURUjeqcDiXN1l/K0QCvnKNx1y5DuwrtP4hAmc9a7poNYk8vvZ\na0yOw5/0pK5MHmAdoftcvKwy/qZLU/G3syGIgRHniY9bLS1TmK9rgr1OGBpv\nVX9qKrkLZapz4W+UaIgoEjURH/djb8+cMXzIJJT4kT0SfYQqUtueefrr1dCt\nMYAj3WPc3GdzVGgVf58bYIOLSNiUDlDWXZkI0tvhUcpefTk0jt4sXlWS9ASo\noVdb\r\n=nYxl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCetWJo90/KjZ3sjxzQDqj+ni4EbDVBON8cynYQgp9wNwIgShnIfHLcb/mWhMHOJUVncWRrx4ZS9ZdBhohyp1JFHH8="}],"size":1910,"noattachment":false,"key":"/array-move/-/array-move-2.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/array-move_2.2.0_1571718713343_0.15599465858874284"},"_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":1571718713484,"_cnpm_publish_time":1571718713484,"dist-tags":{"latest":"4.0.0"}}