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

smath

Package Overview
Dependencies
Maintainers
0
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smath - npm Package Compare versions

Comparing version 1.9.2 to 1.10.0

22

dist/index.js

@@ -6,3 +6,5 @@ "use strict";

* @packageDocumentation
* ![NPM Downloads](https://img.shields.io/npm/d18m/smath) Small math function library
* Small math function library
*
* ![NPM Downloads](https://img.shields.io/npm/d18m/smath)
*/

@@ -408,2 +410,3 @@ /**

* ```
* @deprecated Use `SMath.shuffle()` instead
*/

@@ -422,2 +425,19 @@ function rseq(min, max) {

/**
* Randomize an array of arbitrary elements.
* @param stack An array of arbitrary elements
* @returns The `stack` array in a random order
* @example
* ```js
* ```
*/
function shuffle(stack) {
var rawData = [];
for (var _i = 0, stack_1 = stack; _i < stack_1.length; _i++) {
var item = stack_1[_i];
rawData.push({ index: Math.random(), value: item });
}
return rawData.sort(function (a, b) { return a.index - b.index; }).map(function (a) { return a.value; });
}
SMath.shuffle = shuffle;
/**
* Take the limit of a function. A return value of `NaN` indicates

@@ -424,0 +444,0 @@ * that no limit exists either due to a discontinuity or imaginary value.

2

package.json
{
"name": "smath",
"version": "1.9.2",
"version": "1.10.0",
"description": "Small math function library",

@@ -5,0 +5,0 @@ "homepage": "https://npm.nicfv.com/",

/**
* @packageDocumentation
* ![NPM Downloads](https://img.shields.io/npm/d18m/smath) Small math function library
* Small math function library
*
* ![NPM Downloads](https://img.shields.io/npm/d18m/smath)
*/

@@ -273,5 +275,15 @@ /**

* ```
* @deprecated Use `SMath.shuffle()` instead
*/
function rseq(min: number, max: number): Array<number>;
/**
* Randomize an array of arbitrary elements.
* @param stack An array of arbitrary elements
* @returns The `stack` array in a random order
* @example
* ```js
* ```
*/
function shuffle<T>(stack: Array<T>): Array<T>;
/**
* Take the limit of a function. A return value of `NaN` indicates

@@ -278,0 +290,0 @@ * that no limit exists either due to a discontinuity or imaginary value.

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