Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unique-random-array

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unique-random-array - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

8

index.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc