@speclynx/apidom-json-path 1.12.1

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.
package/src/index.cjs ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
4
+ exports.__esModule = true;
5
+ exports.evaluateMulti = exports.evaluate = exports.MultiEvaluationJsonPathError = exports.EvaluationJsonPathError = void 0;
6
+ var _EvaluationJsonPathError = _interopRequireDefault(require("./errors/EvaluationJsonPathError.cjs"));
7
+ exports.EvaluationJsonPathError = _EvaluationJsonPathError.default;
8
+ var _MultiEvaluationJsonPathError = _interopRequireDefault(require("./errors/MultiEvaluationJsonPathError.cjs"));
9
+ exports.MultiEvaluationJsonPathError = _MultiEvaluationJsonPathError.default;
10
+ var _evaluate = _interopRequireDefault(require("./evaluate.cjs"));
11
+ exports.evaluate = _evaluate.default;
12
+ var _evaluateMulti = _interopRequireDefault(require("./evaluate-multi.cjs"));
13
+ exports.evaluateMulti = _evaluateMulti.default;
package/src/index.mjs ADDED
@@ -0,0 +1,4 @@
1
+ export { default as EvaluationJsonPathError } from "./errors/EvaluationJsonPathError.mjs";
2
+ export { default as MultiEvaluationJsonPathError } from "./errors/MultiEvaluationJsonPathError.mjs";
3
+ export { default as evaluate } from "./evaluate.mjs";
4
+ export { default as evaluateMulti } from "./evaluate-multi.mjs";
@@ -0,0 +1,78 @@
1
+ import { ApiDOMErrorOptions } from '@speclynx/apidom-error';
2
+ import { ApiDOMStructuredError } from '@speclynx/apidom-error';
3
+ import { Element as Element_2 } from '@speclynx/apidom-core';
4
+
5
+ /**
6
+ * @public
7
+ */
8
+ export declare type Evaluate = {
9
+ <T extends Element_2>(path: string, element: T): Element_2[];
10
+ <T extends Element_2>(path: string[], element: T): Element_2[];
11
+ };
12
+
13
+ /**
14
+ * Evaluates single JSONPath on ApiDOM element.
15
+ * @public
16
+ */
17
+ export declare const evaluate: Evaluate;
18
+
19
+ /**
20
+ * @public
21
+ */
22
+ export declare type EvaluateMulti = {
23
+ <T extends Element_2>(paths: string[], element: T): JSONPathEvalTuple[];
24
+ <T extends Element_2>(paths: string[][], element: T): JSONPathEvalTuple[];
25
+ };
26
+
27
+ /**
28
+ * Evaluates multiple JSONPaths on ApiDOM element.
29
+ * @public
30
+ */
31
+ export declare const evaluateMulti: EvaluateMulti;
32
+
33
+ /**
34
+ * @public
35
+ */
36
+ export declare class EvaluationJsonPathError<T extends Element_2> extends JsonPathError {
37
+ readonly path: string | string[];
38
+ readonly element: T;
39
+ constructor(message?: string, structuredOptions?: EvaluationJsonPathErrorOptions<T>);
40
+ }
41
+
42
+ /**
43
+ * @public
44
+ */
45
+ export declare interface EvaluationJsonPathErrorOptions<T extends Element_2> extends ApiDOMErrorOptions {
46
+ path: string | string[];
47
+ element: T;
48
+ }
49
+
50
+ /**
51
+ * @public
52
+ */
53
+ export declare class JsonPathError extends ApiDOMStructuredError {
54
+ }
55
+
56
+ /**
57
+ * @public
58
+ */
59
+ export declare type JSONPathEvalTuple = [string, Element_2[]];
60
+
61
+ /**
62
+ * @public
63
+ */
64
+ export declare class MultiEvaluationJsonPathError<T extends Element_2> extends JsonPathError {
65
+ readonly paths: string[] | string[][];
66
+ readonly element: T;
67
+ constructor(message?: string, structuredOptions?: MultiEvaluationJsonPathErrorOptions<T>);
68
+ }
69
+
70
+ /**
71
+ * @public
72
+ */
73
+ export declare interface MultiEvaluationJsonPathErrorOptions<T extends Element_2> extends ApiDOMErrorOptions {
74
+ paths: string[] | string[][];
75
+ element: T;
76
+ }
77
+
78
+ export { }