jprx 1.3.0 → 1.3.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.
Files changed (3) hide show
  1. package/index.js +2 -1
  2. package/package.json +1 -1
  3. package/parser.js +4 -2
package/index.js CHANGED
@@ -19,7 +19,8 @@ export {
19
19
  resolvePathAsContext,
20
20
  resolveExpression,
21
21
  parseCDOMC,
22
- parseJPRX,
22
+ parseCDOMC as parseJPRX,
23
+ parseJPRX as oldParseJPRX,
23
24
  unwrapSignal,
24
25
  getRegistry,
25
26
  BindingTarget
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jprx",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "JSON Path Reactive eXpressions - A reactive expression language for JSON data",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/parser.js CHANGED
@@ -1409,6 +1409,7 @@ export const parseExpression = (expr, context) => {
1409
1409
  * Supports unquoted keys/values and strictly avoids 'eval'.
1410
1410
  */
1411
1411
  export const parseCDOMC = (input) => {
1412
+ if (typeof input !== 'string') return input;
1412
1413
  let i = 0;
1413
1414
  const len = input.length;
1414
1415
 
@@ -1666,6 +1667,7 @@ export const parseCDOMC = (input) => {
1666
1667
  * @returns {object} - Parsed JSON object
1667
1668
  */
1668
1669
  export const parseJPRX = (input) => {
1670
+ if (typeof input !== 'string') return input;
1669
1671
  let result = '';
1670
1672
  let i = 0;
1671
1673
  const len = input.length;
@@ -1791,9 +1793,9 @@ export const parseJPRX = (input) => {
1791
1793
  }
1792
1794
 
1793
1795
  // Handle unquoted property names, identifiers, paths, and FUNCTION CALLS
1794
- if (/[a-zA-Z_$/./]/.test(char)) {
1796
+ if (/[a-zA-Z_$\/.\/]/.test(char)) {
1795
1797
  let word = '';
1796
- while (i < len && /[a-zA-Z0-9_$/.-]/.test(input[i])) {
1798
+ while (i < len && /[a-zA-Z0-9_$\/.-]/.test(input[i])) {
1797
1799
  word += input[i];
1798
1800
  i++;
1799
1801
  }