Variable defaultFiltersConst

defaultFilters: {
    lowercase: ((value) => string);
    parseDate: ((value, format?, locale?) => undefined | number);
    parseFloat: ((value) => undefined | number);
    parseInt: ((value) => undefined | number);
    parseSize: ((value) => number);
    reverse: ((value) => string);
    slice: ((value, start?, end?) => string);
    titlecase: ((value) => string);
    trim: ((value) => string);
    uppercase: ((value) => string);
} = ...

Default extraction filters

Type declaration

  • lowercase: ((value) => string)

    Lowercase string

    Example

    const selector = `.container @ text | lowercase`
    const input = `heLLo`
    const output = `hello`
      • (value): string
      • Lowercase string

        Parameters

        • value: unknown

        Returns string

        Example

        const selector = `.container @ text | lowercase`
        const input = `heLLo`
        const output = `hello`
  • parseDate: ((value, format?, locale?) => undefined | number)

    Parses date from text to timestamp

    Example

    const selector = `#date @ text | trim | parseDate`
    const input = `2023-11-10 10:30`
    const output = 1699605000000
      • (value, format?, locale?): undefined | number
      • Parses date from text to timestamp

        Parameters

        • value: unknown
        • Optional format: unknown
        • Optional locale: unknown

        Returns undefined | number

        Example

        const selector = `#date @ text | trim | parseDate`
        const input = `2023-11-10 10:30`
        const output = 1699605000000
  • parseFloat: ((value) => undefined | number)

    Parses float from text

    Example

    const selector = `#number @ text | trim | parseFloat`
    const input = `7.6 `
    const output = 7.6
      • (value): undefined | number
      • Parses float from text

        Parameters

        • value: unknown

        Returns undefined | number

        Example

        const selector = `#number @ text | trim | parseFloat`
        const input = `7.6 `
        const output = 7.6
  • parseInt: ((value) => undefined | number)

    Parses int from text

    Example

    const selector = `#number @ text | trim | parseInt`
    const input = `7 `
    const output = 7
      • (value): undefined | number
      • Parses int from text

        Parameters

        • value: unknown

        Returns undefined | number

        Example

        const selector = `#number @ text | trim | parseInt`
        const input = `7 `
        const output = 7
  • parseSize: ((value) => number)

    Parses size string to bytes

    Example

    const selector = `#size @ text | trim | parseSize`
    const input = `7.4 GB`
    const output = `7945689497.6`
      • (value): number
      • Parses size string to bytes

        Parameters

        • value: unknown

        Returns number

        Example

        const selector = `#size @ text | trim | parseSize`
        const input = `7.4 GB`
        const output = `7945689497.6`
  • reverse: ((value) => string)

    Reverses text

    Example

    const selector = `.container @ text | reverse`
    const input = `hello world`
    const output = `dlrow olleh`
      • (value): string
      • Reverses text

        Parameters

        • value: unknown

        Returns string

        Example

        const selector = `.container @ text | reverse`
        const input = `hello world`
        const output = `dlrow olleh`
  • slice: ((value, start?, end?) => string)

    Slices text

    Example

    const selector = `.container @ text | slice:1,3`
    const input = `hello world`
    const output = `el`
      • (value, start?, end?): string
      • Slices text

        Parameters

        • value: unknown
        • Optional start: unknown
        • Optional end: unknown

        Returns string

        Example

        const selector = `.container @ text | slice:1,3`
        const input = `hello world`
        const output = `el`
  • titlecase: ((value) => string)

    Uppercase first word letters

    Example

    const selector = `.container @ text | titlecase`
    const input = `hello world`
    const output = `Hello World`
      • (value): string
      • Uppercase first word letters

        Parameters

        • value: unknown

        Returns string

        Example

        const selector = `.container @ text | titlecase`
        const input = `hello world`
        const output = `Hello World`
  • trim: ((value) => string)

    Trims string start & end

    Example

    const selector = `.container @ text | trim`
    const input = ` heLLo `
    const output = `heLLo`
      • (value): string
      • Trims string start & end

        Parameters

        • value: unknown

        Returns string

        Example

        const selector = `.container @ text | trim`
        const input = ` heLLo `
        const output = `heLLo`
  • uppercase: ((value) => string)

    Uppercase string

    Example

    const selector = `.container @ text | uppercase`
    const input = `heLLo`
    const output = `HELLO`
      • (value): string
      • Uppercase string

        Parameters

        • value: unknown

        Returns string

        Example

        const selector = `.container @ text | uppercase`
        const input = `heLLo`
        const output = `HELLO`

Generated using TypeDoc