@orioro/expression-string-is
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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)
  • 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}
$stringIsFQDN()
$stringIsHash()
$stringIsHexadecimal()
$stringIsIBAN()
$stringIsIMEI()
$stringIsIP()
$stringIsISBN()
$stringIsISIN()
$stringIsISO31661Alpha2()
$stringIsISO31661Alpha3()
$stringIsISRC()
$stringIsISSN()
$stringIsJWT()
$stringIsLowercase()
$stringIsMACAddress()
$stringIsMagnetURI()
$stringIsMimeType()
$stringIsNumeric()
$stringIsUppercase()
$stringIsStrongPassword()
$stringIsURL()
$stringIsUUID()

Readme

Keywords

none

Package Sidebar

Install

npm i @orioro/expression-string-is

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

178 kB

Total Files

11

Last publish

Collaborators

  • simonfan