Skip to content

Commit

Permalink
fix: #3088 error in the description of the return type of pickRandom
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Nov 1, 2023
1 parent f9ab3a1 commit 76c4811
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/function/probability/pickRandom.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export const createPickRandom = /* #__PURE__ */ factory(name, dependencies, ({ t
* @param {Array | Matrix} array A one dimensional array
* @param {Int} number An int or float
* @param {Array | Matrix} weights An array of ints or floats
* @return {number | Array} Returns a single random value from array when number is 1 or undefined.
* Returns an array with the configured number of elements when number is > 1.
* @return {number | Array} Returns a single random value from array when number is undefined.
* Returns an array with the configured number of elements when number is defined.
*/
return typed(name, {
'Array | Matrix': function (possibles) {
Expand Down
5 changes: 2 additions & 3 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2275,9 +2275,8 @@ export interface MathJsInstance extends MathJsFactory {
* @param array A one dimensional array
* @param number An int or float
* @param weights An array of ints or floats
* @returns Returns a single random value from array when number is 1 or
* undefined. Returns an array with the configured number of elements
* when number is > 1.
* @returns Returns a single random value from array when number is undefined.
* Returns an array with the configured number of elements when number is defined.
*/
pickRandom<T>(array: T[]): T
pickRandom<T>(array: T[], number: number): T[]
Expand Down

0 comments on commit 76c4811

Please sign in to comment.