use-multi-possibility
TypeScript icon, indicating that this package has built-in type declarations

1.0.14 • Public • Published

use-multi-possibility

Codecov Coverage GitHub

Purpose

use-multi-possibility is a package designed to simplify testing with a large set of possible values.

It will test every combination of the groups provided.

It also includes sets of grouped data to test with.

Table of Contents

  1. Installation
  2. How to use
  3. Issues
  4. Contributions 😁

Installation

Add to your project using npm i -D use-multi-possibility

How to use

import useMultiPossibility from 'use-multi-possibility';

useMultiPossibility(([value]) => {
  console.log(value);
}, [[1, 2, 3]]);

// 1
// 2
// 3
import useMultiPossibility from 'use-multi-possibility';

useMultiPossibility(([num, char]) => {
  console.log(num, char);
}, [[1, 2], ['a', 'b']]);

// 1 'a'
// 1 'b'
// 2 'a'
// 2 'b'

It comes with sets of predefined grouped data that you can use.

TRUTHY

import useMultiPossibility, { TRUTHY } from 'use-multi-possibility';

useMultiPossibility(([t]) => {
  console.log(t);
}, [TRUTHY]);

// true
// 2
// {}

FALSY

import useMultiPossibility, { FALSY } from 'use-multi-possibility';

useMultiPossibility(([f]) => {
  console.log(f);
}, [FALSY]);

// false
// 0
// undefined
// null

NUMERIC

import useMultiPossibility, { NUMERIC } from 'use-multi-possibility';

useMultiPossibility(([n]) => {
  console.log(n);
}, [NUMERIC]);

// -1
// 0
// 0.5
// 1
// 1000000
// 1000000000

Issues

Please raise any issues on the GitHub repo.

Contributions 😁

All contributions are welcome, and actively encouraged! Have a look at the steps below, but also please don't hesitate to get in contact if you are unsure what to do.

Steps

  1. Fork the repository.
  2. Make your change—including tests—on the develop branch.
  3. Commit your work. Commit messages follow conventional-commits syntax (there is a pre-commit hook to help with this).
  4. Push your branch to origin.
  5. Submit a pull request to the develop branch.
  6. Once merged in to master the new version will be automatically built, and pushed to npm.

Readme

Keywords

none

Package Sidebar

Install

npm i use-multi-possibility

Weekly Downloads

17

Version

1.0.14

License

MIT

Unpacked Size

17.3 kB

Total Files

23

Last publish

Collaborators

  • nickheal