@loancrate/json-selector 5.1.0 → 5.2.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.
package/README.md CHANGED
@@ -62,7 +62,7 @@ Two extensions are added:
62
62
  - **ID-based access**: `x['id']` selects the first array element whose `id` property matches — equivalent to `x[?id == 'id'] | [0]` in standard JMESPath.
63
63
  - **Bare numeric literals**: Numbers like `0`, `-1`, `3.14` can appear directly in expressions without backtick delimiters, enabling natural syntax like `foo[?price > 0]` and `a - 1`.
64
64
 
65
- Compatibility options (`strictJsonLiterals`, `rawStringBackslashEscape`, `evaluateNullMultiSelect`) control standards-compliance behavior. See the [Language Reference](docs/language.md#legacy-compatibility) for details.
65
+ Compatibility options (`strictJsonLiterals`, `rawStringBackslashEscape`, `lowNotPrecedence`, `evaluateNullMultiSelect`) control standards-compliance behavior. See the [Language Reference](docs/language.md#legacy-compatibility) for details.
66
66
 
67
67
  ## License
68
68
 
@@ -2868,6 +2868,7 @@ const BP_AND = 4;
2868
2868
  const BP_COMPARE = 5;
2869
2869
  const BP_ADD = 6;
2870
2870
  const BP_MUL = 7;
2871
+ const BP_LOW_NOT = 8;
2871
2872
  const BP_FLATTEN = 9;
2872
2873
  const BP_FILTER = 21;
2873
2874
  const BP_DOT = 40;
@@ -2928,6 +2929,8 @@ class Parser {
2928
2929
  rawStringBackslashEscape: options === null || options === void 0 ? void 0 : options.rawStringBackslashEscape,
2929
2930
  });
2930
2931
  this.strictJsonLiterals = (options === null || options === void 0 ? void 0 : options.strictJsonLiterals) === true;
2932
+ this.notBindingPower =
2933
+ (options === null || options === void 0 ? void 0 : options.lowNotPrecedence) === true ? BP_LOW_NOT : BP_NOT;
2931
2934
  }
2932
2935
  /**
2933
2936
  * Main entry point: parse a complete expression
@@ -3042,7 +3045,7 @@ class Parser {
3042
3045
  this.lexer.advance();
3043
3046
  return {
3044
3047
  type: "not",
3045
- expression: this.expression(BP_NOT),
3048
+ expression: this.expression(this.notBindingPower),
3046
3049
  };
3047
3050
  case 20 /* TokenType.PLUS */:
3048
3051
  this.lexer.advance();