@mathigon/fermat
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -814,2 +814,6 @@ 'use strict'; | ||
} | ||
/** Randomly selects an element from an array. */ | ||
function find(items) { | ||
return items[Math.floor(items.length * Math.random())]; | ||
} | ||
// --------------------------------------------------------------------------- | ||
@@ -938,2 +942,3 @@ // Smart Random Number Generators | ||
weighted: weighted, | ||
find: find, | ||
smart: smart, | ||
@@ -940,0 +945,0 @@ bernoulli: bernoulli, |
@@ -810,2 +810,6 @@ import { unique, repeat2D, tabulate2D, total, uid, repeat, list } from '@mathigon/core'; | ||
} | ||
/** Randomly selects an element from an array. */ | ||
function find(items) { | ||
return items[Math.floor(items.length * Math.random())]; | ||
} | ||
// --------------------------------------------------------------------------- | ||
@@ -934,2 +938,3 @@ // Smart Random Number Generators | ||
weighted: weighted, | ||
find: find, | ||
smart: smart, | ||
@@ -936,0 +941,0 @@ bernoulli: bernoulli, |
{ | ||
"name": "@mathigon/fermat", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Powerful mathematics and statistics library for JavaScript.", | ||
@@ -33,18 +33,18 @@ "keywords": [ | ||
"dependencies": { | ||
"@mathigon/core": "^0.5.2" | ||
"@mathigon/core": "^0.6.0" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-typescript": "6.0.0", | ||
"@rollup/plugin-typescript": "8.0.0", | ||
"@types/tape": "4.13.0", | ||
"rollup": "2.27.1", | ||
"rollup": "2.34.0", | ||
"tape": "5.0.1", | ||
"ts-node": "9.0.0", | ||
"tslib": "2.0.1", | ||
"typescript": "4.0.3", | ||
"@typescript-eslint/eslint-plugin": "4.1.0", | ||
"@typescript-eslint/parser": "4.1.0", | ||
"eslint": "7.8.1", | ||
"tslib": "2.0.3", | ||
"typescript": "4.1.2", | ||
"@typescript-eslint/eslint-plugin": "4.9.0", | ||
"@typescript-eslint/parser": "4.9.0", | ||
"eslint": "7.14.0", | ||
"eslint-config-google": "0.14.0", | ||
"eslint-plugin-import": "2.22.0" | ||
"eslint-plugin-import": "2.22.1" | ||
} | ||
} |
@@ -35,3 +35,8 @@ // ============================================================================ | ||
/** Randomly selects an element from an array. */ | ||
export function find<T>(items: T[]): T { | ||
return items[Math.floor(items.length * Math.random())]; | ||
} | ||
// --------------------------------------------------------------------------- | ||
@@ -38,0 +43,0 @@ // Smart Random Number Generators |
130151
3766
+ Added@mathigon/core@0.6.8(transitive)
- Removed@mathigon/core@0.5.2(transitive)
Updated@mathigon/core@^0.6.0