json-p3 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +0 -1
  2. package/dist/json-p3.browser.js +5303 -0
  3. package/dist/json-p3.browser.min.js +2 -0
  4. package/dist/json-p3.browser.min.js.map +1 -0
  5. package/dist/json-p3.cjs.js +110 -109
  6. package/dist/json-p3.esm.js +110 -109
  7. package/dist/json-p3.iife.min.js +1 -1
  8. package/dist/json-p3.iife.min.js.map +1 -1
  9. package/package.json +11 -24
  10. package/dist/deep_equals.d.ts +0 -10
  11. package/dist/index.d.ts +0 -10
  12. package/dist/json-p3.iife.js +0 -5338
  13. package/dist/patch/errors.d.ts +0 -11
  14. package/dist/patch/index.d.ts +0 -11
  15. package/dist/patch/patch.d.ts +0 -161
  16. package/dist/path/environment.d.ts +0 -165
  17. package/dist/path/errors.d.ts +0 -65
  18. package/dist/path/expression.d.ts +0 -101
  19. package/dist/path/extra/expression.d.ts +0 -6
  20. package/dist/path/extra/index.d.ts +0 -0
  21. package/dist/path/extra/selectors.d.ts +0 -35
  22. package/dist/path/functions/count.d.ts +0 -7
  23. package/dist/path/functions/function.d.ts +0 -26
  24. package/dist/path/functions/has.d.ts +0 -44
  25. package/dist/path/functions/index.d.ts +0 -11
  26. package/dist/path/functions/length.d.ts +0 -7
  27. package/dist/path/functions/match.d.ts +0 -33
  28. package/dist/path/functions/pattern.d.ts +0 -2
  29. package/dist/path/functions/search.d.ts +0 -34
  30. package/dist/path/functions/value.d.ts +0 -7
  31. package/dist/path/index.d.ts +0 -76
  32. package/dist/path/lex.d.ts +0 -69
  33. package/dist/path/lru_cache.d.ts +0 -10
  34. package/dist/path/node.d.ts +0 -84
  35. package/dist/path/parse.d.ts +0 -61
  36. package/dist/path/path.d.ts +0 -42
  37. package/dist/path/segments.d.ts +0 -39
  38. package/dist/path/selectors.d.ts +0 -85
  39. package/dist/path/serialize.d.ts +0 -6
  40. package/dist/path/token.d.ts +0 -70
  41. package/dist/path/types.d.ts +0 -46
  42. package/dist/pointer/errors.d.ts +0 -42
  43. package/dist/pointer/index.d.ts +0 -24
  44. package/dist/pointer/pointer.d.ts +0 -106
  45. package/dist/tsconfig.tsbuildinfo +0 -1
  46. package/dist/types.d.ts +0 -25
