{"name":"array-move","version":"2.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"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["array","move","change","position","index"],"devDependencies":{"ava":"^1.3.1","tsd-check":"^0.6.0","xo":"^0.24.0"},"gitHead":"a9f625ee083d31feee0784a7beaebc3fd812f64e","bugs":{"url":"https://github.com/sindresorhus/array-move/issues"},"homepage":"https://github.com/sindresorhus/array-move#readme","_id":"array-move@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-bF5o1eewLiCJeumuh6vRZsW7ouLCSAEWIpXSliFWIa8/6Cs630a69ooR+H8ExLz8p17/LVUbpXDoJdP08Cpv5A==","shasum":"4aa2262560ec75bae7a08a69e186ef80d439f770","tarball":"http://registry-npm.ywwl.com/array-move/download/array-move-2.0.0.tgz","fileCount":5,"unpackedSize":4271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcknKHCRA9TVsSAnZWagAAziIP/34B5cIWcrU9lLJV8f+u\noseBn+TvdmxiXvEy9wxOfoQ74Lnj4WR1ei9dXVCnJuZzseNGImDAniJMY1QF\nwKmb0w7/l4aCUPl1lSbYKikeBMlmok/HUy7FB2c7LRoOVC8AItekSxhcSnAm\nQCSmMX/pqdXIgwv+ScxotU/tbuDyzmd2I05n+FLYtsMvOGfYblFU+j8CAJnV\nEOYHuMglu2Gw+ooN6A37qg3SvbOlkh0u2q1/A/WvLi+6temD87vjETvR7AXn\nH5JQZfVyrC/f35LylZBXJDWimGnxSrbIcYlb8nslioC5AluhL/XJ40uMu7V6\nRoX3J9cRQYqsd05UlsFjINSmmaNiJq3WCFGRujybczhsJ1TTwrC/hoiS+1DY\nSgVXOWv8WXrcPxL4w13VXrq4lXVVx4T7p08jQppHrwxF7SxoScfpHVc24xzt\nRFoCrPj8D8R9D4+s8j87iCksUWsd4vS8mlUxd0pZLiNOodbNAvmr3KW8SLEc\nG6gihX50O+pdL7pJ4B0dFKGQhUVQNYBj2JGo574Zw+Qvov0msMbfNDi9KUHI\nHdXkyXmwZJlDTC4YbIAj20vojcyJIFSfDCyWtHRajCKl+F4RlymsmgaU8dLz\nuwip8YHuLbridbast7h/k/64sSyHxtehqLR7A3dBBhtv+C2krr+RwggqbHxB\nc75e\r\n=rRqp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHZmncNb+xzSDEq6J1FI6FTYEeXRQgdXRzoBTniEOvWuAiBLS+RJxcCf8xxvZlOuvcGTwLxzmPdjsfvQNJyVBW+vkw=="}],"size":1890,"noattachment":false,"key":"/array-move/-/array-move-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/array-move_2.0.0_1553101446765_0.2685224664016157"},"_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":1553101446941,"_cnpm_publish_time":1553101446941,"dist-tags":{"latest":"4.0.0"}}