1.0.1 • Published 4 years ago

@nanomatic/object_filter v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Status License


📝 Table of Contents

🏁 Getting Started

Installing

npm i @nanomatic/object_filter

Using

Example code below:

import { getArray, getObject } from '@nanomatic/object_filter';

const salary = {
    Bill: 1350,
    Jackson: 1270,
    Jenny: 1100,
    Jhon: 1200,
    Joseph: 1500
};

const array = getArray(salary, /^J/);
const object = getObject(salary, /^B/);

const sum = array.reduce((sum: number, salary: number) => sum + salary, 0);

console.log(`Sum salary for all J's persons: 💲${sum}`);
console.log(`Jenny salary: 💲${object.Jeny || '?'}`);
console.log(`Bill salary: 💲${object.Bill || '?'}`);

⛏️ Built With

✍️ Authors

🎉 Acknowledgments

  • Special thanks for Sebastian for working together and giving ideas 😉