{"_id":"unique-random-array","_rev":"2785575","name":"unique-random-array","description":"Get consecutively unique elements from an array","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2022-06-21T07:45:22.000Z","created":"2015-01-19T13:49:43.787Z","3.0.0":"2021-04-09T13:25:56.828Z","2.0.0":"2019-04-12T19:53:11.468Z","1.0.1":"2018-03-23T05:12:20.829Z","1.0.0":"2015-01-19T13:49:43.787Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/unique-random-array.git"},"versions":{"3.0.0":{"name":"unique-random-array","version":"3.0.0","description":"Get consecutively unique elements from an array","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/unique-random-array.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["unique","random","number","single","generate","non-repeating","array","item","element"],"dependencies":{"unique-random":"^3.0.0"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.38.2"},"gitHead":"8d08e8c1cc1ad1aadf5a731d8cd61eba79a1b0b7","bugs":{"url":"https://github.com/sindresorhus/unique-random-array/issues"},"homepage":"https://github.com/sindresorhus/unique-random-array#readme","_id":"unique-random-array@3.0.0","_nodeVersion":"15.12.0","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"db0c11c885d674c39050a79cf25d11b09ff97c22","size":1821,"noattachment":false,"key":"/unique-random-array/-/unique-random-array-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/unique-random-array/download/unique-random-array-3.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unique-random-array_3.0.0_1617974756686_0.9076196723840382"},"_hasShrinkwrap":false,"publish_time":1617974756828,"_cnpm_publish_time":1617974756828,"_cnpmcore_publish_time":"2021-12-16T13:29:26.629Z"},"2.0.0":{"name":"unique-random-array","version":"2.0.0","description":"Get consecutively unique elements from an array","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/unique-random-array.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["unique","random","number","single","generate","non-repeating","array","item","element"],"dependencies":{"unique-random":"^2.1.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"04cc4d6a946d3f79709d5f32b1a9cc4ea358d806","bugs":{"url":"https://github.com/sindresorhus/unique-random-array/issues"},"homepage":"https://github.com/sindresorhus/unique-random-array#readme","_id":"unique-random-array@2.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"9e639b1a9dc141e97350a6fc6f17da4b0717b1ad","size":1886,"noattachment":false,"key":"/unique-random-array/-/unique-random-array-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/unique-random-array/download/unique-random-array-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unique-random-array_2.0.0_1555098791318_0.39118064605667513"},"_hasShrinkwrap":false,"publish_time":1555098791468,"_cnpm_publish_time":1555098791468,"_cnpmcore_publish_time":"2021-12-16T13:29:26.885Z"},"1.0.1":{"name":"unique-random-array","version":"1.0.1","description":"Get consecutively unique elements from an array","keywords":["unique","uniq","random","rand","number","single","generate","non-repeating","array","arr","item","element"],"license":"MIT","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"files":["index.js"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/unique-random-array.git"},"scripts":{"test":"ava"},"dependencies":{"unique-random":"^1.0.0"},"devDependencies":{"ava":"*"},"engines":{"node":">=0.10.0"},"gitHead":"e264ecd0a9f92d0a0d849f62e14cb4d32ce51cba","bugs":{"url":"https://github.com/sindresorhus/unique-random-array/issues"},"homepage":"https://github.com/sindresorhus/unique-random-array#readme","_id":"unique-random-array@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"f29bda2a62be8860a703c4739c8f4fdb4d722cc7","size":1806,"noattachment":false,"key":"/unique-random-array/-/unique-random-array-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/unique-random-array/download/unique-random-array-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unique-random-array_1.0.1_1521781940696_0.26286711348666336"},"_hasShrinkwrap":false,"publish_time":1521781940829,"_cnpm_publish_time":1521781940829,"_cnpmcore_publish_time":"2021-12-16T13:29:27.169Z"},"1.0.0":{"name":"unique-random-array","version":"1.0.0","description":"Get consecutively unique elements from an array","keywords":["unique","uniq","random","rand","number","single","generate","non-repeating","array","arr","item","element"],"license":"MIT","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"files":["index.js"],"repository":{"type":"git","url":"https://github.com/sindresorhus/unique-random-array"},"scripts":{"test":"node test.js"},"dependencies":{"unique-random":"^1.0.0"},"devDependencies":{"ava":"0.0.4"},"engines":{"node":">=0.10.0"},"gitHead":"32027155885dfd1242192a05f84689f832e8d7e9","bugs":{"url":"https://github.com/sindresorhus/unique-random-array/issues"},"homepage":"https://github.com/sindresorhus/unique-random-array","_id":"unique-random-array@1.0.0","_shasum":"42b3721c579388d8b667c93c2dbde3d5d81a9136","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"42b3721c579388d8b667c93c2dbde3d5d81a9136","size":1006,"noattachment":false,"key":"/unique-random-array/-/unique-random-array-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/unique-random-array/download/unique-random-array-1.0.0.tgz"},"directories":{},"publish_time":1421675383787,"_hasShrinkwrap":false,"_cnpm_publish_time":1421675383787,"_cnpmcore_publish_time":"2021-12-16T13:29:27.429Z"}},"readme":"# unique-random-array\n\n> Get consecutively unique elements from an array\n\nUseful for things like slideshows where you don't want to have the same slide twice in a row.\n\n## Install\n\n```\n$ npm install unique-random-array\n```\n\n## Usage\n\n```js\nimport uniqueRandomArray from 'unique-random-array';\n\nconst random = uniqueRandomArray([1, 2, 3, 4]);\n\nconsole.log(random(), random(), random(), random());\n//=> 4 2 1 4\n```\n\n## API\n\n### uniqueRandomArray(array)\n\nReturns a function, that when called, will return a random element that's never the same as the previous.\n\n#### array\n\nType: `unknown[]`\n\n## Related\n\n- [unique-random](https://github.com/sindresorhus/unique-random) - Generate random numbers that are consecutively unique\n- [random-int](https://github.com/sindresorhus/random-int) - Generate a random integer\n- [random-float](https://github.com/sindresorhus/random-float) - Generate a random float\n- [random-item](https://github.com/sindresorhus/random-item) - Get a random item from an array\n- [random-obj-key](https://github.com/sindresorhus/random-obj-key) - Get a random key from an object\n- [random-obj-prop](https://github.com/sindresorhus/random-obj-prop) - Get a random property from an object\n- [crypto-random-string](https://github.com/sindresorhus/crypto-random-string) - Generate a cryptographically strong random string\n","_attachments":{},"homepage":"https://github.com/sindresorhus/unique-random-array#readme","bugs":{"url":"https://github.com/sindresorhus/unique-random-array/issues"},"license":"MIT"}