json-p3 2.3.0 → 2.3.2

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.
@@ -0,0 +1,39 @@
1
+ import { JSONPathEnvironment } from "./environment";
2
+ import { JSONPathNode } from "./node";
3
+ import { JSONPathSelector } from "./selectors";
4
+ import { Token } from "./token";
5
+ import { type SerializationOptions } from "./types";
6
+ /** Base class for all JSONPath segments. Both shorthand and bracketed. */
7
+ export declare abstract class JSONPathSegment {
8
+ readonly environment: JSONPathEnvironment;
9
+ readonly token: Token;
10
+ readonly selectors: JSONPathSelector[];
11
+ constructor(environment: JSONPathEnvironment, token: Token, selectors: JSONPathSelector[]);
12
+ /**
13
+ * @param nodes - Nodes matched by preceding segments.
14
+ */
15
+ abstract resolve(nodes: JSONPathNode[]): JSONPathNode[];
16
+ /**
17
+ * @param nodes - Nodes matched by preceding segments.
18
+ */
19
+ abstract lazyResolve(nodes: Iterable<JSONPathNode>): Generator<JSONPathNode>;
20
+ /**
21
+ * Return a string representation of this segment.
22
+ */
23
+ abstract toString(options?: SerializationOptions): string;
24
+ }
25
+ /** The child selection segment. */
26
+ export declare class ChildSegment extends JSONPathSegment {
27
+ resolve(nodes: JSONPathNode[]): JSONPathNode[];
28
+ lazyResolve(nodes: Iterable<JSONPathNode>): Generator<JSONPathNode>;
29
+ toString(options?: SerializationOptions): string;
30
+ }
31
+ /** The recursive descent segment. */
32
+ export declare class DescendantSegment extends JSONPathSegment {
33
+ resolve(nodes: JSONPathNode[]): JSONPathNode[];
34
+ lazyResolve(nodes: Iterable<JSONPathNode>): Generator<JSONPathNode>;
35
+ toString(options?: SerializationOptions): string;
36
+ private visit;
37
+ private nondeterministicVisit;
38
+ private nondeterministicChildren;
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-p3",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "author": "James Prior",
5
5
  "license": "MIT",
6
6
  "description": "JSONPath, JSON Pointer and JSON Patch",
@@ -14,10 +14,10 @@
14
14
  },
15
15
  "scripts": {
16
16
  "test": "jest",
17
- "build:types": "tsc --emitDeclarationOnly",
17
+ "build:types": "tsc -p tsconfig.build.json --emitDeclarationOnly",
18
18
  "build:js": "rollup -c",
19
19
  "build": "npm run build:types && npm run build:js",
20
- "type-check": "tsc --noEmit",
20
+ "type-check": "tsc -p tsconfig.build.json --noEmit",
21
21
  "coverage": "jest --collectCoverage",
22
22
  "clean": "rm -rf ./lib ./dist ./coverage ./docs/docs/api",
23
23
  "lint": "eslint src tests --ext .js,.jsx,.ts,.tsx"