interface LiteralSearchOptions {
    trim?: boolean;
    behavior?: LiteralSearchBehavior;
    flags?: string;
    transform?: SearchAndReplaceRegExp | SearchAndReplaceRegExp[];
    escapeTransform?: SearchAndReplaceRegExp;
    cache?: SimpleCache;
}

Properties

trim?: boolean

Trim whitespace from string value before transforming and escaping

How the literal search value expression should be built IE how to search for the value in a string:

  • 'exact' => tested string must match the search value exactly
  • 'contains' => search value must be present somewhere within the tested string
  • 'startsWith' => search value must be present at the beginning of the tested string
  • 'endsWith' => search value must be present at the end of the tested string
flags?: string

Default flags to set on the parsed regex or literal search expression

One or more search-and-replace criteria used to transform the string value before using it as the literal search expression

escapeTransform?: SearchAndReplaceRegExp

A search-and-replace criteria used to escape the string value before it is inserted into the literal search expression. A default escape function is provided.

cache?: SimpleCache

A caching implementation for caching unique regex strings + behavior + default flags