json-p3
Version:
JSONPath, JSON Pointer and JSON Patch
35 lines (34 loc) • 1.22 kB
TypeScript
import { FilterFunction, FunctionExpressionType } from "./function";
export type SearchFilterFunctionOptions = {
/**
* The maximum number of regular expressions to cache. Defaults
* to 10.
*/
cacheSize?: number;
/**
* If _true_, throw errors from regex construction and matching.
* The standard and default behavior is to ignore these errors
* and return _false_.
*/
throwErrors?: boolean;
/**
* If _true_, check that regexp patterns are valid according to I-Regexp.
* The standard and default behavior is to silently return _false_ if a
* pattern is invalid.
*
* If `iRegexpCheck` is _true_ and `throwErrors` is _true_, an `IRegexpError`
* will be thrown.
*/
iRegexpCheck?: boolean;
};
export declare class Search implements FilterFunction {
#private;
readonly options: SearchFilterFunctionOptions;
readonly argTypes: FunctionExpressionType[];
readonly returnType = FunctionExpressionType.LogicalType;
readonly cacheSize: number;
readonly throwErrors: boolean;
readonly iRegexpCheck: boolean;
constructor(options?: SearchFilterFunctionOptions);
call(s: string, pattern: string): boolean;
}