expressionStringValidate
npm install @orioro/expression-string-validate
yarn add @orioro/expression-string-validate
Design decisions
Not all methods from validator.js are supported
Validator.js has some methods that accept RegExps, thus we've opted for manually checking each of its methods and write corresponding bindings to avoid exposing any access to RegExps.
This library is intended for usage with end-user provided input, thus should not expose any RegExp constructors.
Methods are also selected according to usage in most common scenarios and the complexity of their options (the more complex the more delayed their integration).
API Docs
$stringIsAlpha(options, str)
$stringIsAlphanumeric(options, str)
$stringIsAscii(str)
$stringIsBase32(str)
$stringIsBase58(str)
$stringIsBase64(options, str)
$stringIsBIC(str)
$stringIsCreditCard(str)
$stringIsDataURI(str)
$stringIsEmail(options, str)
$stringIsFQDN()
$stringIsHash()
$stringIsHexadecimal()
$stringIsIBAN()
$stringIsIMEI()
$stringIsIP()
$stringIsISBN()
$stringIsISIN()
$stringIsISO31661Alpha2()
$stringIsISO31661Alpha3()
$stringIsISRC()
$stringIsISSN()
$stringIsJWT()
$stringIsLowercase()
$stringIsMACAddress()
$stringIsMagnetURI()
$stringIsMimeType()
$stringIsNumeric()
$stringIsUppercase()
$stringIsStrongPassword()
$stringIsURL()
$stringIsUUID()
$stringIsAlpha(options, str)
-
options
{Object}-
locale
{String} -
ignore
{String}
-
-
str
{String}
$stringIsAlphanumeric(options, str)
-
options
{Object}-
locale
{String}
-
-
str
{String}
$stringIsAscii(str)
-
str
{String}
$stringIsBase32(str)
-
str
{String}
$stringIsBase58(str)
-
str
{String}
$stringIsBase64(options, str)
-
options
{Object}-
urlSafe
{Boolean}
-
-
str
{String}
$stringIsBIC(str)
-
str
{String}
$stringIsCreditCard(str)
Supported:
-
MasterCard
-
Visa (16 digits)
-
Diners Club
-
Discover
-
JCB
-
str
{String}
$stringIsDataURI(str)
-
str
{String}
$stringIsEmail(options, str)
-
options
{Object}-
allowDisplayName
{Boolean} -
requireDisplayName
{Boolean} -
allowUTF8LocalPart
{Boolean} -
requireTLD
{Boolean} -
allowIPDomain
{Boolean} -
domainSpecificValidation
{Boolean} -
blacklistedChars
{String}
-
-
str
{String}