@joao.hencke/utils

1.0.5 • Public • Published

Some utilities

Installing

npm install @joao.hencke/utils

Usage

 const { generator } = require('@joao.hencke/utils');
 generator.cnpj();
 generator.cpf();
 generator.creditCard(generator.creditCard.schemas.MasterCard);
 generator.creditCard(generator.creditCard.schemas.Visa);

Generators

  • CPF
  • CNPJ
  • Credit Card

String

  • Base64 - Check if String is a valid base64
  • Reverse -
const str = 'reverse'
reverse(str) //esrever

Object

  • is - Check type.
const arr = []
is('array', arr) //true - uses Object.prototype.toString method

Array

  • flatten - flatten an array of arrays
const arr = [1, [2, 3], [4, [5]]]
flatten(arr) // [1, 2, 3, 4, 5]

Package Sidebar

Install

npm i @joao.hencke/utils

Weekly Downloads

1

Version

1.0.5

License

ISC

Unpacked Size

9.24 kB

Total Files

22

Last publish

Collaborators

  • joao.hencke