Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FilterPipe

Filters data

Hierarchy

  • FilterPipe

Implements

  • PipeTransform

Index

Constructors

constructor

Properties

Private filterUtilitiesService

filterUtilitiesService: FilterUtilitiesService

used for simple utility functions.

Methods

Private filterItem

  • filterItem(item: Object, meta: any): Object
  • The actual filter logic applied to each item.

    • Filters out non search queries first (e.g. select box queries)
    • If filtering by search, then it finds the searchable text and checks if it matches any queries.

    Parameters

    • item: Object
    • meta: any

    Returns Object

Private filtering

  • filtering(filterInput: any, filteredMeta: any): object
  • Checks if the filterInput is trying to filter anything at all.

    Parameters

    • filterInput: any
    • filteredMeta: any

    Returns object

    • any: boolean
    • search: boolean

Private flatArray

  • flatArray(input: any): Array<string>
  • Normalizes a string or array of strings to a flat array of strings.

    Parameters

    • input: any

    Returns Array<string>

Private getQueries

  • getQueries(searchQueries: string): Array<string>
  • Takes a raw query string and returns an array of important words to use for search.

    Parameters

    • searchQueries: string

    Returns Array<string>

Private readableList

  • readableList(prev: string, curr: string, i: number, a: Array<string>): string
  • Reduce an array into a readable list

    Parameters

    • prev: string
    • curr: string
    • i: number
    • a: Array<string>

    Returns string

Private readableQueries

  • readableQueries(inputs: Object): string

Private stopWords

  • stopWords(): Array<string>

transform

  • transform(value: any, updateTime?: number, filterInput?: any, filteredMeta?: any): any
  • Filters the input value according to the filteredInput.

    Parameters

    • value: any

      input data

    • Optional updateTime: number

      the timestamp of the last update. Needed because pure pipes do not detect updates to object properties

    • Optional filterInput: any

      the filter input used to filter the input data

    • Optional filteredMeta: any

    Returns any

Generated using TypeDoc