mauroreisvieira / ts-utils

Collection of common utils in Typescript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TS Utils

npm GitHub Tag GitHub issues GitHub license

TS Utils is a versatile collection of TypeScript utility functions designed to simplify your development tasks.
It provides a range of helpful functions for various common scenarios.

Installation

To incorporate TS Utils into your TypeScript projects, you can use either npm or `yarn`` package manager.
Choose the one you're most comfortable with:

Using NPM

npm install @didiermargarido/ts-utils

Using Yarn

yarn add @didiermargarido/ts-utils

Usage

TS Utils provides a comprehensive set of utility functions that can streamline various aspects of your TypeScript projects.
Here's a detailed guide on how to use some of the key utility functions available in TS Utils:

isDefined

Method to check if value is defined.

// Util
import { isDefined } from "@didiermargarido/ts-utils";

// Output: true
isDefined("DM");
isDefined(10);
isDefined([]);

// Output: false
isDefined(null);
isDefined(undefined); 

isEmpty

Method to check if value is empty.

// Util
import { isEmpty } from "@didiermargarido/ts-utils";

// Output: true
isEmpty("");
isEmpty([]);
isEmpty({});
isEmpty(null);
isEmpty(undefined);

// Output: false
isEmpty("DM");
isEmpty(["DM", 36]);
isEmpty({ key: "Demo" }); 

Author

Didier Margarido
github/didiermargarido

License

TS Utils is open-sourced software licensed under the MIT license

About

Collection of common utils in Typescript

License:MIT License


Languages

Language:JavaScript 58.6%Language:TypeScript 37.6%Language:Shell 3.8%