{"name":"array-move","version":"3.0.0","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":"ad75af1fb6dc1e74958bfbba3a85677050282a59","bugs":{"url":"https://github.com/sindresorhus/array-move/issues"},"homepage":"https://github.com/sindresorhus/array-move#readme","_id":"array-move@3.0.0","_nodeVersion":"14.5.0","_npmVersion":"6.14.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-kqK1ZKiAVfIdfiJjC3zpAGPg3OEkjeeKuOILwS1b+oh34dI6GTg9szgRT+oKWw48RuVF8RGjlWCSYkn6NU+Jvw==","shasum":"b646a2f4980be78f04d28d7572a72036150d364e","tarball":"http://registry-npm.ywwl.com/array-move/download/array-move-3.0.0.tgz","fileCount":5,"unpackedSize":4758,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCxhVCRA9TVsSAnZWagAAmN4P/AqWOMdvsoRRS61HKXhf\n8p8K0t717gXQ+9u8qQS0a7AF8SRDke/oP/QrCY5bIrXIXJgFWTkjCd3zeGV9\nnriMc4ZtiSIBa0znkLG3r9giuuV39GGV89gyiZZ5MZbFd87W6DZGBw64qf2+\n/8inrm2SJJi5vEZBINV14NZgAR0iTgFcEUeulOd96gN9tuYQ7KrrgcLXeA3+\nmMsNwUyV1UC6h9P0DcbLjFQK+Bz35YWcoJ5i0rJw6tsU0TfEp9bOW9txA2+t\n42Cb7GXCowqn6+SOt6O4F2xZBtfNrdN4hynBz9F0Wm4LTg9DAh8NkkZJfC7D\n5relx9P6CLgY3hyzagSdSOMjaXp9J9gOAZ+5fAMFvyCasqIMgwTWK4WgizAQ\n9tVUEt1XVFcR5lT3A7WWW6n6Mq8u5/ylyJHsnUVoH5I4Ik2RXEOqGcGfmPL0\nc6XSZf3nr+biQlCIq+LL4eBFbAAyC+L3INd3ZXhR6lWpjJABu//i1Tgz+UdZ\n/on2Z+WgbRyZ3Qmh356TuOBbV/Di1JZBA030ouA9f+M2J9sgQF2sVSClOKWd\ns8hli7YqPCRRVJ9zlxz741SsmZbDICZsaj2OBVdMPagGQdpVFCBHqvpDgelq\n5Ebc1xx/Bg03SzyW8rZw3Ak4UfkoNTfSuYqu8mh0W/ESJPkru5EUzIzkS78f\n9MWH\r\n=9AhD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDaOz44mMMYfsPgO4l4BLBFCUMrBsDE5J/7whRaLDjZ3AiEAhky/jAmQdlk+sD+wk46sxtiJEiC34rolzHhOU6tVRtM="}],"size":2008,"noattachment":false,"key":"/array-move/-/array-move-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/array-move_3.0.0_1594562644976_0.6400207976405741"},"_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":1594562645128,"_cnpm_publish_time":1594562645128,"dist-tags":{"latest":"4.0.0"}}