json-p3
Version:
JSONPath, JSON Pointer and JSON Patch
34 lines (33 loc) • 1.2 kB
TypeScript
import { FilterFunction, FunctionExpressionType } from "./function";
export type MatchFilterFunctionOptions = {
/**
* The maximum number of regular expressions to cache.
*/
cacheSize?: number;
/**
* If _true_, throw errors from regex checking, 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 Match implements FilterFunction {
#private;
readonly options: MatchFilterFunctionOptions;
readonly argTypes: FunctionExpressionType[];
readonly returnType = FunctionExpressionType.LogicalType;
readonly cacheSize: number;
readonly throwErrors: boolean;
readonly iRegexpCheck: boolean;
constructor(options?: MatchFilterFunctionOptions);
call(s: string, pattern: string): boolean;
}