@loancrate/json-selector 1.0.0 → 2.1.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 (60) hide show
  1. package/README.md +60 -5
  2. package/dist/access.d.ts +13 -1
  3. package/dist/access.d.ts.map +1 -0
  4. package/dist/ast.d.ts +77 -0
  5. package/dist/ast.d.ts.map +1 -0
  6. package/dist/evaluate.d.ts +18 -0
  7. package/dist/evaluate.d.ts.map +1 -0
  8. package/dist/format.d.ts +6 -2
  9. package/dist/format.d.ts.map +1 -0
  10. package/dist/get.d.ts +2 -1
  11. package/dist/get.d.ts.map +1 -0
  12. package/dist/index.d.ts +3 -1
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/json-selector.esm.js +3450 -0
  15. package/dist/json-selector.esm.js.map +1 -0
  16. package/dist/json-selector.umd.js +3509 -0
  17. package/dist/json-selector.umd.js.map +1 -0
  18. package/dist/parse.d.ts +2 -1
  19. package/dist/parse.d.ts.map +1 -0
  20. package/dist/set.d.ts +2 -1
  21. package/dist/set.d.ts.map +1 -0
  22. package/dist/util.d.ts +9 -0
  23. package/dist/util.d.ts.map +1 -0
  24. package/dist/visitor.d.ts +14 -2
  25. package/dist/visitor.d.ts.map +1 -0
  26. package/package.json +33 -17
  27. package/src/__generated__/parser.js +2696 -0
  28. package/src/access.ts +510 -0
  29. package/src/ast.ts +109 -0
  30. package/src/evaluate.ts +229 -0
  31. package/src/format.ts +141 -0
  32. package/src/get.ts +9 -0
  33. package/src/grammar.pegjs +217 -0
  34. package/src/index.ts +7 -0
  35. package/src/parse.ts +7 -0
  36. package/src/set.ts +13 -0
  37. package/src/util.ts +70 -0
  38. package/src/visitor.ts +75 -0
  39. package/dist/__generated__/parser.d.ts +0 -10
  40. package/dist/__generated__/parser.js +0 -1206
  41. package/dist/__generated__/parser.js.map +0 -1
  42. package/dist/access.js +0 -123
  43. package/dist/access.js.map +0 -1
  44. package/dist/format.js +0 -26
  45. package/dist/format.js.map +0 -1
  46. package/dist/get.js +0 -9
  47. package/dist/get.js.map +0 -1
  48. package/dist/index.js +0 -23
  49. package/dist/index.js.map +0 -1
  50. package/dist/parse.js +0 -10
  51. package/dist/parse.js.map +0 -1
  52. package/dist/set.js +0 -12
  53. package/dist/set.js.map +0 -1
  54. package/dist/types.d.ts +0 -21
  55. package/dist/types.js +0 -3
  56. package/dist/types.js.map +0 -1
  57. package/dist/util.js +0 -26
  58. package/dist/util.js.map +0 -1
  59. package/dist/visitor.js +0 -21
  60. package/dist/visitor.js.map +0 -1
package/README.md CHANGED
@@ -1,11 +1,13 @@
1
1
  # LoanCrate JSON Selectors
2
2
 
