syncis v1.1.0
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