0.1.0 • Published 3 years ago

categorizer v0.1.0

Weekly downloads
7
License
MIT
Repository
github
Last release
3 years ago

Table of Contents

Install

npm:

npm install categorizer

Yarn:

yarn add categorizer

GitHub:

git clone https://github.com/mazecodes/categorizer.git

Usage

Using with a categorizer object:

const { categorize } = require('categorizer');

const array = [0, 1, 2, 3, 4];

const result = categorize(array, {
  even(value) {
    return value % 2 === 0;
  },
  odd(value) {
    return value % 2 !== 0;
  },
});

Using with a categorizer function:

const { categorize } = require('categorizer');

const array = [0, 1, 2, 3, 4];

const result = categorize(array, value => {
  if (value % 2 === 0) return 'even';
  return 'odd';
});

Run tests

npm run test

Contributing

All contributions, issues and feature requests are welcome! Please feel free to check issues page.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AwesomeFeature)
  3. Commit your changes (git commit -m "Add Awesome Feature")
  4. Push to the branch (git push origin feature/AwesomeFeature)
  5. Open a Pull Request

Author

Maze Peterson:

Show your support

Give a ⭐ if you liked this project!

License

MIT © Maze Peterson

0.1.0

3 years ago