@@ -1,11 +0,0 @@
1
- /**
2
- * Base class for all JSON Patch errors.
3
- */
4
- export declare class JSONPatchError extends Error {
5
- readonly message: string;
6
- constructor(message: string);
7
- }
8
- export declare class JSONPatchTestFailure extends JSONPatchError {
9
- readonly message: string;
10
- constructor(message: string);
11
- }
@@ -1,11 +0,0 @@
1
- import { JSONValue } from "../types";
2
- import { OpObject } from "./patch";
3
- export { JSONPatch } from "./patch";
4
- export { JSONPatchError, JSONPatchTestFailure } from "./errors";
5
- export type { OpObject } from "./patch";
6
- /**
7
- * Apply the JSON Patch _patch_ to JSON-like data _value_.
8
- * @param ops - JSON Patch operations following RFC 6902.
9
- * @param value - The target JSON-like document to patch.
10
- */
11
- export declare function apply(ops: OpObject[], value: JSONValue): JSONValue;
@@ -1,161 +0,0 @@
1
- import { JSONPointer } from "../pointer";
2
- import { JSONValue } from "../types";
3
- export type OpObject = {
4
- op: string;
5
- path: string;
6
- value?: JSONValue;
7
- from?: string;
8
- };
9
- /**
10
- * A JSON Patch operation.
11
- */
12
- export interface Op {
13
- /**
14
- * The patch operation name.
15
- */
16
- name: string;
17
- /**
18
- * Apply the patch operation to _value_.
19
- * @param value - The target JSON value.
20
- */
21
- apply: (value: JSONValue, index: number) => JSONValue;
22
- /**
23
- * A plain object representation of the patch operation.
24
- */
25
- toObject: () => OpObject;
26
- }
27
- /**
28
- * The JSON Patch _add_ operation.
29
- */
30
- export declare class OpAdd implements Op {
31
- readonly path: JSONPointer;
32
- readonly value: JSONValue;
33
- name: string;
34
- constructor(path: JSONPointer, value: JSONValue);
35
- apply(value: JSONValue, index: number): JSONValue;
36
- toObject(): OpObject;
37
- }
38
- /**
39
- * The JSON Patch _remove_ operation.
40
- */
41
- export declare class OpRemove implements Op {
42
- readonly path: JSONPointer;
43
- name: string;
44
- constructor(path: JSONPointer);
45
- apply(value: JSONValue, index: number): JSONValue;
46
- toObject(): OpObject;
47
- }
48
- /**
49
- * The JSON Patch _replace_ operation.
50
- */
51
- export declare class OpReplace implements Op {
52
- readonly path: JSONPointer;
53
- readonly value: JSONValue;
54
- name: string;
55
- constructor(path: JSONPointer, value: JSONValue);
56
- apply(value: JSONValue, index: number): JSONValue;
57
- toObject(): OpObject;
58
- }
59
- /**
60
- * The JSON Patch _move_ operation.
61
- */
62
- export declare class OpMove implements Op {
63
- readonly from: JSONPointer;
64
- readonly path: JSONPointer;
65
- name: string;
66
- constructor(from: JSONPointer, path: JSONPointer);
67
- apply(value: JSONValue, index: number): JSONValue;
68
- toObject(): OpObject;
69
- }
70
- /**
71
- * The JSON Patch _copy_ operation.
72
- */
73
- export declare class OpCopy implements Op {
74
- readonly from: JSONPointer;
75
- readonly path: JSONPointer;
76
- name: string;
77
- constructor(from: JSONPointer, path: JSONPointer);
78
- apply(value: JSONValue, index: number): JSONValue;
79
- toObject(): OpObject;
80
- protected deepCopy(value: JSONValue): JSONValue;
81
- }
82
- /**
83
- * The JSON Patch _test_ operation.
84
- */
85
- export declare class OpTest implements Op {
86
- readonly path: JSONPointer;
87
- readonly value: JSONValue;
88
- name: string;
89
- constructor(path: JSONPointer, value: JSONValue);
90
- apply(value: JSONValue, index: number): JSONValue;
91
- toObject(): OpObject;
92
- }
93
- /**
94
- *
95
- */
96
- export declare class JSONPatch {
97
- private ops;
98
- /**
99
- *
100
- * @param ops -
101
- */
102
- constructor(ops?: OpObject[]);
103
- /**
104
- * @returns an iterator over ops in this patch.
105
- */
106
- [Symbol.iterator](): Iterator<OpObject>;
107
- /**
108
- *
109
- * @param path -
110
- * @param value -
111
- * @returns
112
- */
113
- add(path: string | JSONPointer, value: JSONValue): this;
114
- /**
115
- *
116
- * @param path -
117
- */
118
- remove(path: string | JSONPointer): this;
119
- /**
120
- *
121
- * @param path -
122
- * @param value -
123
- * @returns
124
- */
125
- replace(path: string | JSONPointer, value: JSONValue): this;
126
- /**
127
- *
128
- * @param from -
129
- * @param path -
130
- * @returns
131
- */
132
- move(from: string | JSONPointer, path: string | JSONPointer): this;
133
- /**
134
- *
135
- * @param from -
136
- * @param path -
137
- * @returns
138
- */
139
- copy(from: string | JSONPointer, path: string | JSONPointer): this;
140
- /**
141
- *
142
- * @param path -
143
- * @param value -
144
- * @returns
145
- */
146
- test(path: string | JSONPointer, value: JSONValue): this;
147
- /**
148
- *
149
- * @param value -
150
- */
151
- apply(value: JSONValue): JSONValue;
152
- /**
153
- *
154
- * @returns
155
- */
156
- toArray(): OpObject[];
157
- protected build(ops: OpObject[]): void;
158
- protected opPointer(opObj: OpObject, key: keyof OpObject, op: string, index: number): JSONPointer;
159
- protected opValue(opObj: OpObject, key: keyof OpObject, op: string, index: number): JSONValue;
160
- protected ensurePointer(p: JSONPointer | string, op: string, index: number): JSONPointer;
161
- }
@@ -1,165 +0,0 @@
1
- import { FilterExpression } from "./expression";
2
- import { FilterFunction } from "./functions/function";
3
- import { JSONPathNode, JSONPathNodeList } from "./node";
4
- import { JSONPathQuery } from "./path";
5
- import { Token } from "./token";
6
- import { JSONValue } from "../types";
7
- /**
8
- * JSONPath environment options. The defaults are in compliance with JSONPath
9
- * standards.
10
- */
11
- export type JSONPathEnvironmentOptions = {
12
- /**
13
- * Indicates if the environment should to be strict about its compliance with
14
- * RFC 9535.
15
- *
16
- * Defaults to `true`. Setting `strict` to `false` enables non-standard
17
- * features. Non-standard features are subject to change if conflicting
18
- * features are included in a future JSONPath standard or draft standard, or
19
- * an overwhelming consensus amongst the JSONPath community emerges that
20
- * differs from this implementation.
21
- */
22
- strict?: boolean;
23
- /**
24
- * The maximum number allowed when indexing or slicing an array. Defaults to
25
- * 2**53 -1.
26
- */
27
- maxIntIndex?: number;
28
- /**
29
- * The minimum number allowed when indexing or slicing an array. Defaults to
30
- * -(2**53) -1.
31
- */
32
- minIntIndex?: number;
33
- /**
34
- * The maximum number of objects and/or arrays the recursive descent selector
35
- * can visit before a `JSONPathRecursionLimitError` is thrown.
36
- */
37
- maxRecursionDepth?: number;
38
- /**
39
- * If `true`, enable nondeterministic ordering when iterating JSON object data.
40
- *
41
- * This is mainly useful for validating the JSONPath Compliance Test Suite.
42
- */
43
- nondeterministic?: boolean;
44
- /**
45
- * The pattern to use for the non-standard _keys selector_.
46
- *
47
- * The lexer expects the sticky bit to be set. Defaults to `/~/y`.
48
- */
49
- keysPattern?: RegExp;
50
- };
51
- /**
52
- * A configuration object from which JSONPath queries can be evaluated.
53
- *
54
- * An environment is where you'd register custom function extensions or set
55
- * the maximum recursion depth limit, for example.
56
- */
57
- export declare class JSONPathEnvironment {
58
- /**
59
- * Indicates if the environment should to be strict about its compliance with
60
- * JSONPath standards.
61
- *
62
- * Defaults to `true`. Setting `strict` to `false` currently has no effect.
63
- * If/when we add non-standard features, the environment's strictness will
64
- * control their availability.
65
- */
66
- readonly strict: boolean;
67
- /**
68
- * The maximum number allowed when indexing or slicing an array. Defaults to
69
- * 2**53 -1.
70
- */
71
- readonly maxIntIndex: number;
72
- /**
73
- * The minimum number allowed when indexing or slicing an array. Defaults to
74
- * -(2**53) -1.
75
- */
76
- readonly minIntIndex: number;
77
- /**
78
- * The maximum number of objects and/or arrays the recursive descent selector
79
- * can visit before a `JSONPathRecursionLimitError` is thrown.
80
- */
81
- readonly maxRecursionDepth: number;
82
- /**
83
- * If `true`, enable nondeterministic ordering when iterating JSON object data.
84
- */
85
- readonly nondeterministic: boolean;
86
- /**
87
- * The pattern to use for the non-standard _keys selector_.
88
- */
89
- readonly keysPattern: RegExp;
90
- /**
91
- * A map of function names to objects implementing the {@link FilterFunction}
92
- * interface. You are free to set or delete custom filter functions directly.
93
- */
94
- functionRegister: Map<string, FilterFunction>;
95
- private parser;
96
- /**
97
- * @param options - Environment configuration options.
98
- */
99
- constructor(options?: JSONPathEnvironmentOptions);
100
- /**
101
- * @param path - A JSONPath query to parse.
102
- * @returns A new {@link JSONPathQuery} object, bound to this environment.
103
- */
104
- compile(path: string): JSONPathQuery;
105
- /**
106
- *
107
- * @param path - A JSONPath query to parse and evaluate against _value_.
108
- * @param value - Data to which _path_ will be applied.
109
- * @returns The {@link JSONPathNodeList} resulting from applying _path_
110
- * to _value_.
111
- */
112
- query(path: string, value: JSONValue): JSONPathNodeList;
113
- /**
114
- * A lazy version of {@link query} which is faster and more memory
115
- * efficient when querying some large datasets.
116
- *
117
- * @param path - A JSONPath query to parse and evaluate against _value_.
118
- * @param value - Data to which _path_ will be applied.
119
- * @returns A sequence of {@link JSONPathNode} objects resulting from
120
- * applying _path_ to _value_.
121
- */
122
- lazyQuery(path: string, value: JSONValue): IterableIterator<JSONPathNode>;
123
- /**
124
- * Return a {@link JSONPathNode} instance for the first object found in
125
- * _value_ matching _path_.
126
- *
127
- * @param path - A JSONPath query.
128
- * @param value - JSON-like data to which the query _path_ will be applied.
129
- * @returns The first node in _value_ matching _path_, or `undefined` if
130
- * there are no matches.
131
- */
132
- match(path: string, value: JSONValue): JSONPathNode | undefined;
133
- /**
134
- * A hook for setting up the function register. You are encouraged to
135
- * override this method in classes extending `JSONPathEnvironment`.
136
- */
137
- protected setupFilterFunctions(): void;
138
- /**
139
- * Check the well-typedness of a function's arguments at compile-time.
140
- *
141
- * This method is called by the parser when parsing function calls.
142
- * It is expected to throw a {@link JSONPathTypeError} if the function's
143
- * parameters are not well-typed.
144
- *
145
- * Override this if you want to deviate from the JSONPath Spec's function
146
- * extension type system.
147
- *
148
- * @param token - The {@link Token} starting the function call. `Token.value`
149
- * will contain the name of the function.
150
- * @param args - One {@link FilterExpression} for each argument.
151
- */
152
- checkWellTypedness(token: Token, args: FilterExpression[]): FilterExpression[];
153
- /**
154
- * Return an array of key/values of the enumerable properties in _obj_.
155
- *
156
- * If you want to introduce some nondeterminism to iterating JSON-like
157
- * objects, do it here. The wildcard selector, descendent segment and
158
- * filter selector all use `this.environment.entries`.
159
- *
160
- * @param obj - A JSON-like object.
161
- */
162
- entries(obj: {
163
- [key: string]: JSONValue;
164
- }): Array<[string, JSONValue]>;
165
- }
@@ -1,65 +0,0 @@
1
- import { Token } from "./token";
2
- /**
3
- * Base class for all JSONPath errors.
4
- */
5
- export declare class JSONPathError extends Error {
6
- readonly message: string;
7
- readonly token: Token;
8
- constructor(message: string, token: Token);
9
- }
10
- /**
11
- * Error thrown due to unexpected, internal path tokenization problems.
12
- */
13
- export declare class JSONPathLexerError extends JSONPathError {
14
- readonly message: string;
15
- readonly token: Token;
16
- constructor(message: string, token: Token);
17
- }
18
- /**
19
- * Error thrown due to type errors when evaluating filter expressions.
20
- */
21
- export declare class JSONPathTypeError extends JSONPathError {
22
- readonly message: string;
23
- readonly token: Token;
24
- constructor(message: string, token: Token);
25
- }
26
- /**
27
- * Error thrown due to out of range indices.
28
- */
29
- export declare class JSONPathIndexError extends JSONPathError {
30
- readonly message: string;
31
- readonly token: Token;
32
- constructor(message: string, token: Token);
33
- }
34
- /**
35
- * Error thrown when attempting to retrieve a filter function that has not
36
- * been registered.
37
- */
38
- export declare class UndefinedFilterFunctionError extends JSONPathError {
39
- readonly message: string;
40
- readonly token: Token;
41
- constructor(message: string, token: Token);
42
- }
43
- /**
44
- * Error thrown due to syntax errors found during parsing a JSONPath query.
45
- */
46
- export declare class JSONPathSyntaxError extends JSONPathError {
47
- readonly message: string;
48
- readonly token: Token;
49
- constructor(message: string, token: Token);
50
- }
51
- /**
52
- * Error thrown when the maximum recursion depth is reached.
53
- */
54
- export declare class JSONPathRecursionLimitError extends JSONPathError {
55
- readonly message: string;
56
- readonly token: Token;
57
- constructor(message: string, token: Token);
58
- }
59
- /**
60
- * Error thrown due to invalid I-Regexp syntax.
61
- */
62
- export declare class IRegexpError extends Error {
63
- readonly message: string;
64
- constructor(message: string);
65
- }
@@ -1,101 +0,0 @@
1
- import { JSONPathNodeList } from "./node";
2
- import { JSONPathQuery } from "./path";
3
- import { Token } from "./token";
4
- import { FilterContext, SerializationOptions } from "./types";
5
- /**
6
- * Base class for all filter expressions.
7
- */
8
- export declare abstract class FilterExpression {
9
- readonly token: Token;
10
- constructor(token: Token);
11
- /**
12
- * Evaluate the filter expression in the given context.
13
- * @param context - Evaluation context.
14
- */
15
- abstract evaluate(context: FilterContext): unknown;
16
- /**
17
- * Return a string representation of the expression.
18
- */
19
- abstract toString(options?: SerializationOptions): string;
20
- }
21
- /**
22
- * Base class for JSONPath ValueType literals.
23
- */
24
- export declare abstract class FilterExpressionLiteral extends FilterExpression {
25
- }
26
- export declare class NullLiteral extends FilterExpressionLiteral {
27
- evaluate(): null;
28
- toString(): string;
29
- }
30
- export declare class BooleanLiteral extends FilterExpressionLiteral {
31
- readonly token: Token;
32
- readonly value: boolean;
33
- constructor(token: Token, value: boolean);
34
- evaluate(): boolean;
35
- toString(): string;
36
- }
37
- export declare class StringLiteral extends FilterExpressionLiteral {
38
- readonly token: Token;
39
- readonly value: string;
40
- constructor(token: Token, value: string);
41
- evaluate(): string;
42
- toString(): string;
43
- }
44
- export declare class NumberLiteral extends FilterExpressionLiteral {
45
- readonly token: Token;
46
- readonly value: number;
47
- constructor(token: Token, value: number);
48
- evaluate(): number;
49
- toString(): string;
50
- }
51
- export declare class PrefixExpression extends FilterExpression {
52
- readonly token: Token;
53
- readonly operator: string;
54
- readonly right: FilterExpression;
55
- constructor(token: Token, operator: string, right: FilterExpression);
56
- evaluate(context: FilterContext): boolean;
57
- toString(options?: SerializationOptions): string;
58
- }
59
- export declare class InfixExpression extends FilterExpression {
60
- readonly token: Token;
61
- readonly left: FilterExpression;
62
- readonly operator: string;
63
- readonly right: FilterExpression;
64
- readonly logical: boolean;
65
- constructor(token: Token, left: FilterExpression, operator: string, right: FilterExpression);
66
- evaluate(context: FilterContext): boolean;
67
- toString(options?: SerializationOptions): string;
68
- }
69
- export declare class LogicalExpression extends FilterExpression {
70
- readonly token: Token;
71
- readonly expression: FilterExpression;
72
- constructor(token: Token, expression: FilterExpression);
73
- evaluate(context: FilterContext): boolean;
74
- toString(options?: SerializationOptions): string;
75
- }
76
- /**
77
- * Base class for relative and absolute JSONPath query expressions.
78
- */
79
- export declare abstract class FilterQuery extends FilterExpression {
80
- readonly token: Token;
81
- readonly path: JSONPathQuery;
82
- constructor(token: Token, path: JSONPathQuery);
83
- }
84
- export declare class RelativeQuery extends FilterQuery {
85
- evaluate(context: FilterContext): JSONPathNodeList;
86
- toString(options?: SerializationOptions): string;
87
- }
88
- export declare class RootQuery extends FilterQuery {
89
- evaluate(context: FilterContext): JSONPathNodeList;
90
- toString(options?: SerializationOptions): string;
91
- }
92
- export declare class FunctionExtension extends FilterExpression {
93
- readonly token: Token;
94
- readonly name: string;
95
- readonly args: FilterExpression[];
96
- constructor(token: Token, name: string, args: FilterExpression[]);
97
- evaluate(context: FilterContext): unknown;
98
- toString(options?: SerializationOptions): string;
99
- private unpack_node_list;
100
- }
101
- export declare function compare(left: unknown, operator: string, right: unknown): boolean;
@@ -1,6 +0,0 @@
1
- import { FilterExpression } from "../expression";
2
- import { FilterContext, Nothing } from "../types";
3
- export declare class CurrentKey extends FilterExpression {
4
- evaluate(context: FilterContext): string | number | typeof Nothing;
5
- toString(): string;
6
- }
File without changes
@@ -1,35 +0,0 @@
1
- import { JSONPathEnvironment } from "../environment";
2
- import { LogicalExpression } from "../expression";
3
- import { JSONPathNode } from "../node";
4
- import { JSONPathSelector } from "../selectors";
5
- import { Token } from "../token";
6
- import { type SerializationOptions } from "../types";
7
- export declare class KeySelector extends JSONPathSelector {
8
- readonly environment: JSONPathEnvironment;
9
- readonly token: Token;
10
- readonly key: string;
11
- constructor(environment: JSONPathEnvironment, token: Token, key: string);
12
- resolve(node: JSONPathNode): JSONPathNode[];
13
- lazyResolve(node: JSONPathNode): Generator<JSONPathNode>;
14
- toString(options?: SerializationOptions): string;
15
- }
16
- /**
17
- * Object property name selector or array index selector.
18
- */
19
- export declare class KeysSelector extends JSONPathSelector {
20
- readonly environment: JSONPathEnvironment;
21
- readonly token: Token;
22
- constructor(environment: JSONPathEnvironment, token: Token);
23
- resolve(node: JSONPathNode): JSONPathNode[];
24
- lazyResolve(node: JSONPathNode): Generator<JSONPathNode>;
25
- toString(): string;
26
- }
27
- export declare class KeysFilterSelector extends JSONPathSelector {
28
- readonly environment: JSONPathEnvironment;
29
- readonly token: Token;
30
- readonly expression: LogicalExpression;
31
- constructor(environment: JSONPathEnvironment, token: Token, expression: LogicalExpression);
32
- resolve(node: JSONPathNode): JSONPathNode[];
33
- lazyResolve(node: JSONPathNode): Generator<JSONPathNode>;
34
- toString(options?: SerializationOptions): string;
35
- }
@@ -1,7 +0,0 @@
1
- import { JSONPathNodeList } from "../node";
2
- import { FilterFunction, FunctionExpressionType } from "./function";
3
- export declare class Count implements FilterFunction {
4
- readonly argTypes: FunctionExpressionType[];
5
- readonly returnType = FunctionExpressionType.ValueType;
6
- call(nodes: JSONPathNodeList): number;
7
- }
@@ -1,26 +0,0 @@
1
- /**
2
- * The type of a JSONPath filter function parameter or return value, as
3
- * described in See section 2.4.1 of RFC 9535.
4
- */
5
- export declare enum FunctionExpressionType {
6
- ValueType = "ValueType",
7
- LogicalType = "LogicalType",
8
- NodesType = "NodesType"
9
- }
10
- /**
11
- * A JSONPath filter function definition.
12
- */
13
- export interface FilterFunction {
14
- /**
15
- * Argument types expected by the filter function.
16
- */
17
- argTypes: FunctionExpressionType[];
18
- /**
19
- * The type of the value returned by the filter function.
20
- */
21
- returnType: FunctionExpressionType;
22
- /**
23
- * A function with unknown number and type of arguments.
24
- */
25
- call(...args: unknown[]): unknown;
26
- }
@@ -1,44 +0,0 @@
1
- import { FilterFunction, FunctionExpressionType } from "./function";
2
- export type HasFilterFunctionOptions = {
3
- /**
4
- * The maximum number of regular expressions to cache. Defaults
5
- * to 10.
6
- */
7
- cacheSize?: number;
8
- /**
9
- * If _true_, throw errors from regex construction and matching.
10
- * The standard and default behavior is to ignore these errors
11
- * and return _false_.
12
- */
13
- throwErrors?: boolean;
14
- /**
15
- * If _true_, check that regexp patterns are valid according to I-Regexp.
16
- * The standard and default behavior is to silently return _false_ if a
17
- * pattern is invalid.
18
- *
19
- * If `iRegexpCheck` is _true_ and `throwErrors` is _true_, an `IRegexpError`
20
- * will be thrown.
21
- */
22
- iRegexpCheck?: boolean;
23
- /**
24
- * if _true_, use regex search semantics when testing patterns against
25
- * property names. Defaults to _true_.
26
- */
27
- search?: boolean;
28
- };
29
- /**
30
- * A function extension that returns `true` if the first argument is an object
31
- * value and it contains a property matching the second argument.
32
- */
33
- export declare class Has implements FilterFunction {
34
- #private;
35
- readonly options: HasFilterFunctionOptions;
36
- readonly argTypes: FunctionExpressionType[];
37
- readonly returnType = FunctionExpressionType.LogicalType;
38
- readonly cacheSize: number;
39
- readonly throwErrors: boolean;
40
- readonly iRegexpCheck: boolean;
41
- readonly search: boolean;
42
- constructor(options?: HasFilterFunctionOptions);
43
- call(value: unknown, pattern: string): boolean;
44
- }
@@ -1,11 +0,0 @@
1
- export { Count } from "./count";
2
- export { Length } from "./length";
3
- export { Match } from "./match";
4
- export { Has } from "./has";
5
- export { Search } from "./search";
6
- export { Value } from "./value";
7
- export { FunctionExpressionType } from "./function";
8
- export type { FilterFunction } from "./function";
9
- export type { HasFilterFunctionOptions } from "./has";
10
- export type { MatchFilterFunctionOptions } from "./match";
11
- export type { SearchFilterFunctionOptions } from "./search";
@@ -1,7 +0,0 @@
1
- import { FilterFunction, FunctionExpressionType } from "./function";
2
- import { Nothing } from "../types";
3
- export declare class Length implements FilterFunction {
4
- readonly argTypes: FunctionExpressionType[];
5
- readonly returnType = FunctionExpressionType.ValueType;
6
- call(value: unknown): number | typeof Nothing;
7
- }