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.
- package/index.js +2 -1
- package/package.json +1 -1
- package/parser.js +4 -2
package/index.js
CHANGED
package/package.json
CHANGED
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_
|
|
1796
|
+
if (/[a-zA-Z_$\/.\/]/.test(char)) {
|
|
1795
1797
|
let word = '';
|
|
1796
|
-
while (i < len && /[a-zA-Z0-9_
|
|
1798
|
+
while (i < len && /[a-zA-Z0-9_$\/.-]/.test(input[i])) {
|
|
1797
1799
|
word += input[i];
|
|
1798
1800
|
i++;
|
|
1799
1801
|
}
|