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

array-shuffle

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

array-shuffle - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

6

index.d.ts

@@ -8,3 +8,3 @@ /**

```
import arrayShuffle = require('array-shuffle');
import arrayShuffle from 'array-shuffle';

@@ -15,4 +15,2 @@ const shuffled = arrayShuffle([1, 2, 3, 4, 5, 6]);

*/
declare function arrayShuffle<ElementType>(array: readonly ElementType[]): ElementType[];
export = arrayShuffle;
export default function arrayShuffle<ElementType>(array: readonly ElementType[]): ElementType[];

@@ -1,4 +0,2 @@

'use strict';
module.exports = array => {
export default function arrayShuffle(array) {
if (!Array.isArray(array)) {

@@ -16,2 +14,2 @@ throw new TypeError(`Expected an array, got ${typeof array}`);

return array;
};
}
{
"name": "array-shuffle",
"version": "2.0.0",
"version": "3.0.0",
"description": "Randomize the order of items in an array",

@@ -13,4 +13,6 @@ "license": "MIT",

},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=10"
"node": ">=12.20"
},

@@ -36,6 +38,6 @@ "scripts": {

"devDependencies": {
"ava": "^3.13.0",
"tsd": "^0.13.1",
"xo": "^0.35.0"
"ava": "^3.15.0",
"tsd": "^0.17.0",
"xo": "^0.42.0"
}
}

@@ -5,3 +5,3 @@ # array-shuffle

Uses the [Durstenfeld algorithm](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm) based on the [Fisher–Yates algorithm](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle).
Uses the [Durstenfeld algorithm](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm) which is based on the [Fisher–Yates algorithm](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle).

@@ -17,2 +17,4 @@ ## Install

```js
import arrayShuffle from 'array-shuffle';
const shuffled = arrayShuffle([1, 2, 3, 4, 5, 6]);

@@ -28,4 +30,4 @@ //=> [3, 5, 4, 1, 2, 6]

Type: `array`
Type: `Array`
The array to shuffle.
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