syncis
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

syncis

A helper to compare types on javascript - with adicional validation

How to use

const { is } from "syncis";

For strings

is("text", "string"); return true

For numbers

is(123, "number"); return true

For isBooleans

is(1 === 1, "boolean"); return true

For objects

is({}, "object"); return true

For brazilian phones

is("11988884444", "phone"); return true

For safe password = the minimum required: min 1 letter and 1 number

is("abc123", "safePassword"); return true

For medium password = the minimum required: min 1 letter and 1 number and min 8 characteres

is("abcd1234", "mediumPassword"); return true

Strong password = the minimum required: min 1 letter and 1 number and 1 special character and min 8 characters

is("abcd1234#2", "strongPassword"); return true

For CPF

is("63263770802", "cpf"); return true

For CNPJ

is("24361658000197", "cnpj"); return true

For JSON

is({"is-json":true}, "json"); return true

For email

is("example@example.com", "email"); return true

For string date is("2020-05-01", "dateString"); return true

For string time

is("11:30", "time"); return true

Readme

Keywords

none

Package Sidebar

Install

npm i syncis

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

12.7 kB

Total Files

24

Last publish

Collaborators

  • doutorspace