unique-random-array
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -8,3 +8,3 @@ /** | ||
``` | ||
import uniqueRandomArray = require('unique-random-array'); | ||
import uniqueRandomArray from 'unique-random-array'; | ||
@@ -17,6 +17,2 @@ const random = uniqueRandomArray([1, 2, 3, 4]); | ||
*/ | ||
declare function uniqueRandomArray<ValueType>( | ||
array: readonly ValueType[] | ||
): () => ValueType; | ||
export = uniqueRandomArray; | ||
export default function uniqueRandomArray<T>(array: readonly T[]): () => T; |
@@ -1,7 +0,6 @@ | ||
'use strict'; | ||
const uniqueRandom = require('unique-random'); | ||
import uniqueRandom from 'unique-random'; | ||
module.exports = array => { | ||
export default function uniqueRandomArray(array) { | ||
const random = uniqueRandom(0, array.length - 1); | ||
return () => array[random()]; | ||
}; | ||
} |
{ | ||
"name": "unique-random-array", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Get consecutively unique elements from an array", | ||
"license": "MIT", | ||
"repository": "sindresorhus/unique-random-array", | ||
"funding": "https://github.com/sponsors/sindresorhus", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
"url": "https://sindresorhus.com" | ||
}, | ||
"type": "module", | ||
"exports": "./index.js", | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=12" | ||
}, | ||
@@ -34,9 +37,9 @@ "scripts": { | ||
"dependencies": { | ||
"unique-random": "^2.1.0" | ||
"unique-random": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^1.4.1", | ||
"tsd": "^0.7.2", | ||
"xo": "^0.24.0" | ||
"ava": "^3.15.0", | ||
"tsd": "^0.14.0", | ||
"xo": "^0.38.2" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# unique-random-array [![Build Status](https://travis-ci.org/sindresorhus/unique-random-array.svg?branch=master)](https://travis-ci.org/sindresorhus/unique-random-array) | ||
# unique-random-array | ||
@@ -7,3 +7,2 @@ > Get consecutively unique elements from an array | ||
## Install | ||
@@ -15,7 +14,6 @@ | ||
## Usage | ||
```js | ||
const uniqueRandomArray = require('unique-random-array'); | ||
import uniqueRandomArray from 'unique-random-array'; | ||
@@ -28,3 +26,2 @@ const random = uniqueRandomArray([1, 2, 3, 4]); | ||
## API | ||
@@ -40,3 +37,2 @@ | ||
## Related | ||
@@ -51,6 +47,1 @@ | ||
- [crypto-random-string](https://github.com/sindresorhus/crypto-random-string) - Generate a cryptographically strong random string | ||
## License | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Yes
3863
17
43
+ Addedunique-random@3.0.0(transitive)
- Removedunique-random@2.1.0(transitive)
Updatedunique-random@^3.0.0