0.0.11 • Published 1 year ago

@zardoy/utils v0.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Strict Lodash

Spoiler: this is not only stricter versin of lodash, this library also adds utils that I was missing I'll try to maintain the references to usages in popular repositories (like vscode)

It meant to be stricted and lightweight version of Lodash.

Also, this ilb contains helpers, that I didn't manage to find in other places.

The Main Difference

This module tries to be as strict as possible. Also, @types/lodash has a lot of overloads, which doesn't make

Main goal of this module is to provide clear and precise type definitions, not to rewrite lodash library.

What included

This methods are from lodash, they're doing the same thing, but has improved straightforward types.

  • Array.findWithIndex
  • Array.randomItem
  • (cancelled) Array.removeItem - why not just .remove? To make sure, that coder understand that he can't use callback
  • Array.mapAndFilter - Almost the same as array.map() but, it also removes all undefined values (T badge)
  • Array.findWithIndex - Array.find and Array.findIndex combined into in method. Ex: `const value, index = 4, 5.findWithIndex(n => n === 5)

TODO

  • resolve lodash-markers