Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Conditions

Convert range of arguments into a collection of regular expressions. Config changes flags and filtering. Multiple conditions can be combined.

Hierarchy

  • Conditions

Index

Constructors

constructor

Properties

captures

captures: object

Type declaration

  • [key: number]: string | undefined

config

expressions

expressions: object

Type declaration

  • [key: string]: RegExp

matches

matches: object

Type declaration

  • [key: number]: any

Accessors

captured

  • get captured(): undefined | string | object
  • Get all captured strings, or the first if only one and no keys used

    Returns undefined | string | object

match

  • get match(): any
  • Get success of all matches or the first match object if only one

    Returns any

matched

  • get matched(): any
  • Get the result of all matches or the first if only one and no keys used

    Returns any

success

  • get success(): boolean

Methods

add

  • add(condition: string | RegExp | Condition, key?: string | number): this
  • Add new condition, converted to regular expression. Assigns to either an integer index (as string), or a given key. Returns self for chaining multiple additions.

    Parameters

    • condition: string | RegExp | Condition
    • Optional key: string | number

    Returns this

clear

  • clear(): void

clearAll

  • clearAll(): void

exec

  • exec(str: string): object
  • Test a string against all expressions.

    Parameters

    • str: string

    Returns object

    • [key: number]: any

Generated using TypeDoc