0.0.1 • Published 5 months ago

object-awesome v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

Object Awesome ✨

A cooler way to work with objects.

object-awesome is a tool to speed up software development and make the code more readable for us developers. It provides a set of classes and utility methods that can be called anywhere in the code.

Find what you need 😉

Installation 🔧

Add locally to your project folder: You can also install it globally but it's not recommended.

    # Using npm
    npm install object-awesome
    # Or yarn
    yarn add object-awesome
    # Or pnpm
    pnpm add object-awesome

Documentation 📚

List to explain the methods and usages:

List

Method / FunctionReturnDescription
addAllvoidReceives a list of the given type and adds all elements to the list.
addIgnoringNullsvoidGets a thing of the specified type and throws it into the list if the thing ain't null.
addManyIgnoringNullsvoidGets a list and tosses them into the array if the element ain't null.
checkForNullsAndAddAllTovoidReceives a list of elements and checks if there is any null element in the list; if there is, raises a type error, otherwise adds them all to the array.
hasNullValuesbooleanChecks if the list contains a null element.
replacevoidReplace the element with a different value.
clearvoidRemoves all elements from the array.
takeTGet an element by index.
isEmptybooleanChecks if the list is definitely empty.

Objects

Method / FunctionReturnDescription
nonNullbooleanReceives an object and checks if it is not null or undefined.
isNullbooleanReceives an object and checks if it is null and undefined.
requireNonNullbooleanReceives a sequence of objects and throws an error if an object is null.
equalsbooleanReceives two objects and checks if they are both exactly the same.
strictEqualsbooleanReceives two objects and checks if they are both exactly the same and also not null.
cloneanyReturn a copy of given object.

Made with 💜 by Emanuel Martins © 2023.

0.0.1

5 months ago

0.0.0

5 months ago

0.0.2

5 months ago

1.0.0

6 months ago