3
- LoanCrate JSON Selectors are based on a subset of [JMESPath](https://jmespath.org/specification.html)
3
+ LoanCrate JSON Selectors are based on a subset of [JMESPath](https://jmespath.org)
4
4
  with a shorthand/extension for selecting an object from an array based on ID.
5
- Specifically, the subset includes the [Basic Expressions](https://jmespath.org/tutorial.html#basic-expressions)
6
- ([identifiers](https://jmespath.org/specification.html#identifiers),
7
- [subexpressions](https://jmespath.org/specification.html#subexpressions),
8
- and [index expressions](https://jmespath.org/specification.html#indexexpressions)).
5
+
6
+ Currently, the subset includes everything except [functions](https://jmespath.org/specification.html#functions-expressions),
7
+ object projections ([`*` wildcard](https://jmespath.org/specification.html#wildcard-expressions) not within brackets),
8
+ and multi-select [lists](https://jmespath.org/specification.html#multiselect-list) and [hashes](https://jmespath.org/specification.html#multiselect-hash).
9
+ The library passes all of the [JMESPath compliance tests](https://github.com/jmespath/jmespath.test) not using those specific features.
10
+
9
11
  To allow for selection by ID, we extend index expressions to accept a
10
12
  [raw string literal](https://jmespath.org/specification.html#raw-string-literals)
11
13
  (as opposed to a numeric literal), which represents the value of the `id` property
@@ -13,6 +15,15 @@ of the desired object from an array of objects.
13
15
  Formally, `x['y']` would be equivalent to `x[?id == 'y'] | [0]` in JMESPath.
14
16
  This should be unambiguous relative to the existing grammar and semantics.
15
17
 
18
+ In addition to the extension above, this library offers the following features compared to [jmespath.js](https://github.com/jmespath/jmespath.js):
19
+
20
+ - Written using Typescript and [PEG.js](https://pegjs.org/) for clarity and correctness
21
+ - Type definitions for the abstract syntax tree (AST) produced by the parser
22
+ - Typed visitor pattern for accessing AST nodes
23
+ - Formatting of an AST back into an expression string
24
+ - Read/write/delete accessors allow modification of the input data referenced by a selector
25
+ - Detailed error reporting for syntax errors
26
+
16
27
  ## Installation
17
28
 
18
29
  ```sh
@@ -47,6 +58,50 @@ accessor.delete();
47
58
  console.log(obj.foo.bar[0].value); // undefined
48
59
  ```
49
60
 
61
+ ## Operator Precedence
62
+
63
+ As mentioned above, JSON Selectors are based on
64
+ [JMESPath](https://jmespath.org). Although JMESPath claims to have an "ABNF
65
+ grammar with a complete specification", the
66
+ [specification](https://jmespath.org/specification.html) is not complete
67
+ regarding operator precedence, since it only mentions the relative precedence of
68
+ 5 tokens (`|`, `||`, `&&`, `!`, and `]`). To discover the precedence of other
69
+ operators, we must turn to the [JMESPath source
70
+ code](https://github.com/jmespath/jmespath.js/blob/master/jmespath.js). It is
71
+ implemented as a [Top-Down Operator Precedence (TDOP)
72
+ parser](https://eli.thegreenplace.net/2010/01/02/top-down-operator-precedence-parsing),
73
+ which is based on principles like "token binding power", "null denotation"
74
+ (**nud**), and "left denotation" (**led**). Given knowledge of these principles
75
+ and the [binding power
76
+ table](https://github.com/jmespath/jmespath.js/blob/master/jmespath.js#L474-L501)
77
+ from the source, we can reverse-engineer the operator precedence of JMESPath.
78
+
79
+ Essentially, the expression grammar is structured as a left-hand side (LHS)
80
+ expression followed by zero or more right-hand side (RHS) expressions (which are
81
+ often projections on the result of the LHS). RHS expressions are consumed by the
82
+ parser and projected onto the LHS as long as they have the same or higher
83
+ binding power as the LHS. RHS expressions with lower binding power are projected
84
+ onto the result of the overall expression to the left, as opposed to the nearest
85
+ subexpression. For example, since dot (40) has a higher binding power than left
86
+ bracket (55), `a.b.c['id'].d.e` is parsed and evaluated like
87
+ `((a.b.c)['id']).d.e`. Binding power and precedence can be summarized as
88
+ follows, in increasing order:
89
+
90
+ - pipe: `|`
91
+ - or: `||`
92
+ - and: `&&`
93
+ - compare: `<=`, `>=`, `<`, `>`, `==`, `!=`
94
+ - not: `!`
95
+ - flatten projection: `[]`
96
+ - filter projection: `[?`
97
+ - star/slice projection: `[*`, `[<number?>:`
98
+ - index/ID access: `[<number>`, `['`
99
+ - member access: `.`
100
+
101
+ However, as a [special
102
+ case](https://github.com/jmespath/jmespath.js/blob/master/jmespath.js#L803-L805),
103
+ member access can directly follow (act as RHS) for any projection.
104
+
50
105
  ## License
51
106
 
52
107
  This library is available under the [ISC license](LICENSE).
package/dist/access.d.ts CHANGED
@@ -1,9 +1,21 @@
1
- import { JsonSelector } from "./types";
1
+ import { JsonSelector } from "./ast";
2
+ export interface UnboundAccessor {
3
+ readonly selector: JsonSelector;
4
+ isValidContext(context: unknown): boolean;
5
+ get(context: unknown): unknown;
6
+ set(context: unknown, value: unknown): void;
7
+ delete(context: unknown): void;
8
+ }
9
+ export declare function makeJsonSelectorAccessor(selector: JsonSelector): UnboundAccessor;
2
10
  export interface Accessor<T> {
11
+ readonly selector: JsonSelector;
3
12
  readonly valid: boolean;
4
13
  readonly path: string;
5
14
  get(): T;
6
15
  set(value: T): void;
7
16
  delete(): void;
8
17
  }
18
+ export declare function bindJsonSelectorAccessor(unbound: UnboundAccessor, context: unknown): Accessor<unknown>;
9
19
  export declare function accessWithJsonSelector(selector: JsonSelector, context: unknown): Accessor<unknown>;
20
+ export declare function invertedSlice(value: unknown[], start: number | undefined, end?: number, step?: number): unknown[];
21
+ //# sourceMappingURL=access.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAuBrC,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IAC1C,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IAC/B,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CAChC;AAgDD,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,YAAY,GACrB,eAAe,CAqVjB;AAED,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,GAAG,IAAI,CAAC,CAAC;IACT,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IACpB,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,OAAO,GACf,QAAQ,CAAC,OAAO,CAAC,CAiBnB;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,OAAO,GACf,QAAQ,CAAC,OAAO,CAAC,CAEnB;AAiBD,wBAAgB,aAAa,CAC3B,KAAK,EAAE,OAAO,EAAE,EAChB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,GAAG,CAAC,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,EAAE,CA6BX"}
package/dist/ast.d.ts ADDED
@@ -0,0 +1,77 @@
1
+ import { JsonValue } from "type-fest";
2
+ export type JsonSelectorNodeType = JsonSelector["type"];
3
+ export interface JsonSelectorCurrent {
4
+ type: "current";
5
+ }
6
+ export interface JsonSelectorLiteral {
7
+ type: "literal";
8
+ value: JsonValue;
9
+ }
10
+ export interface JsonSelectorIdentifier {
11
+ type: "identifier";
12
+ id: string;
13
+ }
14
+ export interface JsonSelectorFieldAccess {
15
+ type: "fieldAccess";
16
+ expression: JsonSelector;
17
+ field: string;
18
+ }
19
+ export interface JsonSelectorIndexAccess {
20
+ type: "indexAccess";
21
+ expression: JsonSelector;
22
+ index: number;
23
+ }
24
+ export interface JsonSelectorIdAccess {
25
+ type: "idAccess";
26
+ expression: JsonSelector;
27
+ id: string;
28
+ }
29
+ export interface JsonSelectorProject {
30
+ type: "project";
31
+ expression: JsonSelector;
32
+ projection?: JsonSelector;
33
+ }
34
+ export interface JsonSelectorFilter {
35
+ type: "filter";
36
+ expression: JsonSelector;
37
+ condition: JsonSelector;
38
+ }
39
+ export interface JsonSelectorSlice {
40
+ type: "slice";
41
+ expression: JsonSelector;
42
+ start?: number;
43
+ end?: number;
44
+ step?: number;
45
+ }
46
+ export interface JsonSelectorFlatten {
47
+ type: "flatten";
48
+ expression: JsonSelector;
49
+ }
50
+ export interface JsonSelectorNot {
51
+ type: "not";
52
+ expression: JsonSelector;
53
+ }
54
+ export type JsonSelectorCompareOperator = "<" | "<=" | "==" | ">=" | ">" | "!=";
55
+ export interface JsonSelectorCompare {
56
+ type: "compare";
57
+ operator: JsonSelectorCompareOperator;
58
+ lhs: JsonSelector;
59
+ rhs: JsonSelector;
60
+ }
61
+ export interface JsonSelectorAnd {
62
+ type: "and";
63
+ lhs: JsonSelector;
64
+ rhs: JsonSelector;
65
+ }
66
+ export interface JsonSelectorOr {
67
+ type: "or";
68
+ lhs: JsonSelector;
69
+ rhs: JsonSelector;
70
+ }
71
+ export interface JsonSelectorPipe {
72
+ type: "pipe";
73
+ lhs: JsonSelector;
74
+ rhs: JsonSelector;
75
+ }
76
+ export type JsonSelector = JsonSelectorCurrent | JsonSelectorLiteral | JsonSelectorIdentifier | JsonSelectorFieldAccess | JsonSelectorIndexAccess | JsonSelectorIdAccess | JsonSelectorProject | JsonSelectorFilter | JsonSelectorSlice | JsonSelectorFlatten | JsonSelectorNot | JsonSelectorCompare | JsonSelectorAnd | JsonSelectorOr | JsonSelectorPipe;
77
+ //# sourceMappingURL=ast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../src/ast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AAExD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,YAAY,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,YAAY,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,YAAY,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,YAAY,CAAC;IACzB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,YAAY,CAAC;IACzB,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,YAAY,CAAC;IACzB,SAAS,EAAE,YAAY,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,YAAY,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,YAAY,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,KAAK,CAAC;IACZ,UAAU,EAAE,YAAY,CAAC;CAC1B;AAED,MAAM,MAAM,2BAA2B,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC;AAEhF,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,2BAA2B,CAAC;IACtC,GAAG,EAAE,YAAY,CAAC;IAClB,GAAG,EAAE,YAAY,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,KAAK,CAAC;IACZ,GAAG,EAAE,YAAY,CAAC;IAClB,GAAG,EAAE,YAAY,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,EAAE,YAAY,CAAC;IAClB,GAAG,EAAE,YAAY,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,YAAY,CAAC;IAClB,GAAG,EAAE,YAAY,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GACpB,mBAAmB,GACnB,mBAAmB,GACnB,sBAAsB,GACtB,uBAAuB,GACvB,uBAAuB,GACvB,oBAAoB,GACpB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,mBAAmB,GACnB,eAAe,GACf,mBAAmB,GACnB,eAAe,GACf,cAAc,GACd,gBAAgB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { JsonSelector, JsonSelectorCompareOperator } from "./ast";
2
+ export declare function evaluateJsonSelector(selector: JsonSelector, context: unknown): unknown;
3
+ export declare function project(value: unknown[], projection: JsonSelector | undefined): unknown[];
4
+ export declare function project(value: unknown, projection: JsonSelector | undefined): unknown[] | null;
5
+ export declare function filter(value: unknown[], condition: JsonSelector): unknown[];
6
+ export declare function filter(value: unknown, condition: JsonSelector): unknown[] | null;
7
+ export declare function slice(value: unknown[], start: number | undefined, end?: number, step?: number): unknown[];
8
+ export declare function slice(value: unknown, start: number | undefined, end?: number, step?: number): unknown[] | null;
9
+ export declare function normalizeSlice(length: number, start?: number, end?: number, step?: number): {
10
+ start: number;
11
+ end: number;
12
+ step: number;
13
+ };
14
+ export declare function flatten(value: unknown[]): unknown[];
15
+ export declare function flatten(value: unknown): unknown[] | null;
16
+ export declare function compare(lv: number, rv: number, operator: JsonSelectorCompareOperator): boolean;
17
+ export declare function compare(lv: unknown, rv: unknown, operator: JsonSelectorCompareOperator): boolean | null;
18
+ //# sourceMappingURL=evaluate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../src/evaluate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,OAAO,CAAC;AAIlE,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,OAAO,GACf,OAAO,CA6DT;AAED,wBAAgB,OAAO,CACrB,KAAK,EAAE,OAAO,EAAE,EAChB,UAAU,EAAE,YAAY,GAAG,SAAS,GACnC,OAAO,EAAE,CAAC;AACb,wBAAgB,OAAO,CACrB,KAAK,EAAE,OAAO,EACd,UAAU,EAAE,YAAY,GAAG,SAAS,GACnC,OAAO,EAAE,GAAG,IAAI,CAAC;AAiBpB,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,EAAE,CAAC;AAC7E,wBAAgB,MAAM,CACpB,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,YAAY,GACtB,OAAO,EAAE,GAAG,IAAI,CAAC;AAcpB,wBAAgB,KAAK,CACnB,KAAK,EAAE,OAAO,EAAE,EAChB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,GAAG,CAAC,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,EAAE,CAAC;AACb,wBAAgB,KAAK,CACnB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,GAAG,CAAC,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,EAAE,GAAG,IAAI,CAAC;AAwBpB,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,MAAM,GACZ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAiB9C;AAcD,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;AACrD,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC;AAK1D,wBAAgB,OAAO,CACrB,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,2BAA2B,GACpC,OAAO,CAAC;AACX,wBAAgB,OAAO,CACrB,EAAE,EAAE,OAAO,EACX,EAAE,EAAE,OAAO,EACX,QAAQ,EAAE,2BAA2B,GACpC,OAAO,GAAG,IAAI,CAAC"}
package/dist/format.d.ts CHANGED
@@ -1,2 +1,6 @@
1
- import { JsonSelector } from "./types";
2
- export declare function formatJsonSelector(selector: JsonSelector): string;
1
+ import { JsonSelector } from "./ast";
2
+ export interface FormatJsonSelectorOptions {
3
+ currentImplied: boolean;
4
+ }
5
+ export declare function formatJsonSelector(selector: JsonSelector, options?: Partial<FormatJsonSelectorOptions>): string;
6
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAwB,MAAM,OAAO,CAAC;AAmD3D,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,YAAY,EACtB,OAAO,GAAE,OAAO,CAAC,yBAAyB,CAAM,GAC/C,MAAM,CAkFR"}
package/dist/get.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- import { JsonSelector } from "./types";
1
+ import { JsonSelector } from "./ast";
2
2
  export declare function getWithJsonSelector(selector: JsonSelector, context: unknown): unknown;
3
+ //# sourceMappingURL=get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../src/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,OAAO,GACf,OAAO,CAET"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export * from "./access";
2
+ export * from "./ast";
3
+ export { evaluateJsonSelector } from "./evaluate";
2
4
  export * from "./format";
3
5
  export * from "./get";
4
6
  export * from "./parse";
5
7
  export * from "./set";
6
- export * from "./types";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC"}