segno - deno validation library
segno (Segnosaurus). Validation library for Deno 🦕. Enforcing a high security standard.
Example
import { segno, isIP } from 'https://deno.land/x/segno/mod.ts';
console.log(segno.isEmail('foo@example.org'));
console.log(isIP('127.0.0.1'));
Documentation
A documentation is currently still WIP. But please check our website https://segno.js.org for now.
License
Type aliases
Algorithm
Algorithm: "md5" | "md4" | "sha1" | "sha256" | "sha384" | "sha512" | "ripemd128" | "ripemd160" | "tiger128" | "tiger160" | "tiger192" | "crc32" | "crc32b"
Base64Options
Base64Options: { urlSafe?: undefined | false | true }
Type declaration
-
Optional urlSafe?: undefined | false | true
ByteLengthOptions
ByteLengthOptions: { max?: undefined | number; min?: undefined | number }
Type declaration
-
Optional max?: undefined | number
-
Optional min?: undefined | number
CountryCode
CountryCode: "AM" | "AR" | "AT" | "AU" | "BE" | "BG" | "CA" | "CH" | "CN" | "CY" | "CZ" | "DE" | "DK" | "DZ" | "EE" | "ES" | "FI" | "FR" | "GB" | "GR" | "HR" | "HU" | "IE" | "IN" | "IS" | "IT" | "JP" | "KR" | "LT" | "LU" | "LV" | "MT" | "NL" | "PO" | "PT" | "RO" | "SE" | "SL" | "SK" | "TR" | "UA" | "US"
CurrencyOptions
CurrencyOptions: { allowDecimal?: undefined | false | true; allowNegativeSignPlaceholder?: undefined | false | true; allowNegatives?: undefined | false | true; allowSpaceAfterDigits?: undefined | false | true; allowSpaceAfterSymbol?: undefined | false | true; decimalSeparator?: undefined | string; digitsAfterDecimal?: number[]; negativeSignAfterDigits?: undefined | false | true; negativeSignBeforeDigits?: undefined | false | true; parensForNegatives?: undefined | false | true; requireDecimal?: undefined | false | true; requireSymbol?: undefined | false | true; symbol?: undefined | string; symbolAfterDigits?: undefined | false | true; thousandsSeparator?: undefined | string }
Type declaration
-
Optional allowDecimal?: undefined | false | true
-
Optional allowNegativeSignPlaceholder?: undefined | false | true
-
Optional allowNegatives?: undefined | false | true
-
Optional allowSpaceAfterDigits?: undefined | false | true
-
Optional allowSpaceAfterSymbol?: undefined | false | true
-
Optional decimalSeparator?: undefined | string
-
Optional digitsAfterDecimal?: number[]
-
Optional negativeSignAfterDigits?: undefined | false | true
-
Optional negativeSignBeforeDigits?: undefined | false | true
-
Optional parensForNegatives?: undefined | false | true
-
Optional requireDecimal?: undefined | false | true
-
Optional requireSymbol?: undefined | false | true
-
Optional symbol?: undefined | string
-
Optional symbolAfterDigits?: undefined | false | true
-
Optional thousandsSeparator?: undefined | string
DecimalOptions
DecimalOptions: { decimalDigits?: undefined | string; forceDecimal?: undefined | false | true; locale?: undefined | string }
Type declaration
-
Optional decimalDigits?: undefined | string
-
Optional forceDecimal?: undefined | false | true
-
Optional locale?: undefined | string
EmailOptions
EmailOptions: { allowDisplayName?: undefined | false | true; allowIPDomain?: undefined | false | true; allowUTF8LocalPart?: undefined | false | true; domainSpecificValidation?: undefined | false | true; ignoreMaxLength?: undefined | false | true; requireDisplayName?: undefined | false | true; requireTLD?: undefined | false | true }
Type declaration
-
Optional allowDisplayName?: undefined | false | true
-
Optional allowIPDomain?: undefined | false | true
-
Optional allowUTF8LocalPart?: undefined | false | true
-
Optional domainSpecificValidation?: undefined | false | true
-
Optional ignoreMaxLength?: undefined | false | true
-
Optional requireDisplayName?: undefined | false | true
-
Optional requireTLD?: undefined | false | true
EmptyOptions
EmptyOptions: { ignoreWhitespace?: undefined | false | true }
Type declaration
-
Optional ignoreWhitespace?: undefined | false | true
FQDNOptions
FQDNOptions: { allowTrailingDot?: undefined | false | true; allowUnderscores?: undefined | false | true; requireTLD?: undefined | false | true }
Type declaration
-
Optional allowTrailingDot?: undefined | false | true
-
Optional allowUnderscores?: undefined | false | true
-
Optional requireTLD?: undefined | false | true
FloatOptions
FloatOptions: { gt?: undefined | number; locale?: undefined | string; lt?: undefined | number; max?: undefined | number; min?: undefined | number }
Type declaration
-
Optional gt?: undefined | number
-
Optional locale?: undefined | string
-
Optional lt?: undefined | number
-
Optional max?: undefined | number
-
Optional min?: undefined | number
IMEIOptions
IMEIOptions: { allowHyphens?: undefined | false | true }
Type declaration
-
Optional allowHyphens?: undefined | false | true
ISO8601Options
ISO8601Options: { strict?: undefined | false | true }
Type declaration
-
Optional strict?: undefined | false | true
ISSNOptions
ISSNOptions: { caseSensitive?: undefined | false | true; requireHyphen?: undefined | false | true }
Type declaration
-
Optional caseSensitive?: undefined | false | true
-
Optional requireHyphen?: undefined | false | true
IdentityCardLocale
IdentityCardLocale: "ES" | "IN" | "NO" | "he-IL" | "ar-TN" | "zh-CN" | "zh-TW" | "any"
IntOptions
IntOptions: { allowLeadingZeroes?: undefined | false | true; gt?: undefined | number; lt?: undefined | number; max?: undefined | number; min?: undefined | number }
Type declaration
-
Optional allowLeadingZeroes?: undefined | false | true
-
Optional gt?: undefined | number
-
Optional lt?: undefined | number
-
Optional max?: undefined | number
-
Optional min?: undefined | number
JSONOptions
JSONOptions: { allowPrimitives?: undefined | false | true }
Type declaration
-
Optional allowPrimitives?: undefined | false | true
LatLongOptions
LatLongOptions: { checkDMS?: undefined | false | true }
Type declaration
-
Optional checkDMS?: undefined | false | true
LengthOptions
LengthOptions: { max?: undefined | number; min?: undefined | number }
Type declaration
-
Optional max?: undefined | number
-
Optional min?: undefined | number
MACAddressOptions
MACAddressOptions: { noColons?: undefined | false | true }
Type declaration
-
Optional noColons?: undefined | false | true
MobilePhoneOptions
MobilePhoneOptions: { strictMode?: undefined | false | true }
Type declaration
-
Optional strictMode?: undefined | false | true
NumericOptions
NumericOptions: { locale?: any; noSymbols?: undefined | false | true }
Type declaration
-
Optional locale?: any
-
Optional noSymbols?: undefined | false | true
PhoneLocale
PhoneLocale: "am-AM" | "ar-AE" | "ar-BH" | "ar-DZ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LY" | "ar-SA" | "ar-SY" | "ar-TN" | "bs-BA" | "be-BY" | "bg-BG" | "bn-BD" | "cs-CZ" | "da-DK" | "de-DE" | "de-AT" | "de-CH" | "el-GR" | "en-AU" | "en-GB" | "en-GG" | "en-GH" | "en-HK" | "en-MO" | "en-IE" | "en-IN" | "en-KE" | "en-MT" | "en-MU" | "en-NG" | "en-NZ" | "en-PK" | "en-RW" | "en-SG" | "en-SL" | "en-TZ" | "en-UG" | "en-US" | "en-ZA" | "en-ZM" | "en-ZW" | "es-CO" | "es-CL" | "es-CR" | "es-EC" | "es-ES" | "es-MX" | "es-PA" | "es-PY" | "es-UY" | "et-EE" | "fa-IR" | "fi-FI" | "fj-FJ" | "fo-FO" | "fr-FR" | "fr-GF" | "fr-GP" | "fr-MQ" | "fr-RE" | "he-IL" | "hu-HU" | "id-ID" | "it-IT" | "ja-JP" | "kk-KZ" | "kl-GL" | "ko-KR" | "lt-LT" | "ms-MY" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "pl-PL" | "pt-BR" | "pt-PT" | "ro-RO" | "ru-RU" | "sl-SI" | "sk-SK" | "sr-RS" | "sv-SE" | "th-TH" | "tr-TR" | "uk-UA" | "vi-VN" | "zh-CN" | "zh-TW" | "en-CA" | "fr-BE" | "zh-HK" | "zh-MO" | "any"
PostalCode
PostalCode: "AD" | "AT" | "AU" | "BE" | "BG" | "BR" | "CA" | "CH" | "CZ" | "DE" | "DK" | "DZ" | "EE" | "ES" | "FI" | "FR" | "GB" | "GR" | "HR" | "HU" | "ID" | "IE" | "IL" | "IN" | "IS" | "IT" | "JP" | "KE" | "LI" | "LT" | "LU" | "LV" | "MX" | "MT" | "NL" | "NO" | "NP" | "NZ" | "PL" | "PR" | "PT" | "RO" | "RU" | "SA" | "SE" | "SI" | "SK" | "TN" | "TW" | "UA" | "US" | "ZA" | "ZM" | "any"
URLOptions
URLOptions: { allowProtocolRelativeURLs?: undefined | false | true; allowTrailingDot?: undefined | false | true; allowUnderscores?: undefined | false | true; disallowAuth?: undefined | false | true; hostBlacklist?: undefined | false | true; hostWhitelist?: undefined | false | true; protocols?: string[]; requireHost?: undefined | false | true; requireProtocol?: undefined | false | true; requireTLD?: undefined | false | true; requireValidProtocol?: undefined | false | true; validateLength?: undefined | false | true }
Type declaration
-
Optional allowProtocolRelativeURLs?: undefined | false | true
-
Optional allowTrailingDot?: undefined | false | true
-
Optional allowUnderscores?: undefined | false | true
-
Optional disallowAuth?: undefined | false | true
-
Optional hostBlacklist?: undefined | false | true
-
Optional hostWhitelist?: undefined | false | true
-
Optional protocols?: string[]
-
Optional requireHost?: undefined | false | true
-
Optional requireProtocol?: undefined | false | true
-
Optional requireTLD?: undefined | false | true
-
Optional requireValidProtocol?: undefined | false | true
-
Optional validateLength?: undefined | false | true
undefined