@brightsole/bg-utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

bg-utils

What are they?

tl;dr: an ever expanding set of utils that are useful in many areas of board game development
Method Props Description
shuffle ([any]) Randomly shuffles an array of inputs of any type, very random
selectUniqueRandoms Non-repeatingly selects any number of elements, randomly from an array
arrayToSelectFrom the array of items to randomly pick from
numberToSelect the number of random selections to make
selectUniqueIndices Non-repeatingly selects a number of numbers from 0 to max index
numberToSelect the number of indices to return in an array
max the highest number that can be returned

How to use them?

tl;dr: `npm i @brightsole/bg-utils`

import it, and start using the functions within!

  import { selectUniqueRandoms } from '@brightsole/bg-utils';

  const aFewRandoms = selectUniqueRandoms({ max: 3, numberToSelect: 2 });
  console.log(aFewRandoms);

TODO:

nothing! No plan here, just a bucket to collect random useful methods for consumption elsewhere

Buy Me A Coffee

Package Sidebar

Install

npm i @brightsole/bg-utils

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

5.23 kB

Total Files

4

Last publish

Collaborators

  • one19