Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "core/forms"

Index

Variables

Const MAX_POSTGRESQL_INTEGER

MAX_POSTGRESQL_INTEGER: 2147483647 = 2147483647

Const showdownConverter

showdownConverter: any = new showdown.Converter({extensions: [showdownLazyPicturesExt],})

Const turndownService

turndownService: any = new TurndownService()

Functions

_slug

  • _slug(str: string): any
  • Turns a string into a slug suitable for URLs.

    Parameters

    • str: string

    Returns any

htmlToMarkdown

  • htmlToMarkdown(html: any): any
  • Converts the given HTML string to Markdown

    Parameters

    • html: any

    Returns any

    Markdown

isEmail

  • isEmail(str: string): any
  • Checks whether the string is a valid email. If so, additional sanitizing is not needed.

    Parameters

    • str: string

    Returns any

isFloat

  • isFloat(input: any, options?: any): any
  • Checks whether the string is in a float

    Parameters

    • input: any
    • Default value options: any = {}

      (optional) min max lt gt

    Returns any

isId

  • isId(value: any): any
  • Checks whether the value is a valid ID. If so, additional sanitizing is not needed.

    Parameters

    • value: any

    Returns any

isIn

  • isIn(str: any, values: any): any
  • Checks whether the string is in an array of allowed values

    Parameters

    • str: any
    • values: any

    Returns any

isInt

  • isInt(input: any, options?: any): any
  • Checks whether the string is in an integer

    Parameters

    • input: any
    • Default value options: any = {}

      (optional) min max lt gt

    Returns any

isLengthValid

  • isLengthValid(input: any, maxLength?: number): boolean
  • Checks whether the string is no longer than the specified length. (Note: not checking this does not trigger crashes on the developer H2 database, instead strings are just truncated)

    Parameters

    • input: any
    • Default value maxLength: number = 255

    Returns boolean

isNotSet

  • isNotSet(input: any): boolean

isSet

  • isSet(input: any): boolean

isSlug

  • isSlug(str: string): boolean
  • Checks whether the string is a valid slug. If so, additional sanitizing is not needed.

    Parameters

    • str: string

    Returns boolean

isURL

  • isURL(str: string): any
  • Checks whether the string is a valid URL. If so, additional sanitizing is not needed.

    Parameters

    • str: string

    Returns any

isUsername

  • isUsername(str: any): boolean
  • Checks whether the string is a valid username. If so, additional sanitizing is not needed.

    Parameters

    • str: any

    Returns boolean

markdownToHtml

  • markdownToHtml(markdown: any): any
  • Converts the given Markdown to XSS-safe HTML

    Parameters

    • markdown: any

    Returns any

markdownToText

  • markdownToText(markdown: any): any
  • Converts the given Markdown to single-line text

    Parameters

    • markdown: any

    Returns any

    text without markup, but should not be trusted as safe HTML!

parseDateTime

  • parseDateTime(str: any): Date
  • Converts a string built in a date time picker to an actual date which can be stored in a model

    Parameters

    • str: any

    Returns Date

parseJson

  • parseJson(str: any, options?: any): any
  • Tries to parse the given JSON. By default, returns false if parsing fails

    Parameters

    • str: any
    • Default value options: any = {}

      throwError acceptInvalid

    Returns any

sanitizeMarkdown

  • sanitizeMarkdown(markdown: string, options?: any): string
  • Sanitizes Markdown form input very lightly, just by limiting its length. Real sanitization needs to happen after converting it to HTML.

    Parameters

    • markdown: string
    • Default value options: any = {}

      maxLength

    Returns string

sanitizeString

  • sanitizeString(str: string, options?: any): string
  • Sanitizes a string form input (by removing any tags and slicing it to the max allowed size). Use this on all string input unless you need more advanced escaping (e.g. for URLs, for Markdown)

    Parameters

    • str: string
    • Default value options: any = {}

      maxLength

    Returns string

Object literals

Const SLUG_SETTINGS

SLUG_SETTINGS: object

symbols

symbols: boolean = false

Const markdownSnippets

markdownSnippets: object

PAYPAL_BUTTON

PAYPAL_BUTTON: string = constants.PAYPAL_BUTTON

Const sanitizeHtmlOptions

sanitizeHtmlOptions: object

allowedAttributes

allowedAttributes: object = constants.ALLOWED_POST_ATTRIBUTES

Type declaration

  • a: string[]
  • div: string[]
  • iframe: string[]
  • img: string[]
  • p: string[]
  • progress: string[]
  • source: string[]
  • video: string[]

allowedClasses

allowedClasses: object

Type declaration

allowedTags

allowedTags: string[] = constants.ALLOWED_POST_TAGS

exclusiveFilter

  • exclusiveFilter(frame: any): boolean

Const showdownLazyPicturesExt

showdownLazyPicturesExt: object

type

type: string = "output"

filter

  • filter(text: any): any

Generated using TypeDoc