Skip to content

Someone once said: "I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it."

License

Notifications You must be signed in to change notification settings

igortrinidad/lazyfy

Repository files navigation

lazyfy

A lightweight, zero dependency set of tools that i use in almost any project

npm CI License

🚀 Quickstart

  1. Install with your favorite package manager:

    • npm : npm i @igortrindade/lazyfy
    • yarn : yarn add @igortrindade/lazyfy
  2. Usage

import { ArrayHelpers } from '@igortrindade/lazyfy'

const arr = ['watermelon', 'strawberry', 'grape']

const item = ArrayHelpers.find(arr, 'grape')
// item = 'grape'

const books = [ { id: 1, title: 'Clean Code' }, { id: 2, title: 'Clean Archtecture' }, { id: 3, title: 'Refactoring' }]

const selected = ArrayHelpers.findAll(books, { id: [1, 2]})
// selected = [ { id: 1, title: 'Clean Code' }, { id: 2, title: 'Clean Archtecture' }]

const bookClean = ArrayHelpers.find(books, { title: 'CLEAN CODE' })
// Case insensitive match
// bookClean = { id: 1, title: 'Clean Code' }

// For more examples, see the live playground on: https://igortrinidad.github.io/lazyfy/

🤝 Contributing

Run into a problem? Open an issue. Want to add some feature? PRs are welcome!

👤 About the author

Feel free to contact me:

GitHub

GitHub

twitter: @souigortrindade

📝 License

Copyright © 2022 Igor Trindade.
This project is under MIT license.

About

Someone once said: "I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it."

Resources

License

Stars

Watchers

Forks

Packages

No packages published