Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Sanitize

Index

Functions

blacklist

  • blacklist(_str: string, charTemp: string[]): undefined | null | string
  • description

    Checks if there are no allowed characteres inside a string

    {
    alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËẼÌÍÎÏĨÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëẽìíîïĩðñòóôõöøùúûüýÿ",
    numerical: "0123456789",
    allowed: "\\.\\-\\(\\)\\[\\]\\_\\ \\ª\\º\\?\\#\\~\\!\\+\\,\\*\\:\\@/\/=&",
    date: "01234567891\-\.\:TZ",
    coordinates: "0123456789-.,",
    phone: "0123456789-+\ ",
    boolean: "truefalsn"
    }
    example
    const UTILS =  require("@iotechpis/utils")
    let str = "test123";
    str = UTILS.Sanitize.blacklist(str, ["alphabet"]);

    #str
    "123"

    Parameters

    • _str: string
    • charTemp: string[]

    Returns undefined | null | string

whitelist

  • whitelist(_str: string, charTemp: string[]): undefined | null | string
  • description

    Checks if all characteres are allowed inside a string

    {
    alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËẼÌÍÎÏĨÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëẽìíîïĩðñòóôõöøùúûüýÿ",
    numerical: "0123456789",
    allowed: "\\.\\-\\(\\)\\[\\]\\_\\ \\ª\\º\\?\\#\\~\\!\\+\\,\\*\\:\\@/\/=&",
    date: "01234567891\-\.\:TZ",
    coordinates: "0123456789-.,",
    phone: "0123456789-+\ ",
    boolean: "truefalsn"
    }
    example
    const UTILS =  require("@iotechpis/utils")
    let str = "test123";
    str = UTILS.Sanitize.whitelist(str, ["alphabet"]);

    #str
    "test"

    Parameters

    • _str: string
    • charTemp: string[]

    Returns undefined | null | string

Generated using TypeDoc