diff --git a/.ncurc.cjs b/.ncurc.cjs new file mode 100644 index 00000000..162a5bf9 --- /dev/null +++ b/.ncurc.cjs @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = { + reject: [ + // Until typedoc supports + 'typescript' + ] +}; diff --git a/badges/tests-badge.svg b/badges/tests-badge.svg index eb9013bd..9436f8d5 100644 --- a/badges/tests-badge.svg +++ b/badges/tests-badge.svg @@ -1 +1 @@ -TestsTests280/280280/280 \ No newline at end of file +TestsTests293/293293/293 \ No newline at end of file diff --git a/bin/jsonpath-cli.js b/bin/jsonpath-cli.js index 58fbb4bc..76e864c0 100755 --- a/bin/jsonpath-cli.js +++ b/bin/jsonpath-cli.js @@ -1,6 +1,6 @@ #!/usr/bin/env node import {readFile} from 'fs/promises'; -import {JSONPath as jsonpath} from '../dist/index-node-esm.js'; +import {JSONPath as jsonpath} from '../src/jsonpath-node.js'; const file = process.argv[2]; const path = process.argv[3]; @@ -17,11 +17,16 @@ try { } /** - * @typedef {any} JSON + * @typedef {JSONValue[]} JSONArray */ /** - * @param {JSON} json + * @typedef {null|boolean|number|string| + * {[key: string]: JSONValue}|JSONArray} JSONValue + */ + +/** + * @param {JSONValue} json * @param {string} pth * @returns {void} */ diff --git a/demo/index.js b/demo/index.js index b9db8bdf..a374b160 100644 --- a/demo/index.js +++ b/demo/index.js @@ -1,6 +1,6 @@ -/// +/* eslint-disable import-x/unambiguous -- Demo */ /* globals JSONPath, LZString -- Test UMD */ -/* eslint-disable import/unambiguous -- Demo */ +/// // Todo: Extract testing example paths/contents and use for a // pulldown that can populate examples @@ -12,10 +12,20 @@ // Todo: Could add JSON/JS syntax highlighting in sample and result, // ideally with a jsonpath-plus parser highlighter as well -const $ = (s) => document.querySelector(s); +/** + * @param {string} s + * @returns {HTMLElement} + */ +const $ = (s) => /** @type {HTMLElement} */ (document.querySelector(s)); -const jsonpathEl = $('#jsonpath'); -const jsonSample = $('#jsonSample'); +/** + * @param {string} s + * @returns {HTMLInputElement} + */ +const $i = (s) => /** @type {HTMLInputElement} */ (document.querySelector(s)); + +const jsonpathEl = $i('#jsonpath'); +const jsonSample = $i('#jsonSample'); const updateUrl = () => { const path = jsonpathEl.value; @@ -23,26 +33,30 @@ const updateUrl = () => { const url = new URL(location.href); url.searchParams.set('path', path); url.searchParams.set('json', jsonText); - url.searchParams.set('eval', $('#eval').value); - url.searchParams.set('ignoreEvalErrors', $('#ignoreEvalErrors').value); - history.replaceState(null, '', url.toString()); + url.searchParams.set('eval', $i('#eval').value); + url.searchParams.set('ignoreEvalErrors', $i('#ignoreEvalErrors').value); + history.replaceState(null, '', url.href); }; const loadUrl = () => { const url = new URL(location.href); if (url.searchParams.has('path')) { - jsonpathEl.value = url.searchParams.get('path'); + jsonpathEl.value = /** @type {string} */ (url.searchParams.get('path')); } if (url.searchParams.has('json')) { jsonSample.value = LZString.decompressFromEncodedURIComponent( - url.searchParams.get('json') + /** @type {string} */ (url.searchParams.get('json')) ); } if (url.searchParams.has('eval')) { - $('#eval').value = url.searchParams.get('eval'); + $i('#eval').value = /** @type {string} */ ( + url.searchParams.get('eval') + ); } if (url.searchParams.has('ignoreEvalErrors')) { - $('#ignoreEvalErrors').value = url.searchParams.get('ignoreEvalErrors'); + $i('#ignoreEvalErrors').value = /** @type {string} */ ( + url.searchParams.get('ignoreEvalErrors') + ); } }; @@ -52,7 +66,7 @@ const updateResults = () => { setTimeout(() => { jsonSample.reportValidity(); jsonpathEl.reportValidity(); - }); + }, 0); }; let json; jsonSample.setCustomValidity(''); @@ -61,7 +75,10 @@ const updateResults = () => { try { json = JSON.parse(jsonSample.value); } catch (err) { - jsonSample.setCustomValidity('Error parsing JSON: ' + err.toString()); + jsonSample.setCustomValidity( + 'Error parsing JSON: ' + + /** @type {Error} */ (err).toString() + ); reportValidity(); return; } @@ -69,16 +86,18 @@ const updateResults = () => { const result = new JSONPath.JSONPath({ path: jsonpathEl.value, json, - eval: $('#eval').value === 'false' ? false : $('#eval').value, - ignoreEvalErrors: $('#ignoreEvalErrors').value === 'true' + eval: $i('#eval').value === 'false' ? false : $i('#eval').value, + ignoreEvalErrors: $i('#ignoreEvalErrors').value === 'true' }); - $('#results').value = JSON.stringify(result, null, 2); + $i('#results').value = JSON.stringify(result, null, 2); } catch (err) { jsonpathEl.setCustomValidity( - 'Error executing JSONPath: ' + err.toString() + 'Error executing JSONPath: ' + + /** @type {Error} */ + (err).toString() ); reportValidity(); - $('#results').value = ''; + $i('#results').value = ''; } }; diff --git a/demo/tsconfig.json b/demo/tsconfig.json new file mode 100644 index 00000000..469c95d2 --- /dev/null +++ b/demo/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "lib": ["es2024", "dom"] + }, + "include": ["."] +} diff --git a/dist/Safe-Script.d.ts b/dist/Safe-Script.d.ts new file mode 100644 index 00000000..cb3d17ad --- /dev/null +++ b/dist/Safe-Script.d.ts @@ -0,0 +1,23 @@ +export type AssignmentExpression = import("@jsep-plugin/assignment").AssignmentExpression; +export type Substitution = any; +export type AnyParameter = any; +export type Substitutions = Record; +/** + * A replacement for NodeJS' VM.Script which is also {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | Content Security Policy} friendly. + */ +export class SafeScript { + /** + * @param {string} expr Expression to evaluate + */ + constructor(expr: string); + code: string; + ast: jsep.Expression; + /** + * @param {object} context Object whose items will be added + * to evaluation + * @returns {EvaluatedResult} Result of evaluated code + */ + runInNewContext(context: object): EvaluatedResult; +} +import jsep from 'jsep'; +import type { EvaluatedResult } from './jsonpath.js'; diff --git a/dist/index-browser-esm.js b/dist/index-browser-esm.js index ff47009c..fb6f33cc 100644 --- a/dist/index-browser-esm.js +++ b/dist/index-browser-esm.js @@ -1195,8 +1195,30 @@ const plugin = { } }; +/* eslint-disable unicorn/no-top-level-side-effects -- Temporary? */ /* eslint-disable no-bitwise -- Convenient */ +/** + * @import {EvaluatedResult, UnknownResult} from './jsonpath.js'; + */ + +/** + * @typedef {import('@jsep-plugin/assignment'). + * AssignmentExpression} AssignmentExpression + */ + +/** + * @typedef {any} Substitution + */ + +/** + * @typedef {any} AnyParameter + */ + +/** + * @typedef {Record} Substitutions + */ + // register plugins jsep.plugins.register(index, plugin); jsep.addUnaryOp('typeof'); @@ -1207,37 +1229,50 @@ const BLOCKED_PROTO_PROPERTIES = new Set(['constructor', '__proto__', '__defineG const SafeEval = { /** * @param {jsep.Expression} ast - * @param {Record} subs + * @param {Substitutions} subs + * @returns {UnknownResult} */ evalAst(ast, subs) { switch (ast.type) { case 'BinaryExpression': case 'LogicalExpression': - return SafeEval.evalBinaryExpression(ast, subs); + return SafeEval.evalBinaryExpression(/** @type {jsep.BinaryExpression} */ast, subs); case 'Compound': - return SafeEval.evalCompound(ast, subs); + return SafeEval.evalCompound(/** @type {jsep.Compound} */ast, subs); case 'ConditionalExpression': - return SafeEval.evalConditionalExpression(ast, subs); + return SafeEval.evalConditionalExpression(/** @type {jsep.ConditionalExpression} */ast, subs); case 'Identifier': - return SafeEval.evalIdentifier(ast, subs); + return SafeEval.evalIdentifier(/** @type {jsep.Identifier} */ast, subs); case 'Literal': - return SafeEval.evalLiteral(ast, subs); + return SafeEval.evalLiteral(/** @type {jsep.Literal} */ast); case 'MemberExpression': - return SafeEval.evalMemberExpression(ast, subs); + return SafeEval.evalMemberExpression(/** @type {jsep.MemberExpression} */ast, subs); case 'UnaryExpression': - return SafeEval.evalUnaryExpression(ast, subs); + return SafeEval.evalUnaryExpression(/** @type {jsep.UnaryExpression} */ast, subs); case 'ArrayExpression': - return SafeEval.evalArrayExpression(ast, subs); + return SafeEval.evalArrayExpression(/** @type {jsep.ArrayExpression} */ast, subs); case 'CallExpression': - return SafeEval.evalCallExpression(ast, subs); + return SafeEval.evalCallExpression(/** @type {jsep.CallExpression} */ast, subs); case 'AssignmentExpression': - return SafeEval.evalAssignmentExpression(ast, subs); + return SafeEval.evalAssignmentExpression(/** @type {AssignmentExpression} */ast, subs); default: - throw SyntaxError('Unexpected expression', ast); + throw new SyntaxError('Unexpected expression', { + cause: ast + }); } }, + /** + * @param {jsep.BinaryExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalBinaryExpression(ast, subs) { - const result = { + /** + * @typedef {{ + * [key: string]: (a: AnyParameter, b: AnyParameter) => UnknownResult + * }} OperatorTable + */ + const result = /** @type {OperatorTable} */{ '||': (a, b) => a || b(), '&&': (a, b) => a && b(), '|': (a, b) => a | b(), @@ -1264,14 +1299,18 @@ const SafeEval = { }[ast.operator](SafeEval.evalAst(ast.left, subs), () => SafeEval.evalAst(ast.right, subs)); return result; }, + /** + * @param {jsep.Compound} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalCompound(ast, subs) { let last; for (let i = 0; i < ast.body.length; i++) { - if (ast.body[i].type === 'Identifier' && ['var', 'let', 'const'].includes(ast.body[i].name) && ast.body[i + 1] && ast.body[i + 1].type === 'AssignmentExpression') { + if (ast.body[i].type === 'Identifier' && ['var', 'let', 'const'].includes(/** @type {jsep.Identifier} */ + ast.body[i].name) && Object.hasOwn(ast.body, i + 1) && ast.body[i + 1].type === 'AssignmentExpression') { // var x=2; is detected as // [{Identifier var}, {AssignmentExpression x=2}] - // eslint-disable-next-line @stylistic/max-len -- Long - // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient i += 1; } const expr = ast.body[i]; @@ -1279,71 +1318,120 @@ const SafeEval = { } return last; }, + /** + * @param {jsep.ConditionalExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalConditionalExpression(ast, subs) { if (SafeEval.evalAst(ast.test, subs)) { return SafeEval.evalAst(ast.consequent, subs); } return SafeEval.evalAst(ast.alternate, subs); }, + /** + * @param {jsep.Identifier} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalIdentifier(ast, subs) { if (Object.hasOwn(subs, ast.name)) { return subs[ast.name]; } - throw ReferenceError(`${ast.name} is not defined`); + throw new ReferenceError(`${ast.name} is not defined`); }, + /** + * @param {jsep.Literal} ast + * @returns {UnknownResult} + */ evalLiteral(ast) { return ast.value; }, + /** + * @param {jsep.MemberExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalMemberExpression(ast, subs) { const prop = String( // NOTE: `String(value)` throws error when // value has overwritten the toString method to return non-string // i.e. `value = {toString: () => []}` - ast.computed ? SafeEval.evalAst(ast.property) // `object[property]` + ast.computed ? SafeEval.evalAst(ast.property, {}) // `object[property]` : ast.property.name // `object.property` property is Identifier ); const obj = SafeEval.evalAst(ast.object, subs); if (obj === undefined || obj === null) { - throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); + throw new TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); } if (!Object.hasOwn(obj, prop) && BLOCKED_PROTO_PROPERTIES.has(prop)) { - throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); + throw new TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); } - const result = obj[prop]; + const result = /** @type {Record} */obj[prop]; if (typeof result === 'function' && result !== Function) { return result.bind(obj); // arrow functions aren't affected by bind. } return result; }, + /** + * @param {jsep.UnaryExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalUnaryExpression(ast, subs) { - const result = { - '-': a => -SafeEval.evalAst(a, subs), + /** + * @typedef {{ + * [key: string]: (a: AnyParameter) => UnknownResult + * }} UnaryOperatorTable + */ + const result = /** @type {UnaryOperatorTable} */{ + '-': a => -(/** @type {EvaluatedResult} */ + SafeEval.evalAst(a, subs)), '!': a => !SafeEval.evalAst(a, subs), - '~': a => ~SafeEval.evalAst(a, subs), + '~': a => ~(/** @type {EvaluatedResult} */ + SafeEval.evalAst(a, subs)), // eslint-disable-next-line no-implicit-coercion -- API - '+': a => +SafeEval.evalAst(a, subs), + '+': a => +(/** @type {EvaluatedResult} */ + SafeEval.evalAst(a, subs)), typeof: a => typeof SafeEval.evalAst(a, subs), - // eslint-disable-next-line no-void, sonarjs/void-use -- feature + // eslint-disable-next-line no-void -- Ok void: a => void SafeEval.evalAst(a, subs) }[ast.operator](ast.argument); return result; }, + /** + * @param {jsep.ArrayExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalArrayExpression(ast, subs) { - return ast.elements.map(el => SafeEval.evalAst(el, subs)); + return ast.elements.map(el => SafeEval.evalAst(/** @type {jsep.Expression} */ + el, subs)); }, + /** + * @param {jsep.CallExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalCallExpression(ast, subs) { const args = ast.arguments.map(arg => SafeEval.evalAst(arg, subs)); const func = SafeEval.evalAst(ast.callee, subs); if (func === Function) { throw new Error('Function constructor is disabled'); } - return func(...args); + return (/** @type {(...args: AnyParameter[]) => UnknownResult} */ + func)(...args); }, + /** + * @param {AssignmentExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalAssignmentExpression(ast, subs) { if (ast.left.type !== 'Identifier') { - throw SyntaxError('Invalid left-hand side in assignment'); + throw new SyntaxError('Invalid left-hand side in assignment'); } - const id = ast.left.name; + const id = /** @type {jsep.Identifier} */ast.left.name; const value = SafeEval.evalAst(ast.right, subs); subs[id] = value; return subs[id]; @@ -1375,25 +1463,57 @@ class SafeScript { } /* eslint-disable camelcase -- Convenient for escaping */ +/* eslint-disable class-methods-use-this -- Consistent monkey-patching */ +/* eslint-disable unicorn/prefer-private-class-fields -- Allow + monkey-patching */ + +/** + * @import {Script} from './jsonpath-browser.js'; + */ + +/** + * @typedef {any} AnyInput + */ +/** + * @typedef {((...args: any[]) => any)} SandboxCallback + */ /** - * @typedef {null|boolean|number|string|object|GenericArray} JSONObject + * @typedef {any|SandboxCallback} SandboxPropertyValue */ /** - * @typedef {any} AnyItem + * @typedef {(string|number)[]} ExpressionArray */ /** - * @typedef {any} AnyResult + * @typedef {"scalar"|"boolean"|"string"|"undefined"| + * "function"|"integer"|"number"|"nonFinite"|"object"| + * "array"|"other"|"null"} ValueType + */ + +/** + * @typedef {unknown} ParentValue + */ + +/** + * @typedef {unknown} UnknownResult + */ + +/** + * @typedef {string|number|null} ParentProperty + */ + +/** + * @typedef {unknown|ParentValue|string|ReturnObject} PreferredOutput */ /** * Copies array and then pushes item into it. - * @param {GenericArray} arr Array to copy and into which to push - * @param {AnyItem} item Array item to add (to end) - * @returns {GenericArray} Copy of the original array + * @param {ExpressionArray} arr Array to copy and into which to push + * @param {string|number} item Array item to add (to end) + * @returns {ExpressionArray} Copy of the original array */ function push(arr, item) { arr = arr.slice(); @@ -1402,9 +1522,9 @@ function push(arr, item) { } /** * Copies array and then unshifts item into it. - * @param {AnyItem} item Array item to add (to beginning) - * @param {GenericArray} arr Array to copy and into which to unshift - * @returns {GenericArray} Copy of the original array + * @param {string|number} item Array item to add (to beginning) + * @param {ExpressionArray} arr Array to copy and into which to unshift + * @returns {ExpressionArray} Copy of the original array */ function unshift(item, arr) { arr = arr.slice(); @@ -1418,11 +1538,11 @@ function unshift(item, arr) { */ class NewError extends Error { /** - * @param {AnyResult} value The evaluated scalar value + * @param {UnknownResult} value The evaluated scalar value + * @param {ErrorOptions} [options] */ - constructor(value) { - super('JSONPath should not be called with "new" (it prevents return ' + 'of (unwrapped) scalar values)'); - this.avoidNew = true; + constructor(value, options) { + super('JSONPath should not be called with "new" (it prevents return ' + 'of (unwrapped) scalar values)', options); this.value = value; this.name = 'NewError'; } @@ -1430,15 +1550,20 @@ class NewError extends Error { /** * @typedef {object} ReturnObject -* @property {string} path -* @property {JSONObject} value -* @property {object|GenericArray} parent -* @property {string} parentProperty +* @property {ExpressionArray|string} path +* @property {unknown} value +* @property {ParentValue} parent +* @property {ParentProperty} parentProperty +* @property {boolean} [isParentSelector] +* @property {boolean} [hasArrExpr] +* @property {ExpressionArray} [expr] +* @property {string} [pointer] */ /** * @callback JSONPathCallback -* @param {string|object} preferredOutput +* @param {any} preferredOutput Using `any` type instead of `PreferredOutput` so +* that user can supply flexible type * @param {"value"|"property"} type * @param {ReturnObject} fullRetObj * @returns {void} @@ -1446,10 +1571,10 @@ class NewError extends Error { /** * @callback OtherTypeCallback -* @param {JSONObject} val -* @param {string} path -* @param {object|GenericArray} parent -* @param {string} parentPropName +* @param {unknown} val +* @param {ExpressionArray} path +* @param {ParentValue} parent +* @param {string|null} parentPropName * @returns {boolean} */ @@ -1472,513 +1597,806 @@ class NewError extends Error { * @typedef {typeof SafeScript} EvalClass */ +/** + * @typedef {"value"|"path"|"pointer"|"parent"|"parentProperty"| + * "all"} ResultType + */ + +/** + * @typedef {EvalCallback|EvalClass|'safe'|'native'|boolean} EvalValue + */ + +/** + * @typedef {string|string[]} PathType + */ + +/** + * @typedef {{Script: typeof SafeScript}} SafeScriptType + */ + +/** + * @typedef {import('node:vm')|{Script: typeof Script}} ScriptType + */ + +/** + * @typedef {{ + * _$_path?: string, + * _$_parentProperty?: ParentProperty, + * _$_parent?: ParentValue, + * _$_property?: string|number, + * _$_root?: AnyInput, + * _$_v?: unknown, + * [key: string]: SandboxPropertyValue + * }} SandboxType + */ + /** * @typedef {object} JSONPathOptions - * @property {JSON} json - * @property {string|string[]} path - * @property {"value"|"path"|"pointer"|"parent"|"parentProperty"| - * "all"} [resultType="value"] + * @property {AnyInput} [json] + * @property {PathType} [path] + * @property {ResultType} [resultType="value"] * @property {boolean} [flatten=false] * @property {boolean} [wrap=true] - * @property {object} [sandbox={}] - * @property {EvalCallback|EvalClass|'safe'|'native'| - * boolean} [eval = 'safe'] - * @property {object|GenericArray|null} [parent=null] + * @property {SandboxType} [sandbox={}] + * @property {EvalValue} [eval='safe'] + * @property {any|null} [parent=null] * @property {string|null} [parentProperty=null] * @property {JSONPathCallback} [callback] * @property {OtherTypeCallback} [otherTypeCallback] Defaults to * function which throws on encountering `@other` * @property {boolean} [autostart=true] + * @property {boolean} [ignoreEvalErrors=false] */ /** - * @param {string|JSONPathOptions} opts If a string, will be treated as `expr` - * @param {string} [expr] JSON path to evaluate - * @param {JSON} [obj] JSON object to evaluate against - * @param {JSONPathCallback} [callback] Passed 3 arguments: 1) desired payload - * per `resultType`, 2) `"value"|"property"`, 3) Full returned object with + * @overload + * @param {string} opts JSON path to evaluate + * @param {AnyInput} [expr] JSON object to evaluate against + * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired + * payload per `resultType`, 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [callback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + * @param {undefined} [otherTypeCallback] + * @returns {unknown|JSONPathClass} + */ +/** + * @overload + * @param {JSONPathOptions} opts If a string, will be treated as + * `expr` + * @returns {unknown|JSONPathClass} + */ +/** + * @param {JSONPathOptions|string} opts If a string, will be treated as `expr` + * @param {string|AnyInput} [expr] JSON path to evaluate + * @param {AnyInput|JSONPathCallback} [obj] JSON object to evaluate against + * @param {JSONPathCallback|OtherTypeCallback} [callback] Passed 3 + * arguments: 1) desired payload per `resultType`, + * 2) `"value"|"property"`, 3) Full returned object with * all payloads * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the end * of one's query, this will be invoked with the value of the item, its * path, its parent, and its parent's property name, and it should return * a boolean indicating whether the supplied value belongs to the "other" * type or not (or it may handle transformations and return `false`). - * @returns {JSONPath} - * @class + * @throws {Error} + * @returns {unknown|JSONPathClass} */ function JSONPath(opts, expr, obj, callback, otherTypeCallback) { - // eslint-disable-next-line no-restricted-syntax -- Allow for pseudo-class - if (!(this instanceof JSONPath)) { - try { - return new JSONPath(opts, expr, obj, callback, otherTypeCallback); - } catch (e) { - if (!e.avoidNew) { - throw e; - } - return e.value; - } - } - if (typeof opts === 'string') { - otherTypeCallback = callback; - callback = obj; - obj = expr; - expr = opts; - opts = null; - } - const optObj = opts && typeof opts === 'object'; - opts = opts || {}; - this.json = opts.json || obj; - this.path = opts.path || expr; - this.resultType = opts.resultType || 'value'; - this.flatten = opts.flatten || false; - this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true; - this.sandbox = opts.sandbox || {}; - this.eval = opts.eval === undefined ? 'safe' : opts.eval; - this.ignoreEvalErrors = typeof opts.ignoreEvalErrors === 'undefined' ? false : opts.ignoreEvalErrors; - this.parent = opts.parent || null; - this.parentProperty = opts.parentProperty || null; - this.callback = opts.callback || callback || null; - this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () { - throw new TypeError('You must supply an otherTypeCallback callback option ' + 'with the @other() operator.'); - }; - if (opts.autostart !== false) { - const args = { - path: optObj ? opts.path : expr - }; - if (!optObj) { - args.json = obj; - } else if ('json' in opts) { - args.json = opts.json; + try { + if (opts && typeof opts === 'object') { + return new JSONPathClass(opts); } - const ret = this.evaluate(args); - if (!ret || typeof ret !== 'object') { - throw new NewError(ret); + return new JSONPathClass(opts, expr, /** @type {JSONPathCallback|undefined} */obj, /** @type {OtherTypeCallback|undefined} */callback, /** @type {undefined} */otherTypeCallback); + } catch (e) { + // eslint-disable-next-line no-restricted-syntax -- Within the file + if (!(e instanceof NewError)) { + throw e; } - return ret; + return e.value; } } -// PUBLIC METHODS -JSONPath.prototype.evaluate = function (expr, json, callback, otherTypeCallback) { - let currParent = this.parent, - currParentProperty = this.parentProperty; - let { - flatten, - wrap - } = this; - this.currResultType = this.resultType; - this.currEval = this.eval; - this.currSandbox = this.sandbox; - callback = callback || this.callback; - this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; - json = json || this.json; - expr = expr || this.path; - if (expr && typeof expr === 'object' && !Array.isArray(expr)) { - if (!expr.path && expr.path !== '') { - throw new TypeError('You must supply a "path" property when providing an object ' + 'argument to JSONPath.evaluate().'); - } - if (!Object.hasOwn(expr, 'json')) { - throw new TypeError('You must supply a "json" property when providing an object ' + 'argument to JSONPath.evaluate().'); - } - ({ - json - } = expr); - flatten = Object.hasOwn(expr, 'flatten') ? expr.flatten : flatten; - this.currResultType = Object.hasOwn(expr, 'resultType') ? expr.resultType : this.currResultType; - this.currSandbox = Object.hasOwn(expr, 'sandbox') ? expr.sandbox : this.currSandbox; - wrap = Object.hasOwn(expr, 'wrap') ? expr.wrap : wrap; - this.currEval = Object.hasOwn(expr, 'eval') ? expr.eval : this.currEval; - callback = Object.hasOwn(expr, 'callback') ? expr.callback : callback; - this.currOtherTypeCallback = Object.hasOwn(expr, 'otherTypeCallback') ? expr.otherTypeCallback : this.currOtherTypeCallback; - currParent = Object.hasOwn(expr, 'parent') ? expr.parent : currParent; - currParentProperty = Object.hasOwn(expr, 'parentProperty') ? expr.parentProperty : currParentProperty; - expr = expr.path; - } - currParent = currParent || null; - currParentProperty = currParentProperty || null; - if (Array.isArray(expr)) { - expr = JSONPath.toPathString(expr); - } - if (!expr && expr !== '' || !json) { - return undefined; - } - const exprList = JSONPath.toPathArray(expr); - if (exprList[0] === '$' && exprList.length > 1) { - exprList.shift(); - } - this._hasParentSelector = null; - const result = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback).filter(function (ea) { - return ea && !ea.isParentSelector; - }); - if (!result.length) { - return wrap ? [] : undefined; - } - if (!wrap && result.length === 1 && !result[0].hasArrExpr) { - return this._getPreferredOutput(result[0]); +/** + * + */ +class JSONPathClass { + /** + * @overload + * @param {string} opts JSON path to evaluate + * @param {AnyInput} [expr] JSON object to evaluate against + * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired + * payload per `resultType`, 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [callback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + * @param {undefined} [otherTypeCallback] + * @returns {JSONPath|JSONPathClass} + */ + /** + * @overload + * @param {JSONPathOptions} opts If a string, will be treated as + * `expr` + */ + /** + * @param {null|string|JSONPathOptions} opts If a string, will be treated as + * `expr` + * @param {string|AnyInput} [expr] JSON path to evaluate + * @param {AnyInput|JSONPathCallback} [obj] JSON object to evaluate against + * @param {JSONPathCallback|OtherTypeCallback} [callback] Passed 3 + * arguments: 1) desired payload per `resultType`, + * 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + */ + constructor(opts, expr, obj, callback, otherTypeCallback) { + if (typeof opts === 'string') { + otherTypeCallback = /** @type {OtherTypeCallback} */ + callback; + callback = /** @type {JSONPathCallback} */ + obj; + obj = expr; + expr = opts; + opts = null; + } + const optObj = opts && typeof opts === 'object'; + opts ||= /** @type {JSONPathOptions} */{}; + /** @type {ResultType|undefined} */ + this.currResultType = undefined; + + /** @type {EvalValue|undefined} */ + this.currEval = undefined; + + /** @type {OtherTypeCallback|undefined} */ + this.currOtherTypeCallback = undefined; + + /** @type {SafeScriptType} */ + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members, no-unused-expressions -- On prototype + this.safeVm; + + /** @type {ScriptType} */ + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members, no-unused-expressions -- On prototype + this.vm; + + /** @type {SandboxType|undefined} */ + this.currSandbox = undefined; + this._hasParentSelector = false; + this.json = opts.json || obj; + this.path = opts.path || expr; + this.resultType = opts.resultType || 'value'; + this.flatten = opts.flatten || false; + this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true; + this.sandbox = opts.sandbox || {}; + this.eval = opts.eval === undefined ? 'safe' : opts.eval; + this.ignoreEvalErrors = typeof opts.ignoreEvalErrors === 'undefined' ? false : opts.ignoreEvalErrors; + this.parent = opts.parent || null; + this.parentProperty = opts.parentProperty || null; + this.callback = opts.callback || (/** @type {JSONPathCallback} */ + callback) || null; + this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () { + throw new TypeError('You must supply an otherTypeCallback callback option ' + 'with the @other() operator.'); + }; + if (opts.autostart !== false) { + const args = /** @type {JSONPathOptions} */{ + path: optObj ? opts.path : expr + }; + if (!optObj && obj !== undefined) { + args.json = obj; + } else if ('json' in opts) { + args.json = opts.json; + } + const ret = this.evaluate(args); + if (!ret || typeof ret !== 'object') { + throw new NewError(ret); + } + + // eslint-disable-next-line @stylistic/max-len -- Long + // @ts-expect-error - Constructor returns evaluate result for legacy API + // eslint-disable-next-line no-constructor-return -- Legacy API + return ret; + } } - return result.reduce((rslt, ea) => { - const valOrPath = this._getPreferredOutput(ea); - if (flatten && Array.isArray(valOrPath)) { - rslt = rslt.concat(valOrPath); + + // PUBLIC METHODS + + /** + * @overload + * @param {JSONPathOptions} [expr] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + + /** + * @overload + * @param {PathType|undefined} [expr] + * @param {AnyInput} [json] + * @param {JSONPathCallback|null} [callback] + * @param {OtherTypeCallback} [otherTypeCallback] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + + /** + * @param {PathType|JSONPathOptions|undefined} [expr] + * @param {AnyInput} [json] + * @param {JSONPathCallback|null} [callback] + * @param {OtherTypeCallback} [otherTypeCallback] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + evaluate(expr, json, callback, otherTypeCallback) { + let currParent = this.parent, + currParentProperty = this.parentProperty; + let { + flatten, + wrap + } = this; + this.currResultType = this.resultType; + this.currEval = this.eval; + this.currSandbox = this.sandbox; + callback ||= this.callback; + this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; + if (expr && typeof expr === 'object' && !Array.isArray(expr)) { + const exprObj = expr; + if (!exprObj.path && exprObj.path !== '') { + throw new TypeError('You must supply a "path" property when providing an ' + 'object argument to JSONPath.evaluate().'); + } + if (!Object.hasOwn(exprObj, 'json')) { + throw new TypeError('You must supply a "json" property when providing an ' + 'object argument to JSONPath.evaluate().'); + } + ({ + json + } = exprObj); + flatten = Object.hasOwn(exprObj, 'flatten') ? exprObj.flatten ?? flatten : flatten; + this.currResultType = Object.hasOwn(exprObj, 'resultType') ? exprObj.resultType : this.currResultType; + this.currSandbox = Object.hasOwn(exprObj, 'sandbox') ? exprObj.sandbox : this.currSandbox; + wrap = Object.hasOwn(exprObj, 'wrap') ? exprObj.wrap : wrap; + this.currEval = Object.hasOwn(exprObj, 'eval') ? exprObj.eval : this.currEval; + callback = Object.hasOwn(exprObj, 'callback') ? exprObj.callback : callback; + this.currOtherTypeCallback = Object.hasOwn(exprObj, 'otherTypeCallback') ? exprObj.otherTypeCallback : this.currOtherTypeCallback; + currParent = Object.hasOwn(exprObj, 'parent') ? exprObj.parent ?? currParent : currParent; + currParentProperty = Object.hasOwn(exprObj, 'parentProperty') ? exprObj.parentProperty ?? currParentProperty : currParentProperty; + expr = exprObj.path; } else { - rslt.push(valOrPath); + json ||= this.json; + expr ||= this.path; } - return rslt; - }, []); -}; + currParent ||= null; + currParentProperty ||= null; + if (Array.isArray(expr)) { + expr = JSONPath.toPathString(expr); + } + if (!json || !expr && expr !== '') { + return undefined; + } + const exprList = JSONPath.toPathArray(/** @type {string} */ + expr); + if (exprList[0] === '$' && exprList.length > 1) { + exprList.shift(); + } + this._hasParentSelector = false; + const traceResult = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback ?? undefined, undefined); -// PRIVATE METHODS - -JSONPath.prototype._getPreferredOutput = function (ea) { - const resultType = this.currResultType; - switch (resultType) { - case 'all': - { - const path = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path); - ea.pointer = JSONPath.toPointer(path); - ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(ea.path); - return ea; + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next 2 -- Unreachable: _trace returns array when hasArrExpr set */ + const result = (Array.isArray(traceResult) ? traceResult : [traceResult]).filter(ea => { + return ea && !ea.isParentSelector; + }); + if (!result.length) { + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: valid queries always produce results */ + return wrap ? [] : undefined; + } + if (!wrap && result.length === 1 && !result[0].hasArrExpr) { + const preferredOutput = this._getPreferredOutput(result[0]); + return preferredOutput; + } + const reduced = result.reduce((rslt, ea) => { + const valOrPath = this._getPreferredOutput(ea); + if (flatten && Array.isArray(valOrPath)) { + rslt = rslt.concat(valOrPath); + } else { + rslt.push(valOrPath); } - case 'value': - case 'parent': - case 'parentProperty': - return ea[resultType]; - case 'path': - return JSONPath.toPathString(ea[resultType]); - case 'pointer': - return JSONPath.toPointer(ea.path); - default: - throw new TypeError('Unknown result type'); + return rslt; + }, /** @type {UnknownResult[]} */ + []); + return reduced; } -}; -JSONPath.prototype._handleCallback = function (fullRetObj, callback, type) { - if (callback) { - const preferredOutput = this._getPreferredOutput(fullRetObj); - fullRetObj.path = typeof fullRetObj.path === 'string' ? fullRetObj.path : JSONPath.toPathString(fullRetObj.path); - // eslint-disable-next-line n/callback-return -- No need to return - callback(preferredOutput, type, fullRetObj); - } -}; -/** - * - * @param {string} expr - * @param {JSONObject} val - * @param {string} path - * @param {object|GenericArray} parent - * @param {string} parentPropName - * @param {JSONPathCallback} callback - * @param {boolean} hasArrExpr - * @param {boolean} literalPriority - * @returns {ReturnObject|ReturnObject[]} - */ -JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, callback, hasArrExpr, literalPriority) { - // No expr to follow? return path and value as the result of - // this trace branch - let retObj; - if (!expr.length) { - retObj = { - path, - value: val, - parent, - parentProperty: parentPropName, - hasArrExpr - }; - this._handleCallback(retObj, callback, 'value'); - return retObj; + // PRIVATE METHODS + + /** + * @param {ReturnObject} ea + * @returns {PreferredOutput} + */ + _getPreferredOutput(ea) { + const resultType = this.currResultType; + switch (resultType) { + case 'all': + { + const path = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path); + ea.pointer = JSONPath.toPointer(/** @type {string[]} */path); + ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(/** @type {string[]} */ea.path); + return ea; + } + case 'value': + case 'parent': + case 'parentProperty': + return ea[resultType]; + case 'path': + if (typeof ea.path === 'string') { + return ea.path; + } + return JSONPath.toPathString(/** @type {string[]} */ea.path); + case 'pointer': + { + const pathArray = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path); + return JSONPath.toPointer(/** @type {string[]} */pathArray); + } + default: + throw new TypeError('Unknown result type'); + } } - const loc = expr[0], - x = expr.slice(1); - // We need to gather the return value of recursive trace calls in order to - // do the parent sel computation. - const ret = []; /** - * - * @param {ReturnObject|ReturnObject[]} elems + * @param {ReturnObject} fullRetObj + * @param {JSONPathCallback|undefined} callback + * @param {"value"|"property"} type * @returns {void} */ - function addRet(elems) { - if (Array.isArray(elems)) { - // This was causing excessive stack size in Node (with or - // without Babel) against our performance test: - // `ret.push(...elems);` - elems.forEach(t => { - ret.push(t); - }); - } else { - ret.push(elems); + _handleCallback(fullRetObj, callback, type) { + // Early return if no callback provided (defensive + // check for internal calls) + if (!callback) { + return; + } + const preferredOutput = this._getPreferredOutput(fullRetObj); + if (Array.isArray(fullRetObj.path)) { + fullRetObj.path = JSONPath.toPathString(/** @type {string[]} */fullRetObj.path); } + callback(preferredOutput, type, fullRetObj); } - if ((typeof loc !== 'string' || literalPriority) && val && Object.hasOwn(val, loc)) { - // simple case--directly follow property - addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr)); - // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if` - } else if (loc === '*') { - // all child properties - this._walk(val, m => { - addRet(this._trace(x, val[m], push(path, m), val, m, callback, true, true)); - }); - } else if (loc === '..') { - // all descendent parent properties - // Check remaining expression with val's immediate children - addRet(this._trace(x, val, path, parent, parentPropName, callback, hasArrExpr)); - this._walk(val, m => { - // We don't join m and x here because we only want parents, - // not scalar values - if (typeof val[m] === 'object') { - // Keep going with recursive descent on val's - // object children - addRet(this._trace(expr.slice(), val[m], push(path, m), val, m, callback, true)); + + /** + * + * @param {ExpressionArray} expr + * @param {unknown} val + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @param {JSONPathCallback|undefined} callback + * @param {boolean|undefined} hasArrExpr + * @param {boolean} [literalPriority] + * @returns {ReturnObject|ReturnObject[]} + */ + _trace(expr, val, path, parent, parentPropName, callback, hasArrExpr, literalPriority) { + // No expr to follow? return path and value as the result of + // this trace branch + let retObj; + if (!expr.length) { + retObj = { + path, + value: val, + parent, + parentProperty: parentPropName, + hasArrExpr + }; + this._handleCallback(retObj, callback, 'value'); + return retObj; + } + const loc = /** @type {string} */expr[0], + x = expr.slice(1); + + // We need to gather the return value of recursive trace calls in order + // to do the parent sel computation. + /** @type {ReturnObject[]} */ + const ret = []; + /** + * + * @param {ReturnObject|ReturnObject[]} elems + * @returns {void} + */ + function addRet(elems) { + if (Array.isArray(elems)) { + // This was causing excessive stack size in Node (with or + // without Babel) against our performance test: + // `ret.push(...elems);` + elems.forEach(t => { + ret.push(t); + }); + } else { + ret.push(elems); } - }); - // The parent sel computation is handled in the frame above using the - // ancestor object of val - } else if (loc === '^') { - // This is not a final endpoint, so we do not invoke the callback here - this._hasParentSelector = true; - return { - path: path.slice(0, -1), - expr: x, - isParentSelector: true - }; - } else if (loc === '~') { - // property name - retObj = { - path: push(path, loc), - value: parentPropName, - parent, - parentProperty: null - }; - this._handleCallback(retObj, callback, 'property'); - return retObj; - } else if (loc === '$') { - // root only - addRet(this._trace(x, val, path, null, null, callback, hasArrExpr)); - } else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(loc)) { - // [start:end:step] Python slice syntax - addRet(this._slice(loc, x, val, path, parent, parentPropName, callback)); - } else if (loc.indexOf('?(') === 0) { - // [?(expr)] (filtering) - if (this.currEval === false) { - throw new Error('Eval [?(expr)] prevented in JSONPath expression.'); - } - const safeLoc = loc.replace(/^\?\((.*?)\)$/u, '$1'); - // check for a nested filter expression - const nested = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(safeLoc); - if (nested) { - // find if there are matches in the nested expression - // add them to the result set if there is at least one match + } + if (val && (typeof loc !== 'string' || literalPriority) && Object.hasOwn(val, /** @type {PropertyKey} */loc)) { + // simple case--directly follow property + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[(/** @type {string} */loc)], push(path, loc), val, /** @type {string|number} */loc, callback, hasArrExpr)); + // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if` + } else if (loc === '*') { + // all child properties this._walk(val, m => { - const npath = [nested[2]]; - const nvalue = nested[1] ? val[m][nested[1]] : val[m]; - const filterResults = this._trace(npath, nvalue, path, parent, parentPropName, callback, true); - if (filterResults.length > 0) { - addRet(this._trace(x, val[m], push(path, m), val, m, callback, true)); - } + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[m], push(path, m), val, m, callback, true, true)); }); - } else { + } else if (loc === '..') { + // all descendent parent properties + // Check remaining expression with val's immediate children + addRet(this._trace(x, val, path, parent, parentPropName, callback, hasArrExpr)); this._walk(val, m => { - if (this._eval(safeLoc, val[m], m, path, parent, parentPropName)) { - addRet(this._trace(x, val[m], push(path, m), val, m, callback, true)); + // We don't join m and x here because we only want parents, + // not scalar values + const valObj = /** @type {Record} */val; + if (typeof valObj[m] === 'object') { + // Keep going with recursive descent on val's + // object children + addRet(this._trace(expr.slice(), valObj[m], push(path, m), val, m, callback, true)); } }); - } - } else if (loc[0] === '(') { - // [(expr)] (dynamic property/index) - if (this.currEval === false) { - throw new Error('Eval [(expr)] prevented in JSONPath expression.'); - } - // As this will resolve to a property name (but we don't know it - // yet), property and parent information is relative to the - // parent of the property to which this expression will resolve - addRet(this._trace(unshift(this._eval(loc, val, path.at(-1), path.slice(0, -1), parent, parentPropName), x), val, path, parent, parentPropName, callback, hasArrExpr)); - } else if (loc[0] === '@') { - // value type: @boolean(), etc. - let addType = false; - const valueType = loc.slice(1, -2); - switch (valueType) { - case 'scalar': - if (!val || !['object', 'function'].includes(typeof val)) { - addType = true; - } - break; - case 'boolean': - case 'string': - case 'undefined': - case 'function': - if (typeof val === valueType) { - addType = true; - } - break; - case 'integer': - if (Number.isFinite(val) && !(val % 1)) { - addType = true; - } - break; - case 'number': - if (Number.isFinite(val)) { - addType = true; - } - break; - case 'nonFinite': - if (typeof val === 'number' && !Number.isFinite(val)) { - addType = true; - } - break; - case 'object': - if (val && typeof val === valueType) { - addType = true; - } - break; - case 'array': - if (Array.isArray(val)) { - addType = true; - } - break; - case 'other': - addType = this.currOtherTypeCallback(val, path, parent, parentPropName); - break; - case 'null': - if (val === null) { - addType = true; - } - break; - /* c8 ignore next 2 */ - default: - throw new TypeError('Unknown value type ' + valueType); - } - if (addType) { + // The parent sel computation is handled in the frame above using the + // ancestor object of val + } else if (loc === '^') { + // This is not a final endpoint, so we do not invoke the + // callback here + this._hasParentSelector = true; + return /** @type {ReturnObject} */{ + path: path.slice(0, -1), + expr: x, + isParentSelector: true, + value: undefined, + parent: undefined, + parentProperty: null + }; + } else if (loc === '~') { + // property name retObj = { - path, - value: val, + path: push(path, loc), + value: parentPropName, parent, - parentProperty: parentPropName + parentProperty: null }; - this._handleCallback(retObj, callback, 'value'); + this._handleCallback(retObj, callback, 'property'); return retObj; + } else if (loc === '$') { + // root only + addRet(this._trace(x, val, path, null, null, callback, hasArrExpr)); + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient + } else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(loc)) { + // [start:end:step] Python slice syntax + const sliceResult = this._slice(loc, x, val, path, parent, parentPropName, callback); + if (sliceResult) { + addRet(sliceResult); + } + } else if (loc.indexOf('?(') === 0) { + // [?(expr)] (filtering) + if (this.currEval === false) { + throw new Error('Eval [?(expr)] prevented in JSONPath expression.'); + } + const safeLoc = loc.replace(/^\?\((.*?)\)$/u, '$1'); + // check for a nested filter expression + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient + const nested = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(safeLoc); + if (nested) { + // find if there are matches in the nested expression + // add them to the result set if there is at least one match + this._walk(val, m => { + const npath = [nested[2]]; + const valObj2 = /** @type {Record} */ + val; + const nvalue = /** @type {ValueType} */nested[1] ? /** @type {Record} */valObj2[m][nested[1]] : valObj2[m]; + const filterResults = this._trace(npath, nvalue, path, parent, parentPropName, callback, true); + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next 3 -- Unreachable: _trace always returns array for nested filters */ + const filterArray = Array.isArray(filterResults) ? filterResults : [filterResults]; + if (filterArray.length > 0) { + addRet(this._trace(x, valObj2[m], push(path, m), val, m, callback, true)); + } + }); + } else { + const valObj3 = /** @type {Record} */val; + this._walk(val, m => { + if (this._eval(safeLoc, valObj3[m], m, path, parent, parentPropName)) { + addRet(this._trace(x, valObj3[m], push(path, m), val, m, callback, true)); + } + }); + } + } else if (loc[0] === '(') { + // [(expr)] (dynamic property/index) + if (this.currEval === false) { + throw new Error('Eval [(expr)] prevented in JSONPath expression.'); + } + // As this will resolve to a property name (but we don't know it + // yet), property and parent information is relative to the + const evalResult = this._eval(/** @type {string} */loc, val, /** @type {string|number} */path.at(-1), path.slice(0, -1), parent, parentPropName); + const exprToUse = /** @type {string|number} */ + evalResult !== undefined ? evalResult : ''; + addRet(this._trace(unshift(exprToUse, x), val, path, parent, parentPropName, callback, hasArrExpr)); + } else if (loc[0] === '@') { + // value type: @boolean(), etc. + let addType = false; + const valueType = /** @type {ValueType} */loc.slice(1, -2); + switch (valueType) { + case 'scalar': + if (!val || !['object', 'function'].includes(typeof val)) { + addType = true; + } + break; + case 'boolean': + case 'string': + case 'undefined': + case 'function': + if (typeof val === valueType) { + addType = true; + } + break; + case 'integer': + if (Number.isFinite(val) && !(/** @type {number} */val % 1)) { + addType = true; + } + break; + case 'number': + if (Number.isFinite(val)) { + addType = true; + } + break; + case 'nonFinite': + if (typeof val === 'number' && !Number.isFinite(val)) { + addType = true; + } + break; + case 'object': + if (val && typeof val === valueType) { + addType = true; + } + break; + case 'array': + if (Array.isArray(val)) { + addType = true; + } + break; + case 'other': + addType = this.currOtherTypeCallback?.(val, path, parent, /** @type {string|null} */parentPropName) ?? false; + break; + case 'null': + if (val === null) { + addType = true; + } + break; + /* c8 ignore next 2 */ + default: + throw new TypeError('Unknown value type ' + valueType); + } + if (addType) { + retObj = { + path, + value: val, + parent, + parentProperty: parentPropName, + hasArrExpr + }; + this._handleCallback(retObj, callback, 'value'); + return retObj; + } + // `-escaped property + } else if (val && loc[0] === '`' && Object.hasOwn(val, loc.slice(1))) { + const locProp = loc.slice(1); + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[locProp], push(path, locProp), val, locProp, callback, hasArrExpr, true)); + } else if (loc.includes(',')) { + // [name1,name2,...] + const parts = loc.split(','); + for (const part of parts) { + addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback, true)); + } + // simple case--directly follow property + } else if (!literalPriority && val && Object.hasOwn(val, loc)) { + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[loc], push(path, loc), val, loc, callback, hasArrExpr, true)); } - // `-escaped property - } else if (loc[0] === '`' && val && Object.hasOwn(val, loc.slice(1))) { - const locProp = loc.slice(1); - addRet(this._trace(x, val[locProp], push(path, locProp), val, locProp, callback, hasArrExpr, true)); - } else if (loc.includes(',')) { - // [name1,name2,...] - const parts = loc.split(','); - for (const part of parts) { - addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback, true)); - } - // simple case--directly follow property - } else if (!literalPriority && val && Object.hasOwn(val, loc)) { - addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr, true)); - } - - // We check the resulting values for parent selections. For parent - // selections we discard the value object and continue the trace with the - // current val object - if (this._hasParentSelector) { - for (let t = 0; t < ret.length; t++) { - const rett = ret[t]; - if (rett && rett.isParentSelector) { - const tmp = this._trace(rett.expr, val, rett.path, parent, parentPropName, callback, hasArrExpr); - if (Array.isArray(tmp)) { - ret[t] = tmp[0]; - const tl = tmp.length; - for (let tt = 1; tt < tl; tt++) { - // eslint-disable-next-line @stylistic/max-len -- Long - // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient - t++; - ret.splice(t, 0, tmp[tt]); + + // We check the resulting values for parent selections. For parent + // selections we discard the value object and continue the trace with + // the current val object + if (this._hasParentSelector) { + for (let t = 0; t < ret.length; t++) { + const rett = ret[t]; + if (rett && rett.isParentSelector) { + const exprToUse = /** @type {ExpressionArray} */ + rett.expr; + const pathToUse = /** @type {ExpressionArray} */ + rett.path; + const tmp = this._trace(exprToUse, val, pathToUse, parent, parentPropName, callback, hasArrExpr); + if (Array.isArray(tmp)) { + ret[t] = tmp[0]; + const tl = tmp.length; + for (let tt = 1; tt < tl; tt++) { + t++; + ret.splice(t, 0, tmp[tt]); + } + } else { + ret[t] = tmp; } - } else { - ret[t] = tmp; } } } + return ret; } - return ret; -}; -JSONPath.prototype._walk = function (val, f) { - if (Array.isArray(val)) { - const n = val.length; - for (let i = 0; i < n; i++) { - f(i); - } - } else if (val && typeof val === 'object') { - Object.keys(val).forEach(m => { - f(m); - }); + + /** + * @param {unknown} val + * @param {(prop: string|number) => void} f + * @returns {void} + */ + _walk(val, f) { + if (Array.isArray(val)) { + const n = val.length; + for (let i = 0; i < n; i++) { + f(i); + } + } else if (val && typeof val === 'object') { + Object.keys(val).forEach(m => { + f(m); + }); + } } -}; -JSONPath.prototype._slice = function (loc, expr, val, path, parent, parentPropName, callback) { - if (!Array.isArray(val)) { - return undefined; - } - const len = val.length, - parts = loc.split(':'), - step = parts[2] && Number.parseInt(parts[2]) || 1; - let start = parts[0] && Number.parseInt(parts[0]) || 0, - end = parts[1] ? Number.parseInt(parts[1]) : len; - start = start < 0 ? Math.max(0, start + len) : Math.min(len, start); - end = end < 0 ? Math.max(0, end + len) : Math.min(len, end); - const ret = []; - for (let i = start; i < end; i += step) { - const tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback, true); - // Should only be possible to be an array here since first part of - // ``unshift(i, expr)` passed in above would not be empty, nor `~`, - // nor begin with `@` (as could return objects) - // This was causing excessive stack size in Node (with or - // without Babel) against our performance test: `ret.push(...tmp);` - tmp.forEach(t => { - ret.push(t); - }); + + /** + * @param {string} loc + * @param {ExpressionArray} expr + * @param {unknown} val + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @param {JSONPathCallback|undefined} callback + * @returns {ReturnObject[]|undefined} + */ + _slice(loc, expr, val, path, parent, parentPropName, callback) { + if (!Array.isArray(val)) { + return undefined; + } + const len = val.length, + parts = loc.split(':'), + step = parts[2] && Number(parts[2]) || 1; + let start = parts[0] && Number(parts[0]) || 0, + end = parts[1] ? Number(parts[1]) : len; + start = start < 0 ? Math.max(0, start + len) : Math.min(len, start); + end = end < 0 ? Math.max(0, end + len) : Math.min(len, end); + /** @type {ReturnObject[]} */ + const ret = []; + for (let i = start; i < end; i += step) { + const tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback, true); + // Should only be possible to be an array here since first part of + // ``unshift(i, expr)` passed in above would not be empty, + // nor `~`, nor begin with `@` (as could return objects) + // This was causing excessive stack size in Node (with or + // without Babel) against our performance test: `ret.push(...tmp);` + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: _trace returns array when expr non-empty */ + const tmpArray = Array.isArray(tmp) ? tmp : [tmp]; + tmpArray.forEach(t => { + ret.push(t); + }); + } + return ret; } - return ret; -}; -JSONPath.prototype._eval = function (code, _v, _vname, path, parent, parentPropName) { - this.currSandbox._$_parentProperty = parentPropName; - this.currSandbox._$_parent = parent; - this.currSandbox._$_property = _vname; - this.currSandbox._$_root = this.json; - this.currSandbox._$_v = _v; - const containsPath = code.includes('@path'); - if (containsPath) { - this.currSandbox._$_path = JSONPath.toPathString(path.concat([_vname])); - } - const scriptCacheKey = this.currEval + 'Script:' + code; - if (!JSONPath.cache[scriptCacheKey]) { - let script = code.replaceAll('@parentProperty', '_$_parentProperty').replaceAll('@parent', '_$_parent').replaceAll('@property', '_$_property').replaceAll('@root', '_$_root').replaceAll(/@([.\s)[])/gu, '_$_v$1'); + + /** + * @param {string} code + * @param {unknown} _v + * @param {string|number} _vname + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @returns {UnknownResult} + */ + _eval(code, _v, _vname, path, parent, parentPropName) { + if (this.currSandbox) { + this.currSandbox._$_parentProperty = parentPropName; + this.currSandbox._$_parent = parent; + this.currSandbox._$_property = _vname; + this.currSandbox._$_root = this.json; + this.currSandbox._$_v = _v; + } + const containsPath = code.includes('@path'); if (containsPath) { - script = script.replaceAll('@path', '_$_path'); - } - if (this.currEval === 'safe' || this.currEval === true || this.currEval === undefined) { - JSONPath.cache[scriptCacheKey] = new this.safeVm.Script(script); - } else if (this.currEval === 'native') { - JSONPath.cache[scriptCacheKey] = new this.vm.Script(script); - } else if (typeof this.currEval === 'function' && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, 'runInNewContext')) { - const CurrEval = this.currEval; - JSONPath.cache[scriptCacheKey] = new CurrEval(script); - } else if (typeof this.currEval === 'function') { - JSONPath.cache[scriptCacheKey] = { - runInNewContext: context => this.currEval(script, context) - }; - } else { - throw new TypeError(`Unknown "eval" property "${this.currEval}"`); + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: currSandbox set in evaluate() before _eval */ + const currSandbox = this.currSandbox ?? {}; + currSandbox._$_path = JSONPath.toPathString(/** @type {string[]} */path.concat([_vname])); } - } - try { - return JSONPath.cache[scriptCacheKey].runInNewContext(this.currSandbox); - } catch (e) { - if (this.ignoreEvalErrors) { - return false; + const scriptCacheKey = this.currEval + 'Script:' + code; + if (!Object.hasOwn(JSONPath.cache, scriptCacheKey)) { + let script = code.replaceAll('@parentProperty', '_$_parentProperty').replaceAll('@parent', '_$_parent').replaceAll('@property', '_$_property').replaceAll('@root', '_$_root').replaceAll(/@([.\s)[])/gu, '_$_v$1'); + if (containsPath) { + script = script.replaceAll('@path', '_$_path'); + } + const evalType = /** @type {string|boolean|undefined} */ + this.currEval; + if (['safe', true, undefined].includes(evalType)) { + const { + cache + } = JSONPath; + cache[scriptCacheKey] = new + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members -- Prototype + this.safeVm.Script(script); + } else if (this.currEval === 'native') { + const { + cache + } = JSONPath; + cache[scriptCacheKey] = new + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members -- Prototype + this.vm.Script(script); + } else if (typeof this.currEval === 'function' && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, 'runInNewContext')) { + const CurrEval = this.currEval; + const { + cache + } = JSONPath; + // eslint-disable-next-line @stylistic/max-len -- Long + // @ts-expect-error - Type checked above to have proper constructor + cache[scriptCacheKey] = new CurrEval(script); + } else if (typeof this.currEval === 'function') { + const { + cache + } = JSONPath; + // Type narrowing: at this point currEval is a function + // but not a constructor + const evalFunc = /** @type {EvalCallback} */this.currEval; + cache[scriptCacheKey] = { + runInNewContext: (/** @type {ContextItem} */context) => evalFunc(script, context) + }; + } else { + throw new TypeError(`Unknown "eval" property "${this.currEval}"`); + } + } + try { + const { + cache + } = JSONPath; + + /** + * @typedef {{ + * runInNewContext: ( + * ctx: SandboxType|undefined + * ) => EvaluatedResult + * }} RunInNewContext + */ + + return /** @type {RunInNewContext} */cache[scriptCacheKey].runInNewContext(this.currSandbox); + } catch (e) { + if (this.ignoreEvalErrors) { + return false; + } + const error = /** @type {Error} */e; + throw new Error('jsonPath: ' + error.message + ': ' + code, { + cause: e + }); } - throw new Error('jsonPath: ' + e.message + ': ' + code); } +} +JSONPathClass.prototype.safeVm = { + Script: SafeScript }; // PUBLIC CLASS PROPERTIES AND METHODS // Could store the cache object itself + +/** @type {Record} */ JSONPath.cache = {}; /** @@ -1998,7 +2416,7 @@ JSONPath.toPathString = function (pathArr) { }; /** - * @param {string} pointer JSON Path + * @param {string[]} pointer JSON Path array * @returns {string} JSON Pointer */ JSONPath.toPointer = function (pointer) { @@ -2021,9 +2439,10 @@ JSONPath.toPathArray = function (expr) { const { cache } = JSONPath; - if (cache[expr]) { - return cache[expr].concat(); + if (Object.hasOwn(cache, expr)) { + return /** @type {string[]} */cache[expr].concat(); } + /** @type {string[]} */ const subx = []; const normalized = expr // Properties @@ -2031,7 +2450,10 @@ JSONPath.toPathArray = function (expr) { // Parenthetical evaluations (filtering and otherwise), directly // within brackets or single quotes .replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function ($0, $1) { - return '[#' + (subx.push($1) - 1) + ']'; + return '[#' + ( + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-return-array-push -- Optimization + subx.push($1) - 1) + ']'; }) // Escape periods and tildes within properties .replaceAll(/\[['"]([^'\]]*)['"]\]/gu, function ($0, prop) { @@ -2040,6 +2462,7 @@ JSONPath.toPathArray = function (expr) { // Properties operator .replaceAll('~', ';~;') // Split by property boundaries + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient .replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu, ';') // Reinsert periods within properties .replaceAll('%@%', '.') @@ -2055,34 +2478,95 @@ JSONPath.toPathArray = function (expr) { .replaceAll(/;$|'?\]|'$/gu, ''); const exprList = normalized.split(';').map(function (exp) { const match = exp.match(/#(\d+)/u); - return !match || !match[1] ? exp : subx[match[1]]; + return !match || !match[1] ? exp : subx[Number(match[1])]; }); cache[expr] = exprList; - return cache[expr].concat(); -}; -JSONPath.prototype.safeVm = { - Script: SafeScript + return /** @type {string[]} */cache[expr].concat(); }; /** - * @typedef {any} ContextItem + * @typedef {import('./jsonpath.js').AnyInput} AnyInput */ - /** - * @typedef {any} EvaluatedResult + * @typedef {import('./jsonpath.js').SandboxCallback} SandboxCallback + */ +/** + * @typedef {import('./jsonpath.js').SandboxPropertyValue} SandboxPropertyValue + */ +/** + * @typedef {import('./jsonpath.js').ExpressionArray} ExpressionArray + */ +/** + * @typedef {import('./jsonpath.js').ValueType} ValueType + */ +/** + * @typedef {import('./jsonpath.js').ParentValue} ParentValue + */ +/** + * @typedef {import('./jsonpath.js').UnknownResult} UnknownResult + */ +/** + * @typedef {import('./jsonpath.js').ParentProperty} ParentProperty + */ +/** + * @typedef {import('./jsonpath.js').PreferredOutput} PreferredOutput + */ +/** + * @typedef {import('./jsonpath.js').ReturnObject} ReturnObject + */ +/** + * @typedef {import('./jsonpath.js').JSONPathCallback} JSONPathCallback + */ +/** + * @typedef {import('./jsonpath.js').OtherTypeCallback} OtherTypeCallback + */ +/** + * @typedef {import('./jsonpath.js').ContextItem} ContextItem + */ +/** + * @typedef {import('./jsonpath.js').EvaluatedResult} EvaluatedResult + */ +/** + * @typedef {import('./jsonpath.js').EvalCallback} EvalCallback + */ +/** + * @typedef {import('./jsonpath.js').EvalClass} EvalClass + */ +/** + * @typedef {import('./jsonpath.js').ResultType} ResultType + */ +/** + * @typedef {import('./jsonpath.js').EvalValue} EvalValue + */ +/** + * @typedef {import('./jsonpath.js').PathType} PathType + */ +/** + * @typedef {import('./jsonpath.js').SafeScriptType} SafeScriptType + */ +/** + * @typedef {import('./jsonpath.js').ScriptType} ScriptType + */ +/** + * @typedef {import('./jsonpath.js').SandboxType} SandboxType + */ +/** + * @typedef {import('./jsonpath.js').JSONPathOptions} JSONPathOptions */ /** + * @template T * @callback ConditionCallback - * @param {ContextItem} item + * @param {T} item * @returns {boolean} */ /** * Copy items out of one array into another. - * @param {GenericArray} source Array with items to copy - * @param {GenericArray} target Array to which to copy - * @param {ConditionCallback} conditionCb Callback passed the current item; + * @template T + * @param {T[]} source Array with items to copy + * @param {T[]} target Array to which to copy + * @param {ConditionCallback} conditionCb Callback passed the current item; * will move item if evaluates to `true` * @returns {void} */ @@ -2091,8 +2575,6 @@ const moveToAnotherArray = function (source, target, conditionCb) { for (let i = 0; i < il; i++) { const item = source[i]; if (conditionCb(item)) { - // eslint-disable-next-line @stylistic/max-len -- Long - // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient target.push(source.splice(i--, 1)[0]); } } @@ -2110,14 +2592,14 @@ class Script { } /** - * @param {object} context Object whose items will be added + * @param {SandboxType} context Object whose items will be added * to evaluation * @returns {EvaluatedResult} Result of evaluated code */ runInNewContext(context) { let expr = this.code; const keys = Object.keys(context); - const funcs = []; + const funcs = /** @type {string[]} */[]; moveToAnotherArray(keys, funcs, key => { return typeof context[key] === 'function'; }); @@ -2133,7 +2615,7 @@ class Script { }, ''); expr = funcString + expr; - // Mitigate http://perfectionkills.com/global-eval-what-are-the-options/#new_function + // Mitigate https://perfectionkills.com/global-eval-what-are-the-options/#new_function if (!/(['"])use strict\1/u.test(expr) && !keys.includes('arguments')) { expr = 'var arguments = undefined;' + expr; } @@ -2151,8 +2633,8 @@ class Script { return new Function(...keys, code)(...values); } } -JSONPath.prototype.vm = { +JSONPathClass.prototype.vm = { Script }; -export { JSONPath }; +export { JSONPath, JSONPathClass, Script }; diff --git a/dist/index-browser-esm.min.js b/dist/index-browser-esm.min.js index 6f1ab94d..44299a43 100644 --- a/dist/index-browser-esm.min.js +++ b/dist/index-browser-esm.min.js @@ -1,2 +1,2 @@ -class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,r,s){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=r,s?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,r){return e.literals[t]=r,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(t,r){if(e.hooks[t]){const s={context:this,node:r};return e.hooks.run(t,s),s.node}return r}searchHook(t){if(e.hooks[t]){const r={context:this};return e.hooks[t].find(function(e){return e.call(r.context,r),r.node}),r.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const t=this.gobbleExpressions(),r=1===t.length?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",r)}gobbleExpressions(t){let r,s,n=[];for(;this.index0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.lengthi.right_a&&e.right_a?s>e.prec:s<=e.prec;for(;n.length>2&&h(n[n.length-2]);)a=n.pop(),r=n.pop().value,o=n.pop(),t={type:e.BINARY_EXP,operator:r,left:o,right:a},n.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+l),n.push(i,t)}for(h=n.length-1,t=n[h];h>1;)t={type:e.BINARY_EXP,operator:n[h-1].value,left:n[h-2],right:t},h-=2;return t}gobbleToken(){let t,r,s,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"),n)return this.runHook("after-token",n);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)n=this.gobbleArray();else{for(r=this.expr.substr(this.index,e.max_unop_len),s=r.length;s>0;){if(e.unary_ops.hasOwnProperty(r)&&(!e.isIdentifierStart(this.code)||this.index+r.length=r.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}if(i===e.COMMA_CODE){if(this.index++,n++,n!==r.length)if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let e=r.length;e{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(e),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),e.max_unop_len=e.getMaxKeyLen(e.unary_ops),e.max_binop_len=e.getMaxKeyLen(e.binary_ops);const r=t=>new e(t).parse(),s=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(e).filter(e=>!s.includes(e)&&void 0===r[e]).forEach(t=>{r[t]=e[t]}),r.Jsep=e;var n={name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;const r=t.node,s=this.gobbleExpression();if(s||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const n=this.gobbleExpression();if(n||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:s,alternate:n},r.operator&&e.binary_ops[r.operator]<=.9){let s=r;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;t.node.test=s.right,s.right=t.node,t.node=r}}else this.throwError("Expected :")}})}};r.plugins.register(n);var i={name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){const r=++this.index;let s=!1;for(;this.index=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;i+=this.char}try{n=new RegExp(s,i)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:n,raw:this.expr.slice(r-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?s=!0:s&&this.code===e.CBRACK_CODE&&(s=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}};const o={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[43,45],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];function r(e){o.assignmentOperators.has(e.operator)?(e.type="AssignmentExpression",r(e.left),r(e.right)):e.operator||Object.values(e).forEach(e=>{e&&"object"==typeof e&&r(e)})}o.assignmentOperators.forEach(t=>e.addBinaryOp(t,o.assignmentPrecedence,!0)),e.hooks.add("gobble-token",function(e){const r=this.code;o.updateOperators.some(e=>e===r&&e===this.expr.charCodeAt(this.index+1))&&(this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},e.node.argument&&t.includes(e.node.argument.type)||this.throwError(`Unexpected ${e.node.operator}`))}),e.hooks.add("after-token",function(e){if(e.node){const r=this.code;o.updateOperators.some(e=>e===r&&e===this.expr.charCodeAt(this.index+1))&&(t.includes(e.node.type)||this.throwError(`Unexpected ${e.node.operator}`),this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:e.node,prefix:!1})}}),e.hooks.add("after-expression",function(e){e.node&&r(e.node)})}};r.plugins.register(i,o),r.addUnaryOp("typeof"),r.addUnaryOp("void"),r.addLiteral("null",null),r.addLiteral("undefined",void 0);const a=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),h={evalAst(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":return h.evalBinaryExpression(e,t);case"Compound":return h.evalCompound(e,t);case"ConditionalExpression":return h.evalConditionalExpression(e,t);case"Identifier":return h.evalIdentifier(e,t);case"Literal":return h.evalLiteral(e,t);case"MemberExpression":return h.evalMemberExpression(e,t);case"UnaryExpression":return h.evalUnaryExpression(e,t);case"ArrayExpression":return h.evalArrayExpression(e,t);case"CallExpression":return h.evalCallExpression(e,t);case"AssignmentExpression":return h.evalAssignmentExpression(e,t);default:throw SyntaxError("Unexpected expression",e)}},evalBinaryExpression:(e,t)=>({"||":(e,t)=>e||t(),"&&":(e,t)=>e&&t(),"|":(e,t)=>e|t(),"^":(e,t)=>e^t(),"&":(e,t)=>e&t(),"==":(e,t)=>e==t(),"!=":(e,t)=>e!=t(),"===":(e,t)=>e===t(),"!==":(e,t)=>e!==t(),"<":(e,t)=>e":(e,t)=>e>t(),"<=":(e,t)=>e<=t(),">=":(e,t)=>e>=t(),"<<":(e,t)=>e<>":(e,t)=>e>>t(),">>>":(e,t)=>e>>>t(),"+":(e,t)=>e+t(),"-":(e,t)=>e-t(),"*":(e,t)=>e*t(),"/":(e,t)=>e/t(),"%":(e,t)=>e%t()}[e.operator](h.evalAst(e.left,t),()=>h.evalAst(e.right,t))),evalCompound(e,t){let r;for(let s=0;sh.evalAst(e.test,t)?h.evalAst(e.consequent,t):h.evalAst(e.alternate,t),evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw ReferenceError(`${e.name} is not defined`)},evalLiteral:e=>e.value,evalMemberExpression(e,t){const r=String(e.computed?h.evalAst(e.property):e.property.name),s=h.evalAst(e.object,t);if(null==s)throw TypeError(`Cannot read properties of ${s} (reading '${r}')`);if(!Object.hasOwn(s,r)&&a.has(r))throw TypeError(`Cannot read properties of ${s} (reading '${r}')`);const n=s[r];return"function"==typeof n&&n!==Function?n.bind(s):n},evalUnaryExpression:(e,t)=>({"-":e=>-h.evalAst(e,t),"!":e=>!h.evalAst(e,t),"~":e=>~h.evalAst(e,t),"+":e=>+h.evalAst(e,t),typeof:e=>typeof h.evalAst(e,t),void:e=>{h.evalAst(e,t)}}[e.operator](e.argument)),evalArrayExpression:(e,t)=>e.elements.map(e=>h.evalAst(e,t)),evalCallExpression(e,t){const r=e.arguments.map(e=>h.evalAst(e,t)),s=h.evalAst(e.callee,t);if(s===Function)throw new Error("Function constructor is disabled");return s(...r)},evalAssignmentExpression(e,t){if("Identifier"!==e.left.type)throw SyntaxError("Invalid left-hand side in assignment");const r=e.left.name,s=h.evalAst(e.right,t);return t[r]=s,t[r]}};function l(e,t){return(e=e.slice()).push(t),e}function c(e,t){return(t=t.slice()).unshift(e),t}class p extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}}function u(e,t,r,s,n){if(!(this instanceof u))try{return new u(e,t,r,s,n)}catch(e){if(!e.avoidNew)throw e;return e.value}"string"==typeof e&&(n=s,s=r,r=t,t=e,e=null);const i=e&&"object"==typeof e;if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!Object.hasOwn(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.eval=void 0===e.eval?"safe":e.eval,this.ignoreEvalErrors=void 0!==e.ignoreEvalErrors&&e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||s||null,this.otherTypeCallback=e.otherTypeCallback||n||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){const s={path:i?e.path:t};i?"json"in e&&(s.json=e.json):s.json=r;const n=this.evaluate(s);if(!n||"object"!=typeof n)throw new p(n);return n}}u.prototype.evaluate=function(e,t,r,s){let n=this.parent,i=this.parentProperty,{flatten:o,wrap:a}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=s||this.otherTypeCallback,t=t||this.json,(e=e||this.path)&&"object"==typeof e&&!Array.isArray(e)){if(!e.path&&""!==e.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),o=Object.hasOwn(e,"flatten")?e.flatten:o,this.currResultType=Object.hasOwn(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,"sandbox")?e.sandbox:this.currSandbox,a=Object.hasOwn(e,"wrap")?e.wrap:a,this.currEval=Object.hasOwn(e,"eval")?e.eval:this.currEval,r=Object.hasOwn(e,"callback")?e.callback:r,this.currOtherTypeCallback=Object.hasOwn(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,n=Object.hasOwn(e,"parent")?e.parent:n,i=Object.hasOwn(e,"parentProperty")?e.parentProperty:i,e=e.path}if(n=n||null,i=i||null,Array.isArray(e)&&(e=u.toPathString(e)),!e&&""!==e||!t)return;const h=u.toPathArray(e);"$"===h[0]&&h.length>1&&h.shift(),this._hasParentSelector=null;const l=this._trace(h,t,["$"],n,i,r).filter(function(e){return e&&!e.isParentSelector});return l.length?a||1!==l.length||l[0].hasArrExpr?l.reduce((e,t)=>{const r=this._getPreferredOutput(t);return o&&Array.isArray(r)?e=e.concat(r):e.push(r),e},[]):this._getPreferredOutput(l[0]):a?[]:void 0},u.prototype._getPreferredOutput=function(e){const t=this.currResultType;switch(t){case"all":{const t=Array.isArray(e.path)?e.path:u.toPathArray(e.path);return e.pointer=u.toPointer(t),e.path="string"==typeof e.path?e.path:u.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return u.toPathString(e[t]);case"pointer":return u.toPointer(e.path);default:throw new TypeError("Unknown result type")}},u.prototype._handleCallback=function(e,t,r){if(t){const s=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:u.toPathString(e.path),t(s,r,e)}},u.prototype._trace=function(e,t,r,s,n,i,o,a){let h;if(!e.length)return h={path:r,value:t,parent:s,parentProperty:n,hasArrExpr:o},this._handleCallback(h,i,"value"),h;const p=e[0],u=e.slice(1),d=[];function f(e){Array.isArray(e)?e.forEach(e=>{d.push(e)}):d.push(e)}if(("string"!=typeof p||a)&&t&&Object.hasOwn(t,p))f(this._trace(u,t[p],l(r,p),t,p,i,o));else if("*"===p)this._walk(t,e=>{f(this._trace(u,t[e],l(r,e),t,e,i,!0,!0))});else if(".."===p)f(this._trace(u,t,r,s,n,i,o)),this._walk(t,s=>{"object"==typeof t[s]&&f(this._trace(e.slice(),t[s],l(r,s),t,s,i,!0))});else{if("^"===p)return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:u,isParentSelector:!0};if("~"===p)return h={path:l(r,p),value:n,parent:s,parentProperty:null},this._handleCallback(h,i,"property"),h;if("$"===p)f(this._trace(u,t,r,null,null,i,o));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(p))f(this._slice(p,u,t,r,s,n,i));else if(0===p.indexOf("?(")){if(!1===this.currEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const e=p.replace(/^\?\((.*?)\)$/u,"$1"),o=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e);o?this._walk(t,e=>{const a=[o[2]],h=o[1]?t[e][o[1]]:t[e];this._trace(a,h,r,s,n,i,!0).length>0&&f(this._trace(u,t[e],l(r,e),t,e,i,!0))}):this._walk(t,o=>{this._eval(e,t[o],o,r,s,n)&&f(this._trace(u,t[o],l(r,o),t,o,i,!0))})}else if("("===p[0]){if(!1===this.currEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");f(this._trace(c(this._eval(p,t,r.at(-1),r.slice(0,-1),s,n),u),t,r,s,n,i,o))}else if("@"===p[0]){let e=!1;const o=p.slice(1,-2);switch(o){case"scalar":t&&["object","function"].includes(typeof t)||(e=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===o&&(e=!0);break;case"integer":!Number.isFinite(t)||t%1||(e=!0);break;case"number":Number.isFinite(t)&&(e=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(e=!0);break;case"object":t&&typeof t===o&&(e=!0);break;case"array":Array.isArray(t)&&(e=!0);break;case"other":e=this.currOtherTypeCallback(t,r,s,n);break;case"null":null===t&&(e=!0);break;default:throw new TypeError("Unknown value type "+o)}if(e)return h={path:r,value:t,parent:s,parentProperty:n},this._handleCallback(h,i,"value"),h}else if("`"===p[0]&&t&&Object.hasOwn(t,p.slice(1))){const e=p.slice(1);f(this._trace(u,t[e],l(r,e),t,e,i,o,!0))}else if(p.includes(",")){const e=p.split(",");for(const o of e)f(this._trace(c(o,u),t,r,s,n,i,!0))}else!a&&t&&Object.hasOwn(t,p)&&f(this._trace(u,t[p],l(r,p),t,p,i,o,!0))}if(this._hasParentSelector)for(let e=0;e{t(e)})},u.prototype._slice=function(e,t,r,s,n,i,o){if(!Array.isArray(r))return;const a=r.length,h=e.split(":"),l=h[2]&&Number.parseInt(h[2])||1;let p=h[0]&&Number.parseInt(h[0])||0,u=h[1]?Number.parseInt(h[1]):a;p=p<0?Math.max(0,p+a):Math.min(a,p),u=u<0?Math.max(0,u+a):Math.min(a,u);const d=[];for(let e=p;e{d.push(e)})}return d},u.prototype._eval=function(e,t,r,s,n,i){this.currSandbox._$_parentProperty=i,this.currSandbox._$_parent=n,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;const o=e.includes("@path");o&&(this.currSandbox._$_path=u.toPathString(s.concat([r])));const a=this.currEval+"Script:"+e;if(!u.cache[a]){let t=e.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(o&&(t=t.replaceAll("@path","_$_path")),"safe"===this.currEval||!0===this.currEval||void 0===this.currEval)u.cache[a]=new this.safeVm.Script(t);else if("native"===this.currEval)u.cache[a]=new this.vm.Script(t);else if("function"==typeof this.currEval&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const e=this.currEval;u.cache[a]=new e(t)}else{if("function"!=typeof this.currEval)throw new TypeError(`Unknown "eval" property "${this.currEval}"`);u.cache[a]={runInNewContext:e=>this.currEval(t,e)}}}try{return u.cache[a].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+t.message+": "+e)}},u.cache={},u.toPathString=function(e){const t=e,r=t.length;let s="$";for(let e=1;e"function"==typeof e[t]);const n=r.map(t=>e[t]);t=s.reduce((t,r)=>{let s=e[r].toString();return/function/u.test(s)||(s="function "+s),"var "+r+"="+s+";"+t},"")+t,/(['"])use strict\1/u.test(t)||r.includes("arguments")||(t="var arguments = undefined;"+t),t=t.replace(/;\s*$/u,"");const i=t.lastIndexOf(";"),o=-1!==i?t.slice(0,i+1)+" return "+t.slice(i+1):" return "+t;return new Function(...r,o)(...n)}}};export{u as JSONPath}; +class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,r,s){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=r,s?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,r){return e.literals[t]=r,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(t,r){if(e.hooks[t]){const s={context:this,node:r};return e.hooks.run(t,s),s.node}return r}searchHook(t){if(e.hooks[t]){const r={context:this};return e.hooks[t].find(function(e){return e.call(r.context,r),r.node}),r.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const t=this.gobbleExpressions(),r=1===t.length?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",r)}gobbleExpressions(t){let r,s,n=[];for(;this.index0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.lengthi.right_a&&e.right_a?s>e.prec:s<=e.prec;for(;n.length>2&&h(n[n.length-2]);)o=n.pop(),r=n.pop().value,a=n.pop(),t={type:e.BINARY_EXP,operator:r,left:a,right:o},n.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+l),n.push(i,t)}for(h=n.length-1,t=n[h];h>1;)t={type:e.BINARY_EXP,operator:n[h-1].value,left:n[h-2],right:t},h-=2;return t}gobbleToken(){let t,r,s,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"),n)return this.runHook("after-token",n);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)n=this.gobbleArray();else{for(r=this.expr.substr(this.index,e.max_unop_len),s=r.length;s>0;){if(e.unary_ops.hasOwnProperty(r)&&(!e.isIdentifierStart(this.code)||this.index+r.length=r.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}if(i===e.COMMA_CODE){if(this.index++,n++,n!==r.length)if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let e=r.length;e{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(e),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),e.max_unop_len=e.getMaxKeyLen(e.unary_ops),e.max_binop_len=e.getMaxKeyLen(e.binary_ops);const r=t=>new e(t).parse(),s=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(e).filter(e=>!s.includes(e)&&void 0===r[e]).forEach(t=>{r[t]=e[t]}),r.Jsep=e;var n={name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;const r=t.node,s=this.gobbleExpression();if(s||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const n=this.gobbleExpression();if(n||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:s,alternate:n},r.operator&&e.binary_ops[r.operator]<=.9){let s=r;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;t.node.test=s.right,s.right=t.node,t.node=r}}else this.throwError("Expected :")}})}};r.plugins.register(n);var i={name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){const r=++this.index;let s=!1;for(;this.index=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;i+=this.char}try{n=new RegExp(s,i)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:n,raw:this.expr.slice(r-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?s=!0:s&&this.code===e.CBRACK_CODE&&(s=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}};const a={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[43,45],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];function r(e){a.assignmentOperators.has(e.operator)?(e.type="AssignmentExpression",r(e.left),r(e.right)):e.operator||Object.values(e).forEach(e=>{e&&"object"==typeof e&&r(e)})}a.assignmentOperators.forEach(t=>e.addBinaryOp(t,a.assignmentPrecedence,!0)),e.hooks.add("gobble-token",function(e){const r=this.code;a.updateOperators.some(e=>e===r&&e===this.expr.charCodeAt(this.index+1))&&(this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},e.node.argument&&t.includes(e.node.argument.type)||this.throwError(`Unexpected ${e.node.operator}`))}),e.hooks.add("after-token",function(e){if(e.node){const r=this.code;a.updateOperators.some(e=>e===r&&e===this.expr.charCodeAt(this.index+1))&&(t.includes(e.node.type)||this.throwError(`Unexpected ${e.node.operator}`),this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:e.node,prefix:!1})}}),e.hooks.add("after-expression",function(e){e.node&&r(e.node)})}};r.plugins.register(i,a),r.addUnaryOp("typeof"),r.addUnaryOp("void"),r.addLiteral("null",null),r.addLiteral("undefined",void 0);const o=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),h={evalAst(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":return h.evalBinaryExpression(e,t);case"Compound":return h.evalCompound(e,t);case"ConditionalExpression":return h.evalConditionalExpression(e,t);case"Identifier":return h.evalIdentifier(e,t);case"Literal":return h.evalLiteral(e);case"MemberExpression":return h.evalMemberExpression(e,t);case"UnaryExpression":return h.evalUnaryExpression(e,t);case"ArrayExpression":return h.evalArrayExpression(e,t);case"CallExpression":return h.evalCallExpression(e,t);case"AssignmentExpression":return h.evalAssignmentExpression(e,t);default:throw new SyntaxError("Unexpected expression",{cause:e})}},evalBinaryExpression:(e,t)=>({"||":(e,t)=>e||t(),"&&":(e,t)=>e&&t(),"|":(e,t)=>e|t(),"^":(e,t)=>e^t(),"&":(e,t)=>e&t(),"==":(e,t)=>e==t(),"!=":(e,t)=>e!=t(),"===":(e,t)=>e===t(),"!==":(e,t)=>e!==t(),"<":(e,t)=>e":(e,t)=>e>t(),"<=":(e,t)=>e<=t(),">=":(e,t)=>e>=t(),"<<":(e,t)=>e<>":(e,t)=>e>>t(),">>>":(e,t)=>e>>>t(),"+":(e,t)=>e+t(),"-":(e,t)=>e-t(),"*":(e,t)=>e*t(),"/":(e,t)=>e/t(),"%":(e,t)=>e%t()}[e.operator](h.evalAst(e.left,t),()=>h.evalAst(e.right,t))),evalCompound(e,t){let r;for(let s=0;sh.evalAst(e.test,t)?h.evalAst(e.consequent,t):h.evalAst(e.alternate,t),evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw new ReferenceError(`${e.name} is not defined`)},evalLiteral:e=>e.value,evalMemberExpression(e,t){const r=String(e.computed?h.evalAst(e.property,{}):e.property.name),s=h.evalAst(e.object,t);if(null==s)throw new TypeError(`Cannot read properties of ${s} (reading '${r}')`);if(!Object.hasOwn(s,r)&&o.has(r))throw new TypeError(`Cannot read properties of ${s} (reading '${r}')`);const n=s[r];return"function"==typeof n&&n!==Function?n.bind(s):n},evalUnaryExpression:(e,t)=>({"-":e=>-h.evalAst(e,t),"!":e=>!h.evalAst(e,t),"~":e=>~h.evalAst(e,t),"+":e=>+h.evalAst(e,t),typeof:e=>typeof h.evalAst(e,t),void:e=>{h.evalAst(e,t)}}[e.operator](e.argument)),evalArrayExpression:(e,t)=>e.elements.map(e=>h.evalAst(e,t)),evalCallExpression(e,t){const r=e.arguments.map(e=>h.evalAst(e,t)),s=h.evalAst(e.callee,t);if(s===Function)throw new Error("Function constructor is disabled");return s(...r)},evalAssignmentExpression(e,t){if("Identifier"!==e.left.type)throw new SyntaxError("Invalid left-hand side in assignment");const r=e.left.name,s=h.evalAst(e.right,t);return t[r]=s,t[r]}};function l(e,t){return(e=e.slice()).push(t),e}function c(e,t){return(t=t.slice()).unshift(e),t}class p extends Error{constructor(e,t){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)',t),this.value=e,this.name="NewError"}}function u(e,t,r,s,n){try{return e&&"object"==typeof e?new d(e):new d(e,t,r,s,n)}catch(e){if(!(e instanceof p))throw e;return e.value}}class d{constructor(e,t,r,s,n){"string"==typeof e&&(n=s,s=r,r=t,t=e,e=null);const i=e&&"object"==typeof e;if(e||={},this.currResultType=void 0,this.currEval=void 0,this.currOtherTypeCallback=void 0,this.safeVm,this.vm,this.currSandbox=void 0,this._hasParentSelector=!1,this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!Object.hasOwn(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.eval=void 0===e.eval?"safe":e.eval,this.ignoreEvalErrors=void 0!==e.ignoreEvalErrors&&e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||s||null,this.otherTypeCallback=e.otherTypeCallback||n||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){const s={path:i?e.path:t};i||void 0===r?"json"in e&&(s.json=e.json):s.json=r;const n=this.evaluate(s);if(!n||"object"!=typeof n)throw new p(n);return n}}evaluate(e,t,r,s){let n=this.parent,i=this.parentProperty,{flatten:a,wrap:o}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,r||=this.callback,this.currOtherTypeCallback=s||this.otherTypeCallback,e&&"object"==typeof e&&!Array.isArray(e)){const s=e;if(!s.path&&""!==s.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(s,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=s),a=Object.hasOwn(s,"flatten")?s.flatten??a:a,this.currResultType=Object.hasOwn(s,"resultType")?s.resultType:this.currResultType,this.currSandbox=Object.hasOwn(s,"sandbox")?s.sandbox:this.currSandbox,o=Object.hasOwn(s,"wrap")?s.wrap:o,this.currEval=Object.hasOwn(s,"eval")?s.eval:this.currEval,r=Object.hasOwn(s,"callback")?s.callback:r,this.currOtherTypeCallback=Object.hasOwn(s,"otherTypeCallback")?s.otherTypeCallback:this.currOtherTypeCallback,n=Object.hasOwn(s,"parent")?s.parent??n:n,i=Object.hasOwn(s,"parentProperty")?s.parentProperty??i:i,e=s.path}else t||=this.json,e||=this.path;if(n||=null,i||=null,Array.isArray(e)&&(e=u.toPathString(e)),!t||!e&&""!==e)return;const h=u.toPathArray(e);"$"===h[0]&&h.length>1&&h.shift(),this._hasParentSelector=!1;const l=this._trace(h,t,["$"],n,i,r??void 0,void 0),c=(Array.isArray(l)?l:[l]).filter(e=>e&&!e.isParentSelector);if(!c.length)return o?[]:void 0;if(!o&&1===c.length&&!c[0].hasArrExpr){return this._getPreferredOutput(c[0])}return c.reduce((e,t)=>{const r=this._getPreferredOutput(t);return a&&Array.isArray(r)?e=e.concat(r):e.push(r),e},[])}_getPreferredOutput(e){const t=this.currResultType;switch(t){case"all":{const t=Array.isArray(e.path)?e.path:u.toPathArray(e.path);return e.pointer=u.toPointer(t),e.path="string"==typeof e.path?e.path:u.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return"string"==typeof e.path?e.path:u.toPathString(e.path);case"pointer":{const t=Array.isArray(e.path)?e.path:u.toPathArray(e.path);return u.toPointer(t)}default:throw new TypeError("Unknown result type")}}_handleCallback(e,t,r){if(!t)return;const s=this._getPreferredOutput(e);Array.isArray(e.path)&&(e.path=u.toPathString(e.path)),t(s,r,e)}_trace(e,t,r,s,n,i,a,o){let h;if(!e.length)return h={path:r,value:t,parent:s,parentProperty:n,hasArrExpr:a},this._handleCallback(h,i,"value"),h;const p=e[0],u=e.slice(1),d=[];function f(e){Array.isArray(e)?e.forEach(e=>{d.push(e)}):d.push(e)}if(t&&("string"!=typeof p||o)&&Object.hasOwn(t,p)){const e=t;f(this._trace(u,e[p],l(r,p),t,p,i,a))}else if("*"===p)this._walk(t,e=>{const s=t;f(this._trace(u,s[e],l(r,e),t,e,i,!0,!0))});else if(".."===p)f(this._trace(u,t,r,s,n,i,a)),this._walk(t,s=>{const n=t;"object"==typeof n[s]&&f(this._trace(e.slice(),n[s],l(r,s),t,s,i,!0))});else{if("^"===p)return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:u,isParentSelector:!0,value:void 0,parent:void 0,parentProperty:null};if("~"===p)return h={path:l(r,p),value:n,parent:s,parentProperty:null},this._handleCallback(h,i,"property"),h;if("$"===p)f(this._trace(u,t,r,null,null,i,a));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(p)){const e=this._slice(p,u,t,r,s,n,i);e&&f(e)}else if(0===p.indexOf("?(")){if(!1===this.currEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const e=p.replace(/^\?\((.*?)\)$/u,"$1"),a=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e);if(a)this._walk(t,e=>{const o=[a[2]],h=t,c=a[1]?h[e][a[1]]:h[e],p=this._trace(o,c,r,s,n,i,!0);(Array.isArray(p)?p:[p]).length>0&&f(this._trace(u,h[e],l(r,e),t,e,i,!0))});else{const a=t;this._walk(t,o=>{this._eval(e,a[o],o,r,s,n)&&f(this._trace(u,a[o],l(r,o),t,o,i,!0))})}}else if("("===p[0]){if(!1===this.currEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");const e=this._eval(p,t,r.at(-1),r.slice(0,-1),s,n),o=void 0!==e?e:"";f(this._trace(c(o,u),t,r,s,n,i,a))}else if("@"===p[0]){let e=!1;const o=p.slice(1,-2);switch(o){case"scalar":t&&["object","function"].includes(typeof t)||(e=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===o&&(e=!0);break;case"integer":!Number.isFinite(t)||t%1||(e=!0);break;case"number":Number.isFinite(t)&&(e=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(e=!0);break;case"object":t&&typeof t===o&&(e=!0);break;case"array":Array.isArray(t)&&(e=!0);break;case"other":e=this.currOtherTypeCallback?.(t,r,s,n)??!1;break;case"null":null===t&&(e=!0);break;default:throw new TypeError("Unknown value type "+o)}if(e)return h={path:r,value:t,parent:s,parentProperty:n,hasArrExpr:a},this._handleCallback(h,i,"value"),h}else if(t&&"`"===p[0]&&Object.hasOwn(t,p.slice(1))){const e=p.slice(1),s=t;f(this._trace(u,s[e],l(r,e),t,e,i,a,!0))}else if(p.includes(",")){const e=p.split(",");for(const a of e)f(this._trace(c(a,u),t,r,s,n,i,!0))}else if(!o&&t&&Object.hasOwn(t,p)){const e=t;f(this._trace(u,e[p],l(r,p),t,p,i,a,!0))}}if(this._hasParentSelector)for(let e=0;e{t(e)})}_slice(e,t,r,s,n,i,a){if(!Array.isArray(r))return;const o=r.length,h=e.split(":"),l=h[2]&&Number(h[2])||1;let p=h[0]&&Number(h[0])||0,u=h[1]?Number(h[1]):o;p=p<0?Math.max(0,p+o):Math.min(o,p),u=u<0?Math.max(0,u+o):Math.min(o,u);const d=[];for(let e=p;e{d.push(e)})}return d}_eval(e,t,r,s,n,i){this.currSandbox&&(this.currSandbox._$_parentProperty=i,this.currSandbox._$_parent=n,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t);const a=e.includes("@path");if(a){(this.currSandbox??{})._$_path=u.toPathString(s.concat([r]))}const o=this.currEval+"Script:"+e;if(!Object.hasOwn(u.cache,o)){let t=e.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");a&&(t=t.replaceAll("@path","_$_path"));const r=this.currEval;if(["safe",!0,void 0].includes(r)){const{cache:e}=u;e[o]=new this.safeVm.Script(t)}else if("native"===this.currEval){const{cache:e}=u;e[o]=new this.vm.Script(t)}else if("function"==typeof this.currEval&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const e=this.currEval,{cache:r}=u;r[o]=new e(t)}else{if("function"!=typeof this.currEval)throw new TypeError(`Unknown "eval" property "${this.currEval}"`);{const{cache:e}=u,r=this.currEval;e[o]={runInNewContext:e=>r(t,e)}}}}try{const{cache:e}=u;return e[o].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+t.message+": "+e,{cause:t})}}}d.prototype.safeVm={Script:class{constructor(e){this.code=e,this.ast=r(this.code)}runInNewContext(e){const t=Object.assign(Object.create(null),e);return h.evalAst(this.ast,t)}}},u.cache={},u.toPathString=function(e){const t=e,r=t.length;let s="$";for(let e=1;e"function"==typeof e[t]);const n=r.map(t=>e[t]);t=s.reduce((t,r)=>{let s=e[r].toString();return/function/u.test(s)||(s="function "+s),"var "+r+"="+s+";"+t},"")+t,/(['"])use strict\1/u.test(t)||r.includes("arguments")||(t="var arguments = undefined;"+t),t=t.replace(/;\s*$/u,"");const i=t.lastIndexOf(";"),a=-1!==i?t.slice(0,i+1)+" return "+t.slice(i+1):" return "+t;return new Function(...r,a)(...n)}}d.prototype.vm={Script:f};export{u as JSONPath,d as JSONPathClass,f as Script}; //# sourceMappingURL=index-browser-esm.min.js.map diff --git a/dist/index-browser-esm.min.js.map b/dist/index-browser-esm.min.js.map index 914f3764..9b4bf3ca 100644 --- a/dist/index-browser-esm.min.js.map +++ b/dist/index-browser-esm.min.js.map @@ -1 +1 @@ -{"version":3,"file":"index-browser-esm.min.js","sources":["../node_modules/.pnpm/jsep@1.4.0/node_modules/jsep/dist/jsep.js","../node_modules/.pnpm/@jsep-plugin+regex@1.0.4_jsep@1.4.0/node_modules/@jsep-plugin/regex/dist/index.js","../node_modules/.pnpm/@jsep-plugin+assignment@1.3.0_jsep@1.4.0/node_modules/@jsep-plugin/assignment/dist/index.js","../src/Safe-Script.js","../src/jsonpath.js","../src/jsonpath-browser.js"],"sourcesContent":["/**\n * @implements {IHooks}\n */\nclass Hooks {\n\t/**\n\t * @callback HookCallback\n\t * @this {*|Jsep} this\n\t * @param {Jsep} env\n\t * @returns: void\n\t */\n\t/**\n\t * Adds the given callback to the list of callbacks for the given hook.\n\t *\n\t * The callback will be invoked when the hook it is registered for is run.\n\t *\n\t * One callback function can be registered to multiple hooks and the same hook multiple times.\n\t *\n\t * @param {string|object} name The name of the hook, or an object of callbacks keyed by name\n\t * @param {HookCallback|boolean} callback The callback function which is given environment variables.\n\t * @param {?boolean} [first=false] Will add the hook to the top of the list (defaults to the bottom)\n\t * @public\n\t */\n\tadd(name, callback, first) {\n\t\tif (typeof arguments[0] != 'string') {\n\t\t\t// Multiple hook callbacks, keyed by name\n\t\t\tfor (let name in arguments[0]) {\n\t\t\t\tthis.add(name, arguments[0][name], arguments[1]);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t(Array.isArray(name) ? name : [name]).forEach(function (name) {\n\t\t\t\tthis[name] = this[name] || [];\n\n\t\t\t\tif (callback) {\n\t\t\t\t\tthis[name][first ? 'unshift' : 'push'](callback);\n\t\t\t\t}\n\t\t\t}, this);\n\t\t}\n\t}\n\n\t/**\n\t * Runs a hook invoking all registered callbacks with the given environment variables.\n\t *\n\t * Callbacks will be invoked synchronously and in the order in which they were registered.\n\t *\n\t * @param {string} name The name of the hook.\n\t * @param {Object} env The environment variables of the hook passed to all callbacks registered.\n\t * @public\n\t */\n\trun(name, env) {\n\t\tthis[name] = this[name] || [];\n\t\tthis[name].forEach(function (callback) {\n\t\t\tcallback.call(env && env.context ? env.context : env, env);\n\t\t});\n\t}\n}\n\n/**\n * @implements {IPlugins}\n */\nclass Plugins {\n\tconstructor(jsep) {\n\t\tthis.jsep = jsep;\n\t\tthis.registered = {};\n\t}\n\n\t/**\n\t * @callback PluginSetup\n\t * @this {Jsep} jsep\n\t * @returns: void\n\t */\n\t/**\n\t * Adds the given plugin(s) to the registry\n\t *\n\t * @param {object} plugins\n\t * @param {string} plugins.name The name of the plugin\n\t * @param {PluginSetup} plugins.init The init function\n\t * @public\n\t */\n\tregister(...plugins) {\n\t\tplugins.forEach((plugin) => {\n\t\t\tif (typeof plugin !== 'object' || !plugin.name || !plugin.init) {\n\t\t\t\tthrow new Error('Invalid JSEP plugin format');\n\t\t\t}\n\t\t\tif (this.registered[plugin.name]) {\n\t\t\t\t// already registered. Ignore.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tplugin.init(this.jsep);\n\t\t\tthis.registered[plugin.name] = plugin;\n\t\t});\n\t}\n}\n\n// JavaScript Expression Parser (JSEP) 1.4.0\n\nclass Jsep {\n\t/**\n\t * @returns {string}\n\t */\n\tstatic get version() {\n\t\t// To be filled in by the template\n\t\treturn '1.4.0';\n\t}\n\n\t/**\n\t * @returns {string}\n\t */\n\tstatic toString() {\n\t\treturn 'JavaScript Expression Parser (JSEP) v' + Jsep.version;\n\t};\n\n\t// ==================== CONFIG ================================\n\t/**\n\t * @method addUnaryOp\n\t * @param {string} op_name The name of the unary op to add\n\t * @returns {Jsep}\n\t */\n\tstatic addUnaryOp(op_name) {\n\t\tJsep.max_unop_len = Math.max(op_name.length, Jsep.max_unop_len);\n\t\tJsep.unary_ops[op_name] = 1;\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method jsep.addBinaryOp\n\t * @param {string} op_name The name of the binary op to add\n\t * @param {number} precedence The precedence of the binary op (can be a float). Higher number = higher precedence\n\t * @param {boolean} [isRightAssociative=false] whether operator is right-associative\n\t * @returns {Jsep}\n\t */\n\tstatic addBinaryOp(op_name, precedence, isRightAssociative) {\n\t\tJsep.max_binop_len = Math.max(op_name.length, Jsep.max_binop_len);\n\t\tJsep.binary_ops[op_name] = precedence;\n\t\tif (isRightAssociative) {\n\t\t\tJsep.right_associative.add(op_name);\n\t\t}\n\t\telse {\n\t\t\tJsep.right_associative.delete(op_name);\n\t\t}\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method addIdentifierChar\n\t * @param {string} char The additional character to treat as a valid part of an identifier\n\t * @returns {Jsep}\n\t */\n\tstatic addIdentifierChar(char) {\n\t\tJsep.additional_identifier_chars.add(char);\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method addLiteral\n\t * @param {string} literal_name The name of the literal to add\n\t * @param {*} literal_value The value of the literal\n\t * @returns {Jsep}\n\t */\n\tstatic addLiteral(literal_name, literal_value) {\n\t\tJsep.literals[literal_name] = literal_value;\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeUnaryOp\n\t * @param {string} op_name The name of the unary op to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeUnaryOp(op_name) {\n\t\tdelete Jsep.unary_ops[op_name];\n\t\tif (op_name.length === Jsep.max_unop_len) {\n\t\t\tJsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);\n\t\t}\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllUnaryOps\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllUnaryOps() {\n\t\tJsep.unary_ops = {};\n\t\tJsep.max_unop_len = 0;\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeIdentifierChar\n\t * @param {string} char The additional character to stop treating as a valid part of an identifier\n\t * @returns {Jsep}\n\t */\n\tstatic removeIdentifierChar(char) {\n\t\tJsep.additional_identifier_chars.delete(char);\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeBinaryOp\n\t * @param {string} op_name The name of the binary op to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeBinaryOp(op_name) {\n\t\tdelete Jsep.binary_ops[op_name];\n\n\t\tif (op_name.length === Jsep.max_binop_len) {\n\t\t\tJsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);\n\t\t}\n\t\tJsep.right_associative.delete(op_name);\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllBinaryOps\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllBinaryOps() {\n\t\tJsep.binary_ops = {};\n\t\tJsep.max_binop_len = 0;\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeLiteral\n\t * @param {string} literal_name The name of the literal to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeLiteral(literal_name) {\n\t\tdelete Jsep.literals[literal_name];\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllLiterals\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllLiterals() {\n\t\tJsep.literals = {};\n\n\t\treturn Jsep;\n\t}\n\t// ==================== END CONFIG ============================\n\n\n\t/**\n\t * @returns {string}\n\t */\n\tget char() {\n\t\treturn this.expr.charAt(this.index);\n\t}\n\n\t/**\n\t * @returns {number}\n\t */\n\tget code() {\n\t\treturn this.expr.charCodeAt(this.index);\n\t};\n\n\n\t/**\n\t * @param {string} expr a string with the passed in express\n\t * @returns Jsep\n\t */\n\tconstructor(expr) {\n\t\t// `index` stores the character number we are currently at\n\t\t// All of the gobbles below will modify `index` as we move along\n\t\tthis.expr = expr;\n\t\tthis.index = 0;\n\t}\n\n\t/**\n\t * static top-level parser\n\t * @returns {jsep.Expression}\n\t */\n\tstatic parse(expr) {\n\t\treturn (new Jsep(expr)).parse();\n\t}\n\n\t/**\n\t * Get the longest key length of any object\n\t * @param {object} obj\n\t * @returns {number}\n\t */\n\tstatic getMaxKeyLen(obj) {\n\t\treturn Math.max(0, ...Object.keys(obj).map(k => k.length));\n\t}\n\n\t/**\n\t * `ch` is a character code in the next three functions\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isDecimalDigit(ch) {\n\t\treturn (ch >= 48 && ch <= 57); // 0...9\n\t}\n\n\t/**\n\t * Returns the precedence of a binary operator or `0` if it isn't a binary operator. Can be float.\n\t * @param {string} op_val\n\t * @returns {number}\n\t */\n\tstatic binaryPrecedence(op_val) {\n\t\treturn Jsep.binary_ops[op_val] || 0;\n\t}\n\n\t/**\n\t * Looks for start of identifier\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isIdentifierStart(ch) {\n\t\treturn (ch >= 65 && ch <= 90) || // A...Z\n\t\t\t(ch >= 97 && ch <= 122) || // a...z\n\t\t\t(ch >= 128 && !Jsep.binary_ops[String.fromCharCode(ch)]) || // any non-ASCII that is not an operator\n\t\t\t(Jsep.additional_identifier_chars.has(String.fromCharCode(ch))); // additional characters\n\t}\n\n\t/**\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isIdentifierPart(ch) {\n\t\treturn Jsep.isIdentifierStart(ch) || Jsep.isDecimalDigit(ch);\n\t}\n\n\t/**\n\t * throw error at index of the expression\n\t * @param {string} message\n\t * @throws\n\t */\n\tthrowError(message) {\n\t\tconst error = new Error(message + ' at character ' + this.index);\n\t\terror.index = this.index;\n\t\terror.description = message;\n\t\tthrow error;\n\t}\n\n\t/**\n\t * Run a given hook\n\t * @param {string} name\n\t * @param {jsep.Expression|false} [node]\n\t * @returns {?jsep.Expression}\n\t */\n\trunHook(name, node) {\n\t\tif (Jsep.hooks[name]) {\n\t\t\tconst env = { context: this, node };\n\t\t\tJsep.hooks.run(name, env);\n\t\t\treturn env.node;\n\t\t}\n\t\treturn node;\n\t}\n\n\t/**\n\t * Runs a given hook until one returns a node\n\t * @param {string} name\n\t * @returns {?jsep.Expression}\n\t */\n\tsearchHook(name) {\n\t\tif (Jsep.hooks[name]) {\n\t\t\tconst env = { context: this };\n\t\t\tJsep.hooks[name].find(function (callback) {\n\t\t\t\tcallback.call(env.context, env);\n\t\t\t\treturn env.node;\n\t\t\t});\n\t\t\treturn env.node;\n\t\t}\n\t}\n\n\t/**\n\t * Push `index` up to the next non-space character\n\t */\n\tgobbleSpaces() {\n\t\tlet ch = this.code;\n\t\t// Whitespace\n\t\twhile (ch === Jsep.SPACE_CODE\n\t\t|| ch === Jsep.TAB_CODE\n\t\t|| ch === Jsep.LF_CODE\n\t\t|| ch === Jsep.CR_CODE) {\n\t\t\tch = this.expr.charCodeAt(++this.index);\n\t\t}\n\t\tthis.runHook('gobble-spaces');\n\t}\n\n\t/**\n\t * Top-level method to parse all expressions and returns compound or single node\n\t * @returns {jsep.Expression}\n\t */\n\tparse() {\n\t\tthis.runHook('before-all');\n\t\tconst nodes = this.gobbleExpressions();\n\n\t\t// If there's only one expression just try returning the expression\n\t\tconst node = nodes.length === 1\n\t\t ? nodes[0]\n\t\t\t: {\n\t\t\t\ttype: Jsep.COMPOUND,\n\t\t\t\tbody: nodes\n\t\t\t};\n\t\treturn this.runHook('after-all', node);\n\t}\n\n\t/**\n\t * top-level parser (but can be reused within as well)\n\t * @param {number} [untilICode]\n\t * @returns {jsep.Expression[]}\n\t */\n\tgobbleExpressions(untilICode) {\n\t\tlet nodes = [], ch_i, node;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tch_i = this.code;\n\n\t\t\t// Expressions can be separated by semicolons, commas, or just inferred without any\n\t\t\t// separators\n\t\t\tif (ch_i === Jsep.SEMCOL_CODE || ch_i === Jsep.COMMA_CODE) {\n\t\t\t\tthis.index++; // ignore separators\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Try to gobble each expression individually\n\t\t\t\tif (node = this.gobbleExpression()) {\n\t\t\t\t\tnodes.push(node);\n\t\t\t\t\t// If we weren't able to find a binary expression and are out of room, then\n\t\t\t\t\t// the expression passed in probably has too much\n\t\t\t\t}\n\t\t\t\telse if (this.index < this.expr.length) {\n\t\t\t\t\tif (ch_i === untilICode) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.throwError('Unexpected \"' + this.char + '\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nodes;\n\t}\n\n\t/**\n\t * The main parsing function.\n\t * @returns {?jsep.Expression}\n\t */\n\tgobbleExpression() {\n\t\tconst node = this.searchHook('gobble-expression') || this.gobbleBinaryExpression();\n\t\tthis.gobbleSpaces();\n\n\t\treturn this.runHook('after-expression', node);\n\t}\n\n\t/**\n\t * Search for the operation portion of the string (e.g. `+`, `===`)\n\t * Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`)\n\t * and move down from 3 to 2 to 1 character until a matching binary operation is found\n\t * then, return that binary operation\n\t * @returns {string|boolean}\n\t */\n\tgobbleBinaryOp() {\n\t\tthis.gobbleSpaces();\n\t\tlet to_check = this.expr.substr(this.index, Jsep.max_binop_len);\n\t\tlet tc_len = to_check.length;\n\n\t\twhile (tc_len > 0) {\n\t\t\t// Don't accept a binary op when it is an identifier.\n\t\t\t// Binary ops that start with a identifier-valid character must be followed\n\t\t\t// by a non identifier-part valid character\n\t\t\tif (Jsep.binary_ops.hasOwnProperty(to_check) && (\n\t\t\t\t!Jsep.isIdentifierStart(this.code) ||\n\t\t\t\t(this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))\n\t\t\t)) {\n\t\t\t\tthis.index += tc_len;\n\t\t\t\treturn to_check;\n\t\t\t}\n\t\t\tto_check = to_check.substr(0, --tc_len);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * This function is responsible for gobbling an individual expression,\n\t * e.g. `1`, `1+2`, `a+(b*2)-Math.sqrt(2)`\n\t * @returns {?jsep.BinaryExpression}\n\t */\n\tgobbleBinaryExpression() {\n\t\tlet node, biop, prec, stack, biop_info, left, right, i, cur_biop;\n\n\t\t// First, try to get the leftmost thing\n\t\t// Then, check to see if there's a binary operator operating on that leftmost thing\n\t\t// Don't gobbleBinaryOp without a left-hand-side\n\t\tleft = this.gobbleToken();\n\t\tif (!left) {\n\t\t\treturn left;\n\t\t}\n\t\tbiop = this.gobbleBinaryOp();\n\n\t\t// If there wasn't a binary operator, just return the leftmost node\n\t\tif (!biop) {\n\t\t\treturn left;\n\t\t}\n\n\t\t// Otherwise, we need to start a stack to properly place the binary operations in their\n\t\t// precedence structure\n\t\tbiop_info = { value: biop, prec: Jsep.binaryPrecedence(biop), right_a: Jsep.right_associative.has(biop) };\n\n\t\tright = this.gobbleToken();\n\n\t\tif (!right) {\n\t\t\tthis.throwError(\"Expected expression after \" + biop);\n\t\t}\n\n\t\tstack = [left, biop_info, right];\n\n\t\t// Properly deal with precedence using [recursive descent](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm)\n\t\twhile ((biop = this.gobbleBinaryOp())) {\n\t\t\tprec = Jsep.binaryPrecedence(biop);\n\n\t\t\tif (prec === 0) {\n\t\t\t\tthis.index -= biop.length;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tbiop_info = { value: biop, prec, right_a: Jsep.right_associative.has(biop) };\n\n\t\t\tcur_biop = biop;\n\n\t\t\t// Reduce: make a binary expression from the three topmost entries.\n\t\t\tconst comparePrev = prev => biop_info.right_a && prev.right_a\n\t\t\t\t? prec > prev.prec\n\t\t\t\t: prec <= prev.prec;\n\t\t\twhile ((stack.length > 2) && comparePrev(stack[stack.length - 2])) {\n\t\t\t\tright = stack.pop();\n\t\t\t\tbiop = stack.pop().value;\n\t\t\t\tleft = stack.pop();\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.BINARY_EXP,\n\t\t\t\t\toperator: biop,\n\t\t\t\t\tleft,\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t\tstack.push(node);\n\t\t\t}\n\n\t\t\tnode = this.gobbleToken();\n\n\t\t\tif (!node) {\n\t\t\t\tthis.throwError(\"Expected expression after \" + cur_biop);\n\t\t\t}\n\n\t\t\tstack.push(biop_info, node);\n\t\t}\n\n\t\ti = stack.length - 1;\n\t\tnode = stack[i];\n\n\t\twhile (i > 1) {\n\t\t\tnode = {\n\t\t\t\ttype: Jsep.BINARY_EXP,\n\t\t\t\toperator: stack[i - 1].value,\n\t\t\t\tleft: stack[i - 2],\n\t\t\t\tright: node\n\t\t\t};\n\t\t\ti -= 2;\n\t\t}\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * An individual part of a binary expression:\n\t * e.g. `foo.bar(baz)`, `1`, `\"abc\"`, `(a % 2)` (because it's in parenthesis)\n\t * @returns {boolean|jsep.Expression}\n\t */\n\tgobbleToken() {\n\t\tlet ch, to_check, tc_len, node;\n\n\t\tthis.gobbleSpaces();\n\t\tnode = this.searchHook('gobble-token');\n\t\tif (node) {\n\t\t\treturn this.runHook('after-token', node);\n\t\t}\n\n\t\tch = this.code;\n\n\t\tif (Jsep.isDecimalDigit(ch) || ch === Jsep.PERIOD_CODE) {\n\t\t\t// Char code 46 is a dot `.` which can start off a numeric literal\n\t\t\treturn this.gobbleNumericLiteral();\n\t\t}\n\n\t\tif (ch === Jsep.SQUOTE_CODE || ch === Jsep.DQUOTE_CODE) {\n\t\t\t// Single or double quotes\n\t\t\tnode = this.gobbleStringLiteral();\n\t\t}\n\t\telse if (ch === Jsep.OBRACK_CODE) {\n\t\t\tnode = this.gobbleArray();\n\t\t}\n\t\telse {\n\t\t\tto_check = this.expr.substr(this.index, Jsep.max_unop_len);\n\t\t\ttc_len = to_check.length;\n\n\t\t\twhile (tc_len > 0) {\n\t\t\t\t// Don't accept an unary op when it is an identifier.\n\t\t\t\t// Unary ops that start with a identifier-valid character must be followed\n\t\t\t\t// by a non identifier-part valid character\n\t\t\t\tif (Jsep.unary_ops.hasOwnProperty(to_check) && (\n\t\t\t\t\t!Jsep.isIdentifierStart(this.code) ||\n\t\t\t\t\t(this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))\n\t\t\t\t)) {\n\t\t\t\t\tthis.index += tc_len;\n\t\t\t\t\tconst argument = this.gobbleToken();\n\t\t\t\t\tif (!argument) {\n\t\t\t\t\t\tthis.throwError('missing unaryOp argument');\n\t\t\t\t\t}\n\t\t\t\t\treturn this.runHook('after-token', {\n\t\t\t\t\t\ttype: Jsep.UNARY_EXP,\n\t\t\t\t\t\toperator: to_check,\n\t\t\t\t\t\targument,\n\t\t\t\t\t\tprefix: true\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tto_check = to_check.substr(0, --tc_len);\n\t\t\t}\n\n\t\t\tif (Jsep.isIdentifierStart(ch)) {\n\t\t\t\tnode = this.gobbleIdentifier();\n\t\t\t\tif (Jsep.literals.hasOwnProperty(node.name)) {\n\t\t\t\t\tnode = {\n\t\t\t\t\t\ttype: Jsep.LITERAL,\n\t\t\t\t\t\tvalue: Jsep.literals[node.name],\n\t\t\t\t\t\traw: node.name,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\telse if (node.name === Jsep.this_str) {\n\t\t\t\t\tnode = { type: Jsep.THIS_EXP };\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (ch === Jsep.OPAREN_CODE) { // open parenthesis\n\t\t\t\tnode = this.gobbleGroup();\n\t\t\t}\n\t\t}\n\n\t\tif (!node) {\n\t\t\treturn this.runHook('after-token', false);\n\t\t}\n\n\t\tnode = this.gobbleTokenProperty(node);\n\t\treturn this.runHook('after-token', node);\n\t}\n\n\t/**\n\t * Gobble properties of of identifiers/strings/arrays/groups.\n\t * e.g. `foo`, `bar.baz`, `foo['bar'].baz`\n\t * It also gobbles function calls:\n\t * e.g. `Math.acos(obj.angle)`\n\t * @param {jsep.Expression} node\n\t * @returns {jsep.Expression}\n\t */\n\tgobbleTokenProperty(node) {\n\t\tthis.gobbleSpaces();\n\n\t\tlet ch = this.code;\n\t\twhile (ch === Jsep.PERIOD_CODE || ch === Jsep.OBRACK_CODE || ch === Jsep.OPAREN_CODE || ch === Jsep.QUMARK_CODE) {\n\t\t\tlet optional;\n\t\t\tif (ch === Jsep.QUMARK_CODE) {\n\t\t\t\tif (this.expr.charCodeAt(this.index + 1) !== Jsep.PERIOD_CODE) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\toptional = true;\n\t\t\t\tthis.index += 2;\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tch = this.code;\n\t\t\t}\n\t\t\tthis.index++;\n\n\t\t\tif (ch === Jsep.OBRACK_CODE) {\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.MEMBER_EXP,\n\t\t\t\t\tcomputed: true,\n\t\t\t\t\tobject: node,\n\t\t\t\t\tproperty: this.gobbleExpression()\n\t\t\t\t};\n\t\t\t\tif (!node.property) {\n\t\t\t\t\tthis.throwError('Unexpected \"' + this.char + '\"');\n\t\t\t\t}\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tch = this.code;\n\t\t\t\tif (ch !== Jsep.CBRACK_CODE) {\n\t\t\t\t\tthis.throwError('Unclosed [');\n\t\t\t\t}\n\t\t\t\tthis.index++;\n\t\t\t}\n\t\t\telse if (ch === Jsep.OPAREN_CODE) {\n\t\t\t\t// A function call is being made; gobble all the arguments\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.CALL_EXP,\n\t\t\t\t\t'arguments': this.gobbleArguments(Jsep.CPAREN_CODE),\n\t\t\t\t\tcallee: node\n\t\t\t\t};\n\t\t\t}\n\t\t\telse if (ch === Jsep.PERIOD_CODE || optional) {\n\t\t\t\tif (optional) {\n\t\t\t\t\tthis.index--;\n\t\t\t\t}\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.MEMBER_EXP,\n\t\t\t\t\tcomputed: false,\n\t\t\t\t\tobject: node,\n\t\t\t\t\tproperty: this.gobbleIdentifier(),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (optional) {\n\t\t\t\tnode.optional = true;\n\t\t\t} // else leave undefined for compatibility with esprima\n\n\t\t\tthis.gobbleSpaces();\n\t\t\tch = this.code;\n\t\t}\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to\n\t * keep track of everything in the numeric literal and then calling `parseFloat` on that string\n\t * @returns {jsep.Literal}\n\t */\n\tgobbleNumericLiteral() {\n\t\tlet number = '', ch, chCode;\n\n\t\twhile (Jsep.isDecimalDigit(this.code)) {\n\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t}\n\n\t\tif (this.code === Jsep.PERIOD_CODE) { // can start with a decimal marker\n\t\t\tnumber += this.expr.charAt(this.index++);\n\n\t\t\twhile (Jsep.isDecimalDigit(this.code)) {\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\t\t}\n\n\t\tch = this.char;\n\n\t\tif (ch === 'e' || ch === 'E') { // exponent marker\n\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\tch = this.char;\n\n\t\t\tif (ch === '+' || ch === '-') { // exponent sign\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\n\t\t\twhile (Jsep.isDecimalDigit(this.code)) { // exponent itself\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\n\t\t\tif (!Jsep.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) ) {\n\t\t\t\tthis.throwError('Expected exponent (' + number + this.char + ')');\n\t\t\t}\n\t\t}\n\n\t\tchCode = this.code;\n\n\t\t// Check to make sure this isn't a variable name that start with a number (123abc)\n\t\tif (Jsep.isIdentifierStart(chCode)) {\n\t\t\tthis.throwError('Variable names cannot start with a number (' +\n\t\t\t\tnumber + this.char + ')');\n\t\t}\n\t\telse if (chCode === Jsep.PERIOD_CODE || (number.length === 1 && number.charCodeAt(0) === Jsep.PERIOD_CODE)) {\n\t\t\tthis.throwError('Unexpected period');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Jsep.LITERAL,\n\t\t\tvalue: parseFloat(number),\n\t\t\traw: number\n\t\t};\n\t}\n\n\t/**\n\t * Parses a string literal, staring with single or double quotes with basic support for escape codes\n\t * e.g. `\"hello world\"`, `'this is\\nJSEP'`\n\t * @returns {jsep.Literal}\n\t */\n\tgobbleStringLiteral() {\n\t\tlet str = '';\n\t\tconst startIndex = this.index;\n\t\tconst quote = this.expr.charAt(this.index++);\n\t\tlet closed = false;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tlet ch = this.expr.charAt(this.index++);\n\n\t\t\tif (ch === quote) {\n\t\t\t\tclosed = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (ch === '\\\\') {\n\t\t\t\t// Check for all of the common escape codes\n\t\t\t\tch = this.expr.charAt(this.index++);\n\n\t\t\t\tswitch (ch) {\n\t\t\t\t\tcase 'n': str += '\\n'; break;\n\t\t\t\t\tcase 'r': str += '\\r'; break;\n\t\t\t\t\tcase 't': str += '\\t'; break;\n\t\t\t\t\tcase 'b': str += '\\b'; break;\n\t\t\t\t\tcase 'f': str += '\\f'; break;\n\t\t\t\t\tcase 'v': str += '\\x0B'; break;\n\t\t\t\t\tdefault : str += ch;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tstr += ch;\n\t\t\t}\n\t\t}\n\n\t\tif (!closed) {\n\t\t\tthis.throwError('Unclosed quote after \"' + str + '\"');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Jsep.LITERAL,\n\t\t\tvalue: str,\n\t\t\traw: this.expr.substring(startIndex, this.index),\n\t\t};\n\t}\n\n\t/**\n\t * Gobbles only identifiers\n\t * e.g.: `foo`, `_value`, `$x1`\n\t * Also, this function checks if that identifier is a literal:\n\t * (e.g. `true`, `false`, `null`) or `this`\n\t * @returns {jsep.Identifier}\n\t */\n\tgobbleIdentifier() {\n\t\tlet ch = this.code, start = this.index;\n\n\t\tif (Jsep.isIdentifierStart(ch)) {\n\t\t\tthis.index++;\n\t\t}\n\t\telse {\n\t\t\tthis.throwError('Unexpected ' + this.char);\n\t\t}\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tch = this.code;\n\n\t\t\tif (Jsep.isIdentifierPart(ch)) {\n\t\t\t\tthis.index++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\ttype: Jsep.IDENTIFIER,\n\t\t\tname: this.expr.slice(start, this.index),\n\t\t};\n\t}\n\n\t/**\n\t * Gobbles a list of arguments within the context of a function call\n\t * or array literal. This function also assumes that the opening character\n\t * `(` or `[` has already been gobbled, and gobbles expressions and commas\n\t * until the terminator character `)` or `]` is encountered.\n\t * e.g. `foo(bar, baz)`, `my_func()`, or `[bar, baz]`\n\t * @param {number} termination\n\t * @returns {jsep.Expression[]}\n\t */\n\tgobbleArguments(termination) {\n\t\tconst args = [];\n\t\tlet closed = false;\n\t\tlet separator_count = 0;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tthis.gobbleSpaces();\n\t\t\tlet ch_i = this.code;\n\n\t\t\tif (ch_i === termination) { // done parsing\n\t\t\t\tclosed = true;\n\t\t\t\tthis.index++;\n\n\t\t\t\tif (termination === Jsep.CPAREN_CODE && separator_count && separator_count >= args.length){\n\t\t\t\t\tthis.throwError('Unexpected token ' + String.fromCharCode(termination));\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (ch_i === Jsep.COMMA_CODE) { // between expressions\n\t\t\t\tthis.index++;\n\t\t\t\tseparator_count++;\n\n\t\t\t\tif (separator_count !== args.length) { // missing argument\n\t\t\t\t\tif (termination === Jsep.CPAREN_CODE) {\n\t\t\t\t\t\tthis.throwError('Unexpected token ,');\n\t\t\t\t\t}\n\t\t\t\t\telse if (termination === Jsep.CBRACK_CODE) {\n\t\t\t\t\t\tfor (let arg = args.length; arg < separator_count; arg++) {\n\t\t\t\t\t\t\targs.push(null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (args.length !== separator_count && separator_count !== 0) {\n\t\t\t\t// NOTE: `&& separator_count !== 0` allows for either all commas, or all spaces as arguments\n\t\t\t\tthis.throwError('Expected comma');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst node = this.gobbleExpression();\n\n\t\t\t\tif (!node || node.type === Jsep.COMPOUND) {\n\t\t\t\t\tthis.throwError('Expected comma');\n\t\t\t\t}\n\n\t\t\t\targs.push(node);\n\t\t\t}\n\t\t}\n\n\t\tif (!closed) {\n\t\t\tthis.throwError('Expected ' + String.fromCharCode(termination));\n\t\t}\n\n\t\treturn args;\n\t}\n\n\t/**\n\t * Responsible for parsing a group of things within parentheses `()`\n\t * that have no identifier in front (so not a function call)\n\t * This function assumes that it needs to gobble the opening parenthesis\n\t * and then tries to gobble everything within that parenthesis, assuming\n\t * that the next thing it should see is the close parenthesis. If not,\n\t * then the expression probably doesn't have a `)`\n\t * @returns {boolean|jsep.Expression}\n\t */\n\tgobbleGroup() {\n\t\tthis.index++;\n\t\tlet nodes = this.gobbleExpressions(Jsep.CPAREN_CODE);\n\t\tif (this.code === Jsep.CPAREN_CODE) {\n\t\t\tthis.index++;\n\t\t\tif (nodes.length === 1) {\n\t\t\t\treturn nodes[0];\n\t\t\t}\n\t\t\telse if (!nodes.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn {\n\t\t\t\t\ttype: Jsep.SEQUENCE_EXP,\n\t\t\t\t\texpressions: nodes,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis.throwError('Unclosed (');\n\t\t}\n\t}\n\n\t/**\n\t * Responsible for parsing Array literals `[1, 2, 3]`\n\t * This function assumes that it needs to gobble the opening bracket\n\t * and then tries to gobble the expressions as arguments.\n\t * @returns {jsep.ArrayExpression}\n\t */\n\tgobbleArray() {\n\t\tthis.index++;\n\n\t\treturn {\n\t\t\ttype: Jsep.ARRAY_EXP,\n\t\t\telements: this.gobbleArguments(Jsep.CBRACK_CODE)\n\t\t};\n\t}\n}\n\n// Static fields:\nconst hooks = new Hooks();\nObject.assign(Jsep, {\n\thooks,\n\tplugins: new Plugins(Jsep),\n\n\t// Node Types\n\t// ----------\n\t// This is the full set of types that any JSEP node can be.\n\t// Store them here to save space when minified\n\tCOMPOUND: 'Compound',\n\tSEQUENCE_EXP: 'SequenceExpression',\n\tIDENTIFIER: 'Identifier',\n\tMEMBER_EXP: 'MemberExpression',\n\tLITERAL: 'Literal',\n\tTHIS_EXP: 'ThisExpression',\n\tCALL_EXP: 'CallExpression',\n\tUNARY_EXP: 'UnaryExpression',\n\tBINARY_EXP: 'BinaryExpression',\n\tARRAY_EXP: 'ArrayExpression',\n\n\tTAB_CODE: 9,\n\tLF_CODE: 10,\n\tCR_CODE: 13,\n\tSPACE_CODE: 32,\n\tPERIOD_CODE: 46, // '.'\n\tCOMMA_CODE: 44, // ','\n\tSQUOTE_CODE: 39, // single quote\n\tDQUOTE_CODE: 34, // double quotes\n\tOPAREN_CODE: 40, // (\n\tCPAREN_CODE: 41, // )\n\tOBRACK_CODE: 91, // [\n\tCBRACK_CODE: 93, // ]\n\tQUMARK_CODE: 63, // ?\n\tSEMCOL_CODE: 59, // ;\n\tCOLON_CODE: 58, // :\n\n\n\t// Operations\n\t// ----------\n\t// Use a quickly-accessible map to store all of the unary operators\n\t// Values are set to `1` (it really doesn't matter)\n\tunary_ops: {\n\t\t'-': 1,\n\t\t'!': 1,\n\t\t'~': 1,\n\t\t'+': 1\n\t},\n\n\t// Also use a map for the binary operations but set their values to their\n\t// binary precedence for quick reference (higher number = higher precedence)\n\t// see [Order of operations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)\n\tbinary_ops: {\n\t\t'||': 1, '??': 1,\n\t\t'&&': 2, '|': 3, '^': 4, '&': 5,\n\t\t'==': 6, '!=': 6, '===': 6, '!==': 6,\n\t\t'<': 7, '>': 7, '<=': 7, '>=': 7,\n\t\t'<<': 8, '>>': 8, '>>>': 8,\n\t\t'+': 9, '-': 9,\n\t\t'*': 10, '/': 10, '%': 10,\n\t\t'**': 11,\n\t},\n\n\t// sets specific binary_ops as right-associative\n\tright_associative: new Set(['**']),\n\n\t// Additional valid identifier chars, apart from a-z, A-Z and 0-9 (except on the starting char)\n\tadditional_identifier_chars: new Set(['$', '_']),\n\n\t// Literals\n\t// ----------\n\t// Store the values to return for the various literals we may encounter\n\tliterals: {\n\t\t'true': true,\n\t\t'false': false,\n\t\t'null': null\n\t},\n\n\t// Except for `this`, which is special. This could be changed to something like `'self'` as well\n\tthis_str: 'this',\n});\nJsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);\nJsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);\n\n// Backward Compatibility:\nconst jsep = expr => (new Jsep(expr)).parse();\nconst stdClassProps = Object.getOwnPropertyNames(class Test{});\nObject.getOwnPropertyNames(Jsep)\n\t.filter(prop => !stdClassProps.includes(prop) && jsep[prop] === undefined)\n\t.forEach((m) => {\n\t\tjsep[m] = Jsep[m];\n\t});\njsep.Jsep = Jsep; // allows for const { Jsep } = require('jsep');\n\nconst CONDITIONAL_EXP = 'ConditionalExpression';\n\nvar ternary = {\n\tname: 'ternary',\n\n\tinit(jsep) {\n\t\t// Ternary expression: test ? consequent : alternate\n\t\tjsep.hooks.add('after-expression', function gobbleTernary(env) {\n\t\t\tif (env.node && this.code === jsep.QUMARK_CODE) {\n\t\t\t\tthis.index++;\n\t\t\t\tconst test = env.node;\n\t\t\t\tconst consequent = this.gobbleExpression();\n\n\t\t\t\tif (!consequent) {\n\t\t\t\t\tthis.throwError('Expected expression');\n\t\t\t\t}\n\n\t\t\t\tthis.gobbleSpaces();\n\n\t\t\t\tif (this.code === jsep.COLON_CODE) {\n\t\t\t\t\tthis.index++;\n\t\t\t\t\tconst alternate = this.gobbleExpression();\n\n\t\t\t\t\tif (!alternate) {\n\t\t\t\t\t\tthis.throwError('Expected expression');\n\t\t\t\t\t}\n\t\t\t\t\tenv.node = {\n\t\t\t\t\t\ttype: CONDITIONAL_EXP,\n\t\t\t\t\t\ttest,\n\t\t\t\t\t\tconsequent,\n\t\t\t\t\t\talternate,\n\t\t\t\t\t};\n\n\t\t\t\t\t// check for operators of higher priority than ternary (i.e. assignment)\n\t\t\t\t\t// jsep sets || at 1, and assignment at 0.9, and conditional should be between them\n\t\t\t\t\tif (test.operator && jsep.binary_ops[test.operator] <= 0.9) {\n\t\t\t\t\t\tlet newTest = test;\n\t\t\t\t\t\twhile (newTest.right.operator && jsep.binary_ops[newTest.right.operator] <= 0.9) {\n\t\t\t\t\t\t\tnewTest = newTest.right;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenv.node.test = newTest.right;\n\t\t\t\t\t\tnewTest.right = env.node;\n\t\t\t\t\t\tenv.node = test;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.throwError('Expected :');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t},\n};\n\n// Add default plugins:\n\njsep.plugins.register(ternary);\n\nexport { Jsep, jsep as default };\n","const FSLASH_CODE = 47; // '/'\nconst BSLASH_CODE = 92; // '\\\\'\n\nvar index = {\n\tname: 'regex',\n\n\tinit(jsep) {\n\t\t// Regex literal: /abc123/ig\n\t\tjsep.hooks.add('gobble-token', function gobbleRegexLiteral(env) {\n\t\t\tif (this.code === FSLASH_CODE) {\n\t\t\t\tconst patternIndex = ++this.index;\n\n\t\t\t\tlet inCharSet = false;\n\t\t\t\twhile (this.index < this.expr.length) {\n\t\t\t\t\tif (this.code === FSLASH_CODE && !inCharSet) {\n\t\t\t\t\t\tconst pattern = this.expr.slice(patternIndex, this.index);\n\n\t\t\t\t\t\tlet flags = '';\n\t\t\t\t\t\twhile (++this.index < this.expr.length) {\n\t\t\t\t\t\t\tconst code = this.code;\n\t\t\t\t\t\t\tif ((code >= 97 && code <= 122) // a...z\n\t\t\t\t\t\t\t\t|| (code >= 65 && code <= 90) // A...Z\n\t\t\t\t\t\t\t\t|| (code >= 48 && code <= 57)) { // 0-9\n\t\t\t\t\t\t\t\tflags += this.char;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet value;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvalue = new RegExp(pattern, flags);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\t\tthis.throwError(e.message);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tenv.node = {\n\t\t\t\t\t\t\ttype: jsep.LITERAL,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\traw: this.expr.slice(patternIndex - 1, this.index),\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// allow . [] and () after regex: /regex/.test(a)\n\t\t\t\t\t\tenv.node = this.gobbleTokenProperty(env.node);\n\t\t\t\t\t\treturn env.node;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.code === jsep.OBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = true;\n\t\t\t\t\t}\n\t\t\t\t\telse if (inCharSet && this.code === jsep.CBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = false;\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += this.code === BSLASH_CODE ? 2 : 1;\n\t\t\t\t}\n\t\t\t\tthis.throwError('Unclosed Regex');\n\t\t\t}\n\t\t});\n\t},\n};\n\nexport { index as default };\n","const PLUS_CODE = 43; // +\nconst MINUS_CODE = 45; // -\n\nconst plugin = {\n\tname: 'assignment',\n\n\tassignmentOperators: new Set([\n\t\t'=',\n\t\t'*=',\n\t\t'**=',\n\t\t'/=',\n\t\t'%=',\n\t\t'+=',\n\t\t'-=',\n\t\t'<<=',\n\t\t'>>=',\n\t\t'>>>=',\n\t\t'&=',\n\t\t'^=',\n\t\t'|=',\n\t\t'||=',\n\t\t'&&=',\n\t\t'??=',\n\t]),\n\tupdateOperators: [PLUS_CODE, MINUS_CODE],\n\tassignmentPrecedence: 0.9,\n\n\tinit(jsep) {\n\t\tconst updateNodeTypes = [jsep.IDENTIFIER, jsep.MEMBER_EXP];\n\t\tplugin.assignmentOperators.forEach(op => jsep.addBinaryOp(op, plugin.assignmentPrecedence, true));\n\n\t\tjsep.hooks.add('gobble-token', function gobbleUpdatePrefix(env) {\n\t\t\tconst code = this.code;\n\t\t\tif (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {\n\t\t\t\tthis.index += 2;\n\t\t\t\tenv.node = {\n\t\t\t\t\ttype: 'UpdateExpression',\n\t\t\t\t\toperator: code === PLUS_CODE ? '++' : '--',\n\t\t\t\t\targument: this.gobbleTokenProperty(this.gobbleIdentifier()),\n\t\t\t\t\tprefix: true,\n\t\t\t\t};\n\t\t\t\tif (!env.node.argument || !updateNodeTypes.includes(env.node.argument.type)) {\n\t\t\t\t\tthis.throwError(`Unexpected ${env.node.operator}`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tjsep.hooks.add('after-token', function gobbleUpdatePostfix(env) {\n\t\t\tif (env.node) {\n\t\t\t\tconst code = this.code;\n\t\t\t\tif (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {\n\t\t\t\t\tif (!updateNodeTypes.includes(env.node.type)) {\n\t\t\t\t\t\tthis.throwError(`Unexpected ${env.node.operator}`);\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += 2;\n\t\t\t\t\tenv.node = {\n\t\t\t\t\t\ttype: 'UpdateExpression',\n\t\t\t\t\t\toperator: code === PLUS_CODE ? '++' : '--',\n\t\t\t\t\t\targument: env.node,\n\t\t\t\t\t\tprefix: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tjsep.hooks.add('after-expression', function gobbleAssignment(env) {\n\t\t\tif (env.node) {\n\t\t\t\t// Note: Binaries can be chained in a single expression to respect\n\t\t\t\t// operator precedence (i.e. a = b = 1 + 2 + 3)\n\t\t\t\t// Update all binary assignment nodes in the tree\n\t\t\t\tupdateBinariesToAssignments(env.node);\n\t\t\t}\n\t\t});\n\n\t\tfunction updateBinariesToAssignments(node) {\n\t\t\tif (plugin.assignmentOperators.has(node.operator)) {\n\t\t\t\tnode.type = 'AssignmentExpression';\n\t\t\t\tupdateBinariesToAssignments(node.left);\n\t\t\t\tupdateBinariesToAssignments(node.right);\n\t\t\t}\n\t\t\telse if (!node.operator) {\n\t\t\t\tObject.values(node).forEach((val) => {\n\t\t\t\t\tif (val && typeof val === 'object') {\n\t\t\t\t\t\tupdateBinariesToAssignments(val);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n};\n\nexport { plugin as default };\n","/* eslint-disable no-bitwise -- Convenient */\nimport jsep from 'jsep';\nimport jsepRegex from '@jsep-plugin/regex';\nimport jsepAssignment from '@jsep-plugin/assignment';\n\n// register plugins\njsep.plugins.register(jsepRegex, jsepAssignment);\njsep.addUnaryOp('typeof');\njsep.addUnaryOp('void');\njsep.addLiteral('null', null);\njsep.addLiteral('undefined', undefined);\n\nconst BLOCKED_PROTO_PROPERTIES = new Set([\n 'constructor',\n '__proto__',\n '__defineGetter__',\n '__defineSetter__',\n '__lookupGetter__',\n '__lookupSetter__'\n]);\n\nconst SafeEval = {\n /**\n * @param {jsep.Expression} ast\n * @param {Record} subs\n */\n evalAst (ast, subs) {\n switch (ast.type) {\n case 'BinaryExpression':\n case 'LogicalExpression':\n return SafeEval.evalBinaryExpression(ast, subs);\n case 'Compound':\n return SafeEval.evalCompound(ast, subs);\n case 'ConditionalExpression':\n return SafeEval.evalConditionalExpression(ast, subs);\n case 'Identifier':\n return SafeEval.evalIdentifier(ast, subs);\n case 'Literal':\n return SafeEval.evalLiteral(ast, subs);\n case 'MemberExpression':\n return SafeEval.evalMemberExpression(ast, subs);\n case 'UnaryExpression':\n return SafeEval.evalUnaryExpression(ast, subs);\n case 'ArrayExpression':\n return SafeEval.evalArrayExpression(ast, subs);\n case 'CallExpression':\n return SafeEval.evalCallExpression(ast, subs);\n case 'AssignmentExpression':\n return SafeEval.evalAssignmentExpression(ast, subs);\n default:\n throw SyntaxError('Unexpected expression', ast);\n }\n },\n evalBinaryExpression (ast, subs) {\n const result = {\n '||': (a, b) => a || b(),\n '&&': (a, b) => a && b(),\n '|': (a, b) => a | b(),\n '^': (a, b) => a ^ b(),\n '&': (a, b) => a & b(),\n // eslint-disable-next-line eqeqeq -- API\n '==': (a, b) => a == b(),\n // eslint-disable-next-line eqeqeq -- API\n '!=': (a, b) => a != b(),\n '===': (a, b) => a === b(),\n '!==': (a, b) => a !== b(),\n '<': (a, b) => a < b(),\n '>': (a, b) => a > b(),\n '<=': (a, b) => a <= b(),\n '>=': (a, b) => a >= b(),\n '<<': (a, b) => a << b(),\n '>>': (a, b) => a >> b(),\n '>>>': (a, b) => a >>> b(),\n '+': (a, b) => a + b(),\n '-': (a, b) => a - b(),\n '*': (a, b) => a * b(),\n '/': (a, b) => a / b(),\n '%': (a, b) => a % b()\n }[ast.operator](\n SafeEval.evalAst(ast.left, subs),\n () => SafeEval.evalAst(ast.right, subs)\n );\n return result;\n },\n evalCompound (ast, subs) {\n let last;\n for (let i = 0; i < ast.body.length; i++) {\n if (\n ast.body[i].type === 'Identifier' &&\n ['var', 'let', 'const'].includes(ast.body[i].name) &&\n ast.body[i + 1] &&\n ast.body[i + 1].type === 'AssignmentExpression'\n ) {\n // var x=2; is detected as\n // [{Identifier var}, {AssignmentExpression x=2}]\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient\n i += 1;\n }\n const expr = ast.body[i];\n last = SafeEval.evalAst(expr, subs);\n }\n return last;\n },\n evalConditionalExpression (ast, subs) {\n if (SafeEval.evalAst(ast.test, subs)) {\n return SafeEval.evalAst(ast.consequent, subs);\n }\n return SafeEval.evalAst(ast.alternate, subs);\n },\n evalIdentifier (ast, subs) {\n if (Object.hasOwn(subs, ast.name)) {\n return subs[ast.name];\n }\n throw ReferenceError(`${ast.name} is not defined`);\n },\n evalLiteral (ast) {\n return ast.value;\n },\n evalMemberExpression (ast, subs) {\n const prop = String(\n // NOTE: `String(value)` throws error when\n // value has overwritten the toString method to return non-string\n // i.e. `value = {toString: () => []}`\n ast.computed\n ? SafeEval.evalAst(ast.property) // `object[property]`\n : ast.property.name // `object.property` property is Identifier\n );\n const obj = SafeEval.evalAst(ast.object, subs);\n if (obj === undefined || obj === null) {\n throw TypeError(\n `Cannot read properties of ${obj} (reading '${prop}')`\n );\n }\n if (!Object.hasOwn(obj, prop) && BLOCKED_PROTO_PROPERTIES.has(prop)) {\n throw TypeError(\n `Cannot read properties of ${obj} (reading '${prop}')`\n );\n }\n const result = obj[prop];\n if (typeof result === 'function' && result !== Function) {\n return result.bind(obj); // arrow functions aren't affected by bind.\n }\n return result;\n },\n evalUnaryExpression (ast, subs) {\n const result = {\n '-': (a) => -SafeEval.evalAst(a, subs),\n '!': (a) => !SafeEval.evalAst(a, subs),\n '~': (a) => ~SafeEval.evalAst(a, subs),\n // eslint-disable-next-line no-implicit-coercion -- API\n '+': (a) => +SafeEval.evalAst(a, subs),\n typeof: (a) => typeof SafeEval.evalAst(a, subs),\n // eslint-disable-next-line no-void, sonarjs/void-use -- feature\n void: (a) => void SafeEval.evalAst(a, subs)\n }[ast.operator](ast.argument);\n return result;\n },\n evalArrayExpression (ast, subs) {\n return ast.elements.map((el) => SafeEval.evalAst(el, subs));\n },\n evalCallExpression (ast, subs) {\n const args = ast.arguments.map((arg) => SafeEval.evalAst(arg, subs));\n const func = SafeEval.evalAst(ast.callee, subs);\n if (func === Function) {\n throw new Error('Function constructor is disabled');\n }\n return func(...args);\n },\n evalAssignmentExpression (ast, subs) {\n if (ast.left.type !== 'Identifier') {\n throw SyntaxError('Invalid left-hand side in assignment');\n }\n const id = ast.left.name;\n const value = SafeEval.evalAst(ast.right, subs);\n subs[id] = value;\n return subs[id];\n }\n};\n\n/**\n * A replacement for NodeJS' VM.Script which is also {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | Content Security Policy} friendly.\n */\nclass SafeScript {\n /**\n * @param {string} expr Expression to evaluate\n */\n constructor (expr) {\n this.code = expr;\n this.ast = jsep(this.code);\n }\n\n /**\n * @param {object} context Object whose items will be added\n * to evaluation\n * @returns {EvaluatedResult} Result of evaluated code\n */\n runInNewContext (context) {\n // `Object.create(null)` creates a prototypeless object\n const keyMap = Object.assign(Object.create(null), context);\n return SafeEval.evalAst(this.ast, keyMap);\n }\n}\n\nexport {SafeScript};\n","/* eslint-disable camelcase -- Convenient for escaping */\n\nimport {SafeScript} from './Safe-Script.js';\n\n/**\n * @typedef {null|boolean|number|string|object|GenericArray} JSONObject\n */\n\n/**\n * @typedef {any} AnyItem\n */\n\n/**\n * @typedef {any} AnyResult\n */\n\n/**\n * Copies array and then pushes item into it.\n * @param {GenericArray} arr Array to copy and into which to push\n * @param {AnyItem} item Array item to add (to end)\n * @returns {GenericArray} Copy of the original array\n */\nfunction push (arr, item) {\n arr = arr.slice();\n arr.push(item);\n return arr;\n}\n/**\n * Copies array and then unshifts item into it.\n * @param {AnyItem} item Array item to add (to beginning)\n * @param {GenericArray} arr Array to copy and into which to unshift\n * @returns {GenericArray} Copy of the original array\n */\nfunction unshift (item, arr) {\n arr = arr.slice();\n arr.unshift(item);\n return arr;\n}\n\n/**\n * Caught when JSONPath is used without `new` but rethrown if with `new`\n * @extends Error\n */\nclass NewError extends Error {\n /**\n * @param {AnyResult} value The evaluated scalar value\n */\n constructor (value) {\n super(\n 'JSONPath should not be called with \"new\" (it prevents return ' +\n 'of (unwrapped) scalar values)'\n );\n this.avoidNew = true;\n this.value = value;\n this.name = 'NewError';\n }\n}\n\n/**\n* @typedef {object} ReturnObject\n* @property {string} path\n* @property {JSONObject} value\n* @property {object|GenericArray} parent\n* @property {string} parentProperty\n*/\n\n/**\n* @callback JSONPathCallback\n* @param {string|object} preferredOutput\n* @param {\"value\"|\"property\"} type\n* @param {ReturnObject} fullRetObj\n* @returns {void}\n*/\n\n/**\n* @callback OtherTypeCallback\n* @param {JSONObject} val\n* @param {string} path\n* @param {object|GenericArray} parent\n* @param {string} parentPropName\n* @returns {boolean}\n*/\n\n/**\n * @typedef {any} ContextItem\n */\n\n/**\n * @typedef {any} EvaluatedResult\n */\n\n/**\n* @callback EvalCallback\n* @param {string} code\n* @param {ContextItem} context\n* @returns {EvaluatedResult}\n*/\n\n/**\n * @typedef {typeof SafeScript} EvalClass\n */\n\n/**\n * @typedef {object} JSONPathOptions\n * @property {JSON} json\n * @property {string|string[]} path\n * @property {\"value\"|\"path\"|\"pointer\"|\"parent\"|\"parentProperty\"|\n * \"all\"} [resultType=\"value\"]\n * @property {boolean} [flatten=false]\n * @property {boolean} [wrap=true]\n * @property {object} [sandbox={}]\n * @property {EvalCallback|EvalClass|'safe'|'native'|\n * boolean} [eval = 'safe']\n * @property {object|GenericArray|null} [parent=null]\n * @property {string|null} [parentProperty=null]\n * @property {JSONPathCallback} [callback]\n * @property {OtherTypeCallback} [otherTypeCallback] Defaults to\n * function which throws on encountering `@other`\n * @property {boolean} [autostart=true]\n */\n\n/**\n * @param {string|JSONPathOptions} opts If a string, will be treated as `expr`\n * @param {string} [expr] JSON path to evaluate\n * @param {JSON} [obj] JSON object to evaluate against\n * @param {JSONPathCallback} [callback] Passed 3 arguments: 1) desired payload\n * per `resultType`, 2) `\"value\"|\"property\"`, 3) Full returned object with\n * all payloads\n * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the end\n * of one's query, this will be invoked with the value of the item, its\n * path, its parent, and its parent's property name, and it should return\n * a boolean indicating whether the supplied value belongs to the \"other\"\n * type or not (or it may handle transformations and return `false`).\n * @returns {JSONPath}\n * @class\n */\nfunction JSONPath (opts, expr, obj, callback, otherTypeCallback) {\n // eslint-disable-next-line no-restricted-syntax -- Allow for pseudo-class\n if (!(this instanceof JSONPath)) {\n try {\n return new JSONPath(opts, expr, obj, callback, otherTypeCallback);\n } catch (e) {\n if (!e.avoidNew) {\n throw e;\n }\n return e.value;\n }\n }\n\n if (typeof opts === 'string') {\n otherTypeCallback = callback;\n callback = obj;\n obj = expr;\n expr = opts;\n opts = null;\n }\n const optObj = opts && typeof opts === 'object';\n opts = opts || {};\n this.json = opts.json || obj;\n this.path = opts.path || expr;\n this.resultType = opts.resultType || 'value';\n this.flatten = opts.flatten || false;\n this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true;\n this.sandbox = opts.sandbox || {};\n this.eval = opts.eval === undefined ? 'safe' : opts.eval;\n this.ignoreEvalErrors = (typeof opts.ignoreEvalErrors === 'undefined')\n ? false\n : opts.ignoreEvalErrors;\n this.parent = opts.parent || null;\n this.parentProperty = opts.parentProperty || null;\n this.callback = opts.callback || callback || null;\n this.otherTypeCallback = opts.otherTypeCallback ||\n otherTypeCallback ||\n function () {\n throw new TypeError(\n 'You must supply an otherTypeCallback callback option ' +\n 'with the @other() operator.'\n );\n };\n\n if (opts.autostart !== false) {\n const args = {\n path: (optObj ? opts.path : expr)\n };\n if (!optObj) {\n args.json = obj;\n } else if ('json' in opts) {\n args.json = opts.json;\n }\n const ret = this.evaluate(args);\n if (!ret || typeof ret !== 'object') {\n throw new NewError(ret);\n }\n return ret;\n }\n}\n\n// PUBLIC METHODS\nJSONPath.prototype.evaluate = function (\n expr, json, callback, otherTypeCallback\n) {\n let currParent = this.parent,\n currParentProperty = this.parentProperty;\n let {flatten, wrap} = this;\n\n this.currResultType = this.resultType;\n this.currEval = this.eval;\n this.currSandbox = this.sandbox;\n callback = callback || this.callback;\n this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback;\n\n json = json || this.json;\n expr = expr || this.path;\n if (expr && typeof expr === 'object' && !Array.isArray(expr)) {\n if (!expr.path && expr.path !== '') {\n throw new TypeError(\n 'You must supply a \"path\" property when providing an object ' +\n 'argument to JSONPath.evaluate().'\n );\n }\n if (!(Object.hasOwn(expr, 'json'))) {\n throw new TypeError(\n 'You must supply a \"json\" property when providing an object ' +\n 'argument to JSONPath.evaluate().'\n );\n }\n ({json} = expr);\n flatten = Object.hasOwn(expr, 'flatten') ? expr.flatten : flatten;\n this.currResultType = Object.hasOwn(expr, 'resultType')\n ? expr.resultType\n : this.currResultType;\n this.currSandbox = Object.hasOwn(expr, 'sandbox')\n ? expr.sandbox\n : this.currSandbox;\n wrap = Object.hasOwn(expr, 'wrap') ? expr.wrap : wrap;\n this.currEval = Object.hasOwn(expr, 'eval')\n ? expr.eval\n : this.currEval;\n callback = Object.hasOwn(expr, 'callback') ? expr.callback : callback;\n this.currOtherTypeCallback = Object.hasOwn(expr, 'otherTypeCallback')\n ? expr.otherTypeCallback\n : this.currOtherTypeCallback;\n currParent = Object.hasOwn(expr, 'parent') ? expr.parent : currParent;\n currParentProperty = Object.hasOwn(expr, 'parentProperty')\n ? expr.parentProperty\n : currParentProperty;\n expr = expr.path;\n }\n currParent = currParent || null;\n currParentProperty = currParentProperty || null;\n\n if (Array.isArray(expr)) {\n expr = JSONPath.toPathString(expr);\n }\n if ((!expr && expr !== '') || !json) {\n return undefined;\n }\n\n const exprList = JSONPath.toPathArray(expr);\n if (exprList[0] === '$' && exprList.length > 1) {\n exprList.shift();\n }\n this._hasParentSelector = null;\n const result = this\n ._trace(\n exprList, json, ['$'], currParent, currParentProperty, callback\n )\n .filter(function (ea) {\n return ea && !ea.isParentSelector;\n });\n\n if (!result.length) {\n return wrap ? [] : undefined;\n }\n if (!wrap && result.length === 1 && !result[0].hasArrExpr) {\n return this._getPreferredOutput(result[0]);\n }\n return result.reduce((rslt, ea) => {\n const valOrPath = this._getPreferredOutput(ea);\n if (flatten && Array.isArray(valOrPath)) {\n rslt = rslt.concat(valOrPath);\n } else {\n rslt.push(valOrPath);\n }\n return rslt;\n }, []);\n};\n\n// PRIVATE METHODS\n\nJSONPath.prototype._getPreferredOutput = function (ea) {\n const resultType = this.currResultType;\n switch (resultType) {\n case 'all': {\n const path = Array.isArray(ea.path)\n ? ea.path\n : JSONPath.toPathArray(ea.path);\n ea.pointer = JSONPath.toPointer(path);\n ea.path = typeof ea.path === 'string'\n ? ea.path\n : JSONPath.toPathString(ea.path);\n return ea;\n } case 'value': case 'parent': case 'parentProperty':\n return ea[resultType];\n case 'path':\n return JSONPath.toPathString(ea[resultType]);\n case 'pointer':\n return JSONPath.toPointer(ea.path);\n default:\n throw new TypeError('Unknown result type');\n }\n};\n\nJSONPath.prototype._handleCallback = function (fullRetObj, callback, type) {\n if (callback) {\n const preferredOutput = this._getPreferredOutput(fullRetObj);\n fullRetObj.path = typeof fullRetObj.path === 'string'\n ? fullRetObj.path\n : JSONPath.toPathString(fullRetObj.path);\n // eslint-disable-next-line n/callback-return -- No need to return\n callback(preferredOutput, type, fullRetObj);\n }\n};\n\n/**\n *\n * @param {string} expr\n * @param {JSONObject} val\n * @param {string} path\n * @param {object|GenericArray} parent\n * @param {string} parentPropName\n * @param {JSONPathCallback} callback\n * @param {boolean} hasArrExpr\n * @param {boolean} literalPriority\n * @returns {ReturnObject|ReturnObject[]}\n */\nJSONPath.prototype._trace = function (\n expr, val, path, parent, parentPropName, callback, hasArrExpr,\n literalPriority\n) {\n // No expr to follow? return path and value as the result of\n // this trace branch\n let retObj;\n if (!expr.length) {\n retObj = {\n path,\n value: val,\n parent,\n parentProperty: parentPropName,\n hasArrExpr\n };\n this._handleCallback(retObj, callback, 'value');\n return retObj;\n }\n\n const loc = expr[0], x = expr.slice(1);\n\n // We need to gather the return value of recursive trace calls in order to\n // do the parent sel computation.\n const ret = [];\n /**\n *\n * @param {ReturnObject|ReturnObject[]} elems\n * @returns {void}\n */\n function addRet (elems) {\n if (Array.isArray(elems)) {\n // This was causing excessive stack size in Node (with or\n // without Babel) against our performance test:\n // `ret.push(...elems);`\n elems.forEach((t) => {\n ret.push(t);\n });\n } else {\n ret.push(elems);\n }\n }\n if ((typeof loc !== 'string' || literalPriority) && val &&\n Object.hasOwn(val, loc)\n ) { // simple case--directly follow property\n addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback,\n hasArrExpr));\n // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if`\n } else if (loc === '*') { // all child properties\n this._walk(val, (m) => {\n addRet(this._trace(\n x, val[m], push(path, m), val, m, callback, true, true\n ));\n });\n } else if (loc === '..') { // all descendent parent properties\n // Check remaining expression with val's immediate children\n addRet(\n this._trace(x, val, path, parent, parentPropName, callback,\n hasArrExpr)\n );\n this._walk(val, (m) => {\n // We don't join m and x here because we only want parents,\n // not scalar values\n if (typeof val[m] === 'object') {\n // Keep going with recursive descent on val's\n // object children\n addRet(this._trace(\n expr.slice(), val[m], push(path, m), val, m, callback, true\n ));\n }\n });\n // The parent sel computation is handled in the frame above using the\n // ancestor object of val\n } else if (loc === '^') {\n // This is not a final endpoint, so we do not invoke the callback here\n this._hasParentSelector = true;\n return {\n path: path.slice(0, -1),\n expr: x,\n isParentSelector: true\n };\n } else if (loc === '~') { // property name\n retObj = {\n path: push(path, loc),\n value: parentPropName,\n parent,\n parentProperty: null\n };\n this._handleCallback(retObj, callback, 'property');\n return retObj;\n } else if (loc === '$') { // root only\n addRet(this._trace(x, val, path, null, null, callback, hasArrExpr));\n } else if ((/^(-?\\d*):(-?\\d*):?(\\d*)$/u).test(loc)) { // [start:end:step] Python slice syntax\n addRet(\n this._slice(loc, x, val, path, parent, parentPropName, callback)\n );\n } else if (loc.indexOf('?(') === 0) { // [?(expr)] (filtering)\n if (this.currEval === false) {\n throw new Error('Eval [?(expr)] prevented in JSONPath expression.');\n }\n const safeLoc = loc.replace(/^\\?\\((.*?)\\)$/u, '$1');\n // check for a nested filter expression\n const nested = (/@.?([^?]*)[['](\\??\\(.*?\\))(?!.\\)\\])[\\]']/gu).exec(safeLoc);\n if (nested) {\n // find if there are matches in the nested expression\n // add them to the result set if there is at least one match\n this._walk(val, (m) => {\n const npath = [nested[2]];\n const nvalue = nested[1]\n ? val[m][nested[1]]\n : val[m];\n const filterResults = this._trace(npath, nvalue, path,\n parent, parentPropName, callback, true);\n if (filterResults.length > 0) {\n addRet(this._trace(x, val[m], push(path, m), val,\n m, callback, true));\n }\n });\n } else {\n this._walk(val, (m) => {\n if (this._eval(safeLoc, val[m], m, path, parent,\n parentPropName)) {\n addRet(this._trace(x, val[m], push(path, m), val, m,\n callback, true));\n }\n });\n }\n } else if (loc[0] === '(') { // [(expr)] (dynamic property/index)\n if (this.currEval === false) {\n throw new Error('Eval [(expr)] prevented in JSONPath expression.');\n }\n // As this will resolve to a property name (but we don't know it\n // yet), property and parent information is relative to the\n // parent of the property to which this expression will resolve\n addRet(this._trace(unshift(\n this._eval(\n loc, val, path.at(-1),\n path.slice(0, -1), parent, parentPropName\n ),\n x\n ), val, path, parent, parentPropName, callback, hasArrExpr));\n } else if (loc[0] === '@') { // value type: @boolean(), etc.\n let addType = false;\n const valueType = loc.slice(1, -2);\n switch (valueType) {\n case 'scalar':\n if (!val || !(['object', 'function'].includes(typeof val))) {\n addType = true;\n }\n break;\n case 'boolean': case 'string': case 'undefined': case 'function':\n if (typeof val === valueType) {\n addType = true;\n }\n break;\n case 'integer':\n if (Number.isFinite(val) && !(val % 1)) {\n addType = true;\n }\n break;\n case 'number':\n if (Number.isFinite(val)) {\n addType = true;\n }\n break;\n case 'nonFinite':\n if (typeof val === 'number' && !Number.isFinite(val)) {\n addType = true;\n }\n break;\n case 'object':\n if (val && typeof val === valueType) {\n addType = true;\n }\n break;\n case 'array':\n if (Array.isArray(val)) {\n addType = true;\n }\n break;\n case 'other':\n addType = this.currOtherTypeCallback(\n val, path, parent, parentPropName\n );\n break;\n case 'null':\n if (val === null) {\n addType = true;\n }\n break;\n /* c8 ignore next 2 */\n default:\n throw new TypeError('Unknown value type ' + valueType);\n }\n if (addType) {\n retObj = {path, value: val, parent, parentProperty: parentPropName};\n this._handleCallback(retObj, callback, 'value');\n return retObj;\n }\n // `-escaped property\n } else if (loc[0] === '`' && val && Object.hasOwn(val, loc.slice(1))) {\n const locProp = loc.slice(1);\n addRet(this._trace(\n x, val[locProp], push(path, locProp), val, locProp, callback,\n hasArrExpr, true\n ));\n } else if (loc.includes(',')) { // [name1,name2,...]\n const parts = loc.split(',');\n for (const part of parts) {\n addRet(this._trace(\n unshift(part, x), val, path, parent, parentPropName, callback,\n true\n ));\n }\n // simple case--directly follow property\n } else if (\n !literalPriority && val && Object.hasOwn(val, loc)\n ) {\n addRet(\n this._trace(x, val[loc], push(path, loc), val, loc, callback,\n hasArrExpr, true)\n );\n }\n\n // We check the resulting values for parent selections. For parent\n // selections we discard the value object and continue the trace with the\n // current val object\n if (this._hasParentSelector) {\n for (let t = 0; t < ret.length; t++) {\n const rett = ret[t];\n if (rett && rett.isParentSelector) {\n const tmp = this._trace(\n rett.expr, val, rett.path, parent, parentPropName, callback,\n hasArrExpr\n );\n if (Array.isArray(tmp)) {\n ret[t] = tmp[0];\n const tl = tmp.length;\n for (let tt = 1; tt < tl; tt++) {\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient\n t++;\n ret.splice(t, 0, tmp[tt]);\n }\n } else {\n ret[t] = tmp;\n }\n }\n }\n }\n return ret;\n};\n\nJSONPath.prototype._walk = function (val, f) {\n if (Array.isArray(val)) {\n const n = val.length;\n for (let i = 0; i < n; i++) {\n f(i);\n }\n } else if (val && typeof val === 'object') {\n Object.keys(val).forEach((m) => {\n f(m);\n });\n }\n};\n\nJSONPath.prototype._slice = function (\n loc, expr, val, path, parent, parentPropName, callback\n) {\n if (!Array.isArray(val)) {\n return undefined;\n }\n const len = val.length, parts = loc.split(':'),\n step = (parts[2] && Number.parseInt(parts[2])) || 1;\n let start = (parts[0] && Number.parseInt(parts[0])) || 0,\n end = parts[1] ? Number.parseInt(parts[1]) : len;\n start = (start < 0) ? Math.max(0, start + len) : Math.min(len, start);\n end = (end < 0) ? Math.max(0, end + len) : Math.min(len, end);\n const ret = [];\n for (let i = start; i < end; i += step) {\n const tmp = this._trace(\n unshift(i, expr), val, path, parent, parentPropName, callback, true\n );\n // Should only be possible to be an array here since first part of\n // ``unshift(i, expr)` passed in above would not be empty, nor `~`,\n // nor begin with `@` (as could return objects)\n // This was causing excessive stack size in Node (with or\n // without Babel) against our performance test: `ret.push(...tmp);`\n tmp.forEach((t) => {\n ret.push(t);\n });\n }\n return ret;\n};\n\nJSONPath.prototype._eval = function (\n code, _v, _vname, path, parent, parentPropName\n) {\n this.currSandbox._$_parentProperty = parentPropName;\n this.currSandbox._$_parent = parent;\n this.currSandbox._$_property = _vname;\n this.currSandbox._$_root = this.json;\n this.currSandbox._$_v = _v;\n\n const containsPath = code.includes('@path');\n if (containsPath) {\n this.currSandbox._$_path = JSONPath.toPathString(path.concat([_vname]));\n }\n\n const scriptCacheKey = this.currEval + 'Script:' + code;\n if (!JSONPath.cache[scriptCacheKey]) {\n let script = code\n .replaceAll('@parentProperty', '_$_parentProperty')\n .replaceAll('@parent', '_$_parent')\n .replaceAll('@property', '_$_property')\n .replaceAll('@root', '_$_root')\n .replaceAll(/@([.\\s)[])/gu, '_$_v$1');\n if (containsPath) {\n script = script.replaceAll('@path', '_$_path');\n }\n if (\n this.currEval === 'safe' ||\n this.currEval === true ||\n this.currEval === undefined\n ) {\n JSONPath.cache[scriptCacheKey] = new this.safeVm.Script(script);\n } else if (this.currEval === 'native') {\n JSONPath.cache[scriptCacheKey] = new this.vm.Script(script);\n } else if (\n typeof this.currEval === 'function' &&\n this.currEval.prototype &&\n Object.hasOwn(this.currEval.prototype, 'runInNewContext')\n ) {\n const CurrEval = this.currEval;\n JSONPath.cache[scriptCacheKey] = new CurrEval(script);\n } else if (typeof this.currEval === 'function') {\n JSONPath.cache[scriptCacheKey] = {\n runInNewContext: (context) => this.currEval(script, context)\n };\n } else {\n throw new TypeError(`Unknown \"eval\" property \"${this.currEval}\"`);\n }\n }\n\n try {\n return JSONPath.cache[scriptCacheKey].runInNewContext(this.currSandbox);\n } catch (e) {\n if (this.ignoreEvalErrors) {\n return false;\n }\n throw new Error('jsonPath: ' + e.message + ': ' + code);\n }\n};\n\n// PUBLIC CLASS PROPERTIES AND METHODS\n\n// Could store the cache object itself\nJSONPath.cache = {};\n\n/**\n * @param {string[]} pathArr Array to convert\n * @returns {string} The path string\n */\nJSONPath.toPathString = function (pathArr) {\n const x = pathArr, n = x.length;\n let p = '$';\n for (let i = 1; i < n; i++) {\n if (!(/^(~|\\^|@.*?\\(\\))$/u).test(x[i])) {\n p += (/^[0-9*]+$/u).test(x[i]) ? ('[' + x[i] + ']') : (\"['\" + x[i] + \"']\");\n }\n }\n return p;\n};\n\n/**\n * @param {string} pointer JSON Path\n * @returns {string} JSON Pointer\n */\nJSONPath.toPointer = function (pointer) {\n const x = pointer, n = x.length;\n let p = '';\n for (let i = 1; i < n; i++) {\n if (!(/^(~|\\^|@.*?\\(\\))$/u).test(x[i])) {\n p += '/' + x[i].toString()\n .replaceAll('~', '~0')\n .replaceAll('/', '~1');\n }\n }\n return p;\n};\n\n/**\n * @param {string} expr Expression to convert\n * @returns {string[]}\n */\nJSONPath.toPathArray = function (expr) {\n const {cache} = JSONPath;\n if (cache[expr]) {\n return cache[expr].concat();\n }\n const subx = [];\n const normalized = expr\n // Properties\n .replaceAll(\n /@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\\(\\)/gu,\n ';$&;'\n )\n // Parenthetical evaluations (filtering and otherwise), directly\n // within brackets or single quotes\n .replaceAll(/[['](\\??\\(.*?\\))[\\]'](?!.\\])/gu, function ($0, $1) {\n return '[#' + (subx.push($1) - 1) + ']';\n })\n // Escape periods and tildes within properties\n .replaceAll(/\\[['\"]([^'\\]]*)['\"]\\]/gu, function ($0, prop) {\n return \"['\" + prop\n .replaceAll('.', '%@%')\n .replaceAll('~', '%%@@%%') +\n \"']\";\n })\n // Properties operator\n .replaceAll('~', ';~;')\n // Split by property boundaries\n .replaceAll(/['\"]?\\.['\"]?(?![^[]*\\])|\\[['\"]?/gu, ';')\n // Reinsert periods within properties\n .replaceAll('%@%', '.')\n // Reinsert tildes within properties\n .replaceAll('%%@@%%', '~')\n // Parent\n .replaceAll(/(?:;)?(\\^+)(?:;)?/gu, function ($0, ups) {\n return ';' + ups.split('').join(';') + ';';\n })\n // Descendents\n .replaceAll(/;;;|;;/gu, ';..;')\n // Remove trailing\n .replaceAll(/;$|'?\\]|'$/gu, '');\n\n const exprList = normalized.split(';').map(function (exp) {\n const match = exp.match(/#(\\d+)/u);\n return !match || !match[1] ? exp : subx[match[1]];\n });\n cache[expr] = exprList;\n return cache[expr].concat();\n};\n\nJSONPath.prototype.safeVm = {\n Script: SafeScript\n};\n\nexport {JSONPath};\n","import {JSONPath} from './jsonpath.js';\n\n/**\n * @typedef {any} ContextItem\n */\n\n/**\n * @typedef {any} EvaluatedResult\n */\n\n/**\n * @callback ConditionCallback\n * @param {ContextItem} item\n * @returns {boolean}\n */\n\n/**\n * Copy items out of one array into another.\n * @param {GenericArray} source Array with items to copy\n * @param {GenericArray} target Array to which to copy\n * @param {ConditionCallback} conditionCb Callback passed the current item;\n * will move item if evaluates to `true`\n * @returns {void}\n */\nconst moveToAnotherArray = function (source, target, conditionCb) {\n const il = source.length;\n for (let i = 0; i < il; i++) {\n const item = source[i];\n if (conditionCb(item)) {\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient\n target.push(source.splice(i--, 1)[0]);\n }\n }\n};\n\n/**\n * In-browser replacement for NodeJS' VM.Script.\n */\nclass Script {\n /**\n * @param {string} expr Expression to evaluate\n */\n constructor (expr) {\n this.code = expr;\n }\n\n /**\n * @param {object} context Object whose items will be added\n * to evaluation\n * @returns {EvaluatedResult} Result of evaluated code\n */\n runInNewContext (context) {\n let expr = this.code;\n const keys = Object.keys(context);\n const funcs = [];\n moveToAnotherArray(keys, funcs, (key) => {\n return typeof context[key] === 'function';\n });\n const values = keys.map((vr) => {\n return context[vr];\n });\n\n const funcString = funcs.reduce((s, func) => {\n let fString = context[func].toString();\n if (!(/function/u).test(fString)) {\n fString = 'function ' + fString;\n }\n return 'var ' + func + '=' + fString + ';' + s;\n }, '');\n\n expr = funcString + expr;\n\n // Mitigate http://perfectionkills.com/global-eval-what-are-the-options/#new_function\n if (!(/(['\"])use strict\\1/u).test(expr) && !keys.includes('arguments')) {\n expr = 'var arguments = undefined;' + expr;\n }\n\n // Remove last semi so `return` will be inserted before\n // the previous one instead, allowing for the return\n // of a bare ending expression\n expr = expr.replace(/;\\s*$/u, '');\n\n // Insert `return`\n const lastStatementEnd = expr.lastIndexOf(';');\n const code =\n lastStatementEnd !== -1\n ? expr.slice(0, lastStatementEnd + 1) +\n ' return ' +\n expr.slice(lastStatementEnd + 1)\n : ' return ' + expr;\n\n // eslint-disable-next-line no-new-func -- User's choice\n return new Function(...keys, code)(...values);\n }\n}\n\nJSONPath.prototype.vm = {\n Script\n};\n\nexport {JSONPath};\n"],"names":["Jsep","version","toString","addUnaryOp","op_name","max_unop_len","Math","max","length","unary_ops","addBinaryOp","precedence","isRightAssociative","max_binop_len","binary_ops","right_associative","add","delete","addIdentifierChar","char","additional_identifier_chars","addLiteral","literal_name","literal_value","literals","removeUnaryOp","getMaxKeyLen","removeAllUnaryOps","removeIdentifierChar","removeBinaryOp","removeAllBinaryOps","removeLiteral","removeAllLiterals","this","expr","charAt","index","code","charCodeAt","constructor","parse","obj","Object","keys","map","k","isDecimalDigit","ch","binaryPrecedence","op_val","isIdentifierStart","String","fromCharCode","has","isIdentifierPart","throwError","message","error","Error","description","runHook","name","node","hooks","env","context","run","searchHook","find","callback","call","gobbleSpaces","SPACE_CODE","TAB_CODE","LF_CODE","CR_CODE","nodes","gobbleExpressions","type","COMPOUND","body","untilICode","ch_i","SEMCOL_CODE","COMMA_CODE","gobbleExpression","push","gobbleBinaryExpression","gobbleBinaryOp","to_check","substr","tc_len","hasOwnProperty","biop","prec","stack","biop_info","left","right","i","cur_biop","gobbleToken","value","right_a","comparePrev","prev","pop","BINARY_EXP","operator","PERIOD_CODE","gobbleNumericLiteral","SQUOTE_CODE","DQUOTE_CODE","gobbleStringLiteral","OBRACK_CODE","gobbleArray","argument","UNARY_EXP","prefix","gobbleIdentifier","LITERAL","raw","this_str","THIS_EXP","OPAREN_CODE","gobbleGroup","gobbleTokenProperty","QUMARK_CODE","optional","MEMBER_EXP","computed","object","property","CBRACK_CODE","CALL_EXP","arguments","gobbleArguments","CPAREN_CODE","callee","chCode","number","parseFloat","str","startIndex","quote","closed","substring","start","IDENTIFIER","slice","termination","args","separator_count","arg","SEQUENCE_EXP","expressions","ARRAY_EXP","elements","first","Array","isArray","forEach","assign","plugins","jsep","registered","register","plugin","init","COLON_CODE","Set","true","false","null","stdClassProps","getOwnPropertyNames","filter","prop","includes","undefined","m","ternary","test","consequent","alternate","newTest","patternIndex","inCharSet","pattern","flags","RegExp","e","assignmentOperators","updateOperators","assignmentPrecedence","updateNodeTypes","updateBinariesToAssignments","values","val","op","some","c","jsepRegex","jsepAssignment","BLOCKED_PROTO_PROPERTIES","SafeEval","evalAst","ast","subs","evalBinaryExpression","evalCompound","evalConditionalExpression","evalIdentifier","evalLiteral","evalMemberExpression","evalUnaryExpression","evalArrayExpression","evalCallExpression","evalAssignmentExpression","SyntaxError","||","a","b","&&","|","^","&","==","!=","===","!==","<",">","<=",">=","<<",">>",">>>","+","-","*","/","%","last","hasOwn","ReferenceError","TypeError","result","Function","bind","typeof","void","el","func","id","arr","item","unshift","NewError","super","avoidNew","JSONPath","opts","otherTypeCallback","optObj","json","path","resultType","flatten","wrap","sandbox","eval","ignoreEvalErrors","parent","parentProperty","autostart","ret","evaluate","prototype","currParent","currParentProperty","currResultType","currEval","currSandbox","currOtherTypeCallback","toPathString","exprList","toPathArray","shift","_hasParentSelector","_trace","ea","isParentSelector","hasArrExpr","reduce","rslt","valOrPath","_getPreferredOutput","concat","pointer","toPointer","_handleCallback","fullRetObj","preferredOutput","parentPropName","literalPriority","retObj","loc","x","addRet","elems","t","_walk","_slice","indexOf","safeLoc","replace","nested","exec","npath","nvalue","_eval","at","addType","valueType","Number","isFinite","locProp","parts","split","part","rett","tmp","tl","tt","splice","f","n","len","step","parseInt","end","min","_v","_vname","_$_parentProperty","_$_parent","_$_property","_$_root","_$_v","containsPath","_$_path","scriptCacheKey","cache","script","replaceAll","safeVm","Script","vm","CurrEval","runInNewContext","pathArr","p","subx","$0","$1","ups","join","exp","match","keyMap","create","funcs","source","target","conditionCb","il","moveToAnotherArray","key","vr","s","fString","lastStatementEnd","lastIndexOf"],"mappings":"AAgGA,MAA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,KAAKuM,KACpBA,EAAU,YAAcA,GAErB,OAAShI,EAAO,IAAMgI,EAAU,IAAMD,GAC9C,IAEiB1V,EAGd,sBAAuBoJ,KAAKpJ,IAAUS,EAAKuI,SAAS,eACtDhJ,EAAO,6BAA+BA,GAM1CA,EAAOA,EAAK0R,QAAQ,SAAU,IAG9B,MAAMkE,EAAmB5V,EAAK6V,YAAY,KACpC1V,GACmB,IAArByV,EACM5V,EAAKmH,MAAM,EAAGyO,EAAmB,GACjC,WACA5V,EAAKmH,MAAMyO,EAAmB,GAC9B,WAAa5V,EAGvB,OAAO,IAAIsN,YAAY7M,EAAMN,EAAtB,IAA+BgK,EAC1C","x_google_ignoreList":[0,1,2]} \ No newline at end of file +{"version":3,"file":"index-browser-esm.min.js","sources":["../node_modules/.pnpm/jsep@1.4.0/node_modules/jsep/dist/jsep.js","../node_modules/.pnpm/@jsep-plugin+regex@1.0.4_jsep@1.4.0/node_modules/@jsep-plugin/regex/dist/index.js","../node_modules/.pnpm/@jsep-plugin+assignment@1.3.0_jsep@1.4.0/node_modules/@jsep-plugin/assignment/dist/index.js","../src/Safe-Script.js","../src/jsonpath.js","../src/jsonpath-browser.js"],"sourcesContent":["/**\n * @implements {IHooks}\n */\nclass Hooks {\n\t/**\n\t * @callback HookCallback\n\t * @this {*|Jsep} this\n\t * @param {Jsep} env\n\t * @returns: void\n\t */\n\t/**\n\t * Adds the given callback to the list of callbacks for the given hook.\n\t *\n\t * The callback will be invoked when the hook it is registered for is run.\n\t *\n\t * One callback function can be registered to multiple hooks and the same hook multiple times.\n\t *\n\t * @param {string|object} name The name of the hook, or an object of callbacks keyed by name\n\t * @param {HookCallback|boolean} callback The callback function which is given environment variables.\n\t * @param {?boolean} [first=false] Will add the hook to the top of the list (defaults to the bottom)\n\t * @public\n\t */\n\tadd(name, callback, first) {\n\t\tif (typeof arguments[0] != 'string') {\n\t\t\t// Multiple hook callbacks, keyed by name\n\t\t\tfor (let name in arguments[0]) {\n\t\t\t\tthis.add(name, arguments[0][name], arguments[1]);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t(Array.isArray(name) ? name : [name]).forEach(function (name) {\n\t\t\t\tthis[name] = this[name] || [];\n\n\t\t\t\tif (callback) {\n\t\t\t\t\tthis[name][first ? 'unshift' : 'push'](callback);\n\t\t\t\t}\n\t\t\t}, this);\n\t\t}\n\t}\n\n\t/**\n\t * Runs a hook invoking all registered callbacks with the given environment variables.\n\t *\n\t * Callbacks will be invoked synchronously and in the order in which they were registered.\n\t *\n\t * @param {string} name The name of the hook.\n\t * @param {Object} env The environment variables of the hook passed to all callbacks registered.\n\t * @public\n\t */\n\trun(name, env) {\n\t\tthis[name] = this[name] || [];\n\t\tthis[name].forEach(function (callback) {\n\t\t\tcallback.call(env && env.context ? env.context : env, env);\n\t\t});\n\t}\n}\n\n/**\n * @implements {IPlugins}\n */\nclass Plugins {\n\tconstructor(jsep) {\n\t\tthis.jsep = jsep;\n\t\tthis.registered = {};\n\t}\n\n\t/**\n\t * @callback PluginSetup\n\t * @this {Jsep} jsep\n\t * @returns: void\n\t */\n\t/**\n\t * Adds the given plugin(s) to the registry\n\t *\n\t * @param {object} plugins\n\t * @param {string} plugins.name The name of the plugin\n\t * @param {PluginSetup} plugins.init The init function\n\t * @public\n\t */\n\tregister(...plugins) {\n\t\tplugins.forEach((plugin) => {\n\t\t\tif (typeof plugin !== 'object' || !plugin.name || !plugin.init) {\n\t\t\t\tthrow new Error('Invalid JSEP plugin format');\n\t\t\t}\n\t\t\tif (this.registered[plugin.name]) {\n\t\t\t\t// already registered. Ignore.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tplugin.init(this.jsep);\n\t\t\tthis.registered[plugin.name] = plugin;\n\t\t});\n\t}\n}\n\n// JavaScript Expression Parser (JSEP) 1.4.0\n\nclass Jsep {\n\t/**\n\t * @returns {string}\n\t */\n\tstatic get version() {\n\t\t// To be filled in by the template\n\t\treturn '1.4.0';\n\t}\n\n\t/**\n\t * @returns {string}\n\t */\n\tstatic toString() {\n\t\treturn 'JavaScript Expression Parser (JSEP) v' + Jsep.version;\n\t};\n\n\t// ==================== CONFIG ================================\n\t/**\n\t * @method addUnaryOp\n\t * @param {string} op_name The name of the unary op to add\n\t * @returns {Jsep}\n\t */\n\tstatic addUnaryOp(op_name) {\n\t\tJsep.max_unop_len = Math.max(op_name.length, Jsep.max_unop_len);\n\t\tJsep.unary_ops[op_name] = 1;\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method jsep.addBinaryOp\n\t * @param {string} op_name The name of the binary op to add\n\t * @param {number} precedence The precedence of the binary op (can be a float). Higher number = higher precedence\n\t * @param {boolean} [isRightAssociative=false] whether operator is right-associative\n\t * @returns {Jsep}\n\t */\n\tstatic addBinaryOp(op_name, precedence, isRightAssociative) {\n\t\tJsep.max_binop_len = Math.max(op_name.length, Jsep.max_binop_len);\n\t\tJsep.binary_ops[op_name] = precedence;\n\t\tif (isRightAssociative) {\n\t\t\tJsep.right_associative.add(op_name);\n\t\t}\n\t\telse {\n\t\t\tJsep.right_associative.delete(op_name);\n\t\t}\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method addIdentifierChar\n\t * @param {string} char The additional character to treat as a valid part of an identifier\n\t * @returns {Jsep}\n\t */\n\tstatic addIdentifierChar(char) {\n\t\tJsep.additional_identifier_chars.add(char);\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method addLiteral\n\t * @param {string} literal_name The name of the literal to add\n\t * @param {*} literal_value The value of the literal\n\t * @returns {Jsep}\n\t */\n\tstatic addLiteral(literal_name, literal_value) {\n\t\tJsep.literals[literal_name] = literal_value;\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeUnaryOp\n\t * @param {string} op_name The name of the unary op to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeUnaryOp(op_name) {\n\t\tdelete Jsep.unary_ops[op_name];\n\t\tif (op_name.length === Jsep.max_unop_len) {\n\t\t\tJsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);\n\t\t}\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllUnaryOps\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllUnaryOps() {\n\t\tJsep.unary_ops = {};\n\t\tJsep.max_unop_len = 0;\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeIdentifierChar\n\t * @param {string} char The additional character to stop treating as a valid part of an identifier\n\t * @returns {Jsep}\n\t */\n\tstatic removeIdentifierChar(char) {\n\t\tJsep.additional_identifier_chars.delete(char);\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeBinaryOp\n\t * @param {string} op_name The name of the binary op to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeBinaryOp(op_name) {\n\t\tdelete Jsep.binary_ops[op_name];\n\n\t\tif (op_name.length === Jsep.max_binop_len) {\n\t\t\tJsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);\n\t\t}\n\t\tJsep.right_associative.delete(op_name);\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllBinaryOps\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllBinaryOps() {\n\t\tJsep.binary_ops = {};\n\t\tJsep.max_binop_len = 0;\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeLiteral\n\t * @param {string} literal_name The name of the literal to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeLiteral(literal_name) {\n\t\tdelete Jsep.literals[literal_name];\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllLiterals\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllLiterals() {\n\t\tJsep.literals = {};\n\n\t\treturn Jsep;\n\t}\n\t// ==================== END CONFIG ============================\n\n\n\t/**\n\t * @returns {string}\n\t */\n\tget char() {\n\t\treturn this.expr.charAt(this.index);\n\t}\n\n\t/**\n\t * @returns {number}\n\t */\n\tget code() {\n\t\treturn this.expr.charCodeAt(this.index);\n\t};\n\n\n\t/**\n\t * @param {string} expr a string with the passed in express\n\t * @returns Jsep\n\t */\n\tconstructor(expr) {\n\t\t// `index` stores the character number we are currently at\n\t\t// All of the gobbles below will modify `index` as we move along\n\t\tthis.expr = expr;\n\t\tthis.index = 0;\n\t}\n\n\t/**\n\t * static top-level parser\n\t * @returns {jsep.Expression}\n\t */\n\tstatic parse(expr) {\n\t\treturn (new Jsep(expr)).parse();\n\t}\n\n\t/**\n\t * Get the longest key length of any object\n\t * @param {object} obj\n\t * @returns {number}\n\t */\n\tstatic getMaxKeyLen(obj) {\n\t\treturn Math.max(0, ...Object.keys(obj).map(k => k.length));\n\t}\n\n\t/**\n\t * `ch` is a character code in the next three functions\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isDecimalDigit(ch) {\n\t\treturn (ch >= 48 && ch <= 57); // 0...9\n\t}\n\n\t/**\n\t * Returns the precedence of a binary operator or `0` if it isn't a binary operator. Can be float.\n\t * @param {string} op_val\n\t * @returns {number}\n\t */\n\tstatic binaryPrecedence(op_val) {\n\t\treturn Jsep.binary_ops[op_val] || 0;\n\t}\n\n\t/**\n\t * Looks for start of identifier\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isIdentifierStart(ch) {\n\t\treturn (ch >= 65 && ch <= 90) || // A...Z\n\t\t\t(ch >= 97 && ch <= 122) || // a...z\n\t\t\t(ch >= 128 && !Jsep.binary_ops[String.fromCharCode(ch)]) || // any non-ASCII that is not an operator\n\t\t\t(Jsep.additional_identifier_chars.has(String.fromCharCode(ch))); // additional characters\n\t}\n\n\t/**\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isIdentifierPart(ch) {\n\t\treturn Jsep.isIdentifierStart(ch) || Jsep.isDecimalDigit(ch);\n\t}\n\n\t/**\n\t * throw error at index of the expression\n\t * @param {string} message\n\t * @throws\n\t */\n\tthrowError(message) {\n\t\tconst error = new Error(message + ' at character ' + this.index);\n\t\terror.index = this.index;\n\t\terror.description = message;\n\t\tthrow error;\n\t}\n\n\t/**\n\t * Run a given hook\n\t * @param {string} name\n\t * @param {jsep.Expression|false} [node]\n\t * @returns {?jsep.Expression}\n\t */\n\trunHook(name, node) {\n\t\tif (Jsep.hooks[name]) {\n\t\t\tconst env = { context: this, node };\n\t\t\tJsep.hooks.run(name, env);\n\t\t\treturn env.node;\n\t\t}\n\t\treturn node;\n\t}\n\n\t/**\n\t * Runs a given hook until one returns a node\n\t * @param {string} name\n\t * @returns {?jsep.Expression}\n\t */\n\tsearchHook(name) {\n\t\tif (Jsep.hooks[name]) {\n\t\t\tconst env = { context: this };\n\t\t\tJsep.hooks[name].find(function (callback) {\n\t\t\t\tcallback.call(env.context, env);\n\t\t\t\treturn env.node;\n\t\t\t});\n\t\t\treturn env.node;\n\t\t}\n\t}\n\n\t/**\n\t * Push `index` up to the next non-space character\n\t */\n\tgobbleSpaces() {\n\t\tlet ch = this.code;\n\t\t// Whitespace\n\t\twhile (ch === Jsep.SPACE_CODE\n\t\t|| ch === Jsep.TAB_CODE\n\t\t|| ch === Jsep.LF_CODE\n\t\t|| ch === Jsep.CR_CODE) {\n\t\t\tch = this.expr.charCodeAt(++this.index);\n\t\t}\n\t\tthis.runHook('gobble-spaces');\n\t}\n\n\t/**\n\t * Top-level method to parse all expressions and returns compound or single node\n\t * @returns {jsep.Expression}\n\t */\n\tparse() {\n\t\tthis.runHook('before-all');\n\t\tconst nodes = this.gobbleExpressions();\n\n\t\t// If there's only one expression just try returning the expression\n\t\tconst node = nodes.length === 1\n\t\t ? nodes[0]\n\t\t\t: {\n\t\t\t\ttype: Jsep.COMPOUND,\n\t\t\t\tbody: nodes\n\t\t\t};\n\t\treturn this.runHook('after-all', node);\n\t}\n\n\t/**\n\t * top-level parser (but can be reused within as well)\n\t * @param {number} [untilICode]\n\t * @returns {jsep.Expression[]}\n\t */\n\tgobbleExpressions(untilICode) {\n\t\tlet nodes = [], ch_i, node;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tch_i = this.code;\n\n\t\t\t// Expressions can be separated by semicolons, commas, or just inferred without any\n\t\t\t// separators\n\t\t\tif (ch_i === Jsep.SEMCOL_CODE || ch_i === Jsep.COMMA_CODE) {\n\t\t\t\tthis.index++; // ignore separators\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Try to gobble each expression individually\n\t\t\t\tif (node = this.gobbleExpression()) {\n\t\t\t\t\tnodes.push(node);\n\t\t\t\t\t// If we weren't able to find a binary expression and are out of room, then\n\t\t\t\t\t// the expression passed in probably has too much\n\t\t\t\t}\n\t\t\t\telse if (this.index < this.expr.length) {\n\t\t\t\t\tif (ch_i === untilICode) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.throwError('Unexpected \"' + this.char + '\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nodes;\n\t}\n\n\t/**\n\t * The main parsing function.\n\t * @returns {?jsep.Expression}\n\t */\n\tgobbleExpression() {\n\t\tconst node = this.searchHook('gobble-expression') || this.gobbleBinaryExpression();\n\t\tthis.gobbleSpaces();\n\n\t\treturn this.runHook('after-expression', node);\n\t}\n\n\t/**\n\t * Search for the operation portion of the string (e.g. `+`, `===`)\n\t * Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`)\n\t * and move down from 3 to 2 to 1 character until a matching binary operation is found\n\t * then, return that binary operation\n\t * @returns {string|boolean}\n\t */\n\tgobbleBinaryOp() {\n\t\tthis.gobbleSpaces();\n\t\tlet to_check = this.expr.substr(this.index, Jsep.max_binop_len);\n\t\tlet tc_len = to_check.length;\n\n\t\twhile (tc_len > 0) {\n\t\t\t// Don't accept a binary op when it is an identifier.\n\t\t\t// Binary ops that start with a identifier-valid character must be followed\n\t\t\t// by a non identifier-part valid character\n\t\t\tif (Jsep.binary_ops.hasOwnProperty(to_check) && (\n\t\t\t\t!Jsep.isIdentifierStart(this.code) ||\n\t\t\t\t(this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))\n\t\t\t)) {\n\t\t\t\tthis.index += tc_len;\n\t\t\t\treturn to_check;\n\t\t\t}\n\t\t\tto_check = to_check.substr(0, --tc_len);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * This function is responsible for gobbling an individual expression,\n\t * e.g. `1`, `1+2`, `a+(b*2)-Math.sqrt(2)`\n\t * @returns {?jsep.BinaryExpression}\n\t */\n\tgobbleBinaryExpression() {\n\t\tlet node, biop, prec, stack, biop_info, left, right, i, cur_biop;\n\n\t\t// First, try to get the leftmost thing\n\t\t// Then, check to see if there's a binary operator operating on that leftmost thing\n\t\t// Don't gobbleBinaryOp without a left-hand-side\n\t\tleft = this.gobbleToken();\n\t\tif (!left) {\n\t\t\treturn left;\n\t\t}\n\t\tbiop = this.gobbleBinaryOp();\n\n\t\t// If there wasn't a binary operator, just return the leftmost node\n\t\tif (!biop) {\n\t\t\treturn left;\n\t\t}\n\n\t\t// Otherwise, we need to start a stack to properly place the binary operations in their\n\t\t// precedence structure\n\t\tbiop_info = { value: biop, prec: Jsep.binaryPrecedence(biop), right_a: Jsep.right_associative.has(biop) };\n\n\t\tright = this.gobbleToken();\n\n\t\tif (!right) {\n\t\t\tthis.throwError(\"Expected expression after \" + biop);\n\t\t}\n\n\t\tstack = [left, biop_info, right];\n\n\t\t// Properly deal with precedence using [recursive descent](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm)\n\t\twhile ((biop = this.gobbleBinaryOp())) {\n\t\t\tprec = Jsep.binaryPrecedence(biop);\n\n\t\t\tif (prec === 0) {\n\t\t\t\tthis.index -= biop.length;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tbiop_info = { value: biop, prec, right_a: Jsep.right_associative.has(biop) };\n\n\t\t\tcur_biop = biop;\n\n\t\t\t// Reduce: make a binary expression from the three topmost entries.\n\t\t\tconst comparePrev = prev => biop_info.right_a && prev.right_a\n\t\t\t\t? prec > prev.prec\n\t\t\t\t: prec <= prev.prec;\n\t\t\twhile ((stack.length > 2) && comparePrev(stack[stack.length - 2])) {\n\t\t\t\tright = stack.pop();\n\t\t\t\tbiop = stack.pop().value;\n\t\t\t\tleft = stack.pop();\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.BINARY_EXP,\n\t\t\t\t\toperator: biop,\n\t\t\t\t\tleft,\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t\tstack.push(node);\n\t\t\t}\n\n\t\t\tnode = this.gobbleToken();\n\n\t\t\tif (!node) {\n\t\t\t\tthis.throwError(\"Expected expression after \" + cur_biop);\n\t\t\t}\n\n\t\t\tstack.push(biop_info, node);\n\t\t}\n\n\t\ti = stack.length - 1;\n\t\tnode = stack[i];\n\n\t\twhile (i > 1) {\n\t\t\tnode = {\n\t\t\t\ttype: Jsep.BINARY_EXP,\n\t\t\t\toperator: stack[i - 1].value,\n\t\t\t\tleft: stack[i - 2],\n\t\t\t\tright: node\n\t\t\t};\n\t\t\ti -= 2;\n\t\t}\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * An individual part of a binary expression:\n\t * e.g. `foo.bar(baz)`, `1`, `\"abc\"`, `(a % 2)` (because it's in parenthesis)\n\t * @returns {boolean|jsep.Expression}\n\t */\n\tgobbleToken() {\n\t\tlet ch, to_check, tc_len, node;\n\n\t\tthis.gobbleSpaces();\n\t\tnode = this.searchHook('gobble-token');\n\t\tif (node) {\n\t\t\treturn this.runHook('after-token', node);\n\t\t}\n\n\t\tch = this.code;\n\n\t\tif (Jsep.isDecimalDigit(ch) || ch === Jsep.PERIOD_CODE) {\n\t\t\t// Char code 46 is a dot `.` which can start off a numeric literal\n\t\t\treturn this.gobbleNumericLiteral();\n\t\t}\n\n\t\tif (ch === Jsep.SQUOTE_CODE || ch === Jsep.DQUOTE_CODE) {\n\t\t\t// Single or double quotes\n\t\t\tnode = this.gobbleStringLiteral();\n\t\t}\n\t\telse if (ch === Jsep.OBRACK_CODE) {\n\t\t\tnode = this.gobbleArray();\n\t\t}\n\t\telse {\n\t\t\tto_check = this.expr.substr(this.index, Jsep.max_unop_len);\n\t\t\ttc_len = to_check.length;\n\n\t\t\twhile (tc_len > 0) {\n\t\t\t\t// Don't accept an unary op when it is an identifier.\n\t\t\t\t// Unary ops that start with a identifier-valid character must be followed\n\t\t\t\t// by a non identifier-part valid character\n\t\t\t\tif (Jsep.unary_ops.hasOwnProperty(to_check) && (\n\t\t\t\t\t!Jsep.isIdentifierStart(this.code) ||\n\t\t\t\t\t(this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))\n\t\t\t\t)) {\n\t\t\t\t\tthis.index += tc_len;\n\t\t\t\t\tconst argument = this.gobbleToken();\n\t\t\t\t\tif (!argument) {\n\t\t\t\t\t\tthis.throwError('missing unaryOp argument');\n\t\t\t\t\t}\n\t\t\t\t\treturn this.runHook('after-token', {\n\t\t\t\t\t\ttype: Jsep.UNARY_EXP,\n\t\t\t\t\t\toperator: to_check,\n\t\t\t\t\t\targument,\n\t\t\t\t\t\tprefix: true\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tto_check = to_check.substr(0, --tc_len);\n\t\t\t}\n\n\t\t\tif (Jsep.isIdentifierStart(ch)) {\n\t\t\t\tnode = this.gobbleIdentifier();\n\t\t\t\tif (Jsep.literals.hasOwnProperty(node.name)) {\n\t\t\t\t\tnode = {\n\t\t\t\t\t\ttype: Jsep.LITERAL,\n\t\t\t\t\t\tvalue: Jsep.literals[node.name],\n\t\t\t\t\t\traw: node.name,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\telse if (node.name === Jsep.this_str) {\n\t\t\t\t\tnode = { type: Jsep.THIS_EXP };\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (ch === Jsep.OPAREN_CODE) { // open parenthesis\n\t\t\t\tnode = this.gobbleGroup();\n\t\t\t}\n\t\t}\n\n\t\tif (!node) {\n\t\t\treturn this.runHook('after-token', false);\n\t\t}\n\n\t\tnode = this.gobbleTokenProperty(node);\n\t\treturn this.runHook('after-token', node);\n\t}\n\n\t/**\n\t * Gobble properties of of identifiers/strings/arrays/groups.\n\t * e.g. `foo`, `bar.baz`, `foo['bar'].baz`\n\t * It also gobbles function calls:\n\t * e.g. `Math.acos(obj.angle)`\n\t * @param {jsep.Expression} node\n\t * @returns {jsep.Expression}\n\t */\n\tgobbleTokenProperty(node) {\n\t\tthis.gobbleSpaces();\n\n\t\tlet ch = this.code;\n\t\twhile (ch === Jsep.PERIOD_CODE || ch === Jsep.OBRACK_CODE || ch === Jsep.OPAREN_CODE || ch === Jsep.QUMARK_CODE) {\n\t\t\tlet optional;\n\t\t\tif (ch === Jsep.QUMARK_CODE) {\n\t\t\t\tif (this.expr.charCodeAt(this.index + 1) !== Jsep.PERIOD_CODE) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\toptional = true;\n\t\t\t\tthis.index += 2;\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tch = this.code;\n\t\t\t}\n\t\t\tthis.index++;\n\n\t\t\tif (ch === Jsep.OBRACK_CODE) {\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.MEMBER_EXP,\n\t\t\t\t\tcomputed: true,\n\t\t\t\t\tobject: node,\n\t\t\t\t\tproperty: this.gobbleExpression()\n\t\t\t\t};\n\t\t\t\tif (!node.property) {\n\t\t\t\t\tthis.throwError('Unexpected \"' + this.char + '\"');\n\t\t\t\t}\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tch = this.code;\n\t\t\t\tif (ch !== Jsep.CBRACK_CODE) {\n\t\t\t\t\tthis.throwError('Unclosed [');\n\t\t\t\t}\n\t\t\t\tthis.index++;\n\t\t\t}\n\t\t\telse if (ch === Jsep.OPAREN_CODE) {\n\t\t\t\t// A function call is being made; gobble all the arguments\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.CALL_EXP,\n\t\t\t\t\t'arguments': this.gobbleArguments(Jsep.CPAREN_CODE),\n\t\t\t\t\tcallee: node\n\t\t\t\t};\n\t\t\t}\n\t\t\telse if (ch === Jsep.PERIOD_CODE || optional) {\n\t\t\t\tif (optional) {\n\t\t\t\t\tthis.index--;\n\t\t\t\t}\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.MEMBER_EXP,\n\t\t\t\t\tcomputed: false,\n\t\t\t\t\tobject: node,\n\t\t\t\t\tproperty: this.gobbleIdentifier(),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (optional) {\n\t\t\t\tnode.optional = true;\n\t\t\t} // else leave undefined for compatibility with esprima\n\n\t\t\tthis.gobbleSpaces();\n\t\t\tch = this.code;\n\t\t}\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to\n\t * keep track of everything in the numeric literal and then calling `parseFloat` on that string\n\t * @returns {jsep.Literal}\n\t */\n\tgobbleNumericLiteral() {\n\t\tlet number = '', ch, chCode;\n\n\t\twhile (Jsep.isDecimalDigit(this.code)) {\n\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t}\n\n\t\tif (this.code === Jsep.PERIOD_CODE) { // can start with a decimal marker\n\t\t\tnumber += this.expr.charAt(this.index++);\n\n\t\t\twhile (Jsep.isDecimalDigit(this.code)) {\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\t\t}\n\n\t\tch = this.char;\n\n\t\tif (ch === 'e' || ch === 'E') { // exponent marker\n\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\tch = this.char;\n\n\t\t\tif (ch === '+' || ch === '-') { // exponent sign\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\n\t\t\twhile (Jsep.isDecimalDigit(this.code)) { // exponent itself\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\n\t\t\tif (!Jsep.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) ) {\n\t\t\t\tthis.throwError('Expected exponent (' + number + this.char + ')');\n\t\t\t}\n\t\t}\n\n\t\tchCode = this.code;\n\n\t\t// Check to make sure this isn't a variable name that start with a number (123abc)\n\t\tif (Jsep.isIdentifierStart(chCode)) {\n\t\t\tthis.throwError('Variable names cannot start with a number (' +\n\t\t\t\tnumber + this.char + ')');\n\t\t}\n\t\telse if (chCode === Jsep.PERIOD_CODE || (number.length === 1 && number.charCodeAt(0) === Jsep.PERIOD_CODE)) {\n\t\t\tthis.throwError('Unexpected period');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Jsep.LITERAL,\n\t\t\tvalue: parseFloat(number),\n\t\t\traw: number\n\t\t};\n\t}\n\n\t/**\n\t * Parses a string literal, staring with single or double quotes with basic support for escape codes\n\t * e.g. `\"hello world\"`, `'this is\\nJSEP'`\n\t * @returns {jsep.Literal}\n\t */\n\tgobbleStringLiteral() {\n\t\tlet str = '';\n\t\tconst startIndex = this.index;\n\t\tconst quote = this.expr.charAt(this.index++);\n\t\tlet closed = false;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tlet ch = this.expr.charAt(this.index++);\n\n\t\t\tif (ch === quote) {\n\t\t\t\tclosed = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (ch === '\\\\') {\n\t\t\t\t// Check for all of the common escape codes\n\t\t\t\tch = this.expr.charAt(this.index++);\n\n\t\t\t\tswitch (ch) {\n\t\t\t\t\tcase 'n': str += '\\n'; break;\n\t\t\t\t\tcase 'r': str += '\\r'; break;\n\t\t\t\t\tcase 't': str += '\\t'; break;\n\t\t\t\t\tcase 'b': str += '\\b'; break;\n\t\t\t\t\tcase 'f': str += '\\f'; break;\n\t\t\t\t\tcase 'v': str += '\\x0B'; break;\n\t\t\t\t\tdefault : str += ch;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tstr += ch;\n\t\t\t}\n\t\t}\n\n\t\tif (!closed) {\n\t\t\tthis.throwError('Unclosed quote after \"' + str + '\"');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Jsep.LITERAL,\n\t\t\tvalue: str,\n\t\t\traw: this.expr.substring(startIndex, this.index),\n\t\t};\n\t}\n\n\t/**\n\t * Gobbles only identifiers\n\t * e.g.: `foo`, `_value`, `$x1`\n\t * Also, this function checks if that identifier is a literal:\n\t * (e.g. `true`, `false`, `null`) or `this`\n\t * @returns {jsep.Identifier}\n\t */\n\tgobbleIdentifier() {\n\t\tlet ch = this.code, start = this.index;\n\n\t\tif (Jsep.isIdentifierStart(ch)) {\n\t\t\tthis.index++;\n\t\t}\n\t\telse {\n\t\t\tthis.throwError('Unexpected ' + this.char);\n\t\t}\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tch = this.code;\n\n\t\t\tif (Jsep.isIdentifierPart(ch)) {\n\t\t\t\tthis.index++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\ttype: Jsep.IDENTIFIER,\n\t\t\tname: this.expr.slice(start, this.index),\n\t\t};\n\t}\n\n\t/**\n\t * Gobbles a list of arguments within the context of a function call\n\t * or array literal. This function also assumes that the opening character\n\t * `(` or `[` has already been gobbled, and gobbles expressions and commas\n\t * until the terminator character `)` or `]` is encountered.\n\t * e.g. `foo(bar, baz)`, `my_func()`, or `[bar, baz]`\n\t * @param {number} termination\n\t * @returns {jsep.Expression[]}\n\t */\n\tgobbleArguments(termination) {\n\t\tconst args = [];\n\t\tlet closed = false;\n\t\tlet separator_count = 0;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tthis.gobbleSpaces();\n\t\t\tlet ch_i = this.code;\n\n\t\t\tif (ch_i === termination) { // done parsing\n\t\t\t\tclosed = true;\n\t\t\t\tthis.index++;\n\n\t\t\t\tif (termination === Jsep.CPAREN_CODE && separator_count && separator_count >= args.length){\n\t\t\t\t\tthis.throwError('Unexpected token ' + String.fromCharCode(termination));\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (ch_i === Jsep.COMMA_CODE) { // between expressions\n\t\t\t\tthis.index++;\n\t\t\t\tseparator_count++;\n\n\t\t\t\tif (separator_count !== args.length) { // missing argument\n\t\t\t\t\tif (termination === Jsep.CPAREN_CODE) {\n\t\t\t\t\t\tthis.throwError('Unexpected token ,');\n\t\t\t\t\t}\n\t\t\t\t\telse if (termination === Jsep.CBRACK_CODE) {\n\t\t\t\t\t\tfor (let arg = args.length; arg < separator_count; arg++) {\n\t\t\t\t\t\t\targs.push(null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (args.length !== separator_count && separator_count !== 0) {\n\t\t\t\t// NOTE: `&& separator_count !== 0` allows for either all commas, or all spaces as arguments\n\t\t\t\tthis.throwError('Expected comma');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst node = this.gobbleExpression();\n\n\t\t\t\tif (!node || node.type === Jsep.COMPOUND) {\n\t\t\t\t\tthis.throwError('Expected comma');\n\t\t\t\t}\n\n\t\t\t\targs.push(node);\n\t\t\t}\n\t\t}\n\n\t\tif (!closed) {\n\t\t\tthis.throwError('Expected ' + String.fromCharCode(termination));\n\t\t}\n\n\t\treturn args;\n\t}\n\n\t/**\n\t * Responsible for parsing a group of things within parentheses `()`\n\t * that have no identifier in front (so not a function call)\n\t * This function assumes that it needs to gobble the opening parenthesis\n\t * and then tries to gobble everything within that parenthesis, assuming\n\t * that the next thing it should see is the close parenthesis. If not,\n\t * then the expression probably doesn't have a `)`\n\t * @returns {boolean|jsep.Expression}\n\t */\n\tgobbleGroup() {\n\t\tthis.index++;\n\t\tlet nodes = this.gobbleExpressions(Jsep.CPAREN_CODE);\n\t\tif (this.code === Jsep.CPAREN_CODE) {\n\t\t\tthis.index++;\n\t\t\tif (nodes.length === 1) {\n\t\t\t\treturn nodes[0];\n\t\t\t}\n\t\t\telse if (!nodes.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn {\n\t\t\t\t\ttype: Jsep.SEQUENCE_EXP,\n\t\t\t\t\texpressions: nodes,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis.throwError('Unclosed (');\n\t\t}\n\t}\n\n\t/**\n\t * Responsible for parsing Array literals `[1, 2, 3]`\n\t * This function assumes that it needs to gobble the opening bracket\n\t * and then tries to gobble the expressions as arguments.\n\t * @returns {jsep.ArrayExpression}\n\t */\n\tgobbleArray() {\n\t\tthis.index++;\n\n\t\treturn {\n\t\t\ttype: Jsep.ARRAY_EXP,\n\t\t\telements: this.gobbleArguments(Jsep.CBRACK_CODE)\n\t\t};\n\t}\n}\n\n// Static fields:\nconst hooks = new Hooks();\nObject.assign(Jsep, {\n\thooks,\n\tplugins: new Plugins(Jsep),\n\n\t// Node Types\n\t// ----------\n\t// This is the full set of types that any JSEP node can be.\n\t// Store them here to save space when minified\n\tCOMPOUND: 'Compound',\n\tSEQUENCE_EXP: 'SequenceExpression',\n\tIDENTIFIER: 'Identifier',\n\tMEMBER_EXP: 'MemberExpression',\n\tLITERAL: 'Literal',\n\tTHIS_EXP: 'ThisExpression',\n\tCALL_EXP: 'CallExpression',\n\tUNARY_EXP: 'UnaryExpression',\n\tBINARY_EXP: 'BinaryExpression',\n\tARRAY_EXP: 'ArrayExpression',\n\n\tTAB_CODE: 9,\n\tLF_CODE: 10,\n\tCR_CODE: 13,\n\tSPACE_CODE: 32,\n\tPERIOD_CODE: 46, // '.'\n\tCOMMA_CODE: 44, // ','\n\tSQUOTE_CODE: 39, // single quote\n\tDQUOTE_CODE: 34, // double quotes\n\tOPAREN_CODE: 40, // (\n\tCPAREN_CODE: 41, // )\n\tOBRACK_CODE: 91, // [\n\tCBRACK_CODE: 93, // ]\n\tQUMARK_CODE: 63, // ?\n\tSEMCOL_CODE: 59, // ;\n\tCOLON_CODE: 58, // :\n\n\n\t// Operations\n\t// ----------\n\t// Use a quickly-accessible map to store all of the unary operators\n\t// Values are set to `1` (it really doesn't matter)\n\tunary_ops: {\n\t\t'-': 1,\n\t\t'!': 1,\n\t\t'~': 1,\n\t\t'+': 1\n\t},\n\n\t// Also use a map for the binary operations but set their values to their\n\t// binary precedence for quick reference (higher number = higher precedence)\n\t// see [Order of operations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)\n\tbinary_ops: {\n\t\t'||': 1, '??': 1,\n\t\t'&&': 2, '|': 3, '^': 4, '&': 5,\n\t\t'==': 6, '!=': 6, '===': 6, '!==': 6,\n\t\t'<': 7, '>': 7, '<=': 7, '>=': 7,\n\t\t'<<': 8, '>>': 8, '>>>': 8,\n\t\t'+': 9, '-': 9,\n\t\t'*': 10, '/': 10, '%': 10,\n\t\t'**': 11,\n\t},\n\n\t// sets specific binary_ops as right-associative\n\tright_associative: new Set(['**']),\n\n\t// Additional valid identifier chars, apart from a-z, A-Z and 0-9 (except on the starting char)\n\tadditional_identifier_chars: new Set(['$', '_']),\n\n\t// Literals\n\t// ----------\n\t// Store the values to return for the various literals we may encounter\n\tliterals: {\n\t\t'true': true,\n\t\t'false': false,\n\t\t'null': null\n\t},\n\n\t// Except for `this`, which is special. This could be changed to something like `'self'` as well\n\tthis_str: 'this',\n});\nJsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);\nJsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);\n\n// Backward Compatibility:\nconst jsep = expr => (new Jsep(expr)).parse();\nconst stdClassProps = Object.getOwnPropertyNames(class Test{});\nObject.getOwnPropertyNames(Jsep)\n\t.filter(prop => !stdClassProps.includes(prop) && jsep[prop] === undefined)\n\t.forEach((m) => {\n\t\tjsep[m] = Jsep[m];\n\t});\njsep.Jsep = Jsep; // allows for const { Jsep } = require('jsep');\n\nconst CONDITIONAL_EXP = 'ConditionalExpression';\n\nvar ternary = {\n\tname: 'ternary',\n\n\tinit(jsep) {\n\t\t// Ternary expression: test ? consequent : alternate\n\t\tjsep.hooks.add('after-expression', function gobbleTernary(env) {\n\t\t\tif (env.node && this.code === jsep.QUMARK_CODE) {\n\t\t\t\tthis.index++;\n\t\t\t\tconst test = env.node;\n\t\t\t\tconst consequent = this.gobbleExpression();\n\n\t\t\t\tif (!consequent) {\n\t\t\t\t\tthis.throwError('Expected expression');\n\t\t\t\t}\n\n\t\t\t\tthis.gobbleSpaces();\n\n\t\t\t\tif (this.code === jsep.COLON_CODE) {\n\t\t\t\t\tthis.index++;\n\t\t\t\t\tconst alternate = this.gobbleExpression();\n\n\t\t\t\t\tif (!alternate) {\n\t\t\t\t\t\tthis.throwError('Expected expression');\n\t\t\t\t\t}\n\t\t\t\t\tenv.node = {\n\t\t\t\t\t\ttype: CONDITIONAL_EXP,\n\t\t\t\t\t\ttest,\n\t\t\t\t\t\tconsequent,\n\t\t\t\t\t\talternate,\n\t\t\t\t\t};\n\n\t\t\t\t\t// check for operators of higher priority than ternary (i.e. assignment)\n\t\t\t\t\t// jsep sets || at 1, and assignment at 0.9, and conditional should be between them\n\t\t\t\t\tif (test.operator && jsep.binary_ops[test.operator] <= 0.9) {\n\t\t\t\t\t\tlet newTest = test;\n\t\t\t\t\t\twhile (newTest.right.operator && jsep.binary_ops[newTest.right.operator] <= 0.9) {\n\t\t\t\t\t\t\tnewTest = newTest.right;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenv.node.test = newTest.right;\n\t\t\t\t\t\tnewTest.right = env.node;\n\t\t\t\t\t\tenv.node = test;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.throwError('Expected :');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t},\n};\n\n// Add default plugins:\n\njsep.plugins.register(ternary);\n\nexport { Jsep, jsep as default };\n","const FSLASH_CODE = 47; // '/'\nconst BSLASH_CODE = 92; // '\\\\'\n\nvar index = {\n\tname: 'regex',\n\n\tinit(jsep) {\n\t\t// Regex literal: /abc123/ig\n\t\tjsep.hooks.add('gobble-token', function gobbleRegexLiteral(env) {\n\t\t\tif (this.code === FSLASH_CODE) {\n\t\t\t\tconst patternIndex = ++this.index;\n\n\t\t\t\tlet inCharSet = false;\n\t\t\t\twhile (this.index < this.expr.length) {\n\t\t\t\t\tif (this.code === FSLASH_CODE && !inCharSet) {\n\t\t\t\t\t\tconst pattern = this.expr.slice(patternIndex, this.index);\n\n\t\t\t\t\t\tlet flags = '';\n\t\t\t\t\t\twhile (++this.index < this.expr.length) {\n\t\t\t\t\t\t\tconst code = this.code;\n\t\t\t\t\t\t\tif ((code >= 97 && code <= 122) // a...z\n\t\t\t\t\t\t\t\t|| (code >= 65 && code <= 90) // A...Z\n\t\t\t\t\t\t\t\t|| (code >= 48 && code <= 57)) { // 0-9\n\t\t\t\t\t\t\t\tflags += this.char;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet value;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvalue = new RegExp(pattern, flags);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\t\tthis.throwError(e.message);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tenv.node = {\n\t\t\t\t\t\t\ttype: jsep.LITERAL,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\traw: this.expr.slice(patternIndex - 1, this.index),\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// allow . [] and () after regex: /regex/.test(a)\n\t\t\t\t\t\tenv.node = this.gobbleTokenProperty(env.node);\n\t\t\t\t\t\treturn env.node;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.code === jsep.OBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = true;\n\t\t\t\t\t}\n\t\t\t\t\telse if (inCharSet && this.code === jsep.CBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = false;\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += this.code === BSLASH_CODE ? 2 : 1;\n\t\t\t\t}\n\t\t\t\tthis.throwError('Unclosed Regex');\n\t\t\t}\n\t\t});\n\t},\n};\n\nexport { index as default };\n","const PLUS_CODE = 43; // +\nconst MINUS_CODE = 45; // -\n\nconst plugin = {\n\tname: 'assignment',\n\n\tassignmentOperators: new Set([\n\t\t'=',\n\t\t'*=',\n\t\t'**=',\n\t\t'/=',\n\t\t'%=',\n\t\t'+=',\n\t\t'-=',\n\t\t'<<=',\n\t\t'>>=',\n\t\t'>>>=',\n\t\t'&=',\n\t\t'^=',\n\t\t'|=',\n\t\t'||=',\n\t\t'&&=',\n\t\t'??=',\n\t]),\n\tupdateOperators: [PLUS_CODE, MINUS_CODE],\n\tassignmentPrecedence: 0.9,\n\n\tinit(jsep) {\n\t\tconst updateNodeTypes = [jsep.IDENTIFIER, jsep.MEMBER_EXP];\n\t\tplugin.assignmentOperators.forEach(op => jsep.addBinaryOp(op, plugin.assignmentPrecedence, true));\n\n\t\tjsep.hooks.add('gobble-token', function gobbleUpdatePrefix(env) {\n\t\t\tconst code = this.code;\n\t\t\tif (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {\n\t\t\t\tthis.index += 2;\n\t\t\t\tenv.node = {\n\t\t\t\t\ttype: 'UpdateExpression',\n\t\t\t\t\toperator: code === PLUS_CODE ? '++' : '--',\n\t\t\t\t\targument: this.gobbleTokenProperty(this.gobbleIdentifier()),\n\t\t\t\t\tprefix: true,\n\t\t\t\t};\n\t\t\t\tif (!env.node.argument || !updateNodeTypes.includes(env.node.argument.type)) {\n\t\t\t\t\tthis.throwError(`Unexpected ${env.node.operator}`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tjsep.hooks.add('after-token', function gobbleUpdatePostfix(env) {\n\t\t\tif (env.node) {\n\t\t\t\tconst code = this.code;\n\t\t\t\tif (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {\n\t\t\t\t\tif (!updateNodeTypes.includes(env.node.type)) {\n\t\t\t\t\t\tthis.throwError(`Unexpected ${env.node.operator}`);\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += 2;\n\t\t\t\t\tenv.node = {\n\t\t\t\t\t\ttype: 'UpdateExpression',\n\t\t\t\t\t\toperator: code === PLUS_CODE ? '++' : '--',\n\t\t\t\t\t\targument: env.node,\n\t\t\t\t\t\tprefix: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tjsep.hooks.add('after-expression', function gobbleAssignment(env) {\n\t\t\tif (env.node) {\n\t\t\t\t// Note: Binaries can be chained in a single expression to respect\n\t\t\t\t// operator precedence (i.e. a = b = 1 + 2 + 3)\n\t\t\t\t// Update all binary assignment nodes in the tree\n\t\t\t\tupdateBinariesToAssignments(env.node);\n\t\t\t}\n\t\t});\n\n\t\tfunction updateBinariesToAssignments(node) {\n\t\t\tif (plugin.assignmentOperators.has(node.operator)) {\n\t\t\t\tnode.type = 'AssignmentExpression';\n\t\t\t\tupdateBinariesToAssignments(node.left);\n\t\t\t\tupdateBinariesToAssignments(node.right);\n\t\t\t}\n\t\t\telse if (!node.operator) {\n\t\t\t\tObject.values(node).forEach((val) => {\n\t\t\t\t\tif (val && typeof val === 'object') {\n\t\t\t\t\t\tupdateBinariesToAssignments(val);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n};\n\nexport { plugin as default };\n","/* eslint-disable unicorn/no-top-level-side-effects -- Temporary? */\n/* eslint-disable no-bitwise -- Convenient */\nimport jsep from 'jsep';\nimport jsepRegex from '@jsep-plugin/regex';\nimport jsepAssignment from '@jsep-plugin/assignment';\n\n/**\n * @import {EvaluatedResult, UnknownResult} from './jsonpath.js';\n */\n\n/**\n * @typedef {import('@jsep-plugin/assignment').\n * AssignmentExpression} AssignmentExpression\n */\n\n/**\n * @typedef {any} Substitution\n */\n\n/**\n * @typedef {any} AnyParameter\n */\n\n/**\n * @typedef {Record} Substitutions\n */\n\n// register plugins\njsep.plugins.register(jsepRegex, jsepAssignment);\njsep.addUnaryOp('typeof');\njsep.addUnaryOp('void');\njsep.addLiteral('null', null);\njsep.addLiteral('undefined', undefined);\n\nconst BLOCKED_PROTO_PROPERTIES = new Set([\n 'constructor',\n '__proto__',\n '__defineGetter__',\n '__defineSetter__',\n '__lookupGetter__',\n '__lookupSetter__'\n]);\n\nconst SafeEval = {\n /**\n * @param {jsep.Expression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalAst (ast, subs) {\n switch (ast.type) {\n case 'BinaryExpression':\n case 'LogicalExpression':\n return SafeEval.evalBinaryExpression(\n /** @type {jsep.BinaryExpression} */ (ast),\n subs\n );\n case 'Compound':\n return SafeEval.evalCompound(\n /** @type {jsep.Compound} */ (ast),\n subs\n );\n case 'ConditionalExpression':\n return SafeEval.evalConditionalExpression(\n /** @type {jsep.ConditionalExpression} */ (ast),\n subs\n );\n case 'Identifier':\n return SafeEval.evalIdentifier(\n /** @type {jsep.Identifier} */ (ast),\n subs\n );\n case 'Literal':\n return SafeEval.evalLiteral(/** @type {jsep.Literal} */ (ast));\n case 'MemberExpression':\n return SafeEval.evalMemberExpression(\n /** @type {jsep.MemberExpression} */ (ast),\n subs\n );\n case 'UnaryExpression':\n return SafeEval.evalUnaryExpression(\n /** @type {jsep.UnaryExpression} */ (ast),\n subs\n );\n case 'ArrayExpression':\n return SafeEval.evalArrayExpression(\n /** @type {jsep.ArrayExpression} */ (ast),\n subs\n );\n case 'CallExpression':\n return SafeEval.evalCallExpression(\n /** @type {jsep.CallExpression} */ (ast),\n subs\n );\n case 'AssignmentExpression':\n return SafeEval.evalAssignmentExpression(\n /** @type {AssignmentExpression} */ (ast),\n subs\n );\n default:\n throw new SyntaxError('Unexpected expression', {\n cause: ast\n });\n }\n },\n\n /**\n * @param {jsep.BinaryExpression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalBinaryExpression (ast, subs) {\n /**\n * @typedef {{\n * [key: string]: (a: AnyParameter, b: AnyParameter) => UnknownResult\n * }} OperatorTable\n */\n const result = /** @type {OperatorTable} */ ({\n '||': (a, b) => a || b(),\n '&&': (a, b) => a && b(),\n '|': (a, b) => a | b(),\n '^': (a, b) => a ^ b(),\n '&': (a, b) => a & b(),\n // eslint-disable-next-line eqeqeq -- API\n '==': (a, b) => a == b(),\n // eslint-disable-next-line eqeqeq -- API\n '!=': (a, b) => a != b(),\n '===': (a, b) => a === b(),\n '!==': (a, b) => a !== b(),\n '<': (a, b) => a < b(),\n '>': (a, b) => a > b(),\n '<=': (a, b) => a <= b(),\n '>=': (a, b) => a >= b(),\n '<<': (a, b) => a << b(),\n '>>': (a, b) => a >> b(),\n '>>>': (a, b) => a >>> b(),\n '+': (a, b) => a + b(),\n '-': (a, b) => a - b(),\n '*': (a, b) => a * b(),\n '/': (a, b) => a / b(),\n '%': (a, b) => a % b()\n })[ast.operator](\n SafeEval.evalAst(ast.left, subs),\n () => SafeEval.evalAst(ast.right, subs)\n );\n return result;\n },\n\n /**\n * @param {jsep.Compound} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalCompound (ast, subs) {\n let last;\n for (let i = 0; i < ast.body.length; i++) {\n if (\n ast.body[i].type === 'Identifier' &&\n ['var', 'let', 'const'].includes(\n /** @type {jsep.Identifier} */\n (ast.body[i]).name\n ) &&\n Object.hasOwn(ast.body, i + 1) &&\n ast.body[i + 1].type === 'AssignmentExpression'\n ) {\n // var x=2; is detected as\n // [{Identifier var}, {AssignmentExpression x=2}]\n i += 1;\n }\n const expr = ast.body[i];\n last = SafeEval.evalAst(expr, subs);\n }\n return last;\n },\n\n /**\n * @param {jsep.ConditionalExpression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalConditionalExpression (ast, subs) {\n if (SafeEval.evalAst(ast.test, subs)) {\n return SafeEval.evalAst(ast.consequent, subs);\n }\n return SafeEval.evalAst(ast.alternate, subs);\n },\n\n /**\n * @param {jsep.Identifier} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalIdentifier (ast, subs) {\n if (Object.hasOwn(subs, ast.name)) {\n return subs[ast.name];\n }\n throw new ReferenceError(`${ast.name} is not defined`);\n },\n\n /**\n * @param {jsep.Literal} ast\n * @returns {UnknownResult}\n */\n evalLiteral (ast) {\n return ast.value;\n },\n\n /**\n * @param {jsep.MemberExpression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalMemberExpression (ast, subs) {\n const prop = String(\n // NOTE: `String(value)` throws error when\n // value has overwritten the toString method to return non-string\n // i.e. `value = {toString: () => []}`\n ast.computed\n ? SafeEval.evalAst(ast.property, {}) // `object[property]`\n : ast.property.name // `object.property` property is Identifier\n );\n const obj = SafeEval.evalAst(ast.object, subs);\n if (obj === undefined || obj === null) {\n throw new TypeError(\n `Cannot read properties of ${obj} (reading '${prop}')`\n );\n }\n if (!Object.hasOwn(obj, prop) && BLOCKED_PROTO_PROPERTIES.has(prop)) {\n throw new TypeError(\n `Cannot read properties of ${obj} (reading '${prop}')`\n );\n }\n const result = /** @type {Record} */ (obj)[prop];\n if (typeof result === 'function' && result !== Function) {\n return result.bind(obj); // arrow functions aren't affected by bind.\n }\n return result;\n },\n\n /**\n * @param {jsep.UnaryExpression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalUnaryExpression (ast, subs) {\n /**\n * @typedef {{\n * [key: string]: (a: AnyParameter) => UnknownResult\n * }} UnaryOperatorTable\n */\n const result = /** @type {UnaryOperatorTable} */ ({\n '-': (a) => -(/** @type {EvaluatedResult} */ (\n SafeEval.evalAst(a, subs))\n ),\n '!': (a) => !SafeEval.evalAst(a, subs),\n '~': (a) => ~(/** @type {EvaluatedResult} */ (\n SafeEval.evalAst(a, subs))\n ),\n // eslint-disable-next-line no-implicit-coercion -- API\n '+': (a) => +(/** @type {EvaluatedResult} */ (\n SafeEval.evalAst(a, subs))\n ),\n typeof: (a) => typeof SafeEval.evalAst(a, subs),\n // eslint-disable-next-line no-void -- Ok\n void: (a) => void SafeEval.evalAst(a, subs)\n })[ast.operator](ast.argument);\n return result;\n },\n\n /**\n * @param {jsep.ArrayExpression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalArrayExpression (ast, subs) {\n return ast.elements.map((el) => SafeEval.evalAst(\n /** @type {jsep.Expression} */\n (el),\n subs\n ));\n },\n\n /**\n * @param {jsep.CallExpression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalCallExpression (ast, subs) {\n const args = ast.arguments.map((arg) => SafeEval.evalAst(arg, subs));\n const func = SafeEval.evalAst(ast.callee, subs);\n if (func === Function) {\n throw new Error('Function constructor is disabled');\n }\n return (/** @type {(...args: AnyParameter[]) => UnknownResult} */ (\n func\n ))(...args);\n },\n\n /**\n * @param {AssignmentExpression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalAssignmentExpression (ast, subs) {\n if (ast.left.type !== 'Identifier') {\n throw new SyntaxError('Invalid left-hand side in assignment');\n }\n const id = /** @type {jsep.Identifier} */ (\n ast.left\n ).name;\n const value = SafeEval.evalAst(ast.right, subs);\n subs[id] = value;\n return subs[id];\n }\n};\n\n/**\n * A replacement for NodeJS' VM.Script which is also {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | Content Security Policy} friendly.\n */\nclass SafeScript {\n /**\n * @param {string} expr Expression to evaluate\n */\n constructor (expr) {\n this.code = expr;\n this.ast = jsep(this.code);\n }\n\n /**\n * @param {object} context Object whose items will be added\n * to evaluation\n * @returns {EvaluatedResult} Result of evaluated code\n */\n runInNewContext (context) {\n // `Object.create(null)` creates a prototypeless object\n const keyMap = Object.assign(Object.create(null), context);\n return SafeEval.evalAst(this.ast, keyMap);\n }\n}\n\nexport {SafeScript};\n","/* eslint-disable camelcase -- Convenient for escaping */\n/* eslint-disable class-methods-use-this -- Consistent monkey-patching */\n/* eslint-disable unicorn/prefer-private-class-fields -- Allow\n monkey-patching */\nimport {SafeScript} from './Safe-Script.js';\n\n/**\n * @import {Script} from './jsonpath-browser.js';\n */\n\n/**\n * @typedef {any} AnyInput\n */\n\n/**\n * @typedef {((...args: any[]) => any)} SandboxCallback\n */\n\n/**\n * @typedef {any|SandboxCallback} SandboxPropertyValue\n */\n\n/**\n * @typedef {(string|number)[]} ExpressionArray\n */\n\n/**\n * @typedef {\"scalar\"|\"boolean\"|\"string\"|\"undefined\"|\n * \"function\"|\"integer\"|\"number\"|\"nonFinite\"|\"object\"|\n * \"array\"|\"other\"|\"null\"} ValueType\n */\n\n/**\n * @typedef {unknown} ParentValue\n */\n\n/**\n * @typedef {unknown} UnknownResult\n */\n\n/**\n * @typedef {string|number|null} ParentProperty\n */\n\n/**\n * @typedef {unknown|ParentValue|string|ReturnObject} PreferredOutput\n */\n\n/**\n * Copies array and then pushes item into it.\n * @param {ExpressionArray} arr Array to copy and into which to push\n * @param {string|number} item Array item to add (to end)\n * @returns {ExpressionArray} Copy of the original array\n */\nfunction push (arr, item) {\n arr = arr.slice();\n arr.push(item);\n return arr;\n}\n/**\n * Copies array and then unshifts item into it.\n * @param {string|number} item Array item to add (to beginning)\n * @param {ExpressionArray} arr Array to copy and into which to unshift\n * @returns {ExpressionArray} Copy of the original array\n */\nfunction unshift (item, arr) {\n arr = arr.slice();\n arr.unshift(item);\n return arr;\n}\n\n/**\n * Caught when JSONPath is used without `new` but rethrown if with `new`\n * @extends Error\n */\nclass NewError extends Error {\n /**\n * @param {UnknownResult} value The evaluated scalar value\n * @param {ErrorOptions} [options]\n */\n constructor (value, options) {\n super(\n 'JSONPath should not be called with \"new\" (it prevents return ' +\n 'of (unwrapped) scalar values)',\n options\n );\n this.value = value;\n this.name = 'NewError';\n }\n}\n\n/**\n* @typedef {object} ReturnObject\n* @property {ExpressionArray|string} path\n* @property {unknown} value\n* @property {ParentValue} parent\n* @property {ParentProperty} parentProperty\n* @property {boolean} [isParentSelector]\n* @property {boolean} [hasArrExpr]\n* @property {ExpressionArray} [expr]\n* @property {string} [pointer]\n*/\n\n/**\n* @callback JSONPathCallback\n* @param {any} preferredOutput Using `any` type instead of `PreferredOutput` so\n* that user can supply flexible type\n* @param {\"value\"|\"property\"} type\n* @param {ReturnObject} fullRetObj\n* @returns {void}\n*/\n\n/**\n* @callback OtherTypeCallback\n* @param {unknown} val\n* @param {ExpressionArray} path\n* @param {ParentValue} parent\n* @param {string|null} parentPropName\n* @returns {boolean}\n*/\n\n/**\n * @typedef {any} ContextItem\n */\n\n/**\n * @typedef {any} EvaluatedResult\n */\n\n/**\n* @callback EvalCallback\n* @param {string} code\n* @param {ContextItem} context\n* @returns {EvaluatedResult}\n*/\n\n/**\n * @typedef {typeof SafeScript} EvalClass\n */\n\n/**\n * @typedef {\"value\"|\"path\"|\"pointer\"|\"parent\"|\"parentProperty\"|\n * \"all\"} ResultType\n */\n\n/**\n * @typedef {EvalCallback|EvalClass|'safe'|'native'|boolean} EvalValue\n */\n\n/**\n * @typedef {string|string[]} PathType\n */\n\n/**\n * @typedef {{Script: typeof SafeScript}} SafeScriptType\n */\n\n/**\n * @typedef {import('node:vm')|{Script: typeof Script}} ScriptType\n */\n\n/**\n * @typedef {{\n * _$_path?: string,\n * _$_parentProperty?: ParentProperty,\n * _$_parent?: ParentValue,\n * _$_property?: string|number,\n * _$_root?: AnyInput,\n * _$_v?: unknown,\n * [key: string]: SandboxPropertyValue\n * }} SandboxType\n */\n\n/**\n * @typedef {object} JSONPathOptions\n * @property {AnyInput} [json]\n * @property {PathType} [path]\n * @property {ResultType} [resultType=\"value\"]\n * @property {boolean} [flatten=false]\n * @property {boolean} [wrap=true]\n * @property {SandboxType} [sandbox={}]\n * @property {EvalValue} [eval='safe']\n * @property {any|null} [parent=null]\n * @property {string|null} [parentProperty=null]\n * @property {JSONPathCallback} [callback]\n * @property {OtherTypeCallback} [otherTypeCallback] Defaults to\n * function which throws on encountering `@other`\n * @property {boolean} [autostart=true]\n * @property {boolean} [ignoreEvalErrors=false]\n */\n\n\n/**\n * @overload\n * @param {string} opts JSON path to evaluate\n * @param {AnyInput} [expr] JSON object to evaluate against\n * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired\n * payload per `resultType`, 2) `\"value\"|\"property\"`, 3) Full returned\n * object with all payloads\n * @param {OtherTypeCallback} [callback] If `@other()` is at the\n * end of one's query, this will be invoked with the value of the item,\n * its path, its parent, and its parent's property name, and it should\n * return a boolean indicating whether the supplied value belongs to the\n * \"other\" type or not (or it may handle transformations and return\n * `false`).\n * @param {undefined} [otherTypeCallback]\n * @returns {unknown|JSONPathClass}\n */\n/**\n * @overload\n * @param {JSONPathOptions} opts If a string, will be treated as\n * `expr`\n * @returns {unknown|JSONPathClass}\n */\n/**\n * @param {JSONPathOptions|string} opts If a string, will be treated as `expr`\n * @param {string|AnyInput} [expr] JSON path to evaluate\n * @param {AnyInput|JSONPathCallback} [obj] JSON object to evaluate against\n * @param {JSONPathCallback|OtherTypeCallback} [callback] Passed 3\n * arguments: 1) desired payload per `resultType`,\n * 2) `\"value\"|\"property\"`, 3) Full returned object with\n * all payloads\n * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the end\n * of one's query, this will be invoked with the value of the item, its\n * path, its parent, and its parent's property name, and it should return\n * a boolean indicating whether the supplied value belongs to the \"other\"\n * type or not (or it may handle transformations and return `false`).\n * @throws {Error}\n * @returns {unknown|JSONPathClass}\n */\nfunction JSONPath (opts, expr, obj, callback, otherTypeCallback) {\n try {\n if (opts && typeof opts === 'object') {\n return new JSONPathClass(opts);\n }\n return new JSONPathClass(\n opts,\n expr,\n /** @type {JSONPathCallback|undefined} */ (obj),\n /** @type {OtherTypeCallback|undefined} */ (callback),\n /** @type {undefined} */ (otherTypeCallback)\n );\n } catch (e) {\n // eslint-disable-next-line no-restricted-syntax -- Within the file\n if (!(e instanceof NewError)) {\n throw e;\n }\n return e.value;\n }\n}\n\n/**\n *\n */\nclass JSONPathClass {\n /**\n * @overload\n * @param {string} opts JSON path to evaluate\n * @param {AnyInput} [expr] JSON object to evaluate against\n * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired\n * payload per `resultType`, 2) `\"value\"|\"property\"`, 3) Full returned\n * object with all payloads\n * @param {OtherTypeCallback} [callback] If `@other()` is at the\n * end of one's query, this will be invoked with the value of the item,\n * its path, its parent, and its parent's property name, and it should\n * return a boolean indicating whether the supplied value belongs to the\n * \"other\" type or not (or it may handle transformations and return\n * `false`).\n * @param {undefined} [otherTypeCallback]\n * @returns {JSONPath|JSONPathClass}\n */\n /**\n * @overload\n * @param {JSONPathOptions} opts If a string, will be treated as\n * `expr`\n */\n /**\n * @param {null|string|JSONPathOptions} opts If a string, will be treated as\n * `expr`\n * @param {string|AnyInput} [expr] JSON path to evaluate\n * @param {AnyInput|JSONPathCallback} [obj] JSON object to evaluate against\n * @param {JSONPathCallback|OtherTypeCallback} [callback] Passed 3\n * arguments: 1) desired payload per `resultType`,\n * 2) `\"value\"|\"property\"`, 3) Full returned\n * object with all payloads\n * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the\n * end of one's query, this will be invoked with the value of the item,\n * its path, its parent, and its parent's property name, and it should\n * return a boolean indicating whether the supplied value belongs to the\n * \"other\" type or not (or it may handle transformations and return\n * `false`).\n */\n constructor (opts, expr, obj, callback, otherTypeCallback) {\n if (typeof opts === 'string') {\n otherTypeCallback = /** @type {OtherTypeCallback} */ (\n callback\n );\n callback = /** @type {JSONPathCallback} */ (\n obj\n );\n obj = expr;\n expr = opts;\n opts = null;\n }\n const optObj = opts && typeof opts === 'object';\n opts ||= /** @type {JSONPathOptions} */ ({});\n /** @type {ResultType|undefined} */\n this.currResultType = undefined;\n\n /** @type {EvalValue|undefined} */\n this.currEval = undefined;\n\n /** @type {OtherTypeCallback|undefined} */\n this.currOtherTypeCallback = undefined;\n\n /** @type {SafeScriptType} */\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line unicorn/no-undeclared-class-members, no-unused-expressions -- On prototype\n this.safeVm;\n\n /** @type {ScriptType} */\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line unicorn/no-undeclared-class-members, no-unused-expressions -- On prototype\n this.vm;\n\n /** @type {SandboxType|undefined} */\n this.currSandbox = undefined;\n\n this._hasParentSelector = false;\n\n this.json = opts.json || obj;\n this.path = opts.path || expr;\n this.resultType = opts.resultType || 'value';\n this.flatten = opts.flatten || false;\n this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true;\n this.sandbox = opts.sandbox || {};\n this.eval = opts.eval === undefined ? 'safe' : opts.eval;\n this.ignoreEvalErrors = (typeof opts.ignoreEvalErrors === 'undefined')\n ? false\n : opts.ignoreEvalErrors;\n this.parent = opts.parent || null;\n this.parentProperty = opts.parentProperty || null;\n this.callback = opts.callback ||\n /** @type {JSONPathCallback} */\n (callback) ||\n null;\n this.otherTypeCallback = opts.otherTypeCallback ||\n otherTypeCallback ||\n function () {\n throw new TypeError(\n 'You must supply an otherTypeCallback callback option ' +\n 'with the @other() operator.'\n );\n };\n\n if (opts.autostart !== false) {\n const args = /** @type {JSONPathOptions} */ ({\n path: (optObj ? opts.path : expr)\n });\n if (!optObj && obj !== undefined) {\n args.json = obj;\n } else if ('json' in opts) {\n args.json = opts.json;\n }\n const ret = this.evaluate(args);\n if (!ret || typeof ret !== 'object') {\n throw new NewError(ret);\n }\n\n // eslint-disable-next-line @stylistic/max-len -- Long\n // @ts-expect-error - Constructor returns evaluate result for legacy API\n // eslint-disable-next-line no-constructor-return -- Legacy API\n return ret;\n }\n }\n\n // PUBLIC METHODS\n\n /**\n * @overload\n * @param {JSONPathOptions} [expr]\n * @returns {ReturnObject|ReturnObject[]|undefined|unknown}\n */\n\n /**\n * @overload\n * @param {PathType|undefined} [expr]\n * @param {AnyInput} [json]\n * @param {JSONPathCallback|null} [callback]\n * @param {OtherTypeCallback} [otherTypeCallback]\n * @returns {ReturnObject|ReturnObject[]|undefined|unknown}\n */\n\n /**\n * @param {PathType|JSONPathOptions|undefined} [expr]\n * @param {AnyInput} [json]\n * @param {JSONPathCallback|null} [callback]\n * @param {OtherTypeCallback} [otherTypeCallback]\n * @returns {ReturnObject|ReturnObject[]|undefined|unknown}\n */\n evaluate (\n expr, json, callback, otherTypeCallback\n ) {\n let currParent = this.parent,\n currParentProperty = this.parentProperty;\n let {flatten, wrap} = this;\n\n this.currResultType = this.resultType;\n this.currEval = this.eval;\n this.currSandbox = this.sandbox;\n callback ||= this.callback;\n this.currOtherTypeCallback = otherTypeCallback ||\n this.otherTypeCallback;\n\n if (expr && typeof expr === 'object' && !Array.isArray(expr)) {\n const exprObj = expr;\n if (!exprObj.path && exprObj.path !== '') {\n throw new TypeError(\n 'You must supply a \"path\" property when providing an ' +\n 'object argument to JSONPath.evaluate().'\n );\n }\n if (!(Object.hasOwn(exprObj, 'json'))) {\n throw new TypeError(\n 'You must supply a \"json\" property when providing an ' +\n 'object argument to JSONPath.evaluate().'\n );\n }\n ({json} = exprObj);\n flatten = Object.hasOwn(exprObj, 'flatten')\n ? exprObj.flatten ?? flatten\n : flatten;\n this.currResultType = Object.hasOwn(exprObj, 'resultType')\n ? exprObj.resultType\n : this.currResultType;\n this.currSandbox = Object.hasOwn(exprObj, 'sandbox')\n ? exprObj.sandbox\n : this.currSandbox;\n wrap = Object.hasOwn(exprObj, 'wrap') ? exprObj.wrap : wrap;\n this.currEval = Object.hasOwn(exprObj, 'eval')\n ? exprObj.eval\n : this.currEval;\n callback = Object.hasOwn(exprObj, 'callback')\n ? exprObj.callback\n : callback;\n this.currOtherTypeCallback = Object.hasOwn(\n exprObj, 'otherTypeCallback'\n )\n ? exprObj.otherTypeCallback\n : this.currOtherTypeCallback;\n currParent = Object.hasOwn(exprObj, 'parent')\n ? exprObj.parent ?? currParent\n : currParent;\n currParentProperty = Object.hasOwn(exprObj, 'parentProperty')\n ? exprObj.parentProperty ?? currParentProperty\n : currParentProperty;\n expr = exprObj.path;\n } else {\n json ||= this.json;\n expr ||= this.path;\n }\n currParent ||= null;\n currParentProperty ||= null;\n\n if (Array.isArray(expr)) {\n expr = JSONPath.toPathString(expr);\n }\n if (!json || (!expr && expr !== '')) {\n return undefined;\n }\n\n const exprList = JSONPath.toPathArray(\n /** @type {string} */\n (expr)\n );\n if (exprList[0] === '$' && exprList.length > 1) {\n exprList.shift();\n }\n this._hasParentSelector = false;\n const traceResult = this._trace(\n exprList, json, ['$'], currParent,\n currParentProperty,\n callback ?? undefined,\n undefined\n );\n\n // eslint-disable-next-line @stylistic/max-len -- Long\n /* c8 ignore next 2 -- Unreachable: _trace returns array when hasArrExpr set */\n const result = (\n Array.isArray(traceResult) ? traceResult : [traceResult]\n ).filter((ea) => {\n return ea && !ea.isParentSelector;\n });\n\n if (!result.length) {\n // eslint-disable-next-line @stylistic/max-len -- Long\n /* c8 ignore next -- Unreachable: valid queries always produce results */\n return wrap ? [] : undefined;\n }\n if (!wrap && result.length === 1 && !result[0].hasArrExpr) {\n const preferredOutput = this._getPreferredOutput(result[0]);\n return preferredOutput;\n }\n const reduced = result.reduce(\n (rslt, ea) => {\n const valOrPath = this._getPreferredOutput(ea);\n if (flatten && Array.isArray(valOrPath)) {\n rslt = rslt.concat(valOrPath);\n } else {\n rslt.push(valOrPath);\n }\n return rslt;\n },\n /** @type {UnknownResult[]} */\n ([])\n );\n\n return reduced;\n }\n\n // PRIVATE METHODS\n\n /**\n * @param {ReturnObject} ea\n * @returns {PreferredOutput}\n */\n _getPreferredOutput (ea) {\n const resultType = this.currResultType;\n switch (resultType) {\n case 'all': {\n const path = Array.isArray(ea.path)\n ? ea.path\n : JSONPath.toPathArray(ea.path);\n ea.pointer = JSONPath.toPointer(/** @type {string[]} */ (path));\n ea.path = typeof ea.path === 'string'\n ? ea.path\n : JSONPath.toPathString(/** @type {string[]} */ (ea.path));\n return ea;\n } case 'value': case 'parent': case 'parentProperty':\n return ea[resultType];\n case 'path':\n if (typeof ea.path === 'string') {\n return ea.path;\n }\n return JSONPath.toPathString(/** @type {string[]} */ (ea.path));\n case 'pointer': {\n const pathArray = Array.isArray(ea.path)\n ? ea.path\n : JSONPath.toPathArray(ea.path);\n return JSONPath.toPointer(/** @type {string[]} */ (pathArray));\n }\n default:\n throw new TypeError('Unknown result type');\n }\n }\n\n /**\n * @param {ReturnObject} fullRetObj\n * @param {JSONPathCallback|undefined} callback\n * @param {\"value\"|\"property\"} type\n * @returns {void}\n */\n _handleCallback (fullRetObj, callback, type) {\n // Early return if no callback provided (defensive\n // check for internal calls)\n if (!callback) {\n return;\n }\n const preferredOutput = this._getPreferredOutput(fullRetObj);\n if (Array.isArray(fullRetObj.path)) {\n fullRetObj.path = JSONPath.toPathString(\n /** @type {string[]} */ (fullRetObj.path)\n );\n }\n callback(preferredOutput, type, fullRetObj);\n }\n\n /**\n *\n * @param {ExpressionArray} expr\n * @param {unknown} val\n * @param {ExpressionArray} path\n * @param {ParentValue} parent\n * @param {ParentProperty} parentPropName\n * @param {JSONPathCallback|undefined} callback\n * @param {boolean|undefined} hasArrExpr\n * @param {boolean} [literalPriority]\n * @returns {ReturnObject|ReturnObject[]}\n */\n _trace (\n expr, val, path, parent, parentPropName, callback, hasArrExpr,\n literalPriority\n ) {\n // No expr to follow? return path and value as the result of\n // this trace branch\n let retObj;\n if (!expr.length) {\n retObj = {\n path,\n value: val,\n parent,\n parentProperty: parentPropName,\n hasArrExpr\n };\n this._handleCallback(retObj, callback, 'value');\n return retObj;\n }\n\n const loc = /** @type {string} */ (expr[0]), x = expr.slice(1);\n\n // We need to gather the return value of recursive trace calls in order\n // to do the parent sel computation.\n /** @type {ReturnObject[]} */\n const ret = [];\n /**\n *\n * @param {ReturnObject|ReturnObject[]} elems\n * @returns {void}\n */\n function addRet (elems) {\n if (Array.isArray(elems)) {\n // This was causing excessive stack size in Node (with or\n // without Babel) against our performance test:\n // `ret.push(...elems);`\n elems.forEach((t) => {\n ret.push(t);\n });\n } else {\n ret.push(elems);\n }\n }\n if (val && (typeof loc !== 'string' || literalPriority) &&\n Object.hasOwn(val, /** @type {PropertyKey} */ (loc))\n ) { // simple case--directly follow property\n const valObj = /** @type {Record} */ (val);\n addRet(this._trace(\n x, valObj[/** @type {string} */ (loc)],\n push(path, loc),\n val, /** @type {string|number} */ (loc), callback,\n hasArrExpr\n ));\n // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if`\n } else if (loc === '*') { // all child properties\n this._walk(val, (m) => {\n const valObj = /** @type {Record} */ (val);\n addRet(this._trace(\n x, valObj[m], push(path, m), val, m, callback, true, true\n ));\n });\n } else if (loc === '..') { // all descendent parent properties\n // Check remaining expression with val's immediate children\n addRet(\n this._trace(x, val, path, parent, parentPropName, callback,\n hasArrExpr)\n );\n this._walk(val, (m) => {\n // We don't join m and x here because we only want parents,\n // not scalar values\n const valObj = /** @type {Record} */ (val);\n if (typeof valObj[m] === 'object') {\n // Keep going with recursive descent on val's\n // object children\n addRet(this._trace(\n expr.slice(),\n valObj[m],\n push(path, m),\n val,\n m,\n callback,\n true\n ));\n }\n });\n // The parent sel computation is handled in the frame above using the\n // ancestor object of val\n } else if (loc === '^') {\n // This is not a final endpoint, so we do not invoke the\n // callback here\n this._hasParentSelector = true;\n return /** @type {ReturnObject} */ ({\n path: path.slice(0, -1),\n expr: x,\n isParentSelector: true,\n value: undefined,\n parent: undefined,\n parentProperty: null\n });\n } else if (loc === '~') { // property name\n retObj = {\n path: push(path, loc),\n value: parentPropName,\n parent,\n parentProperty: null\n };\n this._handleCallback(retObj, callback, 'property');\n return retObj;\n } else if (loc === '$') { // root only\n addRet(this._trace(x, val, path, null, null, callback, hasArrExpr));\n // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient\n } else if ((/^(-?\\d*):(-?\\d*):?(\\d*)$/u).test(loc)) { // [start:end:step] Python slice syntax\n const sliceResult = this._slice(\n loc, x, val, path, parent, parentPropName, callback\n );\n if (sliceResult) {\n addRet(sliceResult);\n }\n } else if (loc.indexOf('?(') === 0) { // [?(expr)] (filtering)\n if (this.currEval === false) {\n throw new Error(\n 'Eval [?(expr)] prevented in JSONPath expression.'\n );\n }\n const safeLoc = loc.replace(/^\\?\\((.*?)\\)$/u, '$1');\n // check for a nested filter expression\n // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient\n const nested = (/@.?([^?]*)[['](\\??\\(.*?\\))(?!.\\)\\])[\\]']/gu).exec(safeLoc);\n if (nested) {\n // find if there are matches in the nested expression\n // add them to the result set if there is at least one match\n this._walk(val, (m) => {\n const npath = [nested[2]];\n const valObj2 = /** @type {Record} */ (\n val\n );\n const nvalue = /** @type {ValueType} */ (nested[1]\n ? /** @type {Record} */ (\n valObj2[m]\n )[nested[1]]\n : valObj2[m]);\n const filterResults = this._trace(npath, nvalue, path,\n parent, parentPropName, callback, true);\n // eslint-disable-next-line @stylistic/max-len -- Long\n /* c8 ignore next 3 -- Unreachable: _trace always returns array for nested filters */\n const filterArray = Array.isArray(filterResults)\n ? filterResults\n : [filterResults];\n if (filterArray.length > 0) {\n addRet(this._trace(x, valObj2[m], push(path, m), val,\n m, callback, true));\n }\n });\n } else {\n const valObj3 = /** @type {Record} */ (val);\n this._walk(val, (m) => {\n if (this._eval(safeLoc, valObj3[m], m, path, parent,\n parentPropName)) {\n addRet(this._trace(x, valObj3[m], push(path, m), val, m,\n callback, true));\n }\n });\n }\n } else if (loc[0] === '(') { // [(expr)] (dynamic property/index)\n if (this.currEval === false) {\n throw new Error(\n 'Eval [(expr)] prevented in JSONPath expression.'\n );\n }\n // As this will resolve to a property name (but we don't know it\n // yet), property and parent information is relative to the\n const evalResult = this._eval(\n /** @type {string} */ (loc),\n val, /** @type {string|number} */ (path.at(-1)),\n path.slice(0, -1), parent, parentPropName\n );\n const exprToUse = /** @type {string|number} */ (\n evalResult !== undefined ? evalResult : ''\n );\n addRet(this._trace(unshift(\n exprToUse,\n x\n ), val, path, parent, parentPropName, callback, hasArrExpr));\n } else if (loc[0] === '@') { // value type: @boolean(), etc.\n let addType = false;\n const valueType = /** @type {ValueType} */ (loc).slice(1, -2);\n switch (valueType) {\n case 'scalar':\n if (!val || !(['object', 'function'].includes(typeof val))) {\n addType = true;\n }\n break;\n case 'boolean': case 'string': case 'undefined': case 'function':\n if (typeof val === valueType) {\n addType = true;\n }\n break;\n case 'integer':\n if (Number.isFinite(val) &&\n !(/** @type {number} */ (val) % 1)) {\n addType = true;\n }\n break;\n case 'number':\n if (Number.isFinite(val)) {\n addType = true;\n }\n break;\n case 'nonFinite':\n if (typeof val === 'number' && !Number.isFinite(val)) {\n addType = true;\n }\n break;\n case 'object':\n if (val && typeof val === valueType) {\n addType = true;\n }\n break;\n case 'array':\n if (Array.isArray(val)) {\n addType = true;\n }\n break;\n case 'other':\n addType = this.currOtherTypeCallback?.(\n val, path, parent,\n /** @type {string|null} */ (parentPropName)\n ) ?? false;\n break;\n case 'null':\n if (val === null) {\n addType = true;\n }\n break;\n /* c8 ignore next 2 */\n default:\n throw new TypeError('Unknown value type ' + valueType);\n }\n if (addType) {\n retObj = {\n path, value: val, parent, parentProperty: parentPropName,\n hasArrExpr\n };\n this._handleCallback(retObj, callback, 'value');\n return retObj;\n }\n // `-escaped property\n } else if (val && loc[0] === '`' &&\n Object.hasOwn(val, loc.slice(1))\n ) {\n const locProp = loc.slice(1);\n const valObj = /** @type {Record} */ (val);\n addRet(this._trace(\n x, valObj[locProp], push(path, locProp), val, locProp, callback,\n hasArrExpr, true\n ));\n } else if (loc.includes(',')) { // [name1,name2,...]\n const parts = loc.split(',');\n for (const part of parts) {\n addRet(this._trace(\n unshift(part, x),\n val,\n path,\n parent,\n parentPropName,\n callback,\n true\n ));\n }\n // simple case--directly follow property\n } else if (\n !literalPriority && val && Object.hasOwn(val, loc)\n ) {\n const valObj = /** @type {Record} */ (val);\n addRet(\n this._trace(x, valObj[loc], push(path, loc), val, loc, callback,\n hasArrExpr, true)\n );\n }\n\n // We check the resulting values for parent selections. For parent\n // selections we discard the value object and continue the trace with\n // the current val object\n if (this._hasParentSelector) {\n for (let t = 0; t < ret.length; t++) {\n const rett = ret[t];\n if (rett && rett.isParentSelector) {\n const exprToUse = /** @type {ExpressionArray} */ (\n rett.expr\n );\n const pathToUse = /** @type {ExpressionArray} */ (\n rett.path\n );\n const tmp = this._trace(\n exprToUse,\n val,\n pathToUse,\n parent,\n parentPropName,\n callback,\n hasArrExpr\n );\n if (Array.isArray(tmp)) {\n ret[t] = tmp[0];\n const tl = tmp.length;\n for (let tt = 1; tt < tl; tt++) {\n t++;\n ret.splice(t, 0, tmp[tt]);\n }\n } else {\n ret[t] = tmp;\n }\n }\n }\n }\n return ret;\n }\n\n /**\n * @param {unknown} val\n * @param {(prop: string|number) => void} f\n * @returns {void}\n */\n _walk (val, f) {\n if (Array.isArray(val)) {\n const n = val.length;\n for (let i = 0; i < n; i++) {\n f(i);\n }\n } else if (val && typeof val === 'object') {\n Object.keys(val).forEach((m) => {\n f(m);\n });\n }\n }\n\n /**\n * @param {string} loc\n * @param {ExpressionArray} expr\n * @param {unknown} val\n * @param {ExpressionArray} path\n * @param {ParentValue} parent\n * @param {ParentProperty} parentPropName\n * @param {JSONPathCallback|undefined} callback\n * @returns {ReturnObject[]|undefined}\n */\n _slice (\n loc, expr, val, path, parent, parentPropName, callback\n ) {\n if (!Array.isArray(val)) {\n return undefined;\n }\n const len = val.length, parts = loc.split(':'),\n step = (parts[2] && Number(parts[2])) || 1;\n let start = (parts[0] && Number(parts[0])) || 0,\n end = parts[1] ? Number(parts[1]) : len;\n start = (start < 0) ? Math.max(0, start + len) : Math.min(len, start);\n end = (end < 0) ? Math.max(0, end + len) : Math.min(len, end);\n /** @type {ReturnObject[]} */\n const ret = [];\n for (let i = start; i < end; i += step) {\n const tmp = this._trace(\n unshift(i, expr),\n val,\n path,\n parent,\n parentPropName,\n callback,\n true\n );\n // Should only be possible to be an array here since first part of\n // ``unshift(i, expr)` passed in above would not be empty,\n // nor `~`, nor begin with `@` (as could return objects)\n // This was causing excessive stack size in Node (with or\n // without Babel) against our performance test: `ret.push(...tmp);`\n // eslint-disable-next-line @stylistic/max-len -- Long\n /* c8 ignore next -- Unreachable: _trace returns array when expr non-empty */\n const tmpArray = Array.isArray(tmp) ? tmp : [tmp];\n tmpArray.forEach((t) => {\n ret.push(t);\n });\n }\n return ret;\n }\n\n /**\n * @param {string} code\n * @param {unknown} _v\n * @param {string|number} _vname\n * @param {ExpressionArray} path\n * @param {ParentValue} parent\n * @param {ParentProperty} parentPropName\n * @returns {UnknownResult}\n */\n _eval (\n code, _v, _vname, path, parent, parentPropName\n ) {\n if (this.currSandbox) {\n this.currSandbox._$_parentProperty = parentPropName;\n this.currSandbox._$_parent = parent;\n this.currSandbox._$_property = _vname;\n this.currSandbox._$_root = this.json;\n this.currSandbox._$_v = _v;\n }\n\n const containsPath = code.includes('@path');\n if (containsPath) {\n // eslint-disable-next-line @stylistic/max-len -- Long\n /* c8 ignore next -- Unreachable: currSandbox set in evaluate() before _eval */\n const currSandbox = this.currSandbox ?? {};\n currSandbox._$_path = JSONPath.toPathString(\n /** @type {string[]} */ (path.concat([_vname]))\n );\n }\n\n const scriptCacheKey = this.currEval + 'Script:' + code;\n if (!Object.hasOwn(JSONPath.cache, scriptCacheKey)) {\n let script = code\n .replaceAll('@parentProperty', '_$_parentProperty')\n .replaceAll('@parent', '_$_parent')\n .replaceAll('@property', '_$_property')\n .replaceAll('@root', '_$_root')\n .replaceAll(/@([.\\s)[])/gu, '_$_v$1');\n if (containsPath) {\n script = script.replaceAll('@path', '_$_path');\n }\n const evalType = /** @type {string|boolean|undefined} */ (\n this.currEval\n );\n if (['safe', true, undefined].includes(evalType)) {\n const {cache} = JSONPath;\n cache[scriptCacheKey] = new (\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line unicorn/no-undeclared-class-members -- Prototype\n this.safeVm\n ).Script(script);\n } else if (this.currEval === 'native') {\n const {cache} = JSONPath;\n cache[scriptCacheKey] = new (\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line unicorn/no-undeclared-class-members -- Prototype\n this.vm\n ).Script(script);\n } else if (\n typeof this.currEval === 'function' &&\n this.currEval.prototype &&\n Object.hasOwn(this.currEval.prototype, 'runInNewContext')\n ) {\n const CurrEval = this.currEval;\n const {cache} = JSONPath;\n // eslint-disable-next-line @stylistic/max-len -- Long\n // @ts-expect-error - Type checked above to have proper constructor\n cache[scriptCacheKey] = new CurrEval(script);\n } else if (typeof this.currEval === 'function') {\n const {cache} = JSONPath;\n // Type narrowing: at this point currEval is a function\n // but not a constructor\n const evalFunc = /** @type {EvalCallback} */ (this.currEval);\n cache[scriptCacheKey] = {\n runInNewContext: (\n /** @type {ContextItem} */ context\n ) => evalFunc(script, context)\n };\n } else {\n throw new TypeError(\n `Unknown \"eval\" property \"${this.currEval}\"`\n );\n }\n }\n\n try {\n const {cache} = JSONPath;\n\n /**\n * @typedef {{\n * runInNewContext: (\n * ctx: SandboxType|undefined\n * ) => EvaluatedResult\n * }} RunInNewContext\n */\n\n return /** @type {RunInNewContext} */ (\n cache[scriptCacheKey]\n ).runInNewContext(\n this.currSandbox\n );\n } catch (e) {\n if (this.ignoreEvalErrors) {\n return false;\n }\n const error = /** @type {Error} */ (e);\n throw new Error('jsonPath: ' + error.message + ': ' + code, {\n cause: e\n });\n }\n }\n}\n\nJSONPathClass.prototype.safeVm = {\n Script: SafeScript\n};\n\n// PUBLIC CLASS PROPERTIES AND METHODS\n\n// Could store the cache object itself\n\n/** @type {Record} */\nJSONPath.cache = {};\n\n/**\n * @param {string[]} pathArr Array to convert\n * @returns {string} The path string\n */\nJSONPath.toPathString = function (pathArr) {\n const x = pathArr, n = x.length;\n let p = '$';\n for (let i = 1; i < n; i++) {\n if (!(/^(~|\\^|@.*?\\(\\))$/u).test(x[i])) {\n p += (/^[0-9*]+$/u).test(x[i]) ? ('[' + x[i] + ']') : (\"['\" + x[i] + \"']\");\n }\n }\n return p;\n};\n\n/**\n * @param {string[]} pointer JSON Path array\n * @returns {string} JSON Pointer\n */\nJSONPath.toPointer = function (pointer) {\n const x = pointer, n = x.length;\n let p = '';\n for (let i = 1; i < n; i++) {\n if (!(/^(~|\\^|@.*?\\(\\))$/u).test(x[i])) {\n p += '/' + x[i].toString()\n .replaceAll('~', '~0')\n .replaceAll('/', '~1');\n }\n }\n return p;\n};\n\n/**\n * @param {string} expr Expression to convert\n * @returns {string[]}\n */\nJSONPath.toPathArray = function (expr) {\n const {cache} = JSONPath;\n if (Object.hasOwn(cache, expr)) {\n return /** @type {string[]} */ (cache[expr]).concat();\n }\n /** @type {string[]} */\n const subx = [];\n const normalized = expr\n // Properties\n .replaceAll(\n /@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\\(\\)/gu,\n ';$&;'\n )\n // Parenthetical evaluations (filtering and otherwise), directly\n // within brackets or single quotes\n .replaceAll(/[['](\\??\\(.*?\\))[\\]'](?!.\\])/gu, function ($0, $1) {\n return '[#' +\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line unicorn/no-return-array-push -- Optimization\n (subx.push($1) - 1) +\n ']';\n })\n // Escape periods and tildes within properties\n .replaceAll(/\\[['\"]([^'\\]]*)['\"]\\]/gu, function ($0, prop) {\n return \"['\" + prop\n .replaceAll('.', '%@%')\n .replaceAll('~', '%%@@%%') +\n \"']\";\n })\n // Properties operator\n .replaceAll('~', ';~;')\n // Split by property boundaries\n // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient\n .replaceAll(/['\"]?\\.['\"]?(?![^[]*\\])|\\[['\"]?/gu, ';')\n // Reinsert periods within properties\n .replaceAll('%@%', '.')\n // Reinsert tildes within properties\n .replaceAll('%%@@%%', '~')\n // Parent\n .replaceAll(/(?:;)?(\\^+)(?:;)?/gu, function ($0, ups) {\n return ';' + ups.split('').join(';') + ';';\n })\n // Descendents\n .replaceAll(/;;;|;;/gu, ';..;')\n // Remove trailing\n .replaceAll(/;$|'?\\]|'$/gu, '');\n\n const exprList = normalized.split(';').map(function (exp) {\n const match = exp.match(/#(\\d+)/u);\n return !match || !match[1] ? exp : subx[Number(match[1])];\n });\n cache[expr] = exprList;\n return /** @type {string[]} */ (cache[expr]).concat();\n};\n\nexport {JSONPath, JSONPathClass};\n","import {JSONPath, JSONPathClass} from './jsonpath.js';\n\n/**\n * @typedef {import('./jsonpath.js').AnyInput} AnyInput\n */\n/**\n * @typedef {import('./jsonpath.js').SandboxCallback} SandboxCallback\n */\n/**\n * @typedef {import('./jsonpath.js').SandboxPropertyValue} SandboxPropertyValue\n */\n/**\n * @typedef {import('./jsonpath.js').ExpressionArray} ExpressionArray\n */\n/**\n * @typedef {import('./jsonpath.js').ValueType} ValueType\n */\n/**\n * @typedef {import('./jsonpath.js').ParentValue} ParentValue\n */\n/**\n * @typedef {import('./jsonpath.js').UnknownResult} UnknownResult\n */\n/**\n * @typedef {import('./jsonpath.js').ParentProperty} ParentProperty\n */\n/**\n * @typedef {import('./jsonpath.js').PreferredOutput} PreferredOutput\n */\n/**\n * @typedef {import('./jsonpath.js').ReturnObject} ReturnObject\n */\n/**\n * @typedef {import('./jsonpath.js').JSONPathCallback} JSONPathCallback\n */\n/**\n * @typedef {import('./jsonpath.js').OtherTypeCallback} OtherTypeCallback\n */\n/**\n * @typedef {import('./jsonpath.js').ContextItem} ContextItem\n */\n/**\n * @typedef {import('./jsonpath.js').EvaluatedResult} EvaluatedResult\n */\n/**\n * @typedef {import('./jsonpath.js').EvalCallback} EvalCallback\n */\n/**\n * @typedef {import('./jsonpath.js').EvalClass} EvalClass\n */\n/**\n * @typedef {import('./jsonpath.js').ResultType} ResultType\n */\n/**\n * @typedef {import('./jsonpath.js').EvalValue} EvalValue\n */\n/**\n * @typedef {import('./jsonpath.js').PathType} PathType\n */\n/**\n * @typedef {import('./jsonpath.js').SafeScriptType} SafeScriptType\n */\n/**\n * @typedef {import('./jsonpath.js').ScriptType} ScriptType\n */\n/**\n * @typedef {import('./jsonpath.js').SandboxType} SandboxType\n */\n/**\n * @typedef {import('./jsonpath.js').JSONPathOptions} JSONPathOptions\n */\n\n/**\n * @template T\n * @callback ConditionCallback\n * @param {T} item\n * @returns {boolean}\n */\n\n/**\n * Copy items out of one array into another.\n * @template T\n * @param {T[]} source Array with items to copy\n * @param {T[]} target Array to which to copy\n * @param {ConditionCallback} conditionCb Callback passed the current item;\n * will move item if evaluates to `true`\n * @returns {void}\n */\nconst moveToAnotherArray = function (source, target, conditionCb) {\n const il = source.length;\n for (let i = 0; i < il; i++) {\n const item = source[i];\n if (conditionCb(item)) {\n target.push(source.splice(i--, 1)[0]);\n }\n }\n};\n\n/**\n * In-browser replacement for NodeJS' VM.Script.\n */\nclass Script {\n /**\n * @param {string} expr Expression to evaluate\n */\n constructor (expr) {\n this.code = expr;\n }\n\n /**\n * @param {SandboxType} context Object whose items will be added\n * to evaluation\n * @returns {EvaluatedResult} Result of evaluated code\n */\n runInNewContext (context) {\n let expr = this.code;\n const keys = Object.keys(context);\n const funcs = /** @type {string[]} */ ([]);\n moveToAnotherArray(keys, funcs, (key) => {\n return typeof context[key] === 'function';\n });\n const values = keys.map((vr) => {\n return context[vr];\n });\n\n const funcString = funcs.reduce((s, func) => {\n let fString = context[func].toString();\n if (!(/function/u).test(fString)) {\n fString = 'function ' + fString;\n }\n return 'var ' + func + '=' + fString + ';' + s;\n }, '');\n\n expr = funcString + expr;\n\n // Mitigate https://perfectionkills.com/global-eval-what-are-the-options/#new_function\n if (!(/(['\"])use strict\\1/u).test(expr) && !keys.includes('arguments')) {\n expr = 'var arguments = undefined;' + expr;\n }\n\n // Remove last semi so `return` will be inserted before\n // the previous one instead, allowing for the return\n // of a bare ending expression\n expr = expr.replace(/;\\s*$/u, '');\n\n // Insert `return`\n const lastStatementEnd = expr.lastIndexOf(';');\n const code =\n lastStatementEnd !== -1\n ? expr.slice(0, lastStatementEnd + 1) +\n ' return ' +\n expr.slice(lastStatementEnd + 1)\n : ' return ' + expr;\n\n // eslint-disable-next-line no-new-func -- User's choice\n return new Function(...keys, code)(...values);\n }\n}\n\nJSONPathClass.prototype.vm = {\n Script\n};\n\nexport {JSONPath, JSONPathClass, Script};\n"],"names":["Jsep","version","toString","addUnaryOp","op_name","max_unop_len","Math","max","length","unary_ops","addBinaryOp","precedence","isRightAssociative","max_binop_len","binary_ops","right_associative","add","delete","addIdentifierChar","char","additional_identifier_chars","addLiteral","literal_name","literal_value","literals","removeUnaryOp","getMaxKeyLen","removeAllUnaryOps","removeIdentifierChar","removeBinaryOp","removeAllBinaryOps","removeLiteral","removeAllLiterals","this","expr","charAt","index","code","charCodeAt","constructor","parse","obj","Object","keys","map","k","isDecimalDigit","ch","binaryPrecedence","op_val","isIdentifierStart","String","fromCharCode","has","isIdentifierPart","throwError","message","error","Error","description","runHook","name","node","hooks","env","context","run","searchHook","find","callback","call","gobbleSpaces","SPACE_CODE","TAB_CODE","LF_CODE","CR_CODE","nodes","gobbleExpressions","type","COMPOUND","body","untilICode","ch_i","SEMCOL_CODE","COMMA_CODE","gobbleExpression","push","gobbleBinaryExpression","gobbleBinaryOp","to_check","substr","tc_len","hasOwnProperty","biop","prec","stack","biop_info","left","right","i","cur_biop","gobbleToken","value","right_a","comparePrev","prev","pop","BINARY_EXP","operator","PERIOD_CODE","gobbleNumericLiteral","SQUOTE_CODE","DQUOTE_CODE","gobbleStringLiteral","OBRACK_CODE","gobbleArray","argument","UNARY_EXP","prefix","gobbleIdentifier","LITERAL","raw","this_str","THIS_EXP","OPAREN_CODE","gobbleGroup","gobbleTokenProperty","QUMARK_CODE","optional","MEMBER_EXP","computed","object","property","CBRACK_CODE","CALL_EXP","arguments","gobbleArguments","CPAREN_CODE","callee","chCode","number","parseFloat","str","startIndex","quote","closed","substring","start","IDENTIFIER","slice","termination","args","separator_count","arg","SEQUENCE_EXP","expressions","ARRAY_EXP","elements","first","Array","isArray","forEach","assign","plugins","jsep","registered","register","plugin","init","COLON_CODE","Set","true","false","null","stdClassProps","getOwnPropertyNames","filter","prop","includes","undefined","m","ternary","test","consequent","alternate","newTest","patternIndex","inCharSet","pattern","flags","RegExp","e","assignmentOperators","updateOperators","assignmentPrecedence","updateNodeTypes","updateBinariesToAssignments","values","val","op","some","c","jsepRegex","jsepAssignment","BLOCKED_PROTO_PROPERTIES","SafeEval","evalAst","ast","subs","evalBinaryExpression","evalCompound","evalConditionalExpression","evalIdentifier","evalLiteral","evalMemberExpression","evalUnaryExpression","evalArrayExpression","evalCallExpression","evalAssignmentExpression","SyntaxError","cause","||","a","b","&&","|","^","&","==","!=","===","!==","<",">","<=",">=","<<",">>",">>>","+","-","*","/","%","last","hasOwn","ReferenceError","TypeError","result","Function","bind","typeof","void","el","func","id","arr","item","unshift","NewError","options","super","JSONPath","opts","otherTypeCallback","JSONPathClass","optObj","currResultType","currEval","currOtherTypeCallback","safeVm","vm","currSandbox","_hasParentSelector","json","path","resultType","flatten","wrap","sandbox","eval","ignoreEvalErrors","parent","parentProperty","autostart","ret","evaluate","currParent","currParentProperty","exprObj","toPathString","exprList","toPathArray","shift","traceResult","_trace","ea","isParentSelector","hasArrExpr","_getPreferredOutput","reduce","rslt","valOrPath","concat","pointer","toPointer","pathArray","_handleCallback","fullRetObj","preferredOutput","parentPropName","literalPriority","retObj","loc","x","addRet","elems","t","valObj","_walk","sliceResult","_slice","indexOf","safeLoc","replace","nested","exec","npath","valObj2","nvalue","filterResults","valObj3","_eval","evalResult","at","exprToUse","addType","valueType","Number","isFinite","locProp","parts","split","part","rett","pathToUse","tmp","tl","tt","splice","f","n","len","step","end","min","_v","_vname","_$_parentProperty","_$_parent","_$_property","_$_root","_$_v","containsPath","_$_path","scriptCacheKey","cache","script","replaceAll","evalType","Script","prototype","CurrEval","evalFunc","runInNewContext","keyMap","create","pathArr","p","subx","$0","$1","ups","join","exp","match","funcs","source","target","conditionCb","il","moveToAnotherArray","key","vr","s","fString","lastStatementEnd","lastIndexOf"],"mappings":"AAgGA,MAAMA,EAIL,kBAAWC,GAEV,MAAO,OACR,CAKA,eAAOC,GACN,MAAO,wCAA0CF,EAAKC,OACvD,CAQA,iBAAOE,CAAWC,GAGjB,OAFAJ,EAAKK,aAAeC,KAAKC,IAAIH,EAAQI,OAAQR,EAAKK,cAClDL,EAAKS,UAAUL,GAAW,EACnBJ,CACR,CASA,kBAAOU,CAAYN,EAASO,EAAYC,GASv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oE,EAAc0G,UAAUpG,GAAK,CACzBmG","x_google_ignoreList":[0,1,2]} \ No newline at end of file diff --git a/dist/index-browser-umd.cjs b/dist/index-browser-umd.cjs index 5f66ae76..eb77d36d 100644 --- a/dist/index-browser-umd.cjs +++ b/dist/index-browser-umd.cjs @@ -1201,8 +1201,30 @@ } }; + /* eslint-disable unicorn/no-top-level-side-effects -- Temporary? */ /* eslint-disable no-bitwise -- Convenient */ + /** + * @import {EvaluatedResult, UnknownResult} from './jsonpath.js'; + */ + + /** + * @typedef {import('@jsep-plugin/assignment'). + * AssignmentExpression} AssignmentExpression + */ + + /** + * @typedef {any} Substitution + */ + + /** + * @typedef {any} AnyParameter + */ + + /** + * @typedef {Record} Substitutions + */ + // register plugins jsep.plugins.register(index, plugin); jsep.addUnaryOp('typeof'); @@ -1213,37 +1235,50 @@ const SafeEval = { /** * @param {jsep.Expression} ast - * @param {Record} subs + * @param {Substitutions} subs + * @returns {UnknownResult} */ evalAst(ast, subs) { switch (ast.type) { case 'BinaryExpression': case 'LogicalExpression': - return SafeEval.evalBinaryExpression(ast, subs); + return SafeEval.evalBinaryExpression(/** @type {jsep.BinaryExpression} */ast, subs); case 'Compound': - return SafeEval.evalCompound(ast, subs); + return SafeEval.evalCompound(/** @type {jsep.Compound} */ast, subs); case 'ConditionalExpression': - return SafeEval.evalConditionalExpression(ast, subs); + return SafeEval.evalConditionalExpression(/** @type {jsep.ConditionalExpression} */ast, subs); case 'Identifier': - return SafeEval.evalIdentifier(ast, subs); + return SafeEval.evalIdentifier(/** @type {jsep.Identifier} */ast, subs); case 'Literal': - return SafeEval.evalLiteral(ast, subs); + return SafeEval.evalLiteral(/** @type {jsep.Literal} */ast); case 'MemberExpression': - return SafeEval.evalMemberExpression(ast, subs); + return SafeEval.evalMemberExpression(/** @type {jsep.MemberExpression} */ast, subs); case 'UnaryExpression': - return SafeEval.evalUnaryExpression(ast, subs); + return SafeEval.evalUnaryExpression(/** @type {jsep.UnaryExpression} */ast, subs); case 'ArrayExpression': - return SafeEval.evalArrayExpression(ast, subs); + return SafeEval.evalArrayExpression(/** @type {jsep.ArrayExpression} */ast, subs); case 'CallExpression': - return SafeEval.evalCallExpression(ast, subs); + return SafeEval.evalCallExpression(/** @type {jsep.CallExpression} */ast, subs); case 'AssignmentExpression': - return SafeEval.evalAssignmentExpression(ast, subs); + return SafeEval.evalAssignmentExpression(/** @type {AssignmentExpression} */ast, subs); default: - throw SyntaxError('Unexpected expression', ast); + throw new SyntaxError('Unexpected expression', { + cause: ast + }); } }, + /** + * @param {jsep.BinaryExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalBinaryExpression(ast, subs) { - const result = { + /** + * @typedef {{ + * [key: string]: (a: AnyParameter, b: AnyParameter) => UnknownResult + * }} OperatorTable + */ + const result = /** @type {OperatorTable} */{ '||': (a, b) => a || b(), '&&': (a, b) => a && b(), '|': (a, b) => a | b(), @@ -1270,14 +1305,18 @@ }[ast.operator](SafeEval.evalAst(ast.left, subs), () => SafeEval.evalAst(ast.right, subs)); return result; }, + /** + * @param {jsep.Compound} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalCompound(ast, subs) { let last; for (let i = 0; i < ast.body.length; i++) { - if (ast.body[i].type === 'Identifier' && ['var', 'let', 'const'].includes(ast.body[i].name) && ast.body[i + 1] && ast.body[i + 1].type === 'AssignmentExpression') { + if (ast.body[i].type === 'Identifier' && ['var', 'let', 'const'].includes(/** @type {jsep.Identifier} */ + ast.body[i].name) && Object.hasOwn(ast.body, i + 1) && ast.body[i + 1].type === 'AssignmentExpression') { // var x=2; is detected as // [{Identifier var}, {AssignmentExpression x=2}] - // eslint-disable-next-line @stylistic/max-len -- Long - // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient i += 1; } const expr = ast.body[i]; @@ -1285,71 +1324,120 @@ } return last; }, + /** + * @param {jsep.ConditionalExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalConditionalExpression(ast, subs) { if (SafeEval.evalAst(ast.test, subs)) { return SafeEval.evalAst(ast.consequent, subs); } return SafeEval.evalAst(ast.alternate, subs); }, + /** + * @param {jsep.Identifier} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalIdentifier(ast, subs) { if (Object.hasOwn(subs, ast.name)) { return subs[ast.name]; } - throw ReferenceError(`${ast.name} is not defined`); + throw new ReferenceError(`${ast.name} is not defined`); }, + /** + * @param {jsep.Literal} ast + * @returns {UnknownResult} + */ evalLiteral(ast) { return ast.value; }, + /** + * @param {jsep.MemberExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalMemberExpression(ast, subs) { const prop = String( // NOTE: `String(value)` throws error when // value has overwritten the toString method to return non-string // i.e. `value = {toString: () => []}` - ast.computed ? SafeEval.evalAst(ast.property) // `object[property]` + ast.computed ? SafeEval.evalAst(ast.property, {}) // `object[property]` : ast.property.name // `object.property` property is Identifier ); const obj = SafeEval.evalAst(ast.object, subs); if (obj === undefined || obj === null) { - throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); + throw new TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); } if (!Object.hasOwn(obj, prop) && BLOCKED_PROTO_PROPERTIES.has(prop)) { - throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); + throw new TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); } - const result = obj[prop]; + const result = /** @type {Record} */obj[prop]; if (typeof result === 'function' && result !== Function) { return result.bind(obj); // arrow functions aren't affected by bind. } return result; }, + /** + * @param {jsep.UnaryExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalUnaryExpression(ast, subs) { - const result = { - '-': a => -SafeEval.evalAst(a, subs), + /** + * @typedef {{ + * [key: string]: (a: AnyParameter) => UnknownResult + * }} UnaryOperatorTable + */ + const result = /** @type {UnaryOperatorTable} */{ + '-': a => -(/** @type {EvaluatedResult} */ + SafeEval.evalAst(a, subs)), '!': a => !SafeEval.evalAst(a, subs), - '~': a => ~SafeEval.evalAst(a, subs), + '~': a => ~(/** @type {EvaluatedResult} */ + SafeEval.evalAst(a, subs)), // eslint-disable-next-line no-implicit-coercion -- API - '+': a => +SafeEval.evalAst(a, subs), + '+': a => +(/** @type {EvaluatedResult} */ + SafeEval.evalAst(a, subs)), typeof: a => typeof SafeEval.evalAst(a, subs), - // eslint-disable-next-line no-void, sonarjs/void-use -- feature + // eslint-disable-next-line no-void -- Ok void: a => void SafeEval.evalAst(a, subs) }[ast.operator](ast.argument); return result; }, + /** + * @param {jsep.ArrayExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalArrayExpression(ast, subs) { - return ast.elements.map(el => SafeEval.evalAst(el, subs)); + return ast.elements.map(el => SafeEval.evalAst(/** @type {jsep.Expression} */ + el, subs)); }, + /** + * @param {jsep.CallExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalCallExpression(ast, subs) { const args = ast.arguments.map(arg => SafeEval.evalAst(arg, subs)); const func = SafeEval.evalAst(ast.callee, subs); if (func === Function) { throw new Error('Function constructor is disabled'); } - return func(...args); + return (/** @type {(...args: AnyParameter[]) => UnknownResult} */ + func)(...args); }, + /** + * @param {AssignmentExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalAssignmentExpression(ast, subs) { if (ast.left.type !== 'Identifier') { - throw SyntaxError('Invalid left-hand side in assignment'); + throw new SyntaxError('Invalid left-hand side in assignment'); } - const id = ast.left.name; + const id = /** @type {jsep.Identifier} */ast.left.name; const value = SafeEval.evalAst(ast.right, subs); subs[id] = value; return subs[id]; @@ -1381,25 +1469,57 @@ } /* eslint-disable camelcase -- Convenient for escaping */ + /* eslint-disable class-methods-use-this -- Consistent monkey-patching */ + /* eslint-disable unicorn/prefer-private-class-fields -- Allow + monkey-patching */ + + /** + * @import {Script} from './jsonpath-browser.js'; + */ + + /** + * @typedef {any} AnyInput + */ + /** + * @typedef {((...args: any[]) => any)} SandboxCallback + */ /** - * @typedef {null|boolean|number|string|object|GenericArray} JSONObject + * @typedef {any|SandboxCallback} SandboxPropertyValue */ /** - * @typedef {any} AnyItem + * @typedef {(string|number)[]} ExpressionArray */ /** - * @typedef {any} AnyResult + * @typedef {"scalar"|"boolean"|"string"|"undefined"| + * "function"|"integer"|"number"|"nonFinite"|"object"| + * "array"|"other"|"null"} ValueType + */ + + /** + * @typedef {unknown} ParentValue + */ + + /** + * @typedef {unknown} UnknownResult + */ + + /** + * @typedef {string|number|null} ParentProperty + */ + + /** + * @typedef {unknown|ParentValue|string|ReturnObject} PreferredOutput */ /** * Copies array and then pushes item into it. - * @param {GenericArray} arr Array to copy and into which to push - * @param {AnyItem} item Array item to add (to end) - * @returns {GenericArray} Copy of the original array + * @param {ExpressionArray} arr Array to copy and into which to push + * @param {string|number} item Array item to add (to end) + * @returns {ExpressionArray} Copy of the original array */ function push(arr, item) { arr = arr.slice(); @@ -1408,9 +1528,9 @@ } /** * Copies array and then unshifts item into it. - * @param {AnyItem} item Array item to add (to beginning) - * @param {GenericArray} arr Array to copy and into which to unshift - * @returns {GenericArray} Copy of the original array + * @param {string|number} item Array item to add (to beginning) + * @param {ExpressionArray} arr Array to copy and into which to unshift + * @returns {ExpressionArray} Copy of the original array */ function unshift(item, arr) { arr = arr.slice(); @@ -1424,11 +1544,11 @@ */ class NewError extends Error { /** - * @param {AnyResult} value The evaluated scalar value + * @param {UnknownResult} value The evaluated scalar value + * @param {ErrorOptions} [options] */ - constructor(value) { - super('JSONPath should not be called with "new" (it prevents return ' + 'of (unwrapped) scalar values)'); - this.avoidNew = true; + constructor(value, options) { + super('JSONPath should not be called with "new" (it prevents return ' + 'of (unwrapped) scalar values)', options); this.value = value; this.name = 'NewError'; } @@ -1436,15 +1556,20 @@ /** * @typedef {object} ReturnObject - * @property {string} path - * @property {JSONObject} value - * @property {object|GenericArray} parent - * @property {string} parentProperty + * @property {ExpressionArray|string} path + * @property {unknown} value + * @property {ParentValue} parent + * @property {ParentProperty} parentProperty + * @property {boolean} [isParentSelector] + * @property {boolean} [hasArrExpr] + * @property {ExpressionArray} [expr] + * @property {string} [pointer] */ /** * @callback JSONPathCallback - * @param {string|object} preferredOutput + * @param {any} preferredOutput Using `any` type instead of `PreferredOutput` so + * that user can supply flexible type * @param {"value"|"property"} type * @param {ReturnObject} fullRetObj * @returns {void} @@ -1452,10 +1577,10 @@ /** * @callback OtherTypeCallback - * @param {JSONObject} val - * @param {string} path - * @param {object|GenericArray} parent - * @param {string} parentPropName + * @param {unknown} val + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {string|null} parentPropName * @returns {boolean} */ @@ -1478,513 +1603,806 @@ * @typedef {typeof SafeScript} EvalClass */ + /** + * @typedef {"value"|"path"|"pointer"|"parent"|"parentProperty"| + * "all"} ResultType + */ + + /** + * @typedef {EvalCallback|EvalClass|'safe'|'native'|boolean} EvalValue + */ + + /** + * @typedef {string|string[]} PathType + */ + + /** + * @typedef {{Script: typeof SafeScript}} SafeScriptType + */ + + /** + * @typedef {import('node:vm')|{Script: typeof Script}} ScriptType + */ + + /** + * @typedef {{ + * _$_path?: string, + * _$_parentProperty?: ParentProperty, + * _$_parent?: ParentValue, + * _$_property?: string|number, + * _$_root?: AnyInput, + * _$_v?: unknown, + * [key: string]: SandboxPropertyValue + * }} SandboxType + */ + /** * @typedef {object} JSONPathOptions - * @property {JSON} json - * @property {string|string[]} path - * @property {"value"|"path"|"pointer"|"parent"|"parentProperty"| - * "all"} [resultType="value"] + * @property {AnyInput} [json] + * @property {PathType} [path] + * @property {ResultType} [resultType="value"] * @property {boolean} [flatten=false] * @property {boolean} [wrap=true] - * @property {object} [sandbox={}] - * @property {EvalCallback|EvalClass|'safe'|'native'| - * boolean} [eval = 'safe'] - * @property {object|GenericArray|null} [parent=null] + * @property {SandboxType} [sandbox={}] + * @property {EvalValue} [eval='safe'] + * @property {any|null} [parent=null] * @property {string|null} [parentProperty=null] * @property {JSONPathCallback} [callback] * @property {OtherTypeCallback} [otherTypeCallback] Defaults to * function which throws on encountering `@other` * @property {boolean} [autostart=true] + * @property {boolean} [ignoreEvalErrors=false] */ /** - * @param {string|JSONPathOptions} opts If a string, will be treated as `expr` - * @param {string} [expr] JSON path to evaluate - * @param {JSON} [obj] JSON object to evaluate against - * @param {JSONPathCallback} [callback] Passed 3 arguments: 1) desired payload - * per `resultType`, 2) `"value"|"property"`, 3) Full returned object with + * @overload + * @param {string} opts JSON path to evaluate + * @param {AnyInput} [expr] JSON object to evaluate against + * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired + * payload per `resultType`, 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [callback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + * @param {undefined} [otherTypeCallback] + * @returns {unknown|JSONPathClass} + */ + /** + * @overload + * @param {JSONPathOptions} opts If a string, will be treated as + * `expr` + * @returns {unknown|JSONPathClass} + */ + /** + * @param {JSONPathOptions|string} opts If a string, will be treated as `expr` + * @param {string|AnyInput} [expr] JSON path to evaluate + * @param {AnyInput|JSONPathCallback} [obj] JSON object to evaluate against + * @param {JSONPathCallback|OtherTypeCallback} [callback] Passed 3 + * arguments: 1) desired payload per `resultType`, + * 2) `"value"|"property"`, 3) Full returned object with * all payloads * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the end * of one's query, this will be invoked with the value of the item, its * path, its parent, and its parent's property name, and it should return * a boolean indicating whether the supplied value belongs to the "other" * type or not (or it may handle transformations and return `false`). - * @returns {JSONPath} - * @class + * @throws {Error} + * @returns {unknown|JSONPathClass} */ function JSONPath(opts, expr, obj, callback, otherTypeCallback) { - // eslint-disable-next-line no-restricted-syntax -- Allow for pseudo-class - if (!(this instanceof JSONPath)) { - try { - return new JSONPath(opts, expr, obj, callback, otherTypeCallback); - } catch (e) { - if (!e.avoidNew) { - throw e; - } - return e.value; - } - } - if (typeof opts === 'string') { - otherTypeCallback = callback; - callback = obj; - obj = expr; - expr = opts; - opts = null; - } - const optObj = opts && typeof opts === 'object'; - opts = opts || {}; - this.json = opts.json || obj; - this.path = opts.path || expr; - this.resultType = opts.resultType || 'value'; - this.flatten = opts.flatten || false; - this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true; - this.sandbox = opts.sandbox || {}; - this.eval = opts.eval === undefined ? 'safe' : opts.eval; - this.ignoreEvalErrors = typeof opts.ignoreEvalErrors === 'undefined' ? false : opts.ignoreEvalErrors; - this.parent = opts.parent || null; - this.parentProperty = opts.parentProperty || null; - this.callback = opts.callback || callback || null; - this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () { - throw new TypeError('You must supply an otherTypeCallback callback option ' + 'with the @other() operator.'); - }; - if (opts.autostart !== false) { - const args = { - path: optObj ? opts.path : expr - }; - if (!optObj) { - args.json = obj; - } else if ('json' in opts) { - args.json = opts.json; + try { + if (opts && typeof opts === 'object') { + return new JSONPathClass(opts); } - const ret = this.evaluate(args); - if (!ret || typeof ret !== 'object') { - throw new NewError(ret); + return new JSONPathClass(opts, expr, /** @type {JSONPathCallback|undefined} */obj, /** @type {OtherTypeCallback|undefined} */callback, /** @type {undefined} */otherTypeCallback); + } catch (e) { + // eslint-disable-next-line no-restricted-syntax -- Within the file + if (!(e instanceof NewError)) { + throw e; } - return ret; + return e.value; } } - // PUBLIC METHODS - JSONPath.prototype.evaluate = function (expr, json, callback, otherTypeCallback) { - let currParent = this.parent, - currParentProperty = this.parentProperty; - let { - flatten, - wrap - } = this; - this.currResultType = this.resultType; - this.currEval = this.eval; - this.currSandbox = this.sandbox; - callback = callback || this.callback; - this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; - json = json || this.json; - expr = expr || this.path; - if (expr && typeof expr === 'object' && !Array.isArray(expr)) { - if (!expr.path && expr.path !== '') { - throw new TypeError('You must supply a "path" property when providing an object ' + 'argument to JSONPath.evaluate().'); - } - if (!Object.hasOwn(expr, 'json')) { - throw new TypeError('You must supply a "json" property when providing an object ' + 'argument to JSONPath.evaluate().'); - } - ({ - json - } = expr); - flatten = Object.hasOwn(expr, 'flatten') ? expr.flatten : flatten; - this.currResultType = Object.hasOwn(expr, 'resultType') ? expr.resultType : this.currResultType; - this.currSandbox = Object.hasOwn(expr, 'sandbox') ? expr.sandbox : this.currSandbox; - wrap = Object.hasOwn(expr, 'wrap') ? expr.wrap : wrap; - this.currEval = Object.hasOwn(expr, 'eval') ? expr.eval : this.currEval; - callback = Object.hasOwn(expr, 'callback') ? expr.callback : callback; - this.currOtherTypeCallback = Object.hasOwn(expr, 'otherTypeCallback') ? expr.otherTypeCallback : this.currOtherTypeCallback; - currParent = Object.hasOwn(expr, 'parent') ? expr.parent : currParent; - currParentProperty = Object.hasOwn(expr, 'parentProperty') ? expr.parentProperty : currParentProperty; - expr = expr.path; - } - currParent = currParent || null; - currParentProperty = currParentProperty || null; - if (Array.isArray(expr)) { - expr = JSONPath.toPathString(expr); - } - if (!expr && expr !== '' || !json) { - return undefined; - } - const exprList = JSONPath.toPathArray(expr); - if (exprList[0] === '$' && exprList.length > 1) { - exprList.shift(); - } - this._hasParentSelector = null; - const result = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback).filter(function (ea) { - return ea && !ea.isParentSelector; - }); - if (!result.length) { - return wrap ? [] : undefined; - } - if (!wrap && result.length === 1 && !result[0].hasArrExpr) { - return this._getPreferredOutput(result[0]); + /** + * + */ + class JSONPathClass { + /** + * @overload + * @param {string} opts JSON path to evaluate + * @param {AnyInput} [expr] JSON object to evaluate against + * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired + * payload per `resultType`, 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [callback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + * @param {undefined} [otherTypeCallback] + * @returns {JSONPath|JSONPathClass} + */ + /** + * @overload + * @param {JSONPathOptions} opts If a string, will be treated as + * `expr` + */ + /** + * @param {null|string|JSONPathOptions} opts If a string, will be treated as + * `expr` + * @param {string|AnyInput} [expr] JSON path to evaluate + * @param {AnyInput|JSONPathCallback} [obj] JSON object to evaluate against + * @param {JSONPathCallback|OtherTypeCallback} [callback] Passed 3 + * arguments: 1) desired payload per `resultType`, + * 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + */ + constructor(opts, expr, obj, callback, otherTypeCallback) { + if (typeof opts === 'string') { + otherTypeCallback = /** @type {OtherTypeCallback} */ + callback; + callback = /** @type {JSONPathCallback} */ + obj; + obj = expr; + expr = opts; + opts = null; + } + const optObj = opts && typeof opts === 'object'; + opts ||= /** @type {JSONPathOptions} */{}; + /** @type {ResultType|undefined} */ + this.currResultType = undefined; + + /** @type {EvalValue|undefined} */ + this.currEval = undefined; + + /** @type {OtherTypeCallback|undefined} */ + this.currOtherTypeCallback = undefined; + + /** @type {SafeScriptType} */ + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members, no-unused-expressions -- On prototype + this.safeVm; + + /** @type {ScriptType} */ + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members, no-unused-expressions -- On prototype + this.vm; + + /** @type {SandboxType|undefined} */ + this.currSandbox = undefined; + this._hasParentSelector = false; + this.json = opts.json || obj; + this.path = opts.path || expr; + this.resultType = opts.resultType || 'value'; + this.flatten = opts.flatten || false; + this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true; + this.sandbox = opts.sandbox || {}; + this.eval = opts.eval === undefined ? 'safe' : opts.eval; + this.ignoreEvalErrors = typeof opts.ignoreEvalErrors === 'undefined' ? false : opts.ignoreEvalErrors; + this.parent = opts.parent || null; + this.parentProperty = opts.parentProperty || null; + this.callback = opts.callback || (/** @type {JSONPathCallback} */ + callback) || null; + this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () { + throw new TypeError('You must supply an otherTypeCallback callback option ' + 'with the @other() operator.'); + }; + if (opts.autostart !== false) { + const args = /** @type {JSONPathOptions} */{ + path: optObj ? opts.path : expr + }; + if (!optObj && obj !== undefined) { + args.json = obj; + } else if ('json' in opts) { + args.json = opts.json; + } + const ret = this.evaluate(args); + if (!ret || typeof ret !== 'object') { + throw new NewError(ret); + } + + // eslint-disable-next-line @stylistic/max-len -- Long + // @ts-expect-error - Constructor returns evaluate result for legacy API + // eslint-disable-next-line no-constructor-return -- Legacy API + return ret; + } } - return result.reduce((rslt, ea) => { - const valOrPath = this._getPreferredOutput(ea); - if (flatten && Array.isArray(valOrPath)) { - rslt = rslt.concat(valOrPath); + + // PUBLIC METHODS + + /** + * @overload + * @param {JSONPathOptions} [expr] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + + /** + * @overload + * @param {PathType|undefined} [expr] + * @param {AnyInput} [json] + * @param {JSONPathCallback|null} [callback] + * @param {OtherTypeCallback} [otherTypeCallback] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + + /** + * @param {PathType|JSONPathOptions|undefined} [expr] + * @param {AnyInput} [json] + * @param {JSONPathCallback|null} [callback] + * @param {OtherTypeCallback} [otherTypeCallback] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + evaluate(expr, json, callback, otherTypeCallback) { + let currParent = this.parent, + currParentProperty = this.parentProperty; + let { + flatten, + wrap + } = this; + this.currResultType = this.resultType; + this.currEval = this.eval; + this.currSandbox = this.sandbox; + callback ||= this.callback; + this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; + if (expr && typeof expr === 'object' && !Array.isArray(expr)) { + const exprObj = expr; + if (!exprObj.path && exprObj.path !== '') { + throw new TypeError('You must supply a "path" property when providing an ' + 'object argument to JSONPath.evaluate().'); + } + if (!Object.hasOwn(exprObj, 'json')) { + throw new TypeError('You must supply a "json" property when providing an ' + 'object argument to JSONPath.evaluate().'); + } + ({ + json + } = exprObj); + flatten = Object.hasOwn(exprObj, 'flatten') ? exprObj.flatten ?? flatten : flatten; + this.currResultType = Object.hasOwn(exprObj, 'resultType') ? exprObj.resultType : this.currResultType; + this.currSandbox = Object.hasOwn(exprObj, 'sandbox') ? exprObj.sandbox : this.currSandbox; + wrap = Object.hasOwn(exprObj, 'wrap') ? exprObj.wrap : wrap; + this.currEval = Object.hasOwn(exprObj, 'eval') ? exprObj.eval : this.currEval; + callback = Object.hasOwn(exprObj, 'callback') ? exprObj.callback : callback; + this.currOtherTypeCallback = Object.hasOwn(exprObj, 'otherTypeCallback') ? exprObj.otherTypeCallback : this.currOtherTypeCallback; + currParent = Object.hasOwn(exprObj, 'parent') ? exprObj.parent ?? currParent : currParent; + currParentProperty = Object.hasOwn(exprObj, 'parentProperty') ? exprObj.parentProperty ?? currParentProperty : currParentProperty; + expr = exprObj.path; } else { - rslt.push(valOrPath); + json ||= this.json; + expr ||= this.path; } - return rslt; - }, []); - }; + currParent ||= null; + currParentProperty ||= null; + if (Array.isArray(expr)) { + expr = JSONPath.toPathString(expr); + } + if (!json || !expr && expr !== '') { + return undefined; + } + const exprList = JSONPath.toPathArray(/** @type {string} */ + expr); + if (exprList[0] === '$' && exprList.length > 1) { + exprList.shift(); + } + this._hasParentSelector = false; + const traceResult = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback ?? undefined, undefined); - // PRIVATE METHODS - - JSONPath.prototype._getPreferredOutput = function (ea) { - const resultType = this.currResultType; - switch (resultType) { - case 'all': - { - const path = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path); - ea.pointer = JSONPath.toPointer(path); - ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(ea.path); - return ea; + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next 2 -- Unreachable: _trace returns array when hasArrExpr set */ + const result = (Array.isArray(traceResult) ? traceResult : [traceResult]).filter(ea => { + return ea && !ea.isParentSelector; + }); + if (!result.length) { + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: valid queries always produce results */ + return wrap ? [] : undefined; + } + if (!wrap && result.length === 1 && !result[0].hasArrExpr) { + const preferredOutput = this._getPreferredOutput(result[0]); + return preferredOutput; + } + const reduced = result.reduce((rslt, ea) => { + const valOrPath = this._getPreferredOutput(ea); + if (flatten && Array.isArray(valOrPath)) { + rslt = rslt.concat(valOrPath); + } else { + rslt.push(valOrPath); } - case 'value': - case 'parent': - case 'parentProperty': - return ea[resultType]; - case 'path': - return JSONPath.toPathString(ea[resultType]); - case 'pointer': - return JSONPath.toPointer(ea.path); - default: - throw new TypeError('Unknown result type'); + return rslt; + }, /** @type {UnknownResult[]} */ + []); + return reduced; } - }; - JSONPath.prototype._handleCallback = function (fullRetObj, callback, type) { - if (callback) { - const preferredOutput = this._getPreferredOutput(fullRetObj); - fullRetObj.path = typeof fullRetObj.path === 'string' ? fullRetObj.path : JSONPath.toPathString(fullRetObj.path); - // eslint-disable-next-line n/callback-return -- No need to return - callback(preferredOutput, type, fullRetObj); - } - }; - /** - * - * @param {string} expr - * @param {JSONObject} val - * @param {string} path - * @param {object|GenericArray} parent - * @param {string} parentPropName - * @param {JSONPathCallback} callback - * @param {boolean} hasArrExpr - * @param {boolean} literalPriority - * @returns {ReturnObject|ReturnObject[]} - */ - JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, callback, hasArrExpr, literalPriority) { - // No expr to follow? return path and value as the result of - // this trace branch - let retObj; - if (!expr.length) { - retObj = { - path, - value: val, - parent, - parentProperty: parentPropName, - hasArrExpr - }; - this._handleCallback(retObj, callback, 'value'); - return retObj; + // PRIVATE METHODS + + /** + * @param {ReturnObject} ea + * @returns {PreferredOutput} + */ + _getPreferredOutput(ea) { + const resultType = this.currResultType; + switch (resultType) { + case 'all': + { + const path = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path); + ea.pointer = JSONPath.toPointer(/** @type {string[]} */path); + ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(/** @type {string[]} */ea.path); + return ea; + } + case 'value': + case 'parent': + case 'parentProperty': + return ea[resultType]; + case 'path': + if (typeof ea.path === 'string') { + return ea.path; + } + return JSONPath.toPathString(/** @type {string[]} */ea.path); + case 'pointer': + { + const pathArray = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path); + return JSONPath.toPointer(/** @type {string[]} */pathArray); + } + default: + throw new TypeError('Unknown result type'); + } } - const loc = expr[0], - x = expr.slice(1); - // We need to gather the return value of recursive trace calls in order to - // do the parent sel computation. - const ret = []; /** - * - * @param {ReturnObject|ReturnObject[]} elems + * @param {ReturnObject} fullRetObj + * @param {JSONPathCallback|undefined} callback + * @param {"value"|"property"} type * @returns {void} */ - function addRet(elems) { - if (Array.isArray(elems)) { - // This was causing excessive stack size in Node (with or - // without Babel) against our performance test: - // `ret.push(...elems);` - elems.forEach(t => { - ret.push(t); - }); - } else { - ret.push(elems); + _handleCallback(fullRetObj, callback, type) { + // Early return if no callback provided (defensive + // check for internal calls) + if (!callback) { + return; + } + const preferredOutput = this._getPreferredOutput(fullRetObj); + if (Array.isArray(fullRetObj.path)) { + fullRetObj.path = JSONPath.toPathString(/** @type {string[]} */fullRetObj.path); } + callback(preferredOutput, type, fullRetObj); } - if ((typeof loc !== 'string' || literalPriority) && val && Object.hasOwn(val, loc)) { - // simple case--directly follow property - addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr)); - // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if` - } else if (loc === '*') { - // all child properties - this._walk(val, m => { - addRet(this._trace(x, val[m], push(path, m), val, m, callback, true, true)); - }); - } else if (loc === '..') { - // all descendent parent properties - // Check remaining expression with val's immediate children - addRet(this._trace(x, val, path, parent, parentPropName, callback, hasArrExpr)); - this._walk(val, m => { - // We don't join m and x here because we only want parents, - // not scalar values - if (typeof val[m] === 'object') { - // Keep going with recursive descent on val's - // object children - addRet(this._trace(expr.slice(), val[m], push(path, m), val, m, callback, true)); + + /** + * + * @param {ExpressionArray} expr + * @param {unknown} val + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @param {JSONPathCallback|undefined} callback + * @param {boolean|undefined} hasArrExpr + * @param {boolean} [literalPriority] + * @returns {ReturnObject|ReturnObject[]} + */ + _trace(expr, val, path, parent, parentPropName, callback, hasArrExpr, literalPriority) { + // No expr to follow? return path and value as the result of + // this trace branch + let retObj; + if (!expr.length) { + retObj = { + path, + value: val, + parent, + parentProperty: parentPropName, + hasArrExpr + }; + this._handleCallback(retObj, callback, 'value'); + return retObj; + } + const loc = /** @type {string} */expr[0], + x = expr.slice(1); + + // We need to gather the return value of recursive trace calls in order + // to do the parent sel computation. + /** @type {ReturnObject[]} */ + const ret = []; + /** + * + * @param {ReturnObject|ReturnObject[]} elems + * @returns {void} + */ + function addRet(elems) { + if (Array.isArray(elems)) { + // This was causing excessive stack size in Node (with or + // without Babel) against our performance test: + // `ret.push(...elems);` + elems.forEach(t => { + ret.push(t); + }); + } else { + ret.push(elems); } - }); - // The parent sel computation is handled in the frame above using the - // ancestor object of val - } else if (loc === '^') { - // This is not a final endpoint, so we do not invoke the callback here - this._hasParentSelector = true; - return { - path: path.slice(0, -1), - expr: x, - isParentSelector: true - }; - } else if (loc === '~') { - // property name - retObj = { - path: push(path, loc), - value: parentPropName, - parent, - parentProperty: null - }; - this._handleCallback(retObj, callback, 'property'); - return retObj; - } else if (loc === '$') { - // root only - addRet(this._trace(x, val, path, null, null, callback, hasArrExpr)); - } else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(loc)) { - // [start:end:step] Python slice syntax - addRet(this._slice(loc, x, val, path, parent, parentPropName, callback)); - } else if (loc.indexOf('?(') === 0) { - // [?(expr)] (filtering) - if (this.currEval === false) { - throw new Error('Eval [?(expr)] prevented in JSONPath expression.'); - } - const safeLoc = loc.replace(/^\?\((.*?)\)$/u, '$1'); - // check for a nested filter expression - const nested = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(safeLoc); - if (nested) { - // find if there are matches in the nested expression - // add them to the result set if there is at least one match + } + if (val && (typeof loc !== 'string' || literalPriority) && Object.hasOwn(val, /** @type {PropertyKey} */loc)) { + // simple case--directly follow property + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[(/** @type {string} */loc)], push(path, loc), val, /** @type {string|number} */loc, callback, hasArrExpr)); + // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if` + } else if (loc === '*') { + // all child properties this._walk(val, m => { - const npath = [nested[2]]; - const nvalue = nested[1] ? val[m][nested[1]] : val[m]; - const filterResults = this._trace(npath, nvalue, path, parent, parentPropName, callback, true); - if (filterResults.length > 0) { - addRet(this._trace(x, val[m], push(path, m), val, m, callback, true)); - } + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[m], push(path, m), val, m, callback, true, true)); }); - } else { + } else if (loc === '..') { + // all descendent parent properties + // Check remaining expression with val's immediate children + addRet(this._trace(x, val, path, parent, parentPropName, callback, hasArrExpr)); this._walk(val, m => { - if (this._eval(safeLoc, val[m], m, path, parent, parentPropName)) { - addRet(this._trace(x, val[m], push(path, m), val, m, callback, true)); + // We don't join m and x here because we only want parents, + // not scalar values + const valObj = /** @type {Record} */val; + if (typeof valObj[m] === 'object') { + // Keep going with recursive descent on val's + // object children + addRet(this._trace(expr.slice(), valObj[m], push(path, m), val, m, callback, true)); } }); - } - } else if (loc[0] === '(') { - // [(expr)] (dynamic property/index) - if (this.currEval === false) { - throw new Error('Eval [(expr)] prevented in JSONPath expression.'); - } - // As this will resolve to a property name (but we don't know it - // yet), property and parent information is relative to the - // parent of the property to which this expression will resolve - addRet(this._trace(unshift(this._eval(loc, val, path.at(-1), path.slice(0, -1), parent, parentPropName), x), val, path, parent, parentPropName, callback, hasArrExpr)); - } else if (loc[0] === '@') { - // value type: @boolean(), etc. - let addType = false; - const valueType = loc.slice(1, -2); - switch (valueType) { - case 'scalar': - if (!val || !['object', 'function'].includes(typeof val)) { - addType = true; - } - break; - case 'boolean': - case 'string': - case 'undefined': - case 'function': - if (typeof val === valueType) { - addType = true; - } - break; - case 'integer': - if (Number.isFinite(val) && !(val % 1)) { - addType = true; - } - break; - case 'number': - if (Number.isFinite(val)) { - addType = true; - } - break; - case 'nonFinite': - if (typeof val === 'number' && !Number.isFinite(val)) { - addType = true; - } - break; - case 'object': - if (val && typeof val === valueType) { - addType = true; - } - break; - case 'array': - if (Array.isArray(val)) { - addType = true; - } - break; - case 'other': - addType = this.currOtherTypeCallback(val, path, parent, parentPropName); - break; - case 'null': - if (val === null) { - addType = true; - } - break; - /* c8 ignore next 2 */ - default: - throw new TypeError('Unknown value type ' + valueType); - } - if (addType) { + // The parent sel computation is handled in the frame above using the + // ancestor object of val + } else if (loc === '^') { + // This is not a final endpoint, so we do not invoke the + // callback here + this._hasParentSelector = true; + return /** @type {ReturnObject} */{ + path: path.slice(0, -1), + expr: x, + isParentSelector: true, + value: undefined, + parent: undefined, + parentProperty: null + }; + } else if (loc === '~') { + // property name retObj = { - path, - value: val, + path: push(path, loc), + value: parentPropName, parent, - parentProperty: parentPropName + parentProperty: null }; - this._handleCallback(retObj, callback, 'value'); + this._handleCallback(retObj, callback, 'property'); return retObj; + } else if (loc === '$') { + // root only + addRet(this._trace(x, val, path, null, null, callback, hasArrExpr)); + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient + } else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(loc)) { + // [start:end:step] Python slice syntax + const sliceResult = this._slice(loc, x, val, path, parent, parentPropName, callback); + if (sliceResult) { + addRet(sliceResult); + } + } else if (loc.indexOf('?(') === 0) { + // [?(expr)] (filtering) + if (this.currEval === false) { + throw new Error('Eval [?(expr)] prevented in JSONPath expression.'); + } + const safeLoc = loc.replace(/^\?\((.*?)\)$/u, '$1'); + // check for a nested filter expression + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient + const nested = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(safeLoc); + if (nested) { + // find if there are matches in the nested expression + // add them to the result set if there is at least one match + this._walk(val, m => { + const npath = [nested[2]]; + const valObj2 = /** @type {Record} */ + val; + const nvalue = /** @type {ValueType} */nested[1] ? /** @type {Record} */valObj2[m][nested[1]] : valObj2[m]; + const filterResults = this._trace(npath, nvalue, path, parent, parentPropName, callback, true); + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next 3 -- Unreachable: _trace always returns array for nested filters */ + const filterArray = Array.isArray(filterResults) ? filterResults : [filterResults]; + if (filterArray.length > 0) { + addRet(this._trace(x, valObj2[m], push(path, m), val, m, callback, true)); + } + }); + } else { + const valObj3 = /** @type {Record} */val; + this._walk(val, m => { + if (this._eval(safeLoc, valObj3[m], m, path, parent, parentPropName)) { + addRet(this._trace(x, valObj3[m], push(path, m), val, m, callback, true)); + } + }); + } + } else if (loc[0] === '(') { + // [(expr)] (dynamic property/index) + if (this.currEval === false) { + throw new Error('Eval [(expr)] prevented in JSONPath expression.'); + } + // As this will resolve to a property name (but we don't know it + // yet), property and parent information is relative to the + const evalResult = this._eval(/** @type {string} */loc, val, /** @type {string|number} */path.at(-1), path.slice(0, -1), parent, parentPropName); + const exprToUse = /** @type {string|number} */ + evalResult !== undefined ? evalResult : ''; + addRet(this._trace(unshift(exprToUse, x), val, path, parent, parentPropName, callback, hasArrExpr)); + } else if (loc[0] === '@') { + // value type: @boolean(), etc. + let addType = false; + const valueType = /** @type {ValueType} */loc.slice(1, -2); + switch (valueType) { + case 'scalar': + if (!val || !['object', 'function'].includes(typeof val)) { + addType = true; + } + break; + case 'boolean': + case 'string': + case 'undefined': + case 'function': + if (typeof val === valueType) { + addType = true; + } + break; + case 'integer': + if (Number.isFinite(val) && !(/** @type {number} */val % 1)) { + addType = true; + } + break; + case 'number': + if (Number.isFinite(val)) { + addType = true; + } + break; + case 'nonFinite': + if (typeof val === 'number' && !Number.isFinite(val)) { + addType = true; + } + break; + case 'object': + if (val && typeof val === valueType) { + addType = true; + } + break; + case 'array': + if (Array.isArray(val)) { + addType = true; + } + break; + case 'other': + addType = this.currOtherTypeCallback?.(val, path, parent, /** @type {string|null} */parentPropName) ?? false; + break; + case 'null': + if (val === null) { + addType = true; + } + break; + /* c8 ignore next 2 */ + default: + throw new TypeError('Unknown value type ' + valueType); + } + if (addType) { + retObj = { + path, + value: val, + parent, + parentProperty: parentPropName, + hasArrExpr + }; + this._handleCallback(retObj, callback, 'value'); + return retObj; + } + // `-escaped property + } else if (val && loc[0] === '`' && Object.hasOwn(val, loc.slice(1))) { + const locProp = loc.slice(1); + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[locProp], push(path, locProp), val, locProp, callback, hasArrExpr, true)); + } else if (loc.includes(',')) { + // [name1,name2,...] + const parts = loc.split(','); + for (const part of parts) { + addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback, true)); + } + // simple case--directly follow property + } else if (!literalPriority && val && Object.hasOwn(val, loc)) { + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[loc], push(path, loc), val, loc, callback, hasArrExpr, true)); } - // `-escaped property - } else if (loc[0] === '`' && val && Object.hasOwn(val, loc.slice(1))) { - const locProp = loc.slice(1); - addRet(this._trace(x, val[locProp], push(path, locProp), val, locProp, callback, hasArrExpr, true)); - } else if (loc.includes(',')) { - // [name1,name2,...] - const parts = loc.split(','); - for (const part of parts) { - addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback, true)); - } - // simple case--directly follow property - } else if (!literalPriority && val && Object.hasOwn(val, loc)) { - addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr, true)); - } - - // We check the resulting values for parent selections. For parent - // selections we discard the value object and continue the trace with the - // current val object - if (this._hasParentSelector) { - for (let t = 0; t < ret.length; t++) { - const rett = ret[t]; - if (rett && rett.isParentSelector) { - const tmp = this._trace(rett.expr, val, rett.path, parent, parentPropName, callback, hasArrExpr); - if (Array.isArray(tmp)) { - ret[t] = tmp[0]; - const tl = tmp.length; - for (let tt = 1; tt < tl; tt++) { - // eslint-disable-next-line @stylistic/max-len -- Long - // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient - t++; - ret.splice(t, 0, tmp[tt]); + + // We check the resulting values for parent selections. For parent + // selections we discard the value object and continue the trace with + // the current val object + if (this._hasParentSelector) { + for (let t = 0; t < ret.length; t++) { + const rett = ret[t]; + if (rett && rett.isParentSelector) { + const exprToUse = /** @type {ExpressionArray} */ + rett.expr; + const pathToUse = /** @type {ExpressionArray} */ + rett.path; + const tmp = this._trace(exprToUse, val, pathToUse, parent, parentPropName, callback, hasArrExpr); + if (Array.isArray(tmp)) { + ret[t] = tmp[0]; + const tl = tmp.length; + for (let tt = 1; tt < tl; tt++) { + t++; + ret.splice(t, 0, tmp[tt]); + } + } else { + ret[t] = tmp; } - } else { - ret[t] = tmp; } } } + return ret; } - return ret; - }; - JSONPath.prototype._walk = function (val, f) { - if (Array.isArray(val)) { - const n = val.length; - for (let i = 0; i < n; i++) { - f(i); - } - } else if (val && typeof val === 'object') { - Object.keys(val).forEach(m => { - f(m); - }); + + /** + * @param {unknown} val + * @param {(prop: string|number) => void} f + * @returns {void} + */ + _walk(val, f) { + if (Array.isArray(val)) { + const n = val.length; + for (let i = 0; i < n; i++) { + f(i); + } + } else if (val && typeof val === 'object') { + Object.keys(val).forEach(m => { + f(m); + }); + } } - }; - JSONPath.prototype._slice = function (loc, expr, val, path, parent, parentPropName, callback) { - if (!Array.isArray(val)) { - return undefined; - } - const len = val.length, - parts = loc.split(':'), - step = parts[2] && Number.parseInt(parts[2]) || 1; - let start = parts[0] && Number.parseInt(parts[0]) || 0, - end = parts[1] ? Number.parseInt(parts[1]) : len; - start = start < 0 ? Math.max(0, start + len) : Math.min(len, start); - end = end < 0 ? Math.max(0, end + len) : Math.min(len, end); - const ret = []; - for (let i = start; i < end; i += step) { - const tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback, true); - // Should only be possible to be an array here since first part of - // ``unshift(i, expr)` passed in above would not be empty, nor `~`, - // nor begin with `@` (as could return objects) - // This was causing excessive stack size in Node (with or - // without Babel) against our performance test: `ret.push(...tmp);` - tmp.forEach(t => { - ret.push(t); - }); + + /** + * @param {string} loc + * @param {ExpressionArray} expr + * @param {unknown} val + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @param {JSONPathCallback|undefined} callback + * @returns {ReturnObject[]|undefined} + */ + _slice(loc, expr, val, path, parent, parentPropName, callback) { + if (!Array.isArray(val)) { + return undefined; + } + const len = val.length, + parts = loc.split(':'), + step = parts[2] && Number(parts[2]) || 1; + let start = parts[0] && Number(parts[0]) || 0, + end = parts[1] ? Number(parts[1]) : len; + start = start < 0 ? Math.max(0, start + len) : Math.min(len, start); + end = end < 0 ? Math.max(0, end + len) : Math.min(len, end); + /** @type {ReturnObject[]} */ + const ret = []; + for (let i = start; i < end; i += step) { + const tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback, true); + // Should only be possible to be an array here since first part of + // ``unshift(i, expr)` passed in above would not be empty, + // nor `~`, nor begin with `@` (as could return objects) + // This was causing excessive stack size in Node (with or + // without Babel) against our performance test: `ret.push(...tmp);` + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: _trace returns array when expr non-empty */ + const tmpArray = Array.isArray(tmp) ? tmp : [tmp]; + tmpArray.forEach(t => { + ret.push(t); + }); + } + return ret; } - return ret; - }; - JSONPath.prototype._eval = function (code, _v, _vname, path, parent, parentPropName) { - this.currSandbox._$_parentProperty = parentPropName; - this.currSandbox._$_parent = parent; - this.currSandbox._$_property = _vname; - this.currSandbox._$_root = this.json; - this.currSandbox._$_v = _v; - const containsPath = code.includes('@path'); - if (containsPath) { - this.currSandbox._$_path = JSONPath.toPathString(path.concat([_vname])); - } - const scriptCacheKey = this.currEval + 'Script:' + code; - if (!JSONPath.cache[scriptCacheKey]) { - let script = code.replaceAll('@parentProperty', '_$_parentProperty').replaceAll('@parent', '_$_parent').replaceAll('@property', '_$_property').replaceAll('@root', '_$_root').replaceAll(/@([.\s)[])/gu, '_$_v$1'); + + /** + * @param {string} code + * @param {unknown} _v + * @param {string|number} _vname + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @returns {UnknownResult} + */ + _eval(code, _v, _vname, path, parent, parentPropName) { + if (this.currSandbox) { + this.currSandbox._$_parentProperty = parentPropName; + this.currSandbox._$_parent = parent; + this.currSandbox._$_property = _vname; + this.currSandbox._$_root = this.json; + this.currSandbox._$_v = _v; + } + const containsPath = code.includes('@path'); if (containsPath) { - script = script.replaceAll('@path', '_$_path'); - } - if (this.currEval === 'safe' || this.currEval === true || this.currEval === undefined) { - JSONPath.cache[scriptCacheKey] = new this.safeVm.Script(script); - } else if (this.currEval === 'native') { - JSONPath.cache[scriptCacheKey] = new this.vm.Script(script); - } else if (typeof this.currEval === 'function' && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, 'runInNewContext')) { - const CurrEval = this.currEval; - JSONPath.cache[scriptCacheKey] = new CurrEval(script); - } else if (typeof this.currEval === 'function') { - JSONPath.cache[scriptCacheKey] = { - runInNewContext: context => this.currEval(script, context) - }; - } else { - throw new TypeError(`Unknown "eval" property "${this.currEval}"`); + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: currSandbox set in evaluate() before _eval */ + const currSandbox = this.currSandbox ?? {}; + currSandbox._$_path = JSONPath.toPathString(/** @type {string[]} */path.concat([_vname])); } - } - try { - return JSONPath.cache[scriptCacheKey].runInNewContext(this.currSandbox); - } catch (e) { - if (this.ignoreEvalErrors) { - return false; + const scriptCacheKey = this.currEval + 'Script:' + code; + if (!Object.hasOwn(JSONPath.cache, scriptCacheKey)) { + let script = code.replaceAll('@parentProperty', '_$_parentProperty').replaceAll('@parent', '_$_parent').replaceAll('@property', '_$_property').replaceAll('@root', '_$_root').replaceAll(/@([.\s)[])/gu, '_$_v$1'); + if (containsPath) { + script = script.replaceAll('@path', '_$_path'); + } + const evalType = /** @type {string|boolean|undefined} */ + this.currEval; + if (['safe', true, undefined].includes(evalType)) { + const { + cache + } = JSONPath; + cache[scriptCacheKey] = new + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members -- Prototype + this.safeVm.Script(script); + } else if (this.currEval === 'native') { + const { + cache + } = JSONPath; + cache[scriptCacheKey] = new + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members -- Prototype + this.vm.Script(script); + } else if (typeof this.currEval === 'function' && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, 'runInNewContext')) { + const CurrEval = this.currEval; + const { + cache + } = JSONPath; + // eslint-disable-next-line @stylistic/max-len -- Long + // @ts-expect-error - Type checked above to have proper constructor + cache[scriptCacheKey] = new CurrEval(script); + } else if (typeof this.currEval === 'function') { + const { + cache + } = JSONPath; + // Type narrowing: at this point currEval is a function + // but not a constructor + const evalFunc = /** @type {EvalCallback} */this.currEval; + cache[scriptCacheKey] = { + runInNewContext: (/** @type {ContextItem} */context) => evalFunc(script, context) + }; + } else { + throw new TypeError(`Unknown "eval" property "${this.currEval}"`); + } + } + try { + const { + cache + } = JSONPath; + + /** + * @typedef {{ + * runInNewContext: ( + * ctx: SandboxType|undefined + * ) => EvaluatedResult + * }} RunInNewContext + */ + + return /** @type {RunInNewContext} */cache[scriptCacheKey].runInNewContext(this.currSandbox); + } catch (e) { + if (this.ignoreEvalErrors) { + return false; + } + const error = /** @type {Error} */e; + throw new Error('jsonPath: ' + error.message + ': ' + code, { + cause: e + }); } - throw new Error('jsonPath: ' + e.message + ': ' + code); } + } + JSONPathClass.prototype.safeVm = { + Script: SafeScript }; // PUBLIC CLASS PROPERTIES AND METHODS // Could store the cache object itself + + /** @type {Record} */ JSONPath.cache = {}; /** @@ -2004,7 +2422,7 @@ }; /** - * @param {string} pointer JSON Path + * @param {string[]} pointer JSON Path array * @returns {string} JSON Pointer */ JSONPath.toPointer = function (pointer) { @@ -2027,9 +2445,10 @@ const { cache } = JSONPath; - if (cache[expr]) { - return cache[expr].concat(); + if (Object.hasOwn(cache, expr)) { + return /** @type {string[]} */cache[expr].concat(); } + /** @type {string[]} */ const subx = []; const normalized = expr // Properties @@ -2037,7 +2456,10 @@ // Parenthetical evaluations (filtering and otherwise), directly // within brackets or single quotes .replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function ($0, $1) { - return '[#' + (subx.push($1) - 1) + ']'; + return '[#' + ( + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-return-array-push -- Optimization + subx.push($1) - 1) + ']'; }) // Escape periods and tildes within properties .replaceAll(/\[['"]([^'\]]*)['"]\]/gu, function ($0, prop) { @@ -2046,6 +2468,7 @@ // Properties operator .replaceAll('~', ';~;') // Split by property boundaries + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient .replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu, ';') // Reinsert periods within properties .replaceAll('%@%', '.') @@ -2061,34 +2484,95 @@ .replaceAll(/;$|'?\]|'$/gu, ''); const exprList = normalized.split(';').map(function (exp) { const match = exp.match(/#(\d+)/u); - return !match || !match[1] ? exp : subx[match[1]]; + return !match || !match[1] ? exp : subx[Number(match[1])]; }); cache[expr] = exprList; - return cache[expr].concat(); - }; - JSONPath.prototype.safeVm = { - Script: SafeScript + return /** @type {string[]} */cache[expr].concat(); }; /** - * @typedef {any} ContextItem + * @typedef {import('./jsonpath.js').AnyInput} AnyInput */ - /** - * @typedef {any} EvaluatedResult + * @typedef {import('./jsonpath.js').SandboxCallback} SandboxCallback + */ + /** + * @typedef {import('./jsonpath.js').SandboxPropertyValue} SandboxPropertyValue + */ + /** + * @typedef {import('./jsonpath.js').ExpressionArray} ExpressionArray + */ + /** + * @typedef {import('./jsonpath.js').ValueType} ValueType + */ + /** + * @typedef {import('./jsonpath.js').ParentValue} ParentValue + */ + /** + * @typedef {import('./jsonpath.js').UnknownResult} UnknownResult + */ + /** + * @typedef {import('./jsonpath.js').ParentProperty} ParentProperty + */ + /** + * @typedef {import('./jsonpath.js').PreferredOutput} PreferredOutput + */ + /** + * @typedef {import('./jsonpath.js').ReturnObject} ReturnObject + */ + /** + * @typedef {import('./jsonpath.js').JSONPathCallback} JSONPathCallback + */ + /** + * @typedef {import('./jsonpath.js').OtherTypeCallback} OtherTypeCallback + */ + /** + * @typedef {import('./jsonpath.js').ContextItem} ContextItem + */ + /** + * @typedef {import('./jsonpath.js').EvaluatedResult} EvaluatedResult + */ + /** + * @typedef {import('./jsonpath.js').EvalCallback} EvalCallback + */ + /** + * @typedef {import('./jsonpath.js').EvalClass} EvalClass + */ + /** + * @typedef {import('./jsonpath.js').ResultType} ResultType + */ + /** + * @typedef {import('./jsonpath.js').EvalValue} EvalValue + */ + /** + * @typedef {import('./jsonpath.js').PathType} PathType + */ + /** + * @typedef {import('./jsonpath.js').SafeScriptType} SafeScriptType + */ + /** + * @typedef {import('./jsonpath.js').ScriptType} ScriptType + */ + /** + * @typedef {import('./jsonpath.js').SandboxType} SandboxType + */ + /** + * @typedef {import('./jsonpath.js').JSONPathOptions} JSONPathOptions */ /** + * @template T * @callback ConditionCallback - * @param {ContextItem} item + * @param {T} item * @returns {boolean} */ /** * Copy items out of one array into another. - * @param {GenericArray} source Array with items to copy - * @param {GenericArray} target Array to which to copy - * @param {ConditionCallback} conditionCb Callback passed the current item; + * @template T + * @param {T[]} source Array with items to copy + * @param {T[]} target Array to which to copy + * @param {ConditionCallback} conditionCb Callback passed the current item; * will move item if evaluates to `true` * @returns {void} */ @@ -2097,8 +2581,6 @@ for (let i = 0; i < il; i++) { const item = source[i]; if (conditionCb(item)) { - // eslint-disable-next-line @stylistic/max-len -- Long - // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient target.push(source.splice(i--, 1)[0]); } } @@ -2116,14 +2598,14 @@ } /** - * @param {object} context Object whose items will be added + * @param {SandboxType} context Object whose items will be added * to evaluation * @returns {EvaluatedResult} Result of evaluated code */ runInNewContext(context) { let expr = this.code; const keys = Object.keys(context); - const funcs = []; + const funcs = /** @type {string[]} */[]; moveToAnotherArray(keys, funcs, key => { return typeof context[key] === 'function'; }); @@ -2139,7 +2621,7 @@ }, ''); expr = funcString + expr; - // Mitigate http://perfectionkills.com/global-eval-what-are-the-options/#new_function + // Mitigate https://perfectionkills.com/global-eval-what-are-the-options/#new_function if (!/(['"])use strict\1/u.test(expr) && !keys.includes('arguments')) { expr = 'var arguments = undefined;' + expr; } @@ -2157,10 +2639,12 @@ return new Function(...keys, code)(...values); } } - JSONPath.prototype.vm = { + JSONPathClass.prototype.vm = { Script }; exports.JSONPath = JSONPath; + exports.JSONPathClass = JSONPathClass; + exports.Script = Script; })); diff --git a/dist/index-browser-umd.min.cjs b/dist/index-browser-umd.min.cjs index d0d073a3..f7be1fc0 100644 --- a/dist/index-browser-umd.min.cjs +++ b/dist/index-browser-umd.min.cjs @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).JSONPath={})}(this,function(e){"use strict";class t{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+t.version}static addUnaryOp(e){return t.max_unop_len=Math.max(e.length,t.max_unop_len),t.unary_ops[e]=1,t}static addBinaryOp(e,r,s){return t.max_binop_len=Math.max(e.length,t.max_binop_len),t.binary_ops[e]=r,s?t.right_associative.add(e):t.right_associative.delete(e),t}static addIdentifierChar(e){return t.additional_identifier_chars.add(e),t}static addLiteral(e,r){return t.literals[e]=r,t}static removeUnaryOp(e){return delete t.unary_ops[e],e.length===t.max_unop_len&&(t.max_unop_len=t.getMaxKeyLen(t.unary_ops)),t}static removeAllUnaryOps(){return t.unary_ops={},t.max_unop_len=0,t}static removeIdentifierChar(e){return t.additional_identifier_chars.delete(e),t}static removeBinaryOp(e){return delete t.binary_ops[e],e.length===t.max_binop_len&&(t.max_binop_len=t.getMaxKeyLen(t.binary_ops)),t.right_associative.delete(e),t}static removeAllBinaryOps(){return t.binary_ops={},t.max_binop_len=0,t}static removeLiteral(e){return delete t.literals[e],t}static removeAllLiterals(){return t.literals={},t}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new t(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return t.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!t.binary_ops[String.fromCharCode(e)]||t.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return t.isIdentifierStart(e)||t.isDecimalDigit(e)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,r){if(t.hooks[e]){const s={context:this,node:r};return t.hooks.run(e,s),s.node}return r}searchHook(e){if(t.hooks[e]){const r={context:this};return t.hooks[e].find(function(e){return e.call(r.context,r),r.node}),r.node}}gobbleSpaces(){let e=this.code;for(;e===t.SPACE_CODE||e===t.TAB_CODE||e===t.LF_CODE||e===t.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const e=this.gobbleExpressions(),r=1===e.length?e[0]:{type:t.COMPOUND,body:e};return this.runHook("after-all",r)}gobbleExpressions(e){let r,s,n=[];for(;this.index0;){if(t.binary_ops.hasOwnProperty(e)&&(!t.isIdentifierStart(this.code)||this.index+e.lengthi.right_a&&e.right_a?s>e.prec:s<=e.prec;for(;n.length>2&&h(n[n.length-2]);)a=n.pop(),r=n.pop().value,o=n.pop(),e={type:t.BINARY_EXP,operator:r,left:o,right:a},n.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+l),n.push(i,e)}for(h=n.length-1,e=n[h];h>1;)e={type:t.BINARY_EXP,operator:n[h-1].value,left:n[h-2],right:e},h-=2;return e}gobbleToken(){let e,r,s,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"),n)return this.runHook("after-token",n);if(e=this.code,t.isDecimalDigit(e)||e===t.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===t.SQUOTE_CODE||e===t.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(e===t.OBRACK_CODE)n=this.gobbleArray();else{for(r=this.expr.substr(this.index,t.max_unop_len),s=r.length;s>0;){if(t.unary_ops.hasOwnProperty(r)&&(!t.isIdentifierStart(this.code)||this.index+r.length=r.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(i===t.COMMA_CODE){if(this.index++,n++,n!==r.length)if(e===t.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===t.CBRACK_CODE)for(let e=r.length;e{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(t),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),t.max_unop_len=t.getMaxKeyLen(t.unary_ops),t.max_binop_len=t.getMaxKeyLen(t.binary_ops);const s=e=>new t(e).parse(),n=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(t).filter(e=>!n.includes(e)&&void 0===s[e]).forEach(e=>{s[e]=t[e]}),s.Jsep=t;var i={name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;const r=t.node,s=this.gobbleExpression();if(s||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const n=this.gobbleExpression();if(n||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:s,alternate:n},r.operator&&e.binary_ops[r.operator]<=.9){let s=r;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;t.node.test=s.right,s.right=t.node,t.node=r}}else this.throwError("Expected :")}})}};s.plugins.register(i);var o={name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){const r=++this.index;let s=!1;for(;this.index=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;i+=this.char}try{n=new RegExp(s,i)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:n,raw:this.expr.slice(r-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?s=!0:s&&this.code===e.CBRACK_CODE&&(s=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}};const a={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[43,45],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];function r(e){a.assignmentOperators.has(e.operator)?(e.type="AssignmentExpression",r(e.left),r(e.right)):e.operator||Object.values(e).forEach(e=>{e&&"object"==typeof e&&r(e)})}a.assignmentOperators.forEach(t=>e.addBinaryOp(t,a.assignmentPrecedence,!0)),e.hooks.add("gobble-token",function(e){const r=this.code;a.updateOperators.some(e=>e===r&&e===this.expr.charCodeAt(this.index+1))&&(this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},e.node.argument&&t.includes(e.node.argument.type)||this.throwError(`Unexpected ${e.node.operator}`))}),e.hooks.add("after-token",function(e){if(e.node){const r=this.code;a.updateOperators.some(e=>e===r&&e===this.expr.charCodeAt(this.index+1))&&(t.includes(e.node.type)||this.throwError(`Unexpected ${e.node.operator}`),this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:e.node,prefix:!1})}}),e.hooks.add("after-expression",function(e){e.node&&r(e.node)})}};s.plugins.register(o,a),s.addUnaryOp("typeof"),s.addUnaryOp("void"),s.addLiteral("null",null),s.addLiteral("undefined",void 0);const h=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),l={evalAst(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":return l.evalBinaryExpression(e,t);case"Compound":return l.evalCompound(e,t);case"ConditionalExpression":return l.evalConditionalExpression(e,t);case"Identifier":return l.evalIdentifier(e,t);case"Literal":return l.evalLiteral(e,t);case"MemberExpression":return l.evalMemberExpression(e,t);case"UnaryExpression":return l.evalUnaryExpression(e,t);case"ArrayExpression":return l.evalArrayExpression(e,t);case"CallExpression":return l.evalCallExpression(e,t);case"AssignmentExpression":return l.evalAssignmentExpression(e,t);default:throw SyntaxError("Unexpected expression",e)}},evalBinaryExpression:(e,t)=>({"||":(e,t)=>e||t(),"&&":(e,t)=>e&&t(),"|":(e,t)=>e|t(),"^":(e,t)=>e^t(),"&":(e,t)=>e&t(),"==":(e,t)=>e==t(),"!=":(e,t)=>e!=t(),"===":(e,t)=>e===t(),"!==":(e,t)=>e!==t(),"<":(e,t)=>e":(e,t)=>e>t(),"<=":(e,t)=>e<=t(),">=":(e,t)=>e>=t(),"<<":(e,t)=>e<>":(e,t)=>e>>t(),">>>":(e,t)=>e>>>t(),"+":(e,t)=>e+t(),"-":(e,t)=>e-t(),"*":(e,t)=>e*t(),"/":(e,t)=>e/t(),"%":(e,t)=>e%t()}[e.operator](l.evalAst(e.left,t),()=>l.evalAst(e.right,t))),evalCompound(e,t){let r;for(let s=0;sl.evalAst(e.test,t)?l.evalAst(e.consequent,t):l.evalAst(e.alternate,t),evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw ReferenceError(`${e.name} is not defined`)},evalLiteral:e=>e.value,evalMemberExpression(e,t){const r=String(e.computed?l.evalAst(e.property):e.property.name),s=l.evalAst(e.object,t);if(null==s)throw TypeError(`Cannot read properties of ${s} (reading '${r}')`);if(!Object.hasOwn(s,r)&&h.has(r))throw TypeError(`Cannot read properties of ${s} (reading '${r}')`);const n=s[r];return"function"==typeof n&&n!==Function?n.bind(s):n},evalUnaryExpression:(e,t)=>({"-":e=>-l.evalAst(e,t),"!":e=>!l.evalAst(e,t),"~":e=>~l.evalAst(e,t),"+":e=>+l.evalAst(e,t),typeof:e=>typeof l.evalAst(e,t),void:e=>{l.evalAst(e,t)}}[e.operator](e.argument)),evalArrayExpression:(e,t)=>e.elements.map(e=>l.evalAst(e,t)),evalCallExpression(e,t){const r=e.arguments.map(e=>l.evalAst(e,t)),s=l.evalAst(e.callee,t);if(s===Function)throw new Error("Function constructor is disabled");return s(...r)},evalAssignmentExpression(e,t){if("Identifier"!==e.left.type)throw SyntaxError("Invalid left-hand side in assignment");const r=e.left.name,s=l.evalAst(e.right,t);return t[r]=s,t[r]}};function c(e,t){return(e=e.slice()).push(t),e}function p(e,t){return(t=t.slice()).unshift(e),t}class u extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}}function d(e,t,r,s,n){if(!(this instanceof d))try{return new d(e,t,r,s,n)}catch(e){if(!e.avoidNew)throw e;return e.value}"string"==typeof e&&(n=s,s=r,r=t,t=e,e=null);const i=e&&"object"==typeof e;if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!Object.hasOwn(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.eval=void 0===e.eval?"safe":e.eval,this.ignoreEvalErrors=void 0!==e.ignoreEvalErrors&&e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||s||null,this.otherTypeCallback=e.otherTypeCallback||n||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){const s={path:i?e.path:t};i?"json"in e&&(s.json=e.json):s.json=r;const n=this.evaluate(s);if(!n||"object"!=typeof n)throw new u(n);return n}}d.prototype.evaluate=function(e,t,r,s){let n=this.parent,i=this.parentProperty,{flatten:o,wrap:a}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=s||this.otherTypeCallback,t=t||this.json,(e=e||this.path)&&"object"==typeof e&&!Array.isArray(e)){if(!e.path&&""!==e.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),o=Object.hasOwn(e,"flatten")?e.flatten:o,this.currResultType=Object.hasOwn(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,"sandbox")?e.sandbox:this.currSandbox,a=Object.hasOwn(e,"wrap")?e.wrap:a,this.currEval=Object.hasOwn(e,"eval")?e.eval:this.currEval,r=Object.hasOwn(e,"callback")?e.callback:r,this.currOtherTypeCallback=Object.hasOwn(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,n=Object.hasOwn(e,"parent")?e.parent:n,i=Object.hasOwn(e,"parentProperty")?e.parentProperty:i,e=e.path}if(n=n||null,i=i||null,Array.isArray(e)&&(e=d.toPathString(e)),!e&&""!==e||!t)return;const h=d.toPathArray(e);"$"===h[0]&&h.length>1&&h.shift(),this._hasParentSelector=null;const l=this._trace(h,t,["$"],n,i,r).filter(function(e){return e&&!e.isParentSelector});return l.length?a||1!==l.length||l[0].hasArrExpr?l.reduce((e,t)=>{const r=this._getPreferredOutput(t);return o&&Array.isArray(r)?e=e.concat(r):e.push(r),e},[]):this._getPreferredOutput(l[0]):a?[]:void 0},d.prototype._getPreferredOutput=function(e){const t=this.currResultType;switch(t){case"all":{const t=Array.isArray(e.path)?e.path:d.toPathArray(e.path);return e.pointer=d.toPointer(t),e.path="string"==typeof e.path?e.path:d.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return d.toPathString(e[t]);case"pointer":return d.toPointer(e.path);default:throw new TypeError("Unknown result type")}},d.prototype._handleCallback=function(e,t,r){if(t){const s=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:d.toPathString(e.path),t(s,r,e)}},d.prototype._trace=function(e,t,r,s,n,i,o,a){let h;if(!e.length)return h={path:r,value:t,parent:s,parentProperty:n,hasArrExpr:o},this._handleCallback(h,i,"value"),h;const l=e[0],u=e.slice(1),d=[];function f(e){Array.isArray(e)?e.forEach(e=>{d.push(e)}):d.push(e)}if(("string"!=typeof l||a)&&t&&Object.hasOwn(t,l))f(this._trace(u,t[l],c(r,l),t,l,i,o));else if("*"===l)this._walk(t,e=>{f(this._trace(u,t[e],c(r,e),t,e,i,!0,!0))});else if(".."===l)f(this._trace(u,t,r,s,n,i,o)),this._walk(t,s=>{"object"==typeof t[s]&&f(this._trace(e.slice(),t[s],c(r,s),t,s,i,!0))});else{if("^"===l)return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:u,isParentSelector:!0};if("~"===l)return h={path:c(r,l),value:n,parent:s,parentProperty:null},this._handleCallback(h,i,"property"),h;if("$"===l)f(this._trace(u,t,r,null,null,i,o));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))f(this._slice(l,u,t,r,s,n,i));else if(0===l.indexOf("?(")){if(!1===this.currEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const e=l.replace(/^\?\((.*?)\)$/u,"$1"),o=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e);o?this._walk(t,e=>{const a=[o[2]],h=o[1]?t[e][o[1]]:t[e];this._trace(a,h,r,s,n,i,!0).length>0&&f(this._trace(u,t[e],c(r,e),t,e,i,!0))}):this._walk(t,o=>{this._eval(e,t[o],o,r,s,n)&&f(this._trace(u,t[o],c(r,o),t,o,i,!0))})}else if("("===l[0]){if(!1===this.currEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");f(this._trace(p(this._eval(l,t,r.at(-1),r.slice(0,-1),s,n),u),t,r,s,n,i,o))}else if("@"===l[0]){let e=!1;const o=l.slice(1,-2);switch(o){case"scalar":t&&["object","function"].includes(typeof t)||(e=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===o&&(e=!0);break;case"integer":!Number.isFinite(t)||t%1||(e=!0);break;case"number":Number.isFinite(t)&&(e=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(e=!0);break;case"object":t&&typeof t===o&&(e=!0);break;case"array":Array.isArray(t)&&(e=!0);break;case"other":e=this.currOtherTypeCallback(t,r,s,n);break;case"null":null===t&&(e=!0);break;default:throw new TypeError("Unknown value type "+o)}if(e)return h={path:r,value:t,parent:s,parentProperty:n},this._handleCallback(h,i,"value"),h}else if("`"===l[0]&&t&&Object.hasOwn(t,l.slice(1))){const e=l.slice(1);f(this._trace(u,t[e],c(r,e),t,e,i,o,!0))}else if(l.includes(",")){const e=l.split(",");for(const o of e)f(this._trace(p(o,u),t,r,s,n,i,!0))}else!a&&t&&Object.hasOwn(t,l)&&f(this._trace(u,t[l],c(r,l),t,l,i,o,!0))}if(this._hasParentSelector)for(let e=0;e{t(e)})},d.prototype._slice=function(e,t,r,s,n,i,o){if(!Array.isArray(r))return;const a=r.length,h=e.split(":"),l=h[2]&&Number.parseInt(h[2])||1;let c=h[0]&&Number.parseInt(h[0])||0,u=h[1]?Number.parseInt(h[1]):a;c=c<0?Math.max(0,c+a):Math.min(a,c),u=u<0?Math.max(0,u+a):Math.min(a,u);const d=[];for(let e=c;e{d.push(e)})}return d},d.prototype._eval=function(e,t,r,s,n,i){this.currSandbox._$_parentProperty=i,this.currSandbox._$_parent=n,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;const o=e.includes("@path");o&&(this.currSandbox._$_path=d.toPathString(s.concat([r])));const a=this.currEval+"Script:"+e;if(!d.cache[a]){let t=e.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(o&&(t=t.replaceAll("@path","_$_path")),"safe"===this.currEval||!0===this.currEval||void 0===this.currEval)d.cache[a]=new this.safeVm.Script(t);else if("native"===this.currEval)d.cache[a]=new this.vm.Script(t);else if("function"==typeof this.currEval&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const e=this.currEval;d.cache[a]=new e(t)}else{if("function"!=typeof this.currEval)throw new TypeError(`Unknown "eval" property "${this.currEval}"`);d.cache[a]={runInNewContext:e=>this.currEval(t,e)}}}try{return d.cache[a].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+t.message+": "+e)}},d.cache={},d.toPathString=function(e){const t=e,r=t.length;let s="$";for(let e=1;e"function"==typeof e[t]);const n=r.map(t=>e[t]);t=s.reduce((t,r)=>{let s=e[r].toString();return/function/u.test(s)||(s="function "+s),"var "+r+"="+s+";"+t},"")+t,/(['"])use strict\1/u.test(t)||r.includes("arguments")||(t="var arguments = undefined;"+t),t=t.replace(/;\s*$/u,"");const i=t.lastIndexOf(";"),o=-1!==i?t.slice(0,i+1)+" return "+t.slice(i+1):" return "+t;return new Function(...r,o)(...n)}}},e.JSONPath=d}); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).JSONPath={})}(this,function(e){"use strict";class t{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+t.version}static addUnaryOp(e){return t.max_unop_len=Math.max(e.length,t.max_unop_len),t.unary_ops[e]=1,t}static addBinaryOp(e,r,s){return t.max_binop_len=Math.max(e.length,t.max_binop_len),t.binary_ops[e]=r,s?t.right_associative.add(e):t.right_associative.delete(e),t}static addIdentifierChar(e){return t.additional_identifier_chars.add(e),t}static addLiteral(e,r){return t.literals[e]=r,t}static removeUnaryOp(e){return delete t.unary_ops[e],e.length===t.max_unop_len&&(t.max_unop_len=t.getMaxKeyLen(t.unary_ops)),t}static removeAllUnaryOps(){return t.unary_ops={},t.max_unop_len=0,t}static removeIdentifierChar(e){return t.additional_identifier_chars.delete(e),t}static removeBinaryOp(e){return delete t.binary_ops[e],e.length===t.max_binop_len&&(t.max_binop_len=t.getMaxKeyLen(t.binary_ops)),t.right_associative.delete(e),t}static removeAllBinaryOps(){return t.binary_ops={},t.max_binop_len=0,t}static removeLiteral(e){return delete t.literals[e],t}static removeAllLiterals(){return t.literals={},t}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new t(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return t.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!t.binary_ops[String.fromCharCode(e)]||t.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return t.isIdentifierStart(e)||t.isDecimalDigit(e)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,r){if(t.hooks[e]){const s={context:this,node:r};return t.hooks.run(e,s),s.node}return r}searchHook(e){if(t.hooks[e]){const r={context:this};return t.hooks[e].find(function(e){return e.call(r.context,r),r.node}),r.node}}gobbleSpaces(){let e=this.code;for(;e===t.SPACE_CODE||e===t.TAB_CODE||e===t.LF_CODE||e===t.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const e=this.gobbleExpressions(),r=1===e.length?e[0]:{type:t.COMPOUND,body:e};return this.runHook("after-all",r)}gobbleExpressions(e){let r,s,n=[];for(;this.index0;){if(t.binary_ops.hasOwnProperty(e)&&(!t.isIdentifierStart(this.code)||this.index+e.lengthi.right_a&&e.right_a?s>e.prec:s<=e.prec;for(;n.length>2&&h(n[n.length-2]);)o=n.pop(),r=n.pop().value,a=n.pop(),e={type:t.BINARY_EXP,operator:r,left:a,right:o},n.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+l),n.push(i,e)}for(h=n.length-1,e=n[h];h>1;)e={type:t.BINARY_EXP,operator:n[h-1].value,left:n[h-2],right:e},h-=2;return e}gobbleToken(){let e,r,s,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"),n)return this.runHook("after-token",n);if(e=this.code,t.isDecimalDigit(e)||e===t.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===t.SQUOTE_CODE||e===t.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(e===t.OBRACK_CODE)n=this.gobbleArray();else{for(r=this.expr.substr(this.index,t.max_unop_len),s=r.length;s>0;){if(t.unary_ops.hasOwnProperty(r)&&(!t.isIdentifierStart(this.code)||this.index+r.length=r.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(i===t.COMMA_CODE){if(this.index++,n++,n!==r.length)if(e===t.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===t.CBRACK_CODE)for(let e=r.length;e{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(t),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),t.max_unop_len=t.getMaxKeyLen(t.unary_ops),t.max_binop_len=t.getMaxKeyLen(t.binary_ops);const s=e=>new t(e).parse(),n=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(t).filter(e=>!n.includes(e)&&void 0===s[e]).forEach(e=>{s[e]=t[e]}),s.Jsep=t;var i={name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;const r=t.node,s=this.gobbleExpression();if(s||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const n=this.gobbleExpression();if(n||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:s,alternate:n},r.operator&&e.binary_ops[r.operator]<=.9){let s=r;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;t.node.test=s.right,s.right=t.node,t.node=r}}else this.throwError("Expected :")}})}};s.plugins.register(i);var a={name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){const r=++this.index;let s=!1;for(;this.index=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;i+=this.char}try{n=new RegExp(s,i)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:n,raw:this.expr.slice(r-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?s=!0:s&&this.code===e.CBRACK_CODE&&(s=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}};const o={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[43,45],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];function r(e){o.assignmentOperators.has(e.operator)?(e.type="AssignmentExpression",r(e.left),r(e.right)):e.operator||Object.values(e).forEach(e=>{e&&"object"==typeof e&&r(e)})}o.assignmentOperators.forEach(t=>e.addBinaryOp(t,o.assignmentPrecedence,!0)),e.hooks.add("gobble-token",function(e){const r=this.code;o.updateOperators.some(e=>e===r&&e===this.expr.charCodeAt(this.index+1))&&(this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},e.node.argument&&t.includes(e.node.argument.type)||this.throwError(`Unexpected ${e.node.operator}`))}),e.hooks.add("after-token",function(e){if(e.node){const r=this.code;o.updateOperators.some(e=>e===r&&e===this.expr.charCodeAt(this.index+1))&&(t.includes(e.node.type)||this.throwError(`Unexpected ${e.node.operator}`),this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:e.node,prefix:!1})}}),e.hooks.add("after-expression",function(e){e.node&&r(e.node)})}};s.plugins.register(a,o),s.addUnaryOp("typeof"),s.addUnaryOp("void"),s.addLiteral("null",null),s.addLiteral("undefined",void 0);const h=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),l={evalAst(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":return l.evalBinaryExpression(e,t);case"Compound":return l.evalCompound(e,t);case"ConditionalExpression":return l.evalConditionalExpression(e,t);case"Identifier":return l.evalIdentifier(e,t);case"Literal":return l.evalLiteral(e);case"MemberExpression":return l.evalMemberExpression(e,t);case"UnaryExpression":return l.evalUnaryExpression(e,t);case"ArrayExpression":return l.evalArrayExpression(e,t);case"CallExpression":return l.evalCallExpression(e,t);case"AssignmentExpression":return l.evalAssignmentExpression(e,t);default:throw new SyntaxError("Unexpected expression",{cause:e})}},evalBinaryExpression:(e,t)=>({"||":(e,t)=>e||t(),"&&":(e,t)=>e&&t(),"|":(e,t)=>e|t(),"^":(e,t)=>e^t(),"&":(e,t)=>e&t(),"==":(e,t)=>e==t(),"!=":(e,t)=>e!=t(),"===":(e,t)=>e===t(),"!==":(e,t)=>e!==t(),"<":(e,t)=>e":(e,t)=>e>t(),"<=":(e,t)=>e<=t(),">=":(e,t)=>e>=t(),"<<":(e,t)=>e<>":(e,t)=>e>>t(),">>>":(e,t)=>e>>>t(),"+":(e,t)=>e+t(),"-":(e,t)=>e-t(),"*":(e,t)=>e*t(),"/":(e,t)=>e/t(),"%":(e,t)=>e%t()}[e.operator](l.evalAst(e.left,t),()=>l.evalAst(e.right,t))),evalCompound(e,t){let r;for(let s=0;sl.evalAst(e.test,t)?l.evalAst(e.consequent,t):l.evalAst(e.alternate,t),evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw new ReferenceError(`${e.name} is not defined`)},evalLiteral:e=>e.value,evalMemberExpression(e,t){const r=String(e.computed?l.evalAst(e.property,{}):e.property.name),s=l.evalAst(e.object,t);if(null==s)throw new TypeError(`Cannot read properties of ${s} (reading '${r}')`);if(!Object.hasOwn(s,r)&&h.has(r))throw new TypeError(`Cannot read properties of ${s} (reading '${r}')`);const n=s[r];return"function"==typeof n&&n!==Function?n.bind(s):n},evalUnaryExpression:(e,t)=>({"-":e=>-l.evalAst(e,t),"!":e=>!l.evalAst(e,t),"~":e=>~l.evalAst(e,t),"+":e=>+l.evalAst(e,t),typeof:e=>typeof l.evalAst(e,t),void:e=>{l.evalAst(e,t)}}[e.operator](e.argument)),evalArrayExpression:(e,t)=>e.elements.map(e=>l.evalAst(e,t)),evalCallExpression(e,t){const r=e.arguments.map(e=>l.evalAst(e,t)),s=l.evalAst(e.callee,t);if(s===Function)throw new Error("Function constructor is disabled");return s(...r)},evalAssignmentExpression(e,t){if("Identifier"!==e.left.type)throw new SyntaxError("Invalid left-hand side in assignment");const r=e.left.name,s=l.evalAst(e.right,t);return t[r]=s,t[r]}};function c(e,t){return(e=e.slice()).push(t),e}function p(e,t){return(t=t.slice()).unshift(e),t}class u extends Error{constructor(e,t){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)',t),this.value=e,this.name="NewError"}}function d(e,t,r,s,n){try{return e&&"object"==typeof e?new f(e):new f(e,t,r,s,n)}catch(e){if(!(e instanceof u))throw e;return e.value}}class f{constructor(e,t,r,s,n){"string"==typeof e&&(n=s,s=r,r=t,t=e,e=null);const i=e&&"object"==typeof e;if(e||={},this.currResultType=void 0,this.currEval=void 0,this.currOtherTypeCallback=void 0,this.safeVm,this.vm,this.currSandbox=void 0,this._hasParentSelector=!1,this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!Object.hasOwn(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.eval=void 0===e.eval?"safe":e.eval,this.ignoreEvalErrors=void 0!==e.ignoreEvalErrors&&e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||s||null,this.otherTypeCallback=e.otherTypeCallback||n||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){const s={path:i?e.path:t};i||void 0===r?"json"in e&&(s.json=e.json):s.json=r;const n=this.evaluate(s);if(!n||"object"!=typeof n)throw new u(n);return n}}evaluate(e,t,r,s){let n=this.parent,i=this.parentProperty,{flatten:a,wrap:o}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,r||=this.callback,this.currOtherTypeCallback=s||this.otherTypeCallback,e&&"object"==typeof e&&!Array.isArray(e)){const s=e;if(!s.path&&""!==s.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(s,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=s),a=Object.hasOwn(s,"flatten")?s.flatten??a:a,this.currResultType=Object.hasOwn(s,"resultType")?s.resultType:this.currResultType,this.currSandbox=Object.hasOwn(s,"sandbox")?s.sandbox:this.currSandbox,o=Object.hasOwn(s,"wrap")?s.wrap:o,this.currEval=Object.hasOwn(s,"eval")?s.eval:this.currEval,r=Object.hasOwn(s,"callback")?s.callback:r,this.currOtherTypeCallback=Object.hasOwn(s,"otherTypeCallback")?s.otherTypeCallback:this.currOtherTypeCallback,n=Object.hasOwn(s,"parent")?s.parent??n:n,i=Object.hasOwn(s,"parentProperty")?s.parentProperty??i:i,e=s.path}else t||=this.json,e||=this.path;if(n||=null,i||=null,Array.isArray(e)&&(e=d.toPathString(e)),!t||!e&&""!==e)return;const h=d.toPathArray(e);"$"===h[0]&&h.length>1&&h.shift(),this._hasParentSelector=!1;const l=this._trace(h,t,["$"],n,i,r??void 0,void 0),c=(Array.isArray(l)?l:[l]).filter(e=>e&&!e.isParentSelector);if(!c.length)return o?[]:void 0;if(!o&&1===c.length&&!c[0].hasArrExpr){return this._getPreferredOutput(c[0])}return c.reduce((e,t)=>{const r=this._getPreferredOutput(t);return a&&Array.isArray(r)?e=e.concat(r):e.push(r),e},[])}_getPreferredOutput(e){const t=this.currResultType;switch(t){case"all":{const t=Array.isArray(e.path)?e.path:d.toPathArray(e.path);return e.pointer=d.toPointer(t),e.path="string"==typeof e.path?e.path:d.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return"string"==typeof e.path?e.path:d.toPathString(e.path);case"pointer":{const t=Array.isArray(e.path)?e.path:d.toPathArray(e.path);return d.toPointer(t)}default:throw new TypeError("Unknown result type")}}_handleCallback(e,t,r){if(!t)return;const s=this._getPreferredOutput(e);Array.isArray(e.path)&&(e.path=d.toPathString(e.path)),t(s,r,e)}_trace(e,t,r,s,n,i,a,o){let h;if(!e.length)return h={path:r,value:t,parent:s,parentProperty:n,hasArrExpr:a},this._handleCallback(h,i,"value"),h;const l=e[0],u=e.slice(1),d=[];function f(e){Array.isArray(e)?e.forEach(e=>{d.push(e)}):d.push(e)}if(t&&("string"!=typeof l||o)&&Object.hasOwn(t,l)){const e=t;f(this._trace(u,e[l],c(r,l),t,l,i,a))}else if("*"===l)this._walk(t,e=>{const s=t;f(this._trace(u,s[e],c(r,e),t,e,i,!0,!0))});else if(".."===l)f(this._trace(u,t,r,s,n,i,a)),this._walk(t,s=>{const n=t;"object"==typeof n[s]&&f(this._trace(e.slice(),n[s],c(r,s),t,s,i,!0))});else{if("^"===l)return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:u,isParentSelector:!0,value:void 0,parent:void 0,parentProperty:null};if("~"===l)return h={path:c(r,l),value:n,parent:s,parentProperty:null},this._handleCallback(h,i,"property"),h;if("$"===l)f(this._trace(u,t,r,null,null,i,a));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(l)){const e=this._slice(l,u,t,r,s,n,i);e&&f(e)}else if(0===l.indexOf("?(")){if(!1===this.currEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const e=l.replace(/^\?\((.*?)\)$/u,"$1"),a=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e);if(a)this._walk(t,e=>{const o=[a[2]],h=t,l=a[1]?h[e][a[1]]:h[e],p=this._trace(o,l,r,s,n,i,!0);(Array.isArray(p)?p:[p]).length>0&&f(this._trace(u,h[e],c(r,e),t,e,i,!0))});else{const a=t;this._walk(t,o=>{this._eval(e,a[o],o,r,s,n)&&f(this._trace(u,a[o],c(r,o),t,o,i,!0))})}}else if("("===l[0]){if(!1===this.currEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");const e=this._eval(l,t,r.at(-1),r.slice(0,-1),s,n),o=void 0!==e?e:"";f(this._trace(p(o,u),t,r,s,n,i,a))}else if("@"===l[0]){let e=!1;const o=l.slice(1,-2);switch(o){case"scalar":t&&["object","function"].includes(typeof t)||(e=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===o&&(e=!0);break;case"integer":!Number.isFinite(t)||t%1||(e=!0);break;case"number":Number.isFinite(t)&&(e=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(e=!0);break;case"object":t&&typeof t===o&&(e=!0);break;case"array":Array.isArray(t)&&(e=!0);break;case"other":e=this.currOtherTypeCallback?.(t,r,s,n)??!1;break;case"null":null===t&&(e=!0);break;default:throw new TypeError("Unknown value type "+o)}if(e)return h={path:r,value:t,parent:s,parentProperty:n,hasArrExpr:a},this._handleCallback(h,i,"value"),h}else if(t&&"`"===l[0]&&Object.hasOwn(t,l.slice(1))){const e=l.slice(1),s=t;f(this._trace(u,s[e],c(r,e),t,e,i,a,!0))}else if(l.includes(",")){const e=l.split(",");for(const a of e)f(this._trace(p(a,u),t,r,s,n,i,!0))}else if(!o&&t&&Object.hasOwn(t,l)){const e=t;f(this._trace(u,e[l],c(r,l),t,l,i,a,!0))}}if(this._hasParentSelector)for(let e=0;e{t(e)})}_slice(e,t,r,s,n,i,a){if(!Array.isArray(r))return;const o=r.length,h=e.split(":"),l=h[2]&&Number(h[2])||1;let c=h[0]&&Number(h[0])||0,u=h[1]?Number(h[1]):o;c=c<0?Math.max(0,c+o):Math.min(o,c),u=u<0?Math.max(0,u+o):Math.min(o,u);const d=[];for(let e=c;e{d.push(e)})}return d}_eval(e,t,r,s,n,i){this.currSandbox&&(this.currSandbox._$_parentProperty=i,this.currSandbox._$_parent=n,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t);const a=e.includes("@path");if(a){(this.currSandbox??{})._$_path=d.toPathString(s.concat([r]))}const o=this.currEval+"Script:"+e;if(!Object.hasOwn(d.cache,o)){let t=e.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");a&&(t=t.replaceAll("@path","_$_path"));const r=this.currEval;if(["safe",!0,void 0].includes(r)){const{cache:e}=d;e[o]=new this.safeVm.Script(t)}else if("native"===this.currEval){const{cache:e}=d;e[o]=new this.vm.Script(t)}else if("function"==typeof this.currEval&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const e=this.currEval,{cache:r}=d;r[o]=new e(t)}else{if("function"!=typeof this.currEval)throw new TypeError(`Unknown "eval" property "${this.currEval}"`);{const{cache:e}=d,r=this.currEval;e[o]={runInNewContext:e=>r(t,e)}}}}try{const{cache:e}=d;return e[o].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+t.message+": "+e,{cause:t})}}}f.prototype.safeVm={Script:class{constructor(e){this.code=e,this.ast=s(this.code)}runInNewContext(e){const t=Object.assign(Object.create(null),e);return l.evalAst(this.ast,t)}}},d.cache={},d.toPathString=function(e){const t=e,r=t.length;let s="$";for(let e=1;e"function"==typeof e[t]);const n=r.map(t=>e[t]);t=s.reduce((t,r)=>{let s=e[r].toString();return/function/u.test(s)||(s="function "+s),"var "+r+"="+s+";"+t},"")+t,/(['"])use strict\1/u.test(t)||r.includes("arguments")||(t="var arguments = undefined;"+t),t=t.replace(/;\s*$/u,"");const i=t.lastIndexOf(";"),a=-1!==i?t.slice(0,i+1)+" return "+t.slice(i+1):" return "+t;return new Function(...r,a)(...n)}}f.prototype.vm={Script:b},e.JSONPath=d,e.JSONPathClass=f,e.Script=b}); //# sourceMappingURL=index-browser-umd.min.cjs.map diff --git a/dist/index-browser-umd.min.cjs.map b/dist/index-browser-umd.min.cjs.map index 1752f88c..bf258fad 100644 --- a/dist/index-browser-umd.min.cjs.map +++ b/dist/index-browser-umd.min.cjs.map @@ -1 +1 @@ -{"version":3,"file":"index-browser-umd.min.cjs","sources":["../node_modules/.pnpm/jsep@1.4.0/node_modules/jsep/dist/jsep.js","../node_modules/.pnpm/@jsep-plugin+regex@1.0.4_jsep@1.4.0/node_modules/@jsep-plugin/regex/dist/index.js","../node_modules/.pnpm/@jsep-plugin+assignment@1.3.0_jsep@1.4.0/node_modules/@jsep-plugin/assignment/dist/index.js","../src/Safe-Script.js","../src/jsonpath.js","../src/jsonpath-browser.js"],"sourcesContent":["/**\n * @implements {IHooks}\n */\nclass Hooks {\n\t/**\n\t * @callback HookCallback\n\t * @this {*|Jsep} this\n\t * @param {Jsep} env\n\t * @returns: void\n\t */\n\t/**\n\t * Adds the given callback to the list of callbacks for the given hook.\n\t *\n\t * The callback will be invoked when the hook it is registered for is run.\n\t *\n\t * One callback function can be registered to multiple hooks and the same hook multiple times.\n\t *\n\t * @param {string|object} name The name of the hook, or an object of callbacks keyed by name\n\t * @param {HookCallback|boolean} callback The callback function which is given environment variables.\n\t * @param {?boolean} [first=false] Will add the hook to the top of the list (defaults to the bottom)\n\t * @public\n\t */\n\tadd(name, callback, first) {\n\t\tif (typeof arguments[0] != 'string') {\n\t\t\t// Multiple hook callbacks, keyed by name\n\t\t\tfor (let name in arguments[0]) {\n\t\t\t\tthis.add(name, arguments[0][name], arguments[1]);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t(Array.isArray(name) ? name : [name]).forEach(function (name) {\n\t\t\t\tthis[name] = this[name] || [];\n\n\t\t\t\tif (callback) {\n\t\t\t\t\tthis[name][first ? 'unshift' : 'push'](callback);\n\t\t\t\t}\n\t\t\t}, this);\n\t\t}\n\t}\n\n\t/**\n\t * Runs a hook invoking all registered callbacks with the given environment variables.\n\t *\n\t * Callbacks will be invoked synchronously and in the order in which they were registered.\n\t *\n\t * @param {string} name The name of the hook.\n\t * @param {Object} env The environment variables of the hook passed to all callbacks registered.\n\t * @public\n\t */\n\trun(name, env) {\n\t\tthis[name] = this[name] || [];\n\t\tthis[name].forEach(function (callback) {\n\t\t\tcallback.call(env && env.context ? env.context : env, env);\n\t\t});\n\t}\n}\n\n/**\n * @implements {IPlugins}\n */\nclass Plugins {\n\tconstructor(jsep) {\n\t\tthis.jsep = jsep;\n\t\tthis.registered = {};\n\t}\n\n\t/**\n\t * @callback PluginSetup\n\t * @this {Jsep} jsep\n\t * @returns: void\n\t */\n\t/**\n\t * Adds the given plugin(s) to the registry\n\t *\n\t * @param {object} plugins\n\t * @param {string} plugins.name The name of the plugin\n\t * @param {PluginSetup} plugins.init The init function\n\t * @public\n\t */\n\tregister(...plugins) {\n\t\tplugins.forEach((plugin) => {\n\t\t\tif (typeof plugin !== 'object' || !plugin.name || !plugin.init) {\n\t\t\t\tthrow new Error('Invalid JSEP plugin format');\n\t\t\t}\n\t\t\tif (this.registered[plugin.name]) {\n\t\t\t\t// already registered. Ignore.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tplugin.init(this.jsep);\n\t\t\tthis.registered[plugin.name] = plugin;\n\t\t});\n\t}\n}\n\n// JavaScript Expression Parser (JSEP) 1.4.0\n\nclass Jsep {\n\t/**\n\t * @returns {string}\n\t */\n\tstatic get version() {\n\t\t// To be filled in by the template\n\t\treturn '1.4.0';\n\t}\n\n\t/**\n\t * @returns {string}\n\t */\n\tstatic toString() {\n\t\treturn 'JavaScript Expression Parser (JSEP) v' + Jsep.version;\n\t};\n\n\t// ==================== CONFIG ================================\n\t/**\n\t * @method addUnaryOp\n\t * @param {string} op_name The name of the unary op to add\n\t * @returns {Jsep}\n\t */\n\tstatic addUnaryOp(op_name) {\n\t\tJsep.max_unop_len = Math.max(op_name.length, Jsep.max_unop_len);\n\t\tJsep.unary_ops[op_name] = 1;\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method jsep.addBinaryOp\n\t * @param {string} op_name The name of the binary op to add\n\t * @param {number} precedence The precedence of the binary op (can be a float). Higher number = higher precedence\n\t * @param {boolean} [isRightAssociative=false] whether operator is right-associative\n\t * @returns {Jsep}\n\t */\n\tstatic addBinaryOp(op_name, precedence, isRightAssociative) {\n\t\tJsep.max_binop_len = Math.max(op_name.length, Jsep.max_binop_len);\n\t\tJsep.binary_ops[op_name] = precedence;\n\t\tif (isRightAssociative) {\n\t\t\tJsep.right_associative.add(op_name);\n\t\t}\n\t\telse {\n\t\t\tJsep.right_associative.delete(op_name);\n\t\t}\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method addIdentifierChar\n\t * @param {string} char The additional character to treat as a valid part of an identifier\n\t * @returns {Jsep}\n\t */\n\tstatic addIdentifierChar(char) {\n\t\tJsep.additional_identifier_chars.add(char);\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method addLiteral\n\t * @param {string} literal_name The name of the literal to add\n\t * @param {*} literal_value The value of the literal\n\t * @returns {Jsep}\n\t */\n\tstatic addLiteral(literal_name, literal_value) {\n\t\tJsep.literals[literal_name] = literal_value;\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeUnaryOp\n\t * @param {string} op_name The name of the unary op to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeUnaryOp(op_name) {\n\t\tdelete Jsep.unary_ops[op_name];\n\t\tif (op_name.length === Jsep.max_unop_len) {\n\t\t\tJsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);\n\t\t}\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllUnaryOps\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllUnaryOps() {\n\t\tJsep.unary_ops = {};\n\t\tJsep.max_unop_len = 0;\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeIdentifierChar\n\t * @param {string} char The additional character to stop treating as a valid part of an identifier\n\t * @returns {Jsep}\n\t */\n\tstatic removeIdentifierChar(char) {\n\t\tJsep.additional_identifier_chars.delete(char);\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeBinaryOp\n\t * @param {string} op_name The name of the binary op to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeBinaryOp(op_name) {\n\t\tdelete Jsep.binary_ops[op_name];\n\n\t\tif (op_name.length === Jsep.max_binop_len) {\n\t\t\tJsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);\n\t\t}\n\t\tJsep.right_associative.delete(op_name);\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllBinaryOps\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllBinaryOps() {\n\t\tJsep.binary_ops = {};\n\t\tJsep.max_binop_len = 0;\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeLiteral\n\t * @param {string} literal_name The name of the literal to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeLiteral(literal_name) {\n\t\tdelete Jsep.literals[literal_name];\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllLiterals\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllLiterals() {\n\t\tJsep.literals = {};\n\n\t\treturn Jsep;\n\t}\n\t// ==================== END CONFIG ============================\n\n\n\t/**\n\t * @returns {string}\n\t */\n\tget char() {\n\t\treturn this.expr.charAt(this.index);\n\t}\n\n\t/**\n\t * @returns {number}\n\t */\n\tget code() {\n\t\treturn this.expr.charCodeAt(this.index);\n\t};\n\n\n\t/**\n\t * @param {string} expr a string with the passed in express\n\t * @returns Jsep\n\t */\n\tconstructor(expr) {\n\t\t// `index` stores the character number we are currently at\n\t\t// All of the gobbles below will modify `index` as we move along\n\t\tthis.expr = expr;\n\t\tthis.index = 0;\n\t}\n\n\t/**\n\t * static top-level parser\n\t * @returns {jsep.Expression}\n\t */\n\tstatic parse(expr) {\n\t\treturn (new Jsep(expr)).parse();\n\t}\n\n\t/**\n\t * Get the longest key length of any object\n\t * @param {object} obj\n\t * @returns {number}\n\t */\n\tstatic getMaxKeyLen(obj) {\n\t\treturn Math.max(0, ...Object.keys(obj).map(k => k.length));\n\t}\n\n\t/**\n\t * `ch` is a character code in the next three functions\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isDecimalDigit(ch) {\n\t\treturn (ch >= 48 && ch <= 57); // 0...9\n\t}\n\n\t/**\n\t * Returns the precedence of a binary operator or `0` if it isn't a binary operator. Can be float.\n\t * @param {string} op_val\n\t * @returns {number}\n\t */\n\tstatic binaryPrecedence(op_val) {\n\t\treturn Jsep.binary_ops[op_val] || 0;\n\t}\n\n\t/**\n\t * Looks for start of identifier\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isIdentifierStart(ch) {\n\t\treturn (ch >= 65 && ch <= 90) || // A...Z\n\t\t\t(ch >= 97 && ch <= 122) || // a...z\n\t\t\t(ch >= 128 && !Jsep.binary_ops[String.fromCharCode(ch)]) || // any non-ASCII that is not an operator\n\t\t\t(Jsep.additional_identifier_chars.has(String.fromCharCode(ch))); // additional characters\n\t}\n\n\t/**\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isIdentifierPart(ch) {\n\t\treturn Jsep.isIdentifierStart(ch) || Jsep.isDecimalDigit(ch);\n\t}\n\n\t/**\n\t * throw error at index of the expression\n\t * @param {string} message\n\t * @throws\n\t */\n\tthrowError(message) {\n\t\tconst error = new Error(message + ' at character ' + this.index);\n\t\terror.index = this.index;\n\t\terror.description = message;\n\t\tthrow error;\n\t}\n\n\t/**\n\t * Run a given hook\n\t * @param {string} name\n\t * @param {jsep.Expression|false} [node]\n\t * @returns {?jsep.Expression}\n\t */\n\trunHook(name, node) {\n\t\tif (Jsep.hooks[name]) {\n\t\t\tconst env = { context: this, node };\n\t\t\tJsep.hooks.run(name, env);\n\t\t\treturn env.node;\n\t\t}\n\t\treturn node;\n\t}\n\n\t/**\n\t * Runs a given hook until one returns a node\n\t * @param {string} name\n\t * @returns {?jsep.Expression}\n\t */\n\tsearchHook(name) {\n\t\tif (Jsep.hooks[name]) {\n\t\t\tconst env = { context: this };\n\t\t\tJsep.hooks[name].find(function (callback) {\n\t\t\t\tcallback.call(env.context, env);\n\t\t\t\treturn env.node;\n\t\t\t});\n\t\t\treturn env.node;\n\t\t}\n\t}\n\n\t/**\n\t * Push `index` up to the next non-space character\n\t */\n\tgobbleSpaces() {\n\t\tlet ch = this.code;\n\t\t// Whitespace\n\t\twhile (ch === Jsep.SPACE_CODE\n\t\t|| ch === Jsep.TAB_CODE\n\t\t|| ch === Jsep.LF_CODE\n\t\t|| ch === Jsep.CR_CODE) {\n\t\t\tch = this.expr.charCodeAt(++this.index);\n\t\t}\n\t\tthis.runHook('gobble-spaces');\n\t}\n\n\t/**\n\t * Top-level method to parse all expressions and returns compound or single node\n\t * @returns {jsep.Expression}\n\t */\n\tparse() {\n\t\tthis.runHook('before-all');\n\t\tconst nodes = this.gobbleExpressions();\n\n\t\t// If there's only one expression just try returning the expression\n\t\tconst node = nodes.length === 1\n\t\t ? nodes[0]\n\t\t\t: {\n\t\t\t\ttype: Jsep.COMPOUND,\n\t\t\t\tbody: nodes\n\t\t\t};\n\t\treturn this.runHook('after-all', node);\n\t}\n\n\t/**\n\t * top-level parser (but can be reused within as well)\n\t * @param {number} [untilICode]\n\t * @returns {jsep.Expression[]}\n\t */\n\tgobbleExpressions(untilICode) {\n\t\tlet nodes = [], ch_i, node;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tch_i = this.code;\n\n\t\t\t// Expressions can be separated by semicolons, commas, or just inferred without any\n\t\t\t// separators\n\t\t\tif (ch_i === Jsep.SEMCOL_CODE || ch_i === Jsep.COMMA_CODE) {\n\t\t\t\tthis.index++; // ignore separators\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Try to gobble each expression individually\n\t\t\t\tif (node = this.gobbleExpression()) {\n\t\t\t\t\tnodes.push(node);\n\t\t\t\t\t// If we weren't able to find a binary expression and are out of room, then\n\t\t\t\t\t// the expression passed in probably has too much\n\t\t\t\t}\n\t\t\t\telse if (this.index < this.expr.length) {\n\t\t\t\t\tif (ch_i === untilICode) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.throwError('Unexpected \"' + this.char + '\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nodes;\n\t}\n\n\t/**\n\t * The main parsing function.\n\t * @returns {?jsep.Expression}\n\t */\n\tgobbleExpression() {\n\t\tconst node = this.searchHook('gobble-expression') || this.gobbleBinaryExpression();\n\t\tthis.gobbleSpaces();\n\n\t\treturn this.runHook('after-expression', node);\n\t}\n\n\t/**\n\t * Search for the operation portion of the string (e.g. `+`, `===`)\n\t * Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`)\n\t * and move down from 3 to 2 to 1 character until a matching binary operation is found\n\t * then, return that binary operation\n\t * @returns {string|boolean}\n\t */\n\tgobbleBinaryOp() {\n\t\tthis.gobbleSpaces();\n\t\tlet to_check = this.expr.substr(this.index, Jsep.max_binop_len);\n\t\tlet tc_len = to_check.length;\n\n\t\twhile (tc_len > 0) {\n\t\t\t// Don't accept a binary op when it is an identifier.\n\t\t\t// Binary ops that start with a identifier-valid character must be followed\n\t\t\t// by a non identifier-part valid character\n\t\t\tif (Jsep.binary_ops.hasOwnProperty(to_check) && (\n\t\t\t\t!Jsep.isIdentifierStart(this.code) ||\n\t\t\t\t(this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))\n\t\t\t)) {\n\t\t\t\tthis.index += tc_len;\n\t\t\t\treturn to_check;\n\t\t\t}\n\t\t\tto_check = to_check.substr(0, --tc_len);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * This function is responsible for gobbling an individual expression,\n\t * e.g. `1`, `1+2`, `a+(b*2)-Math.sqrt(2)`\n\t * @returns {?jsep.BinaryExpression}\n\t */\n\tgobbleBinaryExpression() {\n\t\tlet node, biop, prec, stack, biop_info, left, right, i, cur_biop;\n\n\t\t// First, try to get the leftmost thing\n\t\t// Then, check to see if there's a binary operator operating on that leftmost thing\n\t\t// Don't gobbleBinaryOp without a left-hand-side\n\t\tleft = this.gobbleToken();\n\t\tif (!left) {\n\t\t\treturn left;\n\t\t}\n\t\tbiop = this.gobbleBinaryOp();\n\n\t\t// If there wasn't a binary operator, just return the leftmost node\n\t\tif (!biop) {\n\t\t\treturn left;\n\t\t}\n\n\t\t// Otherwise, we need to start a stack to properly place the binary operations in their\n\t\t// precedence structure\n\t\tbiop_info = { value: biop, prec: Jsep.binaryPrecedence(biop), right_a: Jsep.right_associative.has(biop) };\n\n\t\tright = this.gobbleToken();\n\n\t\tif (!right) {\n\t\t\tthis.throwError(\"Expected expression after \" + biop);\n\t\t}\n\n\t\tstack = [left, biop_info, right];\n\n\t\t// Properly deal with precedence using [recursive descent](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm)\n\t\twhile ((biop = this.gobbleBinaryOp())) {\n\t\t\tprec = Jsep.binaryPrecedence(biop);\n\n\t\t\tif (prec === 0) {\n\t\t\t\tthis.index -= biop.length;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tbiop_info = { value: biop, prec, right_a: Jsep.right_associative.has(biop) };\n\n\t\t\tcur_biop = biop;\n\n\t\t\t// Reduce: make a binary expression from the three topmost entries.\n\t\t\tconst comparePrev = prev => biop_info.right_a && prev.right_a\n\t\t\t\t? prec > prev.prec\n\t\t\t\t: prec <= prev.prec;\n\t\t\twhile ((stack.length > 2) && comparePrev(stack[stack.length - 2])) {\n\t\t\t\tright = stack.pop();\n\t\t\t\tbiop = stack.pop().value;\n\t\t\t\tleft = stack.pop();\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.BINARY_EXP,\n\t\t\t\t\toperator: biop,\n\t\t\t\t\tleft,\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t\tstack.push(node);\n\t\t\t}\n\n\t\t\tnode = this.gobbleToken();\n\n\t\t\tif (!node) {\n\t\t\t\tthis.throwError(\"Expected expression after \" + cur_biop);\n\t\t\t}\n\n\t\t\tstack.push(biop_info, node);\n\t\t}\n\n\t\ti = stack.length - 1;\n\t\tnode = stack[i];\n\n\t\twhile (i > 1) {\n\t\t\tnode = {\n\t\t\t\ttype: Jsep.BINARY_EXP,\n\t\t\t\toperator: stack[i - 1].value,\n\t\t\t\tleft: stack[i - 2],\n\t\t\t\tright: node\n\t\t\t};\n\t\t\ti -= 2;\n\t\t}\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * An individual part of a binary expression:\n\t * e.g. `foo.bar(baz)`, `1`, `\"abc\"`, `(a % 2)` (because it's in parenthesis)\n\t * @returns {boolean|jsep.Expression}\n\t */\n\tgobbleToken() {\n\t\tlet ch, to_check, tc_len, node;\n\n\t\tthis.gobbleSpaces();\n\t\tnode = this.searchHook('gobble-token');\n\t\tif (node) {\n\t\t\treturn this.runHook('after-token', node);\n\t\t}\n\n\t\tch = this.code;\n\n\t\tif (Jsep.isDecimalDigit(ch) || ch === Jsep.PERIOD_CODE) {\n\t\t\t// Char code 46 is a dot `.` which can start off a numeric literal\n\t\t\treturn this.gobbleNumericLiteral();\n\t\t}\n\n\t\tif (ch === Jsep.SQUOTE_CODE || ch === Jsep.DQUOTE_CODE) {\n\t\t\t// Single or double quotes\n\t\t\tnode = this.gobbleStringLiteral();\n\t\t}\n\t\telse if (ch === Jsep.OBRACK_CODE) {\n\t\t\tnode = this.gobbleArray();\n\t\t}\n\t\telse {\n\t\t\tto_check = this.expr.substr(this.index, Jsep.max_unop_len);\n\t\t\ttc_len = to_check.length;\n\n\t\t\twhile (tc_len > 0) {\n\t\t\t\t// Don't accept an unary op when it is an identifier.\n\t\t\t\t// Unary ops that start with a identifier-valid character must be followed\n\t\t\t\t// by a non identifier-part valid character\n\t\t\t\tif (Jsep.unary_ops.hasOwnProperty(to_check) && (\n\t\t\t\t\t!Jsep.isIdentifierStart(this.code) ||\n\t\t\t\t\t(this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))\n\t\t\t\t)) {\n\t\t\t\t\tthis.index += tc_len;\n\t\t\t\t\tconst argument = this.gobbleToken();\n\t\t\t\t\tif (!argument) {\n\t\t\t\t\t\tthis.throwError('missing unaryOp argument');\n\t\t\t\t\t}\n\t\t\t\t\treturn this.runHook('after-token', {\n\t\t\t\t\t\ttype: Jsep.UNARY_EXP,\n\t\t\t\t\t\toperator: to_check,\n\t\t\t\t\t\targument,\n\t\t\t\t\t\tprefix: true\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tto_check = to_check.substr(0, --tc_len);\n\t\t\t}\n\n\t\t\tif (Jsep.isIdentifierStart(ch)) {\n\t\t\t\tnode = this.gobbleIdentifier();\n\t\t\t\tif (Jsep.literals.hasOwnProperty(node.name)) {\n\t\t\t\t\tnode = {\n\t\t\t\t\t\ttype: Jsep.LITERAL,\n\t\t\t\t\t\tvalue: Jsep.literals[node.name],\n\t\t\t\t\t\traw: node.name,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\telse if (node.name === Jsep.this_str) {\n\t\t\t\t\tnode = { type: Jsep.THIS_EXP };\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (ch === Jsep.OPAREN_CODE) { // open parenthesis\n\t\t\t\tnode = this.gobbleGroup();\n\t\t\t}\n\t\t}\n\n\t\tif (!node) {\n\t\t\treturn this.runHook('after-token', false);\n\t\t}\n\n\t\tnode = this.gobbleTokenProperty(node);\n\t\treturn this.runHook('after-token', node);\n\t}\n\n\t/**\n\t * Gobble properties of of identifiers/strings/arrays/groups.\n\t * e.g. `foo`, `bar.baz`, `foo['bar'].baz`\n\t * It also gobbles function calls:\n\t * e.g. `Math.acos(obj.angle)`\n\t * @param {jsep.Expression} node\n\t * @returns {jsep.Expression}\n\t */\n\tgobbleTokenProperty(node) {\n\t\tthis.gobbleSpaces();\n\n\t\tlet ch = this.code;\n\t\twhile (ch === Jsep.PERIOD_CODE || ch === Jsep.OBRACK_CODE || ch === Jsep.OPAREN_CODE || ch === Jsep.QUMARK_CODE) {\n\t\t\tlet optional;\n\t\t\tif (ch === Jsep.QUMARK_CODE) {\n\t\t\t\tif (this.expr.charCodeAt(this.index + 1) !== Jsep.PERIOD_CODE) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\toptional = true;\n\t\t\t\tthis.index += 2;\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tch = this.code;\n\t\t\t}\n\t\t\tthis.index++;\n\n\t\t\tif (ch === Jsep.OBRACK_CODE) {\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.MEMBER_EXP,\n\t\t\t\t\tcomputed: true,\n\t\t\t\t\tobject: node,\n\t\t\t\t\tproperty: this.gobbleExpression()\n\t\t\t\t};\n\t\t\t\tif (!node.property) {\n\t\t\t\t\tthis.throwError('Unexpected \"' + this.char + '\"');\n\t\t\t\t}\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tch = this.code;\n\t\t\t\tif (ch !== Jsep.CBRACK_CODE) {\n\t\t\t\t\tthis.throwError('Unclosed [');\n\t\t\t\t}\n\t\t\t\tthis.index++;\n\t\t\t}\n\t\t\telse if (ch === Jsep.OPAREN_CODE) {\n\t\t\t\t// A function call is being made; gobble all the arguments\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.CALL_EXP,\n\t\t\t\t\t'arguments': this.gobbleArguments(Jsep.CPAREN_CODE),\n\t\t\t\t\tcallee: node\n\t\t\t\t};\n\t\t\t}\n\t\t\telse if (ch === Jsep.PERIOD_CODE || optional) {\n\t\t\t\tif (optional) {\n\t\t\t\t\tthis.index--;\n\t\t\t\t}\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.MEMBER_EXP,\n\t\t\t\t\tcomputed: false,\n\t\t\t\t\tobject: node,\n\t\t\t\t\tproperty: this.gobbleIdentifier(),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (optional) {\n\t\t\t\tnode.optional = true;\n\t\t\t} // else leave undefined for compatibility with esprima\n\n\t\t\tthis.gobbleSpaces();\n\t\t\tch = this.code;\n\t\t}\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to\n\t * keep track of everything in the numeric literal and then calling `parseFloat` on that string\n\t * @returns {jsep.Literal}\n\t */\n\tgobbleNumericLiteral() {\n\t\tlet number = '', ch, chCode;\n\n\t\twhile (Jsep.isDecimalDigit(this.code)) {\n\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t}\n\n\t\tif (this.code === Jsep.PERIOD_CODE) { // can start with a decimal marker\n\t\t\tnumber += this.expr.charAt(this.index++);\n\n\t\t\twhile (Jsep.isDecimalDigit(this.code)) {\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\t\t}\n\n\t\tch = this.char;\n\n\t\tif (ch === 'e' || ch === 'E') { // exponent marker\n\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\tch = this.char;\n\n\t\t\tif (ch === '+' || ch === '-') { // exponent sign\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\n\t\t\twhile (Jsep.isDecimalDigit(this.code)) { // exponent itself\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\n\t\t\tif (!Jsep.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) ) {\n\t\t\t\tthis.throwError('Expected exponent (' + number + this.char + ')');\n\t\t\t}\n\t\t}\n\n\t\tchCode = this.code;\n\n\t\t// Check to make sure this isn't a variable name that start with a number (123abc)\n\t\tif (Jsep.isIdentifierStart(chCode)) {\n\t\t\tthis.throwError('Variable names cannot start with a number (' +\n\t\t\t\tnumber + this.char + ')');\n\t\t}\n\t\telse if (chCode === Jsep.PERIOD_CODE || (number.length === 1 && number.charCodeAt(0) === Jsep.PERIOD_CODE)) {\n\t\t\tthis.throwError('Unexpected period');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Jsep.LITERAL,\n\t\t\tvalue: parseFloat(number),\n\t\t\traw: number\n\t\t};\n\t}\n\n\t/**\n\t * Parses a string literal, staring with single or double quotes with basic support for escape codes\n\t * e.g. `\"hello world\"`, `'this is\\nJSEP'`\n\t * @returns {jsep.Literal}\n\t */\n\tgobbleStringLiteral() {\n\t\tlet str = '';\n\t\tconst startIndex = this.index;\n\t\tconst quote = this.expr.charAt(this.index++);\n\t\tlet closed = false;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tlet ch = this.expr.charAt(this.index++);\n\n\t\t\tif (ch === quote) {\n\t\t\t\tclosed = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (ch === '\\\\') {\n\t\t\t\t// Check for all of the common escape codes\n\t\t\t\tch = this.expr.charAt(this.index++);\n\n\t\t\t\tswitch (ch) {\n\t\t\t\t\tcase 'n': str += '\\n'; break;\n\t\t\t\t\tcase 'r': str += '\\r'; break;\n\t\t\t\t\tcase 't': str += '\\t'; break;\n\t\t\t\t\tcase 'b': str += '\\b'; break;\n\t\t\t\t\tcase 'f': str += '\\f'; break;\n\t\t\t\t\tcase 'v': str += '\\x0B'; break;\n\t\t\t\t\tdefault : str += ch;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tstr += ch;\n\t\t\t}\n\t\t}\n\n\t\tif (!closed) {\n\t\t\tthis.throwError('Unclosed quote after \"' + str + '\"');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Jsep.LITERAL,\n\t\t\tvalue: str,\n\t\t\traw: this.expr.substring(startIndex, this.index),\n\t\t};\n\t}\n\n\t/**\n\t * Gobbles only identifiers\n\t * e.g.: `foo`, `_value`, `$x1`\n\t * Also, this function checks if that identifier is a literal:\n\t * (e.g. `true`, `false`, `null`) or `this`\n\t * @returns {jsep.Identifier}\n\t */\n\tgobbleIdentifier() {\n\t\tlet ch = this.code, start = this.index;\n\n\t\tif (Jsep.isIdentifierStart(ch)) {\n\t\t\tthis.index++;\n\t\t}\n\t\telse {\n\t\t\tthis.throwError('Unexpected ' + this.char);\n\t\t}\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tch = this.code;\n\n\t\t\tif (Jsep.isIdentifierPart(ch)) {\n\t\t\t\tthis.index++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\ttype: Jsep.IDENTIFIER,\n\t\t\tname: this.expr.slice(start, this.index),\n\t\t};\n\t}\n\n\t/**\n\t * Gobbles a list of arguments within the context of a function call\n\t * or array literal. This function also assumes that the opening character\n\t * `(` or `[` has already been gobbled, and gobbles expressions and commas\n\t * until the terminator character `)` or `]` is encountered.\n\t * e.g. `foo(bar, baz)`, `my_func()`, or `[bar, baz]`\n\t * @param {number} termination\n\t * @returns {jsep.Expression[]}\n\t */\n\tgobbleArguments(termination) {\n\t\tconst args = [];\n\t\tlet closed = false;\n\t\tlet separator_count = 0;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tthis.gobbleSpaces();\n\t\t\tlet ch_i = this.code;\n\n\t\t\tif (ch_i === termination) { // done parsing\n\t\t\t\tclosed = true;\n\t\t\t\tthis.index++;\n\n\t\t\t\tif (termination === Jsep.CPAREN_CODE && separator_count && separator_count >= args.length){\n\t\t\t\t\tthis.throwError('Unexpected token ' + String.fromCharCode(termination));\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (ch_i === Jsep.COMMA_CODE) { // between expressions\n\t\t\t\tthis.index++;\n\t\t\t\tseparator_count++;\n\n\t\t\t\tif (separator_count !== args.length) { // missing argument\n\t\t\t\t\tif (termination === Jsep.CPAREN_CODE) {\n\t\t\t\t\t\tthis.throwError('Unexpected token ,');\n\t\t\t\t\t}\n\t\t\t\t\telse if (termination === Jsep.CBRACK_CODE) {\n\t\t\t\t\t\tfor (let arg = args.length; arg < separator_count; arg++) {\n\t\t\t\t\t\t\targs.push(null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (args.length !== separator_count && separator_count !== 0) {\n\t\t\t\t// NOTE: `&& separator_count !== 0` allows for either all commas, or all spaces as arguments\n\t\t\t\tthis.throwError('Expected comma');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst node = this.gobbleExpression();\n\n\t\t\t\tif (!node || node.type === Jsep.COMPOUND) {\n\t\t\t\t\tthis.throwError('Expected comma');\n\t\t\t\t}\n\n\t\t\t\targs.push(node);\n\t\t\t}\n\t\t}\n\n\t\tif (!closed) {\n\t\t\tthis.throwError('Expected ' + String.fromCharCode(termination));\n\t\t}\n\n\t\treturn args;\n\t}\n\n\t/**\n\t * Responsible for parsing a group of things within parentheses `()`\n\t * that have no identifier in front (so not a function call)\n\t * This function assumes that it needs to gobble the opening parenthesis\n\t * and then tries to gobble everything within that parenthesis, assuming\n\t * that the next thing it should see is the close parenthesis. If not,\n\t * then the expression probably doesn't have a `)`\n\t * @returns {boolean|jsep.Expression}\n\t */\n\tgobbleGroup() {\n\t\tthis.index++;\n\t\tlet nodes = this.gobbleExpressions(Jsep.CPAREN_CODE);\n\t\tif (this.code === Jsep.CPAREN_CODE) {\n\t\t\tthis.index++;\n\t\t\tif (nodes.length === 1) {\n\t\t\t\treturn nodes[0];\n\t\t\t}\n\t\t\telse if (!nodes.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn {\n\t\t\t\t\ttype: Jsep.SEQUENCE_EXP,\n\t\t\t\t\texpressions: nodes,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis.throwError('Unclosed (');\n\t\t}\n\t}\n\n\t/**\n\t * Responsible for parsing Array literals `[1, 2, 3]`\n\t * This function assumes that it needs to gobble the opening bracket\n\t * and then tries to gobble the expressions as arguments.\n\t * @returns {jsep.ArrayExpression}\n\t */\n\tgobbleArray() {\n\t\tthis.index++;\n\n\t\treturn {\n\t\t\ttype: Jsep.ARRAY_EXP,\n\t\t\telements: this.gobbleArguments(Jsep.CBRACK_CODE)\n\t\t};\n\t}\n}\n\n// Static fields:\nconst hooks = new Hooks();\nObject.assign(Jsep, {\n\thooks,\n\tplugins: new Plugins(Jsep),\n\n\t// Node Types\n\t// ----------\n\t// This is the full set of types that any JSEP node can be.\n\t// Store them here to save space when minified\n\tCOMPOUND: 'Compound',\n\tSEQUENCE_EXP: 'SequenceExpression',\n\tIDENTIFIER: 'Identifier',\n\tMEMBER_EXP: 'MemberExpression',\n\tLITERAL: 'Literal',\n\tTHIS_EXP: 'ThisExpression',\n\tCALL_EXP: 'CallExpression',\n\tUNARY_EXP: 'UnaryExpression',\n\tBINARY_EXP: 'BinaryExpression',\n\tARRAY_EXP: 'ArrayExpression',\n\n\tTAB_CODE: 9,\n\tLF_CODE: 10,\n\tCR_CODE: 13,\n\tSPACE_CODE: 32,\n\tPERIOD_CODE: 46, // '.'\n\tCOMMA_CODE: 44, // ','\n\tSQUOTE_CODE: 39, // single quote\n\tDQUOTE_CODE: 34, // double quotes\n\tOPAREN_CODE: 40, // (\n\tCPAREN_CODE: 41, // )\n\tOBRACK_CODE: 91, // [\n\tCBRACK_CODE: 93, // ]\n\tQUMARK_CODE: 63, // ?\n\tSEMCOL_CODE: 59, // ;\n\tCOLON_CODE: 58, // :\n\n\n\t// Operations\n\t// ----------\n\t// Use a quickly-accessible map to store all of the unary operators\n\t// Values are set to `1` (it really doesn't matter)\n\tunary_ops: {\n\t\t'-': 1,\n\t\t'!': 1,\n\t\t'~': 1,\n\t\t'+': 1\n\t},\n\n\t// Also use a map for the binary operations but set their values to their\n\t// binary precedence for quick reference (higher number = higher precedence)\n\t// see [Order of operations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)\n\tbinary_ops: {\n\t\t'||': 1, '??': 1,\n\t\t'&&': 2, '|': 3, '^': 4, '&': 5,\n\t\t'==': 6, '!=': 6, '===': 6, '!==': 6,\n\t\t'<': 7, '>': 7, '<=': 7, '>=': 7,\n\t\t'<<': 8, '>>': 8, '>>>': 8,\n\t\t'+': 9, '-': 9,\n\t\t'*': 10, '/': 10, '%': 10,\n\t\t'**': 11,\n\t},\n\n\t// sets specific binary_ops as right-associative\n\tright_associative: new Set(['**']),\n\n\t// Additional valid identifier chars, apart from a-z, A-Z and 0-9 (except on the starting char)\n\tadditional_identifier_chars: new Set(['$', '_']),\n\n\t// Literals\n\t// ----------\n\t// Store the values to return for the various literals we may encounter\n\tliterals: {\n\t\t'true': true,\n\t\t'false': false,\n\t\t'null': null\n\t},\n\n\t// Except for `this`, which is special. This could be changed to something like `'self'` as well\n\tthis_str: 'this',\n});\nJsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);\nJsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);\n\n// Backward Compatibility:\nconst jsep = expr => (new Jsep(expr)).parse();\nconst stdClassProps = Object.getOwnPropertyNames(class Test{});\nObject.getOwnPropertyNames(Jsep)\n\t.filter(prop => !stdClassProps.includes(prop) && jsep[prop] === undefined)\n\t.forEach((m) => {\n\t\tjsep[m] = Jsep[m];\n\t});\njsep.Jsep = Jsep; // allows for const { Jsep } = require('jsep');\n\nconst CONDITIONAL_EXP = 'ConditionalExpression';\n\nvar ternary = {\n\tname: 'ternary',\n\n\tinit(jsep) {\n\t\t// Ternary expression: test ? consequent : alternate\n\t\tjsep.hooks.add('after-expression', function gobbleTernary(env) {\n\t\t\tif (env.node && this.code === jsep.QUMARK_CODE) {\n\t\t\t\tthis.index++;\n\t\t\t\tconst test = env.node;\n\t\t\t\tconst consequent = this.gobbleExpression();\n\n\t\t\t\tif (!consequent) {\n\t\t\t\t\tthis.throwError('Expected expression');\n\t\t\t\t}\n\n\t\t\t\tthis.gobbleSpaces();\n\n\t\t\t\tif (this.code === jsep.COLON_CODE) {\n\t\t\t\t\tthis.index++;\n\t\t\t\t\tconst alternate = this.gobbleExpression();\n\n\t\t\t\t\tif (!alternate) {\n\t\t\t\t\t\tthis.throwError('Expected expression');\n\t\t\t\t\t}\n\t\t\t\t\tenv.node = {\n\t\t\t\t\t\ttype: CONDITIONAL_EXP,\n\t\t\t\t\t\ttest,\n\t\t\t\t\t\tconsequent,\n\t\t\t\t\t\talternate,\n\t\t\t\t\t};\n\n\t\t\t\t\t// check for operators of higher priority than ternary (i.e. assignment)\n\t\t\t\t\t// jsep sets || at 1, and assignment at 0.9, and conditional should be between them\n\t\t\t\t\tif (test.operator && jsep.binary_ops[test.operator] <= 0.9) {\n\t\t\t\t\t\tlet newTest = test;\n\t\t\t\t\t\twhile (newTest.right.operator && jsep.binary_ops[newTest.right.operator] <= 0.9) {\n\t\t\t\t\t\t\tnewTest = newTest.right;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenv.node.test = newTest.right;\n\t\t\t\t\t\tnewTest.right = env.node;\n\t\t\t\t\t\tenv.node = test;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.throwError('Expected :');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t},\n};\n\n// Add default plugins:\n\njsep.plugins.register(ternary);\n\nexport { Jsep, jsep as default };\n","const FSLASH_CODE = 47; // '/'\nconst BSLASH_CODE = 92; // '\\\\'\n\nvar index = {\n\tname: 'regex',\n\n\tinit(jsep) {\n\t\t// Regex literal: /abc123/ig\n\t\tjsep.hooks.add('gobble-token', function gobbleRegexLiteral(env) {\n\t\t\tif (this.code === FSLASH_CODE) {\n\t\t\t\tconst patternIndex = ++this.index;\n\n\t\t\t\tlet inCharSet = false;\n\t\t\t\twhile (this.index < this.expr.length) {\n\t\t\t\t\tif (this.code === FSLASH_CODE && !inCharSet) {\n\t\t\t\t\t\tconst pattern = this.expr.slice(patternIndex, this.index);\n\n\t\t\t\t\t\tlet flags = '';\n\t\t\t\t\t\twhile (++this.index < this.expr.length) {\n\t\t\t\t\t\t\tconst code = this.code;\n\t\t\t\t\t\t\tif ((code >= 97 && code <= 122) // a...z\n\t\t\t\t\t\t\t\t|| (code >= 65 && code <= 90) // A...Z\n\t\t\t\t\t\t\t\t|| (code >= 48 && code <= 57)) { // 0-9\n\t\t\t\t\t\t\t\tflags += this.char;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet value;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvalue = new RegExp(pattern, flags);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\t\tthis.throwError(e.message);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tenv.node = {\n\t\t\t\t\t\t\ttype: jsep.LITERAL,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\traw: this.expr.slice(patternIndex - 1, this.index),\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// allow . [] and () after regex: /regex/.test(a)\n\t\t\t\t\t\tenv.node = this.gobbleTokenProperty(env.node);\n\t\t\t\t\t\treturn env.node;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.code === jsep.OBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = true;\n\t\t\t\t\t}\n\t\t\t\t\telse if (inCharSet && this.code === jsep.CBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = false;\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += this.code === BSLASH_CODE ? 2 : 1;\n\t\t\t\t}\n\t\t\t\tthis.throwError('Unclosed Regex');\n\t\t\t}\n\t\t});\n\t},\n};\n\nexport { index as default };\n","const PLUS_CODE = 43; // +\nconst MINUS_CODE = 45; // -\n\nconst plugin = {\n\tname: 'assignment',\n\n\tassignmentOperators: new Set([\n\t\t'=',\n\t\t'*=',\n\t\t'**=',\n\t\t'/=',\n\t\t'%=',\n\t\t'+=',\n\t\t'-=',\n\t\t'<<=',\n\t\t'>>=',\n\t\t'>>>=',\n\t\t'&=',\n\t\t'^=',\n\t\t'|=',\n\t\t'||=',\n\t\t'&&=',\n\t\t'??=',\n\t]),\n\tupdateOperators: [PLUS_CODE, MINUS_CODE],\n\tassignmentPrecedence: 0.9,\n\n\tinit(jsep) {\n\t\tconst updateNodeTypes = [jsep.IDENTIFIER, jsep.MEMBER_EXP];\n\t\tplugin.assignmentOperators.forEach(op => jsep.addBinaryOp(op, plugin.assignmentPrecedence, true));\n\n\t\tjsep.hooks.add('gobble-token', function gobbleUpdatePrefix(env) {\n\t\t\tconst code = this.code;\n\t\t\tif (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {\n\t\t\t\tthis.index += 2;\n\t\t\t\tenv.node = {\n\t\t\t\t\ttype: 'UpdateExpression',\n\t\t\t\t\toperator: code === PLUS_CODE ? '++' : '--',\n\t\t\t\t\targument: this.gobbleTokenProperty(this.gobbleIdentifier()),\n\t\t\t\t\tprefix: true,\n\t\t\t\t};\n\t\t\t\tif (!env.node.argument || !updateNodeTypes.includes(env.node.argument.type)) {\n\t\t\t\t\tthis.throwError(`Unexpected ${env.node.operator}`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tjsep.hooks.add('after-token', function gobbleUpdatePostfix(env) {\n\t\t\tif (env.node) {\n\t\t\t\tconst code = this.code;\n\t\t\t\tif (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {\n\t\t\t\t\tif (!updateNodeTypes.includes(env.node.type)) {\n\t\t\t\t\t\tthis.throwError(`Unexpected ${env.node.operator}`);\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += 2;\n\t\t\t\t\tenv.node = {\n\t\t\t\t\t\ttype: 'UpdateExpression',\n\t\t\t\t\t\toperator: code === PLUS_CODE ? '++' : '--',\n\t\t\t\t\t\targument: env.node,\n\t\t\t\t\t\tprefix: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tjsep.hooks.add('after-expression', function gobbleAssignment(env) {\n\t\t\tif (env.node) {\n\t\t\t\t// Note: Binaries can be chained in a single expression to respect\n\t\t\t\t// operator precedence (i.e. a = b = 1 + 2 + 3)\n\t\t\t\t// Update all binary assignment nodes in the tree\n\t\t\t\tupdateBinariesToAssignments(env.node);\n\t\t\t}\n\t\t});\n\n\t\tfunction updateBinariesToAssignments(node) {\n\t\t\tif (plugin.assignmentOperators.has(node.operator)) {\n\t\t\t\tnode.type = 'AssignmentExpression';\n\t\t\t\tupdateBinariesToAssignments(node.left);\n\t\t\t\tupdateBinariesToAssignments(node.right);\n\t\t\t}\n\t\t\telse if (!node.operator) {\n\t\t\t\tObject.values(node).forEach((val) => {\n\t\t\t\t\tif (val && typeof val === 'object') {\n\t\t\t\t\t\tupdateBinariesToAssignments(val);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n};\n\nexport { plugin as default };\n","/* eslint-disable no-bitwise -- Convenient */\nimport jsep from 'jsep';\nimport jsepRegex from '@jsep-plugin/regex';\nimport jsepAssignment from '@jsep-plugin/assignment';\n\n// register plugins\njsep.plugins.register(jsepRegex, jsepAssignment);\njsep.addUnaryOp('typeof');\njsep.addUnaryOp('void');\njsep.addLiteral('null', null);\njsep.addLiteral('undefined', undefined);\n\nconst BLOCKED_PROTO_PROPERTIES = new Set([\n 'constructor',\n '__proto__',\n '__defineGetter__',\n '__defineSetter__',\n '__lookupGetter__',\n '__lookupSetter__'\n]);\n\nconst SafeEval = {\n /**\n * @param {jsep.Expression} ast\n * @param {Record} subs\n */\n evalAst (ast, subs) {\n switch (ast.type) {\n case 'BinaryExpression':\n case 'LogicalExpression':\n return SafeEval.evalBinaryExpression(ast, subs);\n case 'Compound':\n return SafeEval.evalCompound(ast, subs);\n case 'ConditionalExpression':\n return SafeEval.evalConditionalExpression(ast, subs);\n case 'Identifier':\n return SafeEval.evalIdentifier(ast, subs);\n case 'Literal':\n return SafeEval.evalLiteral(ast, subs);\n case 'MemberExpression':\n return SafeEval.evalMemberExpression(ast, subs);\n case 'UnaryExpression':\n return SafeEval.evalUnaryExpression(ast, subs);\n case 'ArrayExpression':\n return SafeEval.evalArrayExpression(ast, subs);\n case 'CallExpression':\n return SafeEval.evalCallExpression(ast, subs);\n case 'AssignmentExpression':\n return SafeEval.evalAssignmentExpression(ast, subs);\n default:\n throw SyntaxError('Unexpected expression', ast);\n }\n },\n evalBinaryExpression (ast, subs) {\n const result = {\n '||': (a, b) => a || b(),\n '&&': (a, b) => a && b(),\n '|': (a, b) => a | b(),\n '^': (a, b) => a ^ b(),\n '&': (a, b) => a & b(),\n // eslint-disable-next-line eqeqeq -- API\n '==': (a, b) => a == b(),\n // eslint-disable-next-line eqeqeq -- API\n '!=': (a, b) => a != b(),\n '===': (a, b) => a === b(),\n '!==': (a, b) => a !== b(),\n '<': (a, b) => a < b(),\n '>': (a, b) => a > b(),\n '<=': (a, b) => a <= b(),\n '>=': (a, b) => a >= b(),\n '<<': (a, b) => a << b(),\n '>>': (a, b) => a >> b(),\n '>>>': (a, b) => a >>> b(),\n '+': (a, b) => a + b(),\n '-': (a, b) => a - b(),\n '*': (a, b) => a * b(),\n '/': (a, b) => a / b(),\n '%': (a, b) => a % b()\n }[ast.operator](\n SafeEval.evalAst(ast.left, subs),\n () => SafeEval.evalAst(ast.right, subs)\n );\n return result;\n },\n evalCompound (ast, subs) {\n let last;\n for (let i = 0; i < ast.body.length; i++) {\n if (\n ast.body[i].type === 'Identifier' &&\n ['var', 'let', 'const'].includes(ast.body[i].name) &&\n ast.body[i + 1] &&\n ast.body[i + 1].type === 'AssignmentExpression'\n ) {\n // var x=2; is detected as\n // [{Identifier var}, {AssignmentExpression x=2}]\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient\n i += 1;\n }\n const expr = ast.body[i];\n last = SafeEval.evalAst(expr, subs);\n }\n return last;\n },\n evalConditionalExpression (ast, subs) {\n if (SafeEval.evalAst(ast.test, subs)) {\n return SafeEval.evalAst(ast.consequent, subs);\n }\n return SafeEval.evalAst(ast.alternate, subs);\n },\n evalIdentifier (ast, subs) {\n if (Object.hasOwn(subs, ast.name)) {\n return subs[ast.name];\n }\n throw ReferenceError(`${ast.name} is not defined`);\n },\n evalLiteral (ast) {\n return ast.value;\n },\n evalMemberExpression (ast, subs) {\n const prop = String(\n // NOTE: `String(value)` throws error when\n // value has overwritten the toString method to return non-string\n // i.e. `value = {toString: () => []}`\n ast.computed\n ? SafeEval.evalAst(ast.property) // `object[property]`\n : ast.property.name // `object.property` property is Identifier\n );\n const obj = SafeEval.evalAst(ast.object, subs);\n if (obj === undefined || obj === null) {\n throw TypeError(\n `Cannot read properties of ${obj} (reading '${prop}')`\n );\n }\n if (!Object.hasOwn(obj, prop) && BLOCKED_PROTO_PROPERTIES.has(prop)) {\n throw TypeError(\n `Cannot read properties of ${obj} (reading '${prop}')`\n );\n }\n const result = obj[prop];\n if (typeof result === 'function' && result !== Function) {\n return result.bind(obj); // arrow functions aren't affected by bind.\n }\n return result;\n },\n evalUnaryExpression (ast, subs) {\n const result = {\n '-': (a) => -SafeEval.evalAst(a, subs),\n '!': (a) => !SafeEval.evalAst(a, subs),\n '~': (a) => ~SafeEval.evalAst(a, subs),\n // eslint-disable-next-line no-implicit-coercion -- API\n '+': (a) => +SafeEval.evalAst(a, subs),\n typeof: (a) => typeof SafeEval.evalAst(a, subs),\n // eslint-disable-next-line no-void, sonarjs/void-use -- feature\n void: (a) => void SafeEval.evalAst(a, subs)\n }[ast.operator](ast.argument);\n return result;\n },\n evalArrayExpression (ast, subs) {\n return ast.elements.map((el) => SafeEval.evalAst(el, subs));\n },\n evalCallExpression (ast, subs) {\n const args = ast.arguments.map((arg) => SafeEval.evalAst(arg, subs));\n const func = SafeEval.evalAst(ast.callee, subs);\n if (func === Function) {\n throw new Error('Function constructor is disabled');\n }\n return func(...args);\n },\n evalAssignmentExpression (ast, subs) {\n if (ast.left.type !== 'Identifier') {\n throw SyntaxError('Invalid left-hand side in assignment');\n }\n const id = ast.left.name;\n const value = SafeEval.evalAst(ast.right, subs);\n subs[id] = value;\n return subs[id];\n }\n};\n\n/**\n * A replacement for NodeJS' VM.Script which is also {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | Content Security Policy} friendly.\n */\nclass SafeScript {\n /**\n * @param {string} expr Expression to evaluate\n */\n constructor (expr) {\n this.code = expr;\n this.ast = jsep(this.code);\n }\n\n /**\n * @param {object} context Object whose items will be added\n * to evaluation\n * @returns {EvaluatedResult} Result of evaluated code\n */\n runInNewContext (context) {\n // `Object.create(null)` creates a prototypeless object\n const keyMap = Object.assign(Object.create(null), context);\n return SafeEval.evalAst(this.ast, keyMap);\n }\n}\n\nexport {SafeScript};\n","/* eslint-disable camelcase -- Convenient for escaping */\n\nimport {SafeScript} from './Safe-Script.js';\n\n/**\n * @typedef {null|boolean|number|string|object|GenericArray} JSONObject\n */\n\n/**\n * @typedef {any} AnyItem\n */\n\n/**\n * @typedef {any} AnyResult\n */\n\n/**\n * Copies array and then pushes item into it.\n * @param {GenericArray} arr Array to copy and into which to push\n * @param {AnyItem} item Array item to add (to end)\n * @returns {GenericArray} Copy of the original array\n */\nfunction push (arr, item) {\n arr = arr.slice();\n arr.push(item);\n return arr;\n}\n/**\n * Copies array and then unshifts item into it.\n * @param {AnyItem} item Array item to add (to beginning)\n * @param {GenericArray} arr Array to copy and into which to unshift\n * @returns {GenericArray} Copy of the original array\n */\nfunction unshift (item, arr) {\n arr = arr.slice();\n arr.unshift(item);\n return arr;\n}\n\n/**\n * Caught when JSONPath is used without `new` but rethrown if with `new`\n * @extends Error\n */\nclass NewError extends Error {\n /**\n * @param {AnyResult} value The evaluated scalar value\n */\n constructor (value) {\n super(\n 'JSONPath should not be called with \"new\" (it prevents return ' +\n 'of (unwrapped) scalar values)'\n );\n this.avoidNew = true;\n this.value = value;\n this.name = 'NewError';\n }\n}\n\n/**\n* @typedef {object} ReturnObject\n* @property {string} path\n* @property {JSONObject} value\n* @property {object|GenericArray} parent\n* @property {string} parentProperty\n*/\n\n/**\n* @callback JSONPathCallback\n* @param {string|object} preferredOutput\n* @param {\"value\"|\"property\"} type\n* @param {ReturnObject} fullRetObj\n* @returns {void}\n*/\n\n/**\n* @callback OtherTypeCallback\n* @param {JSONObject} val\n* @param {string} path\n* @param {object|GenericArray} parent\n* @param {string} parentPropName\n* @returns {boolean}\n*/\n\n/**\n * @typedef {any} ContextItem\n */\n\n/**\n * @typedef {any} EvaluatedResult\n */\n\n/**\n* @callback EvalCallback\n* @param {string} code\n* @param {ContextItem} context\n* @returns {EvaluatedResult}\n*/\n\n/**\n * @typedef {typeof SafeScript} EvalClass\n */\n\n/**\n * @typedef {object} JSONPathOptions\n * @property {JSON} json\n * @property {string|string[]} path\n * @property {\"value\"|\"path\"|\"pointer\"|\"parent\"|\"parentProperty\"|\n * \"all\"} [resultType=\"value\"]\n * @property {boolean} [flatten=false]\n * @property {boolean} [wrap=true]\n * @property {object} [sandbox={}]\n * @property {EvalCallback|EvalClass|'safe'|'native'|\n * boolean} [eval = 'safe']\n * @property {object|GenericArray|null} [parent=null]\n * @property {string|null} [parentProperty=null]\n * @property {JSONPathCallback} [callback]\n * @property {OtherTypeCallback} [otherTypeCallback] Defaults to\n * function which throws on encountering `@other`\n * @property {boolean} [autostart=true]\n */\n\n/**\n * @param {string|JSONPathOptions} opts If a string, will be treated as `expr`\n * @param {string} [expr] JSON path to evaluate\n * @param {JSON} [obj] JSON object to evaluate against\n * @param {JSONPathCallback} [callback] Passed 3 arguments: 1) desired payload\n * per `resultType`, 2) `\"value\"|\"property\"`, 3) Full returned object with\n * all payloads\n * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the end\n * of one's query, this will be invoked with the value of the item, its\n * path, its parent, and its parent's property name, and it should return\n * a boolean indicating whether the supplied value belongs to the \"other\"\n * type or not (or it may handle transformations and return `false`).\n * @returns {JSONPath}\n * @class\n */\nfunction JSONPath (opts, expr, obj, callback, otherTypeCallback) {\n // eslint-disable-next-line no-restricted-syntax -- Allow for pseudo-class\n if (!(this instanceof JSONPath)) {\n try {\n return new JSONPath(opts, expr, obj, callback, otherTypeCallback);\n } catch (e) {\n if (!e.avoidNew) {\n throw e;\n }\n return e.value;\n }\n }\n\n if (typeof opts === 'string') {\n otherTypeCallback = callback;\n callback = obj;\n obj = expr;\n expr = opts;\n opts = null;\n }\n const optObj = opts && typeof opts === 'object';\n opts = opts || {};\n this.json = opts.json || obj;\n this.path = opts.path || expr;\n this.resultType = opts.resultType || 'value';\n this.flatten = opts.flatten || false;\n this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true;\n this.sandbox = opts.sandbox || {};\n this.eval = opts.eval === undefined ? 'safe' : opts.eval;\n this.ignoreEvalErrors = (typeof opts.ignoreEvalErrors === 'undefined')\n ? false\n : opts.ignoreEvalErrors;\n this.parent = opts.parent || null;\n this.parentProperty = opts.parentProperty || null;\n this.callback = opts.callback || callback || null;\n this.otherTypeCallback = opts.otherTypeCallback ||\n otherTypeCallback ||\n function () {\n throw new TypeError(\n 'You must supply an otherTypeCallback callback option ' +\n 'with the @other() operator.'\n );\n };\n\n if (opts.autostart !== false) {\n const args = {\n path: (optObj ? opts.path : expr)\n };\n if (!optObj) {\n args.json = obj;\n } else if ('json' in opts) {\n args.json = opts.json;\n }\n const ret = this.evaluate(args);\n if (!ret || typeof ret !== 'object') {\n throw new NewError(ret);\n }\n return ret;\n }\n}\n\n// PUBLIC METHODS\nJSONPath.prototype.evaluate = function (\n expr, json, callback, otherTypeCallback\n) {\n let currParent = this.parent,\n currParentProperty = this.parentProperty;\n let {flatten, wrap} = this;\n\n this.currResultType = this.resultType;\n this.currEval = this.eval;\n this.currSandbox = this.sandbox;\n callback = callback || this.callback;\n this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback;\n\n json = json || this.json;\n expr = expr || this.path;\n if (expr && typeof expr === 'object' && !Array.isArray(expr)) {\n if (!expr.path && expr.path !== '') {\n throw new TypeError(\n 'You must supply a \"path\" property when providing an object ' +\n 'argument to JSONPath.evaluate().'\n );\n }\n if (!(Object.hasOwn(expr, 'json'))) {\n throw new TypeError(\n 'You must supply a \"json\" property when providing an object ' +\n 'argument to JSONPath.evaluate().'\n );\n }\n ({json} = expr);\n flatten = Object.hasOwn(expr, 'flatten') ? expr.flatten : flatten;\n this.currResultType = Object.hasOwn(expr, 'resultType')\n ? expr.resultType\n : this.currResultType;\n this.currSandbox = Object.hasOwn(expr, 'sandbox')\n ? expr.sandbox\n : this.currSandbox;\n wrap = Object.hasOwn(expr, 'wrap') ? expr.wrap : wrap;\n this.currEval = Object.hasOwn(expr, 'eval')\n ? expr.eval\n : this.currEval;\n callback = Object.hasOwn(expr, 'callback') ? expr.callback : callback;\n this.currOtherTypeCallback = Object.hasOwn(expr, 'otherTypeCallback')\n ? expr.otherTypeCallback\n : this.currOtherTypeCallback;\n currParent = Object.hasOwn(expr, 'parent') ? expr.parent : currParent;\n currParentProperty = Object.hasOwn(expr, 'parentProperty')\n ? expr.parentProperty\n : currParentProperty;\n expr = expr.path;\n }\n currParent = currParent || null;\n currParentProperty = currParentProperty || null;\n\n if (Array.isArray(expr)) {\n expr = JSONPath.toPathString(expr);\n }\n if ((!expr && expr !== '') || !json) {\n return undefined;\n }\n\n const exprList = JSONPath.toPathArray(expr);\n if (exprList[0] === '$' && exprList.length > 1) {\n exprList.shift();\n }\n this._hasParentSelector = null;\n const result = this\n ._trace(\n exprList, json, ['$'], currParent, currParentProperty, callback\n )\n .filter(function (ea) {\n return ea && !ea.isParentSelector;\n });\n\n if (!result.length) {\n return wrap ? [] : undefined;\n }\n if (!wrap && result.length === 1 && !result[0].hasArrExpr) {\n return this._getPreferredOutput(result[0]);\n }\n return result.reduce((rslt, ea) => {\n const valOrPath = this._getPreferredOutput(ea);\n if (flatten && Array.isArray(valOrPath)) {\n rslt = rslt.concat(valOrPath);\n } else {\n rslt.push(valOrPath);\n }\n return rslt;\n }, []);\n};\n\n// PRIVATE METHODS\n\nJSONPath.prototype._getPreferredOutput = function (ea) {\n const resultType = this.currResultType;\n switch (resultType) {\n case 'all': {\n const path = Array.isArray(ea.path)\n ? ea.path\n : JSONPath.toPathArray(ea.path);\n ea.pointer = JSONPath.toPointer(path);\n ea.path = typeof ea.path === 'string'\n ? ea.path\n : JSONPath.toPathString(ea.path);\n return ea;\n } case 'value': case 'parent': case 'parentProperty':\n return ea[resultType];\n case 'path':\n return JSONPath.toPathString(ea[resultType]);\n case 'pointer':\n return JSONPath.toPointer(ea.path);\n default:\n throw new TypeError('Unknown result type');\n }\n};\n\nJSONPath.prototype._handleCallback = function (fullRetObj, callback, type) {\n if (callback) {\n const preferredOutput = this._getPreferredOutput(fullRetObj);\n fullRetObj.path = typeof fullRetObj.path === 'string'\n ? fullRetObj.path\n : JSONPath.toPathString(fullRetObj.path);\n // eslint-disable-next-line n/callback-return -- No need to return\n callback(preferredOutput, type, fullRetObj);\n }\n};\n\n/**\n *\n * @param {string} expr\n * @param {JSONObject} val\n * @param {string} path\n * @param {object|GenericArray} parent\n * @param {string} parentPropName\n * @param {JSONPathCallback} callback\n * @param {boolean} hasArrExpr\n * @param {boolean} literalPriority\n * @returns {ReturnObject|ReturnObject[]}\n */\nJSONPath.prototype._trace = function (\n expr, val, path, parent, parentPropName, callback, hasArrExpr,\n literalPriority\n) {\n // No expr to follow? return path and value as the result of\n // this trace branch\n let retObj;\n if (!expr.length) {\n retObj = {\n path,\n value: val,\n parent,\n parentProperty: parentPropName,\n hasArrExpr\n };\n this._handleCallback(retObj, callback, 'value');\n return retObj;\n }\n\n const loc = expr[0], x = expr.slice(1);\n\n // We need to gather the return value of recursive trace calls in order to\n // do the parent sel computation.\n const ret = [];\n /**\n *\n * @param {ReturnObject|ReturnObject[]} elems\n * @returns {void}\n */\n function addRet (elems) {\n if (Array.isArray(elems)) {\n // This was causing excessive stack size in Node (with or\n // without Babel) against our performance test:\n // `ret.push(...elems);`\n elems.forEach((t) => {\n ret.push(t);\n });\n } else {\n ret.push(elems);\n }\n }\n if ((typeof loc !== 'string' || literalPriority) && val &&\n Object.hasOwn(val, loc)\n ) { // simple case--directly follow property\n addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback,\n hasArrExpr));\n // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if`\n } else if (loc === '*') { // all child properties\n this._walk(val, (m) => {\n addRet(this._trace(\n x, val[m], push(path, m), val, m, callback, true, true\n ));\n });\n } else if (loc === '..') { // all descendent parent properties\n // Check remaining expression with val's immediate children\n addRet(\n this._trace(x, val, path, parent, parentPropName, callback,\n hasArrExpr)\n );\n this._walk(val, (m) => {\n // We don't join m and x here because we only want parents,\n // not scalar values\n if (typeof val[m] === 'object') {\n // Keep going with recursive descent on val's\n // object children\n addRet(this._trace(\n expr.slice(), val[m], push(path, m), val, m, callback, true\n ));\n }\n });\n // The parent sel computation is handled in the frame above using the\n // ancestor object of val\n } else if (loc === '^') {\n // This is not a final endpoint, so we do not invoke the callback here\n this._hasParentSelector = true;\n return {\n path: path.slice(0, -1),\n expr: x,\n isParentSelector: true\n };\n } else if (loc === '~') { // property name\n retObj = {\n path: push(path, loc),\n value: parentPropName,\n parent,\n parentProperty: null\n };\n this._handleCallback(retObj, callback, 'property');\n return retObj;\n } else if (loc === '$') { // root only\n addRet(this._trace(x, val, path, null, null, callback, hasArrExpr));\n } else if ((/^(-?\\d*):(-?\\d*):?(\\d*)$/u).test(loc)) { // [start:end:step] Python slice syntax\n addRet(\n this._slice(loc, x, val, path, parent, parentPropName, callback)\n );\n } else if (loc.indexOf('?(') === 0) { // [?(expr)] (filtering)\n if (this.currEval === false) {\n throw new Error('Eval [?(expr)] prevented in JSONPath expression.');\n }\n const safeLoc = loc.replace(/^\\?\\((.*?)\\)$/u, '$1');\n // check for a nested filter expression\n const nested = (/@.?([^?]*)[['](\\??\\(.*?\\))(?!.\\)\\])[\\]']/gu).exec(safeLoc);\n if (nested) {\n // find if there are matches in the nested expression\n // add them to the result set if there is at least one match\n this._walk(val, (m) => {\n const npath = [nested[2]];\n const nvalue = nested[1]\n ? val[m][nested[1]]\n : val[m];\n const filterResults = this._trace(npath, nvalue, path,\n parent, parentPropName, callback, true);\n if (filterResults.length > 0) {\n addRet(this._trace(x, val[m], push(path, m), val,\n m, callback, true));\n }\n });\n } else {\n this._walk(val, (m) => {\n if (this._eval(safeLoc, val[m], m, path, parent,\n parentPropName)) {\n addRet(this._trace(x, val[m], push(path, m), val, m,\n callback, true));\n }\n });\n }\n } else if (loc[0] === '(') { // [(expr)] (dynamic property/index)\n if (this.currEval === false) {\n throw new Error('Eval [(expr)] prevented in JSONPath expression.');\n }\n // As this will resolve to a property name (but we don't know it\n // yet), property and parent information is relative to the\n // parent of the property to which this expression will resolve\n addRet(this._trace(unshift(\n this._eval(\n loc, val, path.at(-1),\n path.slice(0, -1), parent, parentPropName\n ),\n x\n ), val, path, parent, parentPropName, callback, hasArrExpr));\n } else if (loc[0] === '@') { // value type: @boolean(), etc.\n let addType = false;\n const valueType = loc.slice(1, -2);\n switch (valueType) {\n case 'scalar':\n if (!val || !(['object', 'function'].includes(typeof val))) {\n addType = true;\n }\n break;\n case 'boolean': case 'string': case 'undefined': case 'function':\n if (typeof val === valueType) {\n addType = true;\n }\n break;\n case 'integer':\n if (Number.isFinite(val) && !(val % 1)) {\n addType = true;\n }\n break;\n case 'number':\n if (Number.isFinite(val)) {\n addType = true;\n }\n break;\n case 'nonFinite':\n if (typeof val === 'number' && !Number.isFinite(val)) {\n addType = true;\n }\n break;\n case 'object':\n if (val && typeof val === valueType) {\n addType = true;\n }\n break;\n case 'array':\n if (Array.isArray(val)) {\n addType = true;\n }\n break;\n case 'other':\n addType = this.currOtherTypeCallback(\n val, path, parent, parentPropName\n );\n break;\n case 'null':\n if (val === null) {\n addType = true;\n }\n break;\n /* c8 ignore next 2 */\n default:\n throw new TypeError('Unknown value type ' + valueType);\n }\n if (addType) {\n retObj = {path, value: val, parent, parentProperty: parentPropName};\n this._handleCallback(retObj, callback, 'value');\n return retObj;\n }\n // `-escaped property\n } else if (loc[0] === '`' && val && Object.hasOwn(val, loc.slice(1))) {\n const locProp = loc.slice(1);\n addRet(this._trace(\n x, val[locProp], push(path, locProp), val, locProp, callback,\n hasArrExpr, true\n ));\n } else if (loc.includes(',')) { // [name1,name2,...]\n const parts = loc.split(',');\n for (const part of parts) {\n addRet(this._trace(\n unshift(part, x), val, path, parent, parentPropName, callback,\n true\n ));\n }\n // simple case--directly follow property\n } else if (\n !literalPriority && val && Object.hasOwn(val, loc)\n ) {\n addRet(\n this._trace(x, val[loc], push(path, loc), val, loc, callback,\n hasArrExpr, true)\n );\n }\n\n // We check the resulting values for parent selections. For parent\n // selections we discard the value object and continue the trace with the\n // current val object\n if (this._hasParentSelector) {\n for (let t = 0; t < ret.length; t++) {\n const rett = ret[t];\n if (rett && rett.isParentSelector) {\n const tmp = this._trace(\n rett.expr, val, rett.path, parent, parentPropName, callback,\n hasArrExpr\n );\n if (Array.isArray(tmp)) {\n ret[t] = tmp[0];\n const tl = tmp.length;\n for (let tt = 1; tt < tl; tt++) {\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient\n t++;\n ret.splice(t, 0, tmp[tt]);\n }\n } else {\n ret[t] = tmp;\n }\n }\n }\n }\n return ret;\n};\n\nJSONPath.prototype._walk = function (val, f) {\n if (Array.isArray(val)) {\n const n = val.length;\n for (let i = 0; i < n; i++) {\n f(i);\n }\n } else if (val && typeof val === 'object') {\n Object.keys(val).forEach((m) => {\n f(m);\n });\n }\n};\n\nJSONPath.prototype._slice = function (\n loc, expr, val, path, parent, parentPropName, callback\n) {\n if (!Array.isArray(val)) {\n return undefined;\n }\n const len = val.length, parts = loc.split(':'),\n step = (parts[2] && Number.parseInt(parts[2])) || 1;\n let start = (parts[0] && Number.parseInt(parts[0])) || 0,\n end = parts[1] ? Number.parseInt(parts[1]) : len;\n start = (start < 0) ? Math.max(0, start + len) : Math.min(len, start);\n end = (end < 0) ? Math.max(0, end + len) : Math.min(len, end);\n const ret = [];\n for (let i = start; i < end; i += step) {\n const tmp = this._trace(\n unshift(i, expr), val, path, parent, parentPropName, callback, true\n );\n // Should only be possible to be an array here since first part of\n // ``unshift(i, expr)` passed in above would not be empty, nor `~`,\n // nor begin with `@` (as could return objects)\n // This was causing excessive stack size in Node (with or\n // without Babel) against our performance test: `ret.push(...tmp);`\n tmp.forEach((t) => {\n ret.push(t);\n });\n }\n return ret;\n};\n\nJSONPath.prototype._eval = function (\n code, _v, _vname, path, parent, parentPropName\n) {\n this.currSandbox._$_parentProperty = parentPropName;\n this.currSandbox._$_parent = parent;\n this.currSandbox._$_property = _vname;\n this.currSandbox._$_root = this.json;\n this.currSandbox._$_v = _v;\n\n const containsPath = code.includes('@path');\n if (containsPath) {\n this.currSandbox._$_path = JSONPath.toPathString(path.concat([_vname]));\n }\n\n const scriptCacheKey = this.currEval + 'Script:' + code;\n if (!JSONPath.cache[scriptCacheKey]) {\n let script = code\n .replaceAll('@parentProperty', '_$_parentProperty')\n .replaceAll('@parent', '_$_parent')\n .replaceAll('@property', '_$_property')\n .replaceAll('@root', '_$_root')\n .replaceAll(/@([.\\s)[])/gu, '_$_v$1');\n if (containsPath) {\n script = script.replaceAll('@path', '_$_path');\n }\n if (\n this.currEval === 'safe' ||\n this.currEval === true ||\n this.currEval === undefined\n ) {\n JSONPath.cache[scriptCacheKey] = new this.safeVm.Script(script);\n } else if (this.currEval === 'native') {\n JSONPath.cache[scriptCacheKey] = new this.vm.Script(script);\n } else if (\n typeof this.currEval === 'function' &&\n this.currEval.prototype &&\n Object.hasOwn(this.currEval.prototype, 'runInNewContext')\n ) {\n const CurrEval = this.currEval;\n JSONPath.cache[scriptCacheKey] = new CurrEval(script);\n } else if (typeof this.currEval === 'function') {\n JSONPath.cache[scriptCacheKey] = {\n runInNewContext: (context) => this.currEval(script, context)\n };\n } else {\n throw new TypeError(`Unknown \"eval\" property \"${this.currEval}\"`);\n }\n }\n\n try {\n return JSONPath.cache[scriptCacheKey].runInNewContext(this.currSandbox);\n } catch (e) {\n if (this.ignoreEvalErrors) {\n return false;\n }\n throw new Error('jsonPath: ' + e.message + ': ' + code);\n }\n};\n\n// PUBLIC CLASS PROPERTIES AND METHODS\n\n// Could store the cache object itself\nJSONPath.cache = {};\n\n/**\n * @param {string[]} pathArr Array to convert\n * @returns {string} The path string\n */\nJSONPath.toPathString = function (pathArr) {\n const x = pathArr, n = x.length;\n let p = '$';\n for (let i = 1; i < n; i++) {\n if (!(/^(~|\\^|@.*?\\(\\))$/u).test(x[i])) {\n p += (/^[0-9*]+$/u).test(x[i]) ? ('[' + x[i] + ']') : (\"['\" + x[i] + \"']\");\n }\n }\n return p;\n};\n\n/**\n * @param {string} pointer JSON Path\n * @returns {string} JSON Pointer\n */\nJSONPath.toPointer = function (pointer) {\n const x = pointer, n = x.length;\n let p = '';\n for (let i = 1; i < n; i++) {\n if (!(/^(~|\\^|@.*?\\(\\))$/u).test(x[i])) {\n p += '/' + x[i].toString()\n .replaceAll('~', '~0')\n .replaceAll('/', '~1');\n }\n }\n return p;\n};\n\n/**\n * @param {string} expr Expression to convert\n * @returns {string[]}\n */\nJSONPath.toPathArray = function (expr) {\n const {cache} = JSONPath;\n if (cache[expr]) {\n return cache[expr].concat();\n }\n const subx = [];\n const normalized = expr\n // Properties\n .replaceAll(\n /@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\\(\\)/gu,\n ';$&;'\n )\n // Parenthetical evaluations (filtering and otherwise), directly\n // within brackets or single quotes\n .replaceAll(/[['](\\??\\(.*?\\))[\\]'](?!.\\])/gu, function ($0, $1) {\n return '[#' + (subx.push($1) - 1) + ']';\n })\n // Escape periods and tildes within properties\n .replaceAll(/\\[['\"]([^'\\]]*)['\"]\\]/gu, function ($0, prop) {\n return \"['\" + prop\n .replaceAll('.', '%@%')\n .replaceAll('~', '%%@@%%') +\n \"']\";\n })\n // Properties operator\n .replaceAll('~', ';~;')\n // Split by property boundaries\n .replaceAll(/['\"]?\\.['\"]?(?![^[]*\\])|\\[['\"]?/gu, ';')\n // Reinsert periods within properties\n .replaceAll('%@%', '.')\n // Reinsert tildes within properties\n .replaceAll('%%@@%%', '~')\n // Parent\n .replaceAll(/(?:;)?(\\^+)(?:;)?/gu, function ($0, ups) {\n return ';' + ups.split('').join(';') + ';';\n })\n // Descendents\n .replaceAll(/;;;|;;/gu, ';..;')\n // Remove trailing\n .replaceAll(/;$|'?\\]|'$/gu, '');\n\n const exprList = normalized.split(';').map(function (exp) {\n const match = exp.match(/#(\\d+)/u);\n return !match || !match[1] ? exp : subx[match[1]];\n });\n cache[expr] = exprList;\n return cache[expr].concat();\n};\n\nJSONPath.prototype.safeVm = {\n Script: SafeScript\n};\n\nexport {JSONPath};\n","import {JSONPath} from './jsonpath.js';\n\n/**\n * @typedef {any} ContextItem\n */\n\n/**\n * @typedef {any} EvaluatedResult\n */\n\n/**\n * @callback ConditionCallback\n * @param {ContextItem} item\n * @returns {boolean}\n */\n\n/**\n * Copy items out of one array into another.\n * @param {GenericArray} source Array with items to copy\n * @param {GenericArray} target Array to which to copy\n * @param {ConditionCallback} conditionCb Callback passed the current item;\n * will move item if evaluates to `true`\n * @returns {void}\n */\nconst moveToAnotherArray = function (source, target, conditionCb) {\n const il = source.length;\n for (let i = 0; i < il; i++) {\n const item = source[i];\n if (conditionCb(item)) {\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient\n target.push(source.splice(i--, 1)[0]);\n }\n }\n};\n\n/**\n * In-browser replacement for NodeJS' VM.Script.\n */\nclass Script {\n /**\n * @param {string} expr Expression to evaluate\n */\n constructor (expr) {\n this.code = expr;\n }\n\n /**\n * @param {object} context Object whose items will be added\n * to evaluation\n * @returns {EvaluatedResult} Result of evaluated code\n */\n runInNewContext (context) {\n let expr = this.code;\n const keys = Object.keys(context);\n const funcs = [];\n moveToAnotherArray(keys, funcs, (key) => {\n return typeof context[key] === 'function';\n });\n const values = keys.map((vr) => {\n return context[vr];\n });\n\n const funcString = funcs.reduce((s, func) => {\n let fString = context[func].toString();\n if (!(/function/u).test(fString)) {\n fString = 'function ' + fString;\n }\n return 'var ' + func + '=' + fString + ';' + s;\n }, '');\n\n expr = funcString + expr;\n\n // Mitigate http://perfectionkills.com/global-eval-what-are-the-options/#new_function\n if (!(/(['\"])use strict\\1/u).test(expr) && !keys.includes('arguments')) {\n expr = 'var arguments = undefined;' + expr;\n }\n\n // Remove last semi so `return` will be inserted before\n // the previous one instead, allowing for the return\n // of a bare ending expression\n expr = expr.replace(/;\\s*$/u, '');\n\n // Insert `return`\n const lastStatementEnd = expr.lastIndexOf(';');\n const code =\n lastStatementEnd !== -1\n ? expr.slice(0, lastStatementEnd + 1) +\n ' return ' +\n expr.slice(lastStatementEnd + 1)\n : ' return ' + expr;\n\n // eslint-disable-next-line no-new-func -- User's choice\n return new Function(...keys, code)(...values);\n }\n}\n\nJSONPath.prototype.vm = {\n Script\n};\n\nexport {JSONPath};\n"],"names":["Jsep","version","toString","addUnaryOp","op_name","max_unop_len","Math","max","length","unary_ops","addBinaryOp","precedence","isRightAssociative","max_binop_len","binary_ops","right_associative","add","delete","addIdentifierChar","char","additional_identifier_chars","addLiteral","literal_name","literal_value","literals","removeUnaryOp","getMaxKeyLen","removeAllUnaryOps","removeIdentifierChar","removeBinaryOp","removeAllBinaryOps","removeLiteral","removeAllLiterals","this","expr","charAt","index","code","charCodeAt","constructor","parse","obj","Object","keys","map","k","isDecimalDigit","ch","binaryPrecedence","op_val","isIdentifierStart","String","fromCharCode","has","isIdentifierPart","throwError","message","error","Error","description","runHook","name","node","hooks","env","context","run","searchHook","find","callback","call","gobbleSpaces","SPACE_CODE","TAB_CODE","LF_CODE","CR_CODE","nodes","gobbleExpressions","type","COMPOUND","body","untilICode","ch_i","SEMCOL_CODE","COMMA_CODE","gobbleExpression","push","gobbleBinaryExpression","gobbleBinaryOp","to_check","substr","tc_len","hasOwnProperty","biop","prec","stack","biop_info","left","right","i","cur_biop","gobbleToken","value","right_a","comparePrev","prev","pop","BINARY_EXP","operator","PERIOD_CODE","gobbleNumericLiteral","SQUOTE_CODE","DQUOTE_CODE","gobbleStringLiteral","OBRACK_CODE","gobbleArray","argument","UNARY_EXP","prefix","gobbleIdentifier","LITERAL","raw","this_str","THIS_EXP","OPAREN_CODE","gobbleGroup","gobbleTokenProperty","QUMARK_CODE","optional","MEMBER_EXP","computed","object","property","CBRACK_CODE","CALL_EXP","arguments","gobbleArguments","CPAREN_CODE","callee","chCode","number","parseFloat","str","startIndex","quote","closed","substring","start","IDENTIFIER","slice","termination","args","separator_count","arg","SEQUENCE_EXP","expressions","ARRAY_EXP","elements","first","Array","isArray","forEach","assign","plugins","jsep","registered","register","plugin","init","COLON_CODE","Set","true","false","null","stdClassProps","getOwnPropertyNames","filter","prop","includes","undefined","m","ternary","test","consequent","alternate","newTest","patternIndex","inCharSet","pattern","flags","RegExp","e","assignmentOperators","updateOperators","assignmentPrecedence","updateNodeTypes","updateBinariesToAssignments","values","val","op","some","c","jsepRegex","jsepAssignment","BLOCKED_PROTO_PROPERTIES","SafeEval","evalAst","ast","subs","evalBinaryExpression","evalCompound","evalConditionalExpression","evalIdentifier","evalLiteral","evalMemberExpression","evalUnaryExpression","evalArrayExpression","evalCallExpression","evalAssignmentExpression","SyntaxError","||","a","b","&&","|","^","&","==","!=","===","!==","<",">","<=",">=","<<",">>",">>>","+","-","*","/","%","last","hasOwn","ReferenceError","TypeError","result","Function","bind","typeof","void","el","func","id","arr","item","unshift","NewError","super","avoidNew","JSONPath","opts","otherTypeCallback","optObj","json","path","resultType","flatten","wrap","sandbox","eval","ignoreEvalErrors","parent","parentProperty","autostart","ret","evaluate","prototype","currParent","currParentProperty","currResultType","currEval","currSandbox","currOtherTypeCallback","toPathString","exprList","toPathArray","shift","_hasParentSelector","_trace","ea","isParentSelector","hasArrExpr","reduce","rslt","valOrPath","_getPreferredOutput","concat","pointer","toPointer","_handleCallback","fullRetObj","preferredOutput","parentPropName","literalPriority","retObj","loc","x","addRet","elems","t","_walk","_slice","indexOf","safeLoc","replace","nested","exec","npath","nvalue","_eval","at","addType","valueType","Number","isFinite","locProp","parts","split","part","rett","tmp","tl","tt","splice","f","n","len","step","parseInt","end","min","_v","_vname","_$_parentProperty","_$_parent","_$_property","_$_root","_$_v","containsPath","_$_path","scriptCacheKey","cache","script","replaceAll","safeVm","Script","vm","CurrEval","runInNewContext","pathArr","p","subx","$0","$1","ups","join","exp","match","keyMap","create","funcs","source","target","conditionCb","il","moveToAnotherArray","key","vr","s","fString","lastStatementEnd","lastIndexOf"],"mappings":"+OAgGA,MAAMA,EAIL,kBAAWC,GAEV,MAAO,OACR,CAKA,eAAOC,GACN,MAAO,wCAA0CF,EAAKC,OACvD,CAQA,iBAAOE,CAAWC,GAGjB,OAFAJ,EAAKK,aAAeC,KAAKC,IAAIH,EAAQI,OAAQR,EAAKK,cAClDL,EAAKS,UAAUL,GAAW,EACnBJ,CACR,CASA,kBAAOU,CAAYN,EAASO,EAAYC,GASvC,OARAZ,EAAKa,cAAgBP,KAAKC,IAAIH,EAAQI,OAAQR,EAAKa,eACnDb,EAAKc,WAAWV,GAAWO,EACvBC,EACHZ,EAAKe,kBAAkBC,IAAIZ,GAG3BJ,EAAKe,kBAAkBE,OAAOb,GAExBJ,CACR,CAOA,wBAAOkB,CAAkBC,GAExB,OADAnB,EAAKoB,4BAA4BJ,IAAIG,GAC9BnB,CACR,CAQA,iBAAOqB,CAAWC,EAAcC,GAE/B,OADAvB,EAAKwB,SAASF,GAAgBC,EACvBvB,CACR,CAOA,oBAAOyB,CAAcrB,GAKpB,cAJOJ,EAAKS,UAAUL,GAClBA,EAAQI,SAAWR,EAAKK,eAC3BL,EAAKK,aAAeL,EAAK0B,aAAa1B,EAAKS,YAErCT,CACR,CAMA,wBAAO2B,GAIN,OAHA3B,EAAKS,UAAY,CAAA,EACjBT,EAAKK,aAAe,EAEbL,CACR,CAOA,2BAAO4B,CAAqBT,GAE3B,OADAnB,EAAKoB,4BAA4B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EAAO7W,OAClB,IAAK,IAAI2F,EAAI,EAAGA,EAAIqR,EAAIrR,IAEhBoR,EADSF,EAAOlR,KAIhBmR,EAAOhS,KAAK+R,EAAOtC,OAAO5O,IAAK,GAAG,GAG9C,CAsBQsR,CAAmB9U,EAAMyU,EAAQM,GACE,mBAAjBzT,EAAQyT,IAE1B,MAAMrL,EAAS1J,EAAKC,IAAK+U,GACd1T,EAAQ0T,IAWnBzV,EARmBkV,EAAM9E,OAAO,CAACsF,EAAG/H,KAChC,IAAIgI,EAAU5T,EAAQ4L,GAAM3P,WAI5B,MAHM,YAAaoL,KAAKuM,KACpBA,EAAU,YAAcA,GAErB,OAAShI,EAAO,IAAMgI,EAAU,IAAMD,GAC9C,IAEiB1V,EAGd,sBAAuBoJ,KAAKpJ,IAAUS,EAAKuI,SAAS,eACtDhJ,EAAO,6BAA+BA,GAM1CA,EAAOA,EAAK0R,QAAQ,SAAU,IAG9B,MAAMkE,EAAmB5V,EAAK6V,YAAY,KACpC1V,GACmB,IAArByV,EACM5V,EAAKmH,MAAM,EAAGyO,EAAmB,GACjC,WACA5V,EAAKmH,MAAMyO,EAAmB,GAC9B,WAAa5V,EAGvB,OAAO,IAAIsN,YAAY7M,EAAMN,EAAtB,IAA+BgK,EAC1C","x_google_ignoreList":[0,1,2]} \ No newline at end of file +{"version":3,"file":"index-browser-umd.min.cjs","sources":["../node_modules/.pnpm/jsep@1.4.0/node_modules/jsep/dist/jsep.js","../node_modules/.pnpm/@jsep-plugin+regex@1.0.4_jsep@1.4.0/node_modules/@jsep-plugin/regex/dist/index.js","../node_modules/.pnpm/@jsep-plugin+assignment@1.3.0_jsep@1.4.0/node_modules/@jsep-plugin/assignment/dist/index.js","../src/Safe-Script.js","../src/jsonpath.js","../src/jsonpath-browser.js"],"sourcesContent":["/**\n * @implements {IHooks}\n */\nclass Hooks {\n\t/**\n\t * @callback HookCallback\n\t * @this {*|Jsep} this\n\t * @param {Jsep} env\n\t * @returns: void\n\t */\n\t/**\n\t * Adds the given callback to the list of callbacks for the given hook.\n\t *\n\t * The callback will be invoked when the hook it is registered for is run.\n\t *\n\t * One callback function can be registered to multiple hooks and the same hook multiple times.\n\t *\n\t * @param {string|object} name The name of the hook, or an object of callbacks keyed by name\n\t * @param {HookCallback|boolean} callback The callback function which is given environment variables.\n\t * @param {?boolean} [first=false] Will add the hook to the top of the list (defaults to the bottom)\n\t * @public\n\t */\n\tadd(name, callback, first) {\n\t\tif (typeof arguments[0] != 'string') {\n\t\t\t// Multiple hook callbacks, keyed by name\n\t\t\tfor (let name in arguments[0]) {\n\t\t\t\tthis.add(name, arguments[0][name], arguments[1]);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t(Array.isArray(name) ? name : [name]).forEach(function (name) {\n\t\t\t\tthis[name] = this[name] || [];\n\n\t\t\t\tif (callback) {\n\t\t\t\t\tthis[name][first ? 'unshift' : 'push'](callback);\n\t\t\t\t}\n\t\t\t}, this);\n\t\t}\n\t}\n\n\t/**\n\t * Runs a hook invoking all registered callbacks with the given environment variables.\n\t *\n\t * Callbacks will be invoked synchronously and in the order in which they were registered.\n\t *\n\t * @param {string} name The name of the hook.\n\t * @param {Object} env The environment variables of the hook passed to all callbacks registered.\n\t * @public\n\t */\n\trun(name, env) {\n\t\tthis[name] = this[name] || [];\n\t\tthis[name].forEach(function (callback) {\n\t\t\tcallback.call(env && env.context ? env.context : env, env);\n\t\t});\n\t}\n}\n\n/**\n * @implements {IPlugins}\n */\nclass Plugins {\n\tconstructor(jsep) {\n\t\tthis.jsep = jsep;\n\t\tthis.registered = {};\n\t}\n\n\t/**\n\t * @callback PluginSetup\n\t * @this {Jsep} jsep\n\t * @returns: void\n\t */\n\t/**\n\t * Adds the given plugin(s) to the registry\n\t *\n\t * @param {object} plugins\n\t * @param {string} plugins.name The name of the plugin\n\t * @param {PluginSetup} plugins.init The init function\n\t * @public\n\t */\n\tregister(...plugins) {\n\t\tplugins.forEach((plugin) => {\n\t\t\tif (typeof plugin !== 'object' || !plugin.name || !plugin.init) {\n\t\t\t\tthrow new Error('Invalid JSEP plugin format');\n\t\t\t}\n\t\t\tif (this.registered[plugin.name]) {\n\t\t\t\t// already registered. Ignore.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tplugin.init(this.jsep);\n\t\t\tthis.registered[plugin.name] = plugin;\n\t\t});\n\t}\n}\n\n// JavaScript Expression Parser (JSEP) 1.4.0\n\nclass Jsep {\n\t/**\n\t * @returns {string}\n\t */\n\tstatic get version() {\n\t\t// To be filled in by the template\n\t\treturn '1.4.0';\n\t}\n\n\t/**\n\t * @returns {string}\n\t */\n\tstatic toString() {\n\t\treturn 'JavaScript Expression Parser (JSEP) v' + Jsep.version;\n\t};\n\n\t// ==================== CONFIG ================================\n\t/**\n\t * @method addUnaryOp\n\t * @param {string} op_name The name of the unary op to add\n\t * @returns {Jsep}\n\t */\n\tstatic addUnaryOp(op_name) {\n\t\tJsep.max_unop_len = Math.max(op_name.length, Jsep.max_unop_len);\n\t\tJsep.unary_ops[op_name] = 1;\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method jsep.addBinaryOp\n\t * @param {string} op_name The name of the binary op to add\n\t * @param {number} precedence The precedence of the binary op (can be a float). Higher number = higher precedence\n\t * @param {boolean} [isRightAssociative=false] whether operator is right-associative\n\t * @returns {Jsep}\n\t */\n\tstatic addBinaryOp(op_name, precedence, isRightAssociative) {\n\t\tJsep.max_binop_len = Math.max(op_name.length, Jsep.max_binop_len);\n\t\tJsep.binary_ops[op_name] = precedence;\n\t\tif (isRightAssociative) {\n\t\t\tJsep.right_associative.add(op_name);\n\t\t}\n\t\telse {\n\t\t\tJsep.right_associative.delete(op_name);\n\t\t}\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method addIdentifierChar\n\t * @param {string} char The additional character to treat as a valid part of an identifier\n\t * @returns {Jsep}\n\t */\n\tstatic addIdentifierChar(char) {\n\t\tJsep.additional_identifier_chars.add(char);\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method addLiteral\n\t * @param {string} literal_name The name of the literal to add\n\t * @param {*} literal_value The value of the literal\n\t * @returns {Jsep}\n\t */\n\tstatic addLiteral(literal_name, literal_value) {\n\t\tJsep.literals[literal_name] = literal_value;\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeUnaryOp\n\t * @param {string} op_name The name of the unary op to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeUnaryOp(op_name) {\n\t\tdelete Jsep.unary_ops[op_name];\n\t\tif (op_name.length === Jsep.max_unop_len) {\n\t\t\tJsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);\n\t\t}\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllUnaryOps\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllUnaryOps() {\n\t\tJsep.unary_ops = {};\n\t\tJsep.max_unop_len = 0;\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeIdentifierChar\n\t * @param {string} char The additional character to stop treating as a valid part of an identifier\n\t * @returns {Jsep}\n\t */\n\tstatic removeIdentifierChar(char) {\n\t\tJsep.additional_identifier_chars.delete(char);\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeBinaryOp\n\t * @param {string} op_name The name of the binary op to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeBinaryOp(op_name) {\n\t\tdelete Jsep.binary_ops[op_name];\n\n\t\tif (op_name.length === Jsep.max_binop_len) {\n\t\t\tJsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);\n\t\t}\n\t\tJsep.right_associative.delete(op_name);\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllBinaryOps\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllBinaryOps() {\n\t\tJsep.binary_ops = {};\n\t\tJsep.max_binop_len = 0;\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeLiteral\n\t * @param {string} literal_name The name of the literal to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeLiteral(literal_name) {\n\t\tdelete Jsep.literals[literal_name];\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllLiterals\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllLiterals() {\n\t\tJsep.literals = {};\n\n\t\treturn Jsep;\n\t}\n\t// ==================== END CONFIG ============================\n\n\n\t/**\n\t * @returns {string}\n\t */\n\tget char() {\n\t\treturn this.expr.charAt(this.index);\n\t}\n\n\t/**\n\t * @returns {number}\n\t */\n\tget code() {\n\t\treturn this.expr.charCodeAt(this.index);\n\t};\n\n\n\t/**\n\t * @param {string} expr a string with the passed in express\n\t * @returns Jsep\n\t */\n\tconstructor(expr) {\n\t\t// `index` stores the character number we are currently at\n\t\t// All of the gobbles below will modify `index` as we move along\n\t\tthis.expr = expr;\n\t\tthis.index = 0;\n\t}\n\n\t/**\n\t * static top-level parser\n\t * @returns {jsep.Expression}\n\t */\n\tstatic parse(expr) {\n\t\treturn (new Jsep(expr)).parse();\n\t}\n\n\t/**\n\t * Get the longest key length of any object\n\t * @param {object} obj\n\t * @returns {number}\n\t */\n\tstatic getMaxKeyLen(obj) {\n\t\treturn Math.max(0, ...Object.keys(obj).map(k => k.length));\n\t}\n\n\t/**\n\t * `ch` is a character code in the next three functions\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isDecimalDigit(ch) {\n\t\treturn (ch >= 48 && ch <= 57); // 0...9\n\t}\n\n\t/**\n\t * Returns the precedence of a binary operator or `0` if it isn't a binary operator. Can be float.\n\t * @param {string} op_val\n\t * @returns {number}\n\t */\n\tstatic binaryPrecedence(op_val) {\n\t\treturn Jsep.binary_ops[op_val] || 0;\n\t}\n\n\t/**\n\t * Looks for start of identifier\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isIdentifierStart(ch) {\n\t\treturn (ch >= 65 && ch <= 90) || // A...Z\n\t\t\t(ch >= 97 && ch <= 122) || // a...z\n\t\t\t(ch >= 128 && !Jsep.binary_ops[String.fromCharCode(ch)]) || // any non-ASCII that is not an operator\n\t\t\t(Jsep.additional_identifier_chars.has(String.fromCharCode(ch))); // additional characters\n\t}\n\n\t/**\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isIdentifierPart(ch) {\n\t\treturn Jsep.isIdentifierStart(ch) || Jsep.isDecimalDigit(ch);\n\t}\n\n\t/**\n\t * throw error at index of the expression\n\t * @param {string} message\n\t * @throws\n\t */\n\tthrowError(message) {\n\t\tconst error = new Error(message + ' at character ' + this.index);\n\t\terror.index = this.index;\n\t\terror.description = message;\n\t\tthrow error;\n\t}\n\n\t/**\n\t * Run a given hook\n\t * @param {string} name\n\t * @param {jsep.Expression|false} [node]\n\t * @returns {?jsep.Expression}\n\t */\n\trunHook(name, node) {\n\t\tif (Jsep.hooks[name]) {\n\t\t\tconst env = { context: this, node };\n\t\t\tJsep.hooks.run(name, env);\n\t\t\treturn env.node;\n\t\t}\n\t\treturn node;\n\t}\n\n\t/**\n\t * Runs a given hook until one returns a node\n\t * @param {string} name\n\t * @returns {?jsep.Expression}\n\t */\n\tsearchHook(name) {\n\t\tif (Jsep.hooks[name]) {\n\t\t\tconst env = { context: this };\n\t\t\tJsep.hooks[name].find(function (callback) {\n\t\t\t\tcallback.call(env.context, env);\n\t\t\t\treturn env.node;\n\t\t\t});\n\t\t\treturn env.node;\n\t\t}\n\t}\n\n\t/**\n\t * Push `index` up to the next non-space character\n\t */\n\tgobbleSpaces() {\n\t\tlet ch = this.code;\n\t\t// Whitespace\n\t\twhile (ch === Jsep.SPACE_CODE\n\t\t|| ch === Jsep.TAB_CODE\n\t\t|| ch === Jsep.LF_CODE\n\t\t|| ch === Jsep.CR_CODE) {\n\t\t\tch = this.expr.charCodeAt(++this.index);\n\t\t}\n\t\tthis.runHook('gobble-spaces');\n\t}\n\n\t/**\n\t * Top-level method to parse all expressions and returns compound or single node\n\t * @returns {jsep.Expression}\n\t */\n\tparse() {\n\t\tthis.runHook('before-all');\n\t\tconst nodes = this.gobbleExpressions();\n\n\t\t// If there's only one expression just try returning the expression\n\t\tconst node = nodes.length === 1\n\t\t ? nodes[0]\n\t\t\t: {\n\t\t\t\ttype: Jsep.COMPOUND,\n\t\t\t\tbody: nodes\n\t\t\t};\n\t\treturn this.runHook('after-all', node);\n\t}\n\n\t/**\n\t * top-level parser (but can be reused within as well)\n\t * @param {number} [untilICode]\n\t * @returns {jsep.Expression[]}\n\t */\n\tgobbleExpressions(untilICode) {\n\t\tlet nodes = [], ch_i, node;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tch_i = this.code;\n\n\t\t\t// Expressions can be separated by semicolons, commas, or just inferred without any\n\t\t\t// separators\n\t\t\tif (ch_i === Jsep.SEMCOL_CODE || ch_i === Jsep.COMMA_CODE) {\n\t\t\t\tthis.index++; // ignore separators\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Try to gobble each expression individually\n\t\t\t\tif (node = this.gobbleExpression()) {\n\t\t\t\t\tnodes.push(node);\n\t\t\t\t\t// If we weren't able to find a binary expression and are out of room, then\n\t\t\t\t\t// the expression passed in probably has too much\n\t\t\t\t}\n\t\t\t\telse if (this.index < this.expr.length) {\n\t\t\t\t\tif (ch_i === untilICode) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.throwError('Unexpected \"' + this.char + '\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nodes;\n\t}\n\n\t/**\n\t * The main parsing function.\n\t * @returns {?jsep.Expression}\n\t */\n\tgobbleExpression() {\n\t\tconst node = this.searchHook('gobble-expression') || this.gobbleBinaryExpression();\n\t\tthis.gobbleSpaces();\n\n\t\treturn this.runHook('after-expression', node);\n\t}\n\n\t/**\n\t * Search for the operation portion of the string (e.g. `+`, `===`)\n\t * Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`)\n\t * and move down from 3 to 2 to 1 character until a matching binary operation is found\n\t * then, return that binary operation\n\t * @returns {string|boolean}\n\t */\n\tgobbleBinaryOp() {\n\t\tthis.gobbleSpaces();\n\t\tlet to_check = this.expr.substr(this.index, Jsep.max_binop_len);\n\t\tlet tc_len = to_check.length;\n\n\t\twhile (tc_len > 0) {\n\t\t\t// Don't accept a binary op when it is an identifier.\n\t\t\t// Binary ops that start with a identifier-valid character must be followed\n\t\t\t// by a non identifier-part valid character\n\t\t\tif (Jsep.binary_ops.hasOwnProperty(to_check) && (\n\t\t\t\t!Jsep.isIdentifierStart(this.code) ||\n\t\t\t\t(this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))\n\t\t\t)) {\n\t\t\t\tthis.index += tc_len;\n\t\t\t\treturn to_check;\n\t\t\t}\n\t\t\tto_check = to_check.substr(0, --tc_len);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * This function is responsible for gobbling an individual expression,\n\t * e.g. `1`, `1+2`, `a+(b*2)-Math.sqrt(2)`\n\t * @returns {?jsep.BinaryExpression}\n\t */\n\tgobbleBinaryExpression() {\n\t\tlet node, biop, prec, stack, biop_info, left, right, i, cur_biop;\n\n\t\t// First, try to get the leftmost thing\n\t\t// Then, check to see if there's a binary operator operating on that leftmost thing\n\t\t// Don't gobbleBinaryOp without a left-hand-side\n\t\tleft = this.gobbleToken();\n\t\tif (!left) {\n\t\t\treturn left;\n\t\t}\n\t\tbiop = this.gobbleBinaryOp();\n\n\t\t// If there wasn't a binary operator, just return the leftmost node\n\t\tif (!biop) {\n\t\t\treturn left;\n\t\t}\n\n\t\t// Otherwise, we need to start a stack to properly place the binary operations in their\n\t\t// precedence structure\n\t\tbiop_info = { value: biop, prec: Jsep.binaryPrecedence(biop), right_a: Jsep.right_associative.has(biop) };\n\n\t\tright = this.gobbleToken();\n\n\t\tif (!right) {\n\t\t\tthis.throwError(\"Expected expression after \" + biop);\n\t\t}\n\n\t\tstack = [left, biop_info, right];\n\n\t\t// Properly deal with precedence using [recursive descent](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm)\n\t\twhile ((biop = this.gobbleBinaryOp())) {\n\t\t\tprec = Jsep.binaryPrecedence(biop);\n\n\t\t\tif (prec === 0) {\n\t\t\t\tthis.index -= biop.length;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tbiop_info = { value: biop, prec, right_a: Jsep.right_associative.has(biop) };\n\n\t\t\tcur_biop = biop;\n\n\t\t\t// Reduce: make a binary expression from the three topmost entries.\n\t\t\tconst comparePrev = prev => biop_info.right_a && prev.right_a\n\t\t\t\t? prec > prev.prec\n\t\t\t\t: prec <= prev.prec;\n\t\t\twhile ((stack.length > 2) && comparePrev(stack[stack.length - 2])) {\n\t\t\t\tright = stack.pop();\n\t\t\t\tbiop = stack.pop().value;\n\t\t\t\tleft = stack.pop();\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.BINARY_EXP,\n\t\t\t\t\toperator: biop,\n\t\t\t\t\tleft,\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t\tstack.push(node);\n\t\t\t}\n\n\t\t\tnode = this.gobbleToken();\n\n\t\t\tif (!node) {\n\t\t\t\tthis.throwError(\"Expected expression after \" + cur_biop);\n\t\t\t}\n\n\t\t\tstack.push(biop_info, node);\n\t\t}\n\n\t\ti = stack.length - 1;\n\t\tnode = stack[i];\n\n\t\twhile (i > 1) {\n\t\t\tnode = {\n\t\t\t\ttype: Jsep.BINARY_EXP,\n\t\t\t\toperator: stack[i - 1].value,\n\t\t\t\tleft: stack[i - 2],\n\t\t\t\tright: node\n\t\t\t};\n\t\t\ti -= 2;\n\t\t}\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * An individual part of a binary expression:\n\t * e.g. `foo.bar(baz)`, `1`, `\"abc\"`, `(a % 2)` (because it's in parenthesis)\n\t * @returns {boolean|jsep.Expression}\n\t */\n\tgobbleToken() {\n\t\tlet ch, to_check, tc_len, node;\n\n\t\tthis.gobbleSpaces();\n\t\tnode = this.searchHook('gobble-token');\n\t\tif (node) {\n\t\t\treturn this.runHook('after-token', node);\n\t\t}\n\n\t\tch = this.code;\n\n\t\tif (Jsep.isDecimalDigit(ch) || ch === Jsep.PERIOD_CODE) {\n\t\t\t// Char code 46 is a dot `.` which can start off a numeric literal\n\t\t\treturn this.gobbleNumericLiteral();\n\t\t}\n\n\t\tif (ch === Jsep.SQUOTE_CODE || ch === Jsep.DQUOTE_CODE) {\n\t\t\t// Single or double quotes\n\t\t\tnode = this.gobbleStringLiteral();\n\t\t}\n\t\telse if (ch === Jsep.OBRACK_CODE) {\n\t\t\tnode = this.gobbleArray();\n\t\t}\n\t\telse {\n\t\t\tto_check = this.expr.substr(this.index, Jsep.max_unop_len);\n\t\t\ttc_len = to_check.length;\n\n\t\t\twhile (tc_len > 0) {\n\t\t\t\t// Don't accept an unary op when it is an identifier.\n\t\t\t\t// Unary ops that start with a identifier-valid character must be followed\n\t\t\t\t// by a non identifier-part valid character\n\t\t\t\tif (Jsep.unary_ops.hasOwnProperty(to_check) && (\n\t\t\t\t\t!Jsep.isIdentifierStart(this.code) ||\n\t\t\t\t\t(this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))\n\t\t\t\t)) {\n\t\t\t\t\tthis.index += tc_len;\n\t\t\t\t\tconst argument = this.gobbleToken();\n\t\t\t\t\tif (!argument) {\n\t\t\t\t\t\tthis.throwError('missing unaryOp argument');\n\t\t\t\t\t}\n\t\t\t\t\treturn this.runHook('after-token', {\n\t\t\t\t\t\ttype: Jsep.UNARY_EXP,\n\t\t\t\t\t\toperator: to_check,\n\t\t\t\t\t\targument,\n\t\t\t\t\t\tprefix: true\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tto_check = to_check.substr(0, --tc_len);\n\t\t\t}\n\n\t\t\tif (Jsep.isIdentifierStart(ch)) {\n\t\t\t\tnode = this.gobbleIdentifier();\n\t\t\t\tif (Jsep.literals.hasOwnProperty(node.name)) {\n\t\t\t\t\tnode = {\n\t\t\t\t\t\ttype: Jsep.LITERAL,\n\t\t\t\t\t\tvalue: Jsep.literals[node.name],\n\t\t\t\t\t\traw: node.name,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\telse if (node.name === Jsep.this_str) {\n\t\t\t\t\tnode = { type: Jsep.THIS_EXP };\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (ch === Jsep.OPAREN_CODE) { // open parenthesis\n\t\t\t\tnode = this.gobbleGroup();\n\t\t\t}\n\t\t}\n\n\t\tif (!node) {\n\t\t\treturn this.runHook('after-token', false);\n\t\t}\n\n\t\tnode = this.gobbleTokenProperty(node);\n\t\treturn this.runHook('after-token', node);\n\t}\n\n\t/**\n\t * Gobble properties of of identifiers/strings/arrays/groups.\n\t * e.g. `foo`, `bar.baz`, `foo['bar'].baz`\n\t * It also gobbles function calls:\n\t * e.g. `Math.acos(obj.angle)`\n\t * @param {jsep.Expression} node\n\t * @returns {jsep.Expression}\n\t */\n\tgobbleTokenProperty(node) {\n\t\tthis.gobbleSpaces();\n\n\t\tlet ch = this.code;\n\t\twhile (ch === Jsep.PERIOD_CODE || ch === Jsep.OBRACK_CODE || ch === Jsep.OPAREN_CODE || ch === Jsep.QUMARK_CODE) {\n\t\t\tlet optional;\n\t\t\tif (ch === Jsep.QUMARK_CODE) {\n\t\t\t\tif (this.expr.charCodeAt(this.index + 1) !== Jsep.PERIOD_CODE) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\toptional = true;\n\t\t\t\tthis.index += 2;\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tch = this.code;\n\t\t\t}\n\t\t\tthis.index++;\n\n\t\t\tif (ch === Jsep.OBRACK_CODE) {\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.MEMBER_EXP,\n\t\t\t\t\tcomputed: true,\n\t\t\t\t\tobject: node,\n\t\t\t\t\tproperty: this.gobbleExpression()\n\t\t\t\t};\n\t\t\t\tif (!node.property) {\n\t\t\t\t\tthis.throwError('Unexpected \"' + this.char + '\"');\n\t\t\t\t}\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tch = this.code;\n\t\t\t\tif (ch !== Jsep.CBRACK_CODE) {\n\t\t\t\t\tthis.throwError('Unclosed [');\n\t\t\t\t}\n\t\t\t\tthis.index++;\n\t\t\t}\n\t\t\telse if (ch === Jsep.OPAREN_CODE) {\n\t\t\t\t// A function call is being made; gobble all the arguments\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.CALL_EXP,\n\t\t\t\t\t'arguments': this.gobbleArguments(Jsep.CPAREN_CODE),\n\t\t\t\t\tcallee: node\n\t\t\t\t};\n\t\t\t}\n\t\t\telse if (ch === Jsep.PERIOD_CODE || optional) {\n\t\t\t\tif (optional) {\n\t\t\t\t\tthis.index--;\n\t\t\t\t}\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.MEMBER_EXP,\n\t\t\t\t\tcomputed: false,\n\t\t\t\t\tobject: node,\n\t\t\t\t\tproperty: this.gobbleIdentifier(),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (optional) {\n\t\t\t\tnode.optional = true;\n\t\t\t} // else leave undefined for compatibility with esprima\n\n\t\t\tthis.gobbleSpaces();\n\t\t\tch = this.code;\n\t\t}\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to\n\t * keep track of everything in the numeric literal and then calling `parseFloat` on that string\n\t * @returns {jsep.Literal}\n\t */\n\tgobbleNumericLiteral() {\n\t\tlet number = '', ch, chCode;\n\n\t\twhile (Jsep.isDecimalDigit(this.code)) {\n\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t}\n\n\t\tif (this.code === Jsep.PERIOD_CODE) { // can start with a decimal marker\n\t\t\tnumber += this.expr.charAt(this.index++);\n\n\t\t\twhile (Jsep.isDecimalDigit(this.code)) {\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\t\t}\n\n\t\tch = this.char;\n\n\t\tif (ch === 'e' || ch === 'E') { // exponent marker\n\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\tch = this.char;\n\n\t\t\tif (ch === '+' || ch === '-') { // exponent sign\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\n\t\t\twhile (Jsep.isDecimalDigit(this.code)) { // exponent itself\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\n\t\t\tif (!Jsep.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) ) {\n\t\t\t\tthis.throwError('Expected exponent (' + number + this.char + ')');\n\t\t\t}\n\t\t}\n\n\t\tchCode = this.code;\n\n\t\t// Check to make sure this isn't a variable name that start with a number (123abc)\n\t\tif (Jsep.isIdentifierStart(chCode)) {\n\t\t\tthis.throwError('Variable names cannot start with a number (' +\n\t\t\t\tnumber + this.char + ')');\n\t\t}\n\t\telse if (chCode === Jsep.PERIOD_CODE || (number.length === 1 && number.charCodeAt(0) === Jsep.PERIOD_CODE)) {\n\t\t\tthis.throwError('Unexpected period');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Jsep.LITERAL,\n\t\t\tvalue: parseFloat(number),\n\t\t\traw: number\n\t\t};\n\t}\n\n\t/**\n\t * Parses a string literal, staring with single or double quotes with basic support for escape codes\n\t * e.g. `\"hello world\"`, `'this is\\nJSEP'`\n\t * @returns {jsep.Literal}\n\t */\n\tgobbleStringLiteral() {\n\t\tlet str = '';\n\t\tconst startIndex = this.index;\n\t\tconst quote = this.expr.charAt(this.index++);\n\t\tlet closed = false;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tlet ch = this.expr.charAt(this.index++);\n\n\t\t\tif (ch === quote) {\n\t\t\t\tclosed = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (ch === '\\\\') {\n\t\t\t\t// Check for all of the common escape codes\n\t\t\t\tch = this.expr.charAt(this.index++);\n\n\t\t\t\tswitch (ch) {\n\t\t\t\t\tcase 'n': str += '\\n'; break;\n\t\t\t\t\tcase 'r': str += '\\r'; break;\n\t\t\t\t\tcase 't': str += '\\t'; break;\n\t\t\t\t\tcase 'b': str += '\\b'; break;\n\t\t\t\t\tcase 'f': str += '\\f'; break;\n\t\t\t\t\tcase 'v': str += '\\x0B'; break;\n\t\t\t\t\tdefault : str += ch;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tstr += ch;\n\t\t\t}\n\t\t}\n\n\t\tif (!closed) {\n\t\t\tthis.throwError('Unclosed quote after \"' + str + '\"');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Jsep.LITERAL,\n\t\t\tvalue: str,\n\t\t\traw: this.expr.substring(startIndex, this.index),\n\t\t};\n\t}\n\n\t/**\n\t * Gobbles only identifiers\n\t * e.g.: `foo`, `_value`, `$x1`\n\t * Also, this function checks if that identifier is a literal:\n\t * (e.g. `true`, `false`, `null`) or `this`\n\t * @returns {jsep.Identifier}\n\t */\n\tgobbleIdentifier() {\n\t\tlet ch = this.code, start = this.index;\n\n\t\tif (Jsep.isIdentifierStart(ch)) {\n\t\t\tthis.index++;\n\t\t}\n\t\telse {\n\t\t\tthis.throwError('Unexpected ' + this.char);\n\t\t}\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tch = this.code;\n\n\t\t\tif (Jsep.isIdentifierPart(ch)) {\n\t\t\t\tthis.index++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\ttype: Jsep.IDENTIFIER,\n\t\t\tname: this.expr.slice(start, this.index),\n\t\t};\n\t}\n\n\t/**\n\t * Gobbles a list of arguments within the context of a function call\n\t * or array literal. This function also assumes that the opening character\n\t * `(` or `[` has already been gobbled, and gobbles expressions and commas\n\t * until the terminator character `)` or `]` is encountered.\n\t * e.g. `foo(bar, baz)`, `my_func()`, or `[bar, baz]`\n\t * @param {number} termination\n\t * @returns {jsep.Expression[]}\n\t */\n\tgobbleArguments(termination) {\n\t\tconst args = [];\n\t\tlet closed = false;\n\t\tlet separator_count = 0;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tthis.gobbleSpaces();\n\t\t\tlet ch_i = this.code;\n\n\t\t\tif (ch_i === termination) { // done parsing\n\t\t\t\tclosed = true;\n\t\t\t\tthis.index++;\n\n\t\t\t\tif (termination === Jsep.CPAREN_CODE && separator_count && separator_count >= args.length){\n\t\t\t\t\tthis.throwError('Unexpected token ' + String.fromCharCode(termination));\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (ch_i === Jsep.COMMA_CODE) { // between expressions\n\t\t\t\tthis.index++;\n\t\t\t\tseparator_count++;\n\n\t\t\t\tif (separator_count !== args.length) { // missing argument\n\t\t\t\t\tif (termination === Jsep.CPAREN_CODE) {\n\t\t\t\t\t\tthis.throwError('Unexpected token ,');\n\t\t\t\t\t}\n\t\t\t\t\telse if (termination === Jsep.CBRACK_CODE) {\n\t\t\t\t\t\tfor (let arg = args.length; arg < separator_count; arg++) {\n\t\t\t\t\t\t\targs.push(null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (args.length !== separator_count && separator_count !== 0) {\n\t\t\t\t// NOTE: `&& separator_count !== 0` allows for either all commas, or all spaces as arguments\n\t\t\t\tthis.throwError('Expected comma');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst node = this.gobbleExpression();\n\n\t\t\t\tif (!node || node.type === Jsep.COMPOUND) {\n\t\t\t\t\tthis.throwError('Expected comma');\n\t\t\t\t}\n\n\t\t\t\targs.push(node);\n\t\t\t}\n\t\t}\n\n\t\tif (!closed) {\n\t\t\tthis.throwError('Expected ' + String.fromCharCode(termination));\n\t\t}\n\n\t\treturn args;\n\t}\n\n\t/**\n\t * Responsible for parsing a group of things within parentheses `()`\n\t * that have no identifier in front (so not a function call)\n\t * This function assumes that it needs to gobble the opening parenthesis\n\t * and then tries to gobble everything within that parenthesis, assuming\n\t * that the next thing it should see is the close parenthesis. If not,\n\t * then the expression probably doesn't have a `)`\n\t * @returns {boolean|jsep.Expression}\n\t */\n\tgobbleGroup() {\n\t\tthis.index++;\n\t\tlet nodes = this.gobbleExpressions(Jsep.CPAREN_CODE);\n\t\tif (this.code === Jsep.CPAREN_CODE) {\n\t\t\tthis.index++;\n\t\t\tif (nodes.length === 1) {\n\t\t\t\treturn nodes[0];\n\t\t\t}\n\t\t\telse if (!nodes.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn {\n\t\t\t\t\ttype: Jsep.SEQUENCE_EXP,\n\t\t\t\t\texpressions: nodes,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis.throwError('Unclosed (');\n\t\t}\n\t}\n\n\t/**\n\t * Responsible for parsing Array literals `[1, 2, 3]`\n\t * This function assumes that it needs to gobble the opening bracket\n\t * and then tries to gobble the expressions as arguments.\n\t * @returns {jsep.ArrayExpression}\n\t */\n\tgobbleArray() {\n\t\tthis.index++;\n\n\t\treturn {\n\t\t\ttype: Jsep.ARRAY_EXP,\n\t\t\telements: this.gobbleArguments(Jsep.CBRACK_CODE)\n\t\t};\n\t}\n}\n\n// Static fields:\nconst hooks = new Hooks();\nObject.assign(Jsep, {\n\thooks,\n\tplugins: new Plugins(Jsep),\n\n\t// Node Types\n\t// ----------\n\t// This is the full set of types that any JSEP node can be.\n\t// Store them here to save space when minified\n\tCOMPOUND: 'Compound',\n\tSEQUENCE_EXP: 'SequenceExpression',\n\tIDENTIFIER: 'Identifier',\n\tMEMBER_EXP: 'MemberExpression',\n\tLITERAL: 'Literal',\n\tTHIS_EXP: 'ThisExpression',\n\tCALL_EXP: 'CallExpression',\n\tUNARY_EXP: 'UnaryExpression',\n\tBINARY_EXP: 'BinaryExpression',\n\tARRAY_EXP: 'ArrayExpression',\n\n\tTAB_CODE: 9,\n\tLF_CODE: 10,\n\tCR_CODE: 13,\n\tSPACE_CODE: 32,\n\tPERIOD_CODE: 46, // '.'\n\tCOMMA_CODE: 44, // ','\n\tSQUOTE_CODE: 39, // single quote\n\tDQUOTE_CODE: 34, // double quotes\n\tOPAREN_CODE: 40, // (\n\tCPAREN_CODE: 41, // )\n\tOBRACK_CODE: 91, // [\n\tCBRACK_CODE: 93, // ]\n\tQUMARK_CODE: 63, // ?\n\tSEMCOL_CODE: 59, // ;\n\tCOLON_CODE: 58, // :\n\n\n\t// Operations\n\t// ----------\n\t// Use a quickly-accessible map to store all of the unary operators\n\t// Values are set to `1` (it really doesn't matter)\n\tunary_ops: {\n\t\t'-': 1,\n\t\t'!': 1,\n\t\t'~': 1,\n\t\t'+': 1\n\t},\n\n\t// Also use a map for the binary operations but set their values to their\n\t// binary precedence for quick reference (higher number = higher precedence)\n\t// see [Order of operations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)\n\tbinary_ops: {\n\t\t'||': 1, '??': 1,\n\t\t'&&': 2, '|': 3, '^': 4, '&': 5,\n\t\t'==': 6, '!=': 6, '===': 6, '!==': 6,\n\t\t'<': 7, '>': 7, '<=': 7, '>=': 7,\n\t\t'<<': 8, '>>': 8, '>>>': 8,\n\t\t'+': 9, '-': 9,\n\t\t'*': 10, '/': 10, '%': 10,\n\t\t'**': 11,\n\t},\n\n\t// sets specific binary_ops as right-associative\n\tright_associative: new Set(['**']),\n\n\t// Additional valid identifier chars, apart from a-z, A-Z and 0-9 (except on the starting char)\n\tadditional_identifier_chars: new Set(['$', '_']),\n\n\t// Literals\n\t// ----------\n\t// Store the values to return for the various literals we may encounter\n\tliterals: {\n\t\t'true': true,\n\t\t'false': false,\n\t\t'null': null\n\t},\n\n\t// Except for `this`, which is special. This could be changed to something like `'self'` as well\n\tthis_str: 'this',\n});\nJsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);\nJsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);\n\n// Backward Compatibility:\nconst jsep = expr => (new Jsep(expr)).parse();\nconst stdClassProps = Object.getOwnPropertyNames(class Test{});\nObject.getOwnPropertyNames(Jsep)\n\t.filter(prop => !stdClassProps.includes(prop) && jsep[prop] === undefined)\n\t.forEach((m) => {\n\t\tjsep[m] = Jsep[m];\n\t});\njsep.Jsep = Jsep; // allows for const { Jsep } = require('jsep');\n\nconst CONDITIONAL_EXP = 'ConditionalExpression';\n\nvar ternary = {\n\tname: 'ternary',\n\n\tinit(jsep) {\n\t\t// Ternary expression: test ? consequent : alternate\n\t\tjsep.hooks.add('after-expression', function gobbleTernary(env) {\n\t\t\tif (env.node && this.code === jsep.QUMARK_CODE) {\n\t\t\t\tthis.index++;\n\t\t\t\tconst test = env.node;\n\t\t\t\tconst consequent = this.gobbleExpression();\n\n\t\t\t\tif (!consequent) {\n\t\t\t\t\tthis.throwError('Expected expression');\n\t\t\t\t}\n\n\t\t\t\tthis.gobbleSpaces();\n\n\t\t\t\tif (this.code === jsep.COLON_CODE) {\n\t\t\t\t\tthis.index++;\n\t\t\t\t\tconst alternate = this.gobbleExpression();\n\n\t\t\t\t\tif (!alternate) {\n\t\t\t\t\t\tthis.throwError('Expected expression');\n\t\t\t\t\t}\n\t\t\t\t\tenv.node = {\n\t\t\t\t\t\ttype: CONDITIONAL_EXP,\n\t\t\t\t\t\ttest,\n\t\t\t\t\t\tconsequent,\n\t\t\t\t\t\talternate,\n\t\t\t\t\t};\n\n\t\t\t\t\t// check for operators of higher priority than ternary (i.e. assignment)\n\t\t\t\t\t// jsep sets || at 1, and assignment at 0.9, and conditional should be between them\n\t\t\t\t\tif (test.operator && jsep.binary_ops[test.operator] <= 0.9) {\n\t\t\t\t\t\tlet newTest = test;\n\t\t\t\t\t\twhile (newTest.right.operator && jsep.binary_ops[newTest.right.operator] <= 0.9) {\n\t\t\t\t\t\t\tnewTest = newTest.right;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenv.node.test = newTest.right;\n\t\t\t\t\t\tnewTest.right = env.node;\n\t\t\t\t\t\tenv.node = test;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.throwError('Expected :');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t},\n};\n\n// Add default plugins:\n\njsep.plugins.register(ternary);\n\nexport { Jsep, jsep as default };\n","const FSLASH_CODE = 47; // '/'\nconst BSLASH_CODE = 92; // '\\\\'\n\nvar index = {\n\tname: 'regex',\n\n\tinit(jsep) {\n\t\t// Regex literal: /abc123/ig\n\t\tjsep.hooks.add('gobble-token', function gobbleRegexLiteral(env) {\n\t\t\tif (this.code === FSLASH_CODE) {\n\t\t\t\tconst patternIndex = ++this.index;\n\n\t\t\t\tlet inCharSet = false;\n\t\t\t\twhile (this.index < this.expr.length) {\n\t\t\t\t\tif (this.code === FSLASH_CODE && !inCharSet) {\n\t\t\t\t\t\tconst pattern = this.expr.slice(patternIndex, this.index);\n\n\t\t\t\t\t\tlet flags = '';\n\t\t\t\t\t\twhile (++this.index < this.expr.length) {\n\t\t\t\t\t\t\tconst code = this.code;\n\t\t\t\t\t\t\tif ((code >= 97 && code <= 122) // a...z\n\t\t\t\t\t\t\t\t|| (code >= 65 && code <= 90) // A...Z\n\t\t\t\t\t\t\t\t|| (code >= 48 && code <= 57)) { // 0-9\n\t\t\t\t\t\t\t\tflags += this.char;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet value;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvalue = new RegExp(pattern, flags);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\t\tthis.throwError(e.message);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tenv.node = {\n\t\t\t\t\t\t\ttype: jsep.LITERAL,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\traw: this.expr.slice(patternIndex - 1, this.index),\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// allow . [] and () after regex: /regex/.test(a)\n\t\t\t\t\t\tenv.node = this.gobbleTokenProperty(env.node);\n\t\t\t\t\t\treturn env.node;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.code === jsep.OBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = true;\n\t\t\t\t\t}\n\t\t\t\t\telse if (inCharSet && this.code === jsep.CBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = false;\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += this.code === BSLASH_CODE ? 2 : 1;\n\t\t\t\t}\n\t\t\t\tthis.throwError('Unclosed Regex');\n\t\t\t}\n\t\t});\n\t},\n};\n\nexport { index as default };\n","const PLUS_CODE = 43; // +\nconst MINUS_CODE = 45; // -\n\nconst plugin = {\n\tname: 'assignment',\n\n\tassignmentOperators: new Set([\n\t\t'=',\n\t\t'*=',\n\t\t'**=',\n\t\t'/=',\n\t\t'%=',\n\t\t'+=',\n\t\t'-=',\n\t\t'<<=',\n\t\t'>>=',\n\t\t'>>>=',\n\t\t'&=',\n\t\t'^=',\n\t\t'|=',\n\t\t'||=',\n\t\t'&&=',\n\t\t'??=',\n\t]),\n\tupdateOperators: [PLUS_CODE, MINUS_CODE],\n\tassignmentPrecedence: 0.9,\n\n\tinit(jsep) {\n\t\tconst updateNodeTypes = [jsep.IDENTIFIER, jsep.MEMBER_EXP];\n\t\tplugin.assignmentOperators.forEach(op => jsep.addBinaryOp(op, plugin.assignmentPrecedence, true));\n\n\t\tjsep.hooks.add('gobble-token', function gobbleUpdatePrefix(env) {\n\t\t\tconst code = this.code;\n\t\t\tif (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {\n\t\t\t\tthis.index += 2;\n\t\t\t\tenv.node = {\n\t\t\t\t\ttype: 'UpdateExpression',\n\t\t\t\t\toperator: code === PLUS_CODE ? '++' : '--',\n\t\t\t\t\targument: this.gobbleTokenProperty(this.gobbleIdentifier()),\n\t\t\t\t\tprefix: true,\n\t\t\t\t};\n\t\t\t\tif (!env.node.argument || !updateNodeTypes.includes(env.node.argument.type)) {\n\t\t\t\t\tthis.throwError(`Unexpected ${env.node.operator}`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tjsep.hooks.add('after-token', function gobbleUpdatePostfix(env) {\n\t\t\tif (env.node) {\n\t\t\t\tconst code = this.code;\n\t\t\t\tif (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {\n\t\t\t\t\tif (!updateNodeTypes.includes(env.node.type)) {\n\t\t\t\t\t\tthis.throwError(`Unexpected ${env.node.operator}`);\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += 2;\n\t\t\t\t\tenv.node = {\n\t\t\t\t\t\ttype: 'UpdateExpression',\n\t\t\t\t\t\toperator: code === PLUS_CODE ? '++' : '--',\n\t\t\t\t\t\targument: env.node,\n\t\t\t\t\t\tprefix: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tjsep.hooks.add('after-expression', function gobbleAssignment(env) {\n\t\t\tif (env.node) {\n\t\t\t\t// Note: Binaries can be chained in a single expression to respect\n\t\t\t\t// operator precedence (i.e. a = b = 1 + 2 + 3)\n\t\t\t\t// Update all binary assignment nodes in the tree\n\t\t\t\tupdateBinariesToAssignments(env.node);\n\t\t\t}\n\t\t});\n\n\t\tfunction updateBinariesToAssignments(node) {\n\t\t\tif (plugin.assignmentOperators.has(node.operator)) {\n\t\t\t\tnode.type = 'AssignmentExpression';\n\t\t\t\tupdateBinariesToAssignments(node.left);\n\t\t\t\tupdateBinariesToAssignments(node.right);\n\t\t\t}\n\t\t\telse if (!node.operator) {\n\t\t\t\tObject.values(node).forEach((val) => {\n\t\t\t\t\tif (val && typeof val === 'object') {\n\t\t\t\t\t\tupdateBinariesToAssignments(val);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n};\n\nexport { plugin as default };\n","/* eslint-disable unicorn/no-top-level-side-effects -- Temporary? */\n/* eslint-disable no-bitwise -- Convenient */\nimport jsep from 'jsep';\nimport jsepRegex from '@jsep-plugin/regex';\nimport jsepAssignment from '@jsep-plugin/assignment';\n\n/**\n * @import {EvaluatedResult, UnknownResult} from './jsonpath.js';\n */\n\n/**\n * @typedef {import('@jsep-plugin/assignment').\n * AssignmentExpression} AssignmentExpression\n */\n\n/**\n * @typedef {any} Substitution\n */\n\n/**\n * @typedef {any} AnyParameter\n */\n\n/**\n * @typedef {Record} Substitutions\n */\n\n// register plugins\njsep.plugins.register(jsepRegex, jsepAssignment);\njsep.addUnaryOp('typeof');\njsep.addUnaryOp('void');\njsep.addLiteral('null', null);\njsep.addLiteral('undefined', undefined);\n\nconst BLOCKED_PROTO_PROPERTIES = new Set([\n 'constructor',\n '__proto__',\n '__defineGetter__',\n '__defineSetter__',\n '__lookupGetter__',\n '__lookupSetter__'\n]);\n\nconst SafeEval = {\n /**\n * @param {jsep.Expression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalAst (ast, subs) {\n switch (ast.type) {\n case 'BinaryExpression':\n case 'LogicalExpression':\n return SafeEval.evalBinaryExpression(\n /** @type {jsep.BinaryExpression} */ (ast),\n subs\n );\n case 'Compound':\n return SafeEval.evalCompound(\n /** @type {jsep.Compound} */ (ast),\n subs\n );\n case 'ConditionalExpression':\n return SafeEval.evalConditionalExpression(\n /** @type {jsep.ConditionalExpression} */ (ast),\n subs\n );\n case 'Identifier':\n return SafeEval.evalIdentifier(\n /** @type {jsep.Identifier} */ (ast),\n subs\n );\n case 'Literal':\n return SafeEval.evalLiteral(/** @type {jsep.Literal} */ (ast));\n case 'MemberExpression':\n return SafeEval.evalMemberExpression(\n /** @type {jsep.MemberExpression} */ (ast),\n subs\n );\n case 'UnaryExpression':\n return SafeEval.evalUnaryExpression(\n /** @type {jsep.UnaryExpression} */ (ast),\n subs\n );\n case 'ArrayExpression':\n return SafeEval.evalArrayExpression(\n /** @type {jsep.ArrayExpression} */ (ast),\n subs\n );\n case 'CallExpression':\n return SafeEval.evalCallExpression(\n /** @type {jsep.CallExpression} */ (ast),\n subs\n );\n case 'AssignmentExpression':\n return SafeEval.evalAssignmentExpression(\n /** @type {AssignmentExpression} */ (ast),\n subs\n );\n default:\n throw new SyntaxError('Unexpected expression', {\n cause: ast\n });\n }\n },\n\n /**\n * @param {jsep.BinaryExpression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalBinaryExpression (ast, subs) {\n /**\n * @typedef {{\n * [key: string]: (a: AnyParameter, b: AnyParameter) => UnknownResult\n * }} OperatorTable\n */\n const result = /** @type {OperatorTable} */ ({\n '||': (a, b) => a || b(),\n '&&': (a, b) => a && b(),\n '|': (a, b) => a | b(),\n '^': (a, b) => a ^ b(),\n '&': (a, b) => a & b(),\n // eslint-disable-next-line eqeqeq -- API\n '==': (a, b) => a == b(),\n // eslint-disable-next-line eqeqeq -- API\n '!=': (a, b) => a != b(),\n '===': (a, b) => a === b(),\n '!==': (a, b) => a !== b(),\n '<': (a, b) => a < b(),\n '>': (a, b) => a > b(),\n '<=': (a, b) => a <= b(),\n '>=': (a, b) => a >= b(),\n '<<': (a, b) => a << b(),\n '>>': (a, b) => a >> b(),\n '>>>': (a, b) => a >>> b(),\n '+': (a, b) => a + b(),\n '-': (a, b) => a - b(),\n '*': (a, b) => a * b(),\n '/': (a, b) => a / b(),\n '%': (a, b) => a % b()\n })[ast.operator](\n SafeEval.evalAst(ast.left, subs),\n () => SafeEval.evalAst(ast.right, subs)\n );\n return result;\n },\n\n /**\n * @param {jsep.Compound} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalCompound (ast, subs) {\n let last;\n for (let i = 0; i < ast.body.length; i++) {\n if (\n ast.body[i].type === 'Identifier' &&\n ['var', 'let', 'const'].includes(\n /** @type {jsep.Identifier} */\n (ast.body[i]).name\n ) &&\n Object.hasOwn(ast.body, i + 1) &&\n ast.body[i + 1].type === 'AssignmentExpression'\n ) {\n // var x=2; is detected as\n // [{Identifier var}, {AssignmentExpression x=2}]\n i += 1;\n }\n const expr = ast.body[i];\n last = SafeEval.evalAst(expr, subs);\n }\n return last;\n },\n\n /**\n * @param {jsep.ConditionalExpression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalConditionalExpression (ast, subs) {\n if (SafeEval.evalAst(ast.test, subs)) {\n return SafeEval.evalAst(ast.consequent, subs);\n }\n return SafeEval.evalAst(ast.alternate, subs);\n },\n\n /**\n * @param {jsep.Identifier} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalIdentifier (ast, subs) {\n if (Object.hasOwn(subs, ast.name)) {\n return subs[ast.name];\n }\n throw new ReferenceError(`${ast.name} is not defined`);\n },\n\n /**\n * @param {jsep.Literal} ast\n * @returns {UnknownResult}\n */\n evalLiteral (ast) {\n return ast.value;\n },\n\n /**\n * @param {jsep.MemberExpression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalMemberExpression (ast, subs) {\n const prop = String(\n // NOTE: `String(value)` throws error when\n // value has overwritten the toString method to return non-string\n // i.e. `value = {toString: () => []}`\n ast.computed\n ? SafeEval.evalAst(ast.property, {}) // `object[property]`\n : ast.property.name // `object.property` property is Identifier\n );\n const obj = SafeEval.evalAst(ast.object, subs);\n if (obj === undefined || obj === null) {\n throw new TypeError(\n `Cannot read properties of ${obj} (reading '${prop}')`\n );\n }\n if (!Object.hasOwn(obj, prop) && BLOCKED_PROTO_PROPERTIES.has(prop)) {\n throw new TypeError(\n `Cannot read properties of ${obj} (reading '${prop}')`\n );\n }\n const result = /** @type {Record} */ (obj)[prop];\n if (typeof result === 'function' && result !== Function) {\n return result.bind(obj); // arrow functions aren't affected by bind.\n }\n return result;\n },\n\n /**\n * @param {jsep.UnaryExpression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalUnaryExpression (ast, subs) {\n /**\n * @typedef {{\n * [key: string]: (a: AnyParameter) => UnknownResult\n * }} UnaryOperatorTable\n */\n const result = /** @type {UnaryOperatorTable} */ ({\n '-': (a) => -(/** @type {EvaluatedResult} */ (\n SafeEval.evalAst(a, subs))\n ),\n '!': (a) => !SafeEval.evalAst(a, subs),\n '~': (a) => ~(/** @type {EvaluatedResult} */ (\n SafeEval.evalAst(a, subs))\n ),\n // eslint-disable-next-line no-implicit-coercion -- API\n '+': (a) => +(/** @type {EvaluatedResult} */ (\n SafeEval.evalAst(a, subs))\n ),\n typeof: (a) => typeof SafeEval.evalAst(a, subs),\n // eslint-disable-next-line no-void -- Ok\n void: (a) => void SafeEval.evalAst(a, subs)\n })[ast.operator](ast.argument);\n return result;\n },\n\n /**\n * @param {jsep.ArrayExpression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalArrayExpression (ast, subs) {\n return ast.elements.map((el) => SafeEval.evalAst(\n /** @type {jsep.Expression} */\n (el),\n subs\n ));\n },\n\n /**\n * @param {jsep.CallExpression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalCallExpression (ast, subs) {\n const args = ast.arguments.map((arg) => SafeEval.evalAst(arg, subs));\n const func = SafeEval.evalAst(ast.callee, subs);\n if (func === Function) {\n throw new Error('Function constructor is disabled');\n }\n return (/** @type {(...args: AnyParameter[]) => UnknownResult} */ (\n func\n ))(...args);\n },\n\n /**\n * @param {AssignmentExpression} ast\n * @param {Substitutions} subs\n * @returns {UnknownResult}\n */\n evalAssignmentExpression (ast, subs) {\n if (ast.left.type !== 'Identifier') {\n throw new SyntaxError('Invalid left-hand side in assignment');\n }\n const id = /** @type {jsep.Identifier} */ (\n ast.left\n ).name;\n const value = SafeEval.evalAst(ast.right, subs);\n subs[id] = value;\n return subs[id];\n }\n};\n\n/**\n * A replacement for NodeJS' VM.Script which is also {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | Content Security Policy} friendly.\n */\nclass SafeScript {\n /**\n * @param {string} expr Expression to evaluate\n */\n constructor (expr) {\n this.code = expr;\n this.ast = jsep(this.code);\n }\n\n /**\n * @param {object} context Object whose items will be added\n * to evaluation\n * @returns {EvaluatedResult} Result of evaluated code\n */\n runInNewContext (context) {\n // `Object.create(null)` creates a prototypeless object\n const keyMap = Object.assign(Object.create(null), context);\n return SafeEval.evalAst(this.ast, keyMap);\n }\n}\n\nexport {SafeScript};\n","/* eslint-disable camelcase -- Convenient for escaping */\n/* eslint-disable class-methods-use-this -- Consistent monkey-patching */\n/* eslint-disable unicorn/prefer-private-class-fields -- Allow\n monkey-patching */\nimport {SafeScript} from './Safe-Script.js';\n\n/**\n * @import {Script} from './jsonpath-browser.js';\n */\n\n/**\n * @typedef {any} AnyInput\n */\n\n/**\n * @typedef {((...args: any[]) => any)} SandboxCallback\n */\n\n/**\n * @typedef {any|SandboxCallback} SandboxPropertyValue\n */\n\n/**\n * @typedef {(string|number)[]} ExpressionArray\n */\n\n/**\n * @typedef {\"scalar\"|\"boolean\"|\"string\"|\"undefined\"|\n * \"function\"|\"integer\"|\"number\"|\"nonFinite\"|\"object\"|\n * \"array\"|\"other\"|\"null\"} ValueType\n */\n\n/**\n * @typedef {unknown} ParentValue\n */\n\n/**\n * @typedef {unknown} UnknownResult\n */\n\n/**\n * @typedef {string|number|null} ParentProperty\n */\n\n/**\n * @typedef {unknown|ParentValue|string|ReturnObject} PreferredOutput\n */\n\n/**\n * Copies array and then pushes item into it.\n * @param {ExpressionArray} arr Array to copy and into which to push\n * @param {string|number} item Array item to add (to end)\n * @returns {ExpressionArray} Copy of the original array\n */\nfunction push (arr, item) {\n arr = arr.slice();\n arr.push(item);\n return arr;\n}\n/**\n * Copies array and then unshifts item into it.\n * @param {string|number} item Array item to add (to beginning)\n * @param {ExpressionArray} arr Array to copy and into which to unshift\n * @returns {ExpressionArray} Copy of the original array\n */\nfunction unshift (item, arr) {\n arr = arr.slice();\n arr.unshift(item);\n return arr;\n}\n\n/**\n * Caught when JSONPath is used without `new` but rethrown if with `new`\n * @extends Error\n */\nclass NewError extends Error {\n /**\n * @param {UnknownResult} value The evaluated scalar value\n * @param {ErrorOptions} [options]\n */\n constructor (value, options) {\n super(\n 'JSONPath should not be called with \"new\" (it prevents return ' +\n 'of (unwrapped) scalar values)',\n options\n );\n this.value = value;\n this.name = 'NewError';\n }\n}\n\n/**\n* @typedef {object} ReturnObject\n* @property {ExpressionArray|string} path\n* @property {unknown} value\n* @property {ParentValue} parent\n* @property {ParentProperty} parentProperty\n* @property {boolean} [isParentSelector]\n* @property {boolean} [hasArrExpr]\n* @property {ExpressionArray} [expr]\n* @property {string} [pointer]\n*/\n\n/**\n* @callback JSONPathCallback\n* @param {any} preferredOutput Using `any` type instead of `PreferredOutput` so\n* that user can supply flexible type\n* @param {\"value\"|\"property\"} type\n* @param {ReturnObject} fullRetObj\n* @returns {void}\n*/\n\n/**\n* @callback OtherTypeCallback\n* @param {unknown} val\n* @param {ExpressionArray} path\n* @param {ParentValue} parent\n* @param {string|null} parentPropName\n* @returns {boolean}\n*/\n\n/**\n * @typedef {any} ContextItem\n */\n\n/**\n * @typedef {any} EvaluatedResult\n */\n\n/**\n* @callback EvalCallback\n* @param {string} code\n* @param {ContextItem} context\n* @returns {EvaluatedResult}\n*/\n\n/**\n * @typedef {typeof SafeScript} EvalClass\n */\n\n/**\n * @typedef {\"value\"|\"path\"|\"pointer\"|\"parent\"|\"parentProperty\"|\n * \"all\"} ResultType\n */\n\n/**\n * @typedef {EvalCallback|EvalClass|'safe'|'native'|boolean} EvalValue\n */\n\n/**\n * @typedef {string|string[]} PathType\n */\n\n/**\n * @typedef {{Script: typeof SafeScript}} SafeScriptType\n */\n\n/**\n * @typedef {import('node:vm')|{Script: typeof Script}} ScriptType\n */\n\n/**\n * @typedef {{\n * _$_path?: string,\n * _$_parentProperty?: ParentProperty,\n * _$_parent?: ParentValue,\n * _$_property?: string|number,\n * _$_root?: AnyInput,\n * _$_v?: unknown,\n * [key: string]: SandboxPropertyValue\n * }} SandboxType\n */\n\n/**\n * @typedef {object} JSONPathOptions\n * @property {AnyInput} [json]\n * @property {PathType} [path]\n * @property {ResultType} [resultType=\"value\"]\n * @property {boolean} [flatten=false]\n * @property {boolean} [wrap=true]\n * @property {SandboxType} [sandbox={}]\n * @property {EvalValue} [eval='safe']\n * @property {any|null} [parent=null]\n * @property {string|null} [parentProperty=null]\n * @property {JSONPathCallback} [callback]\n * @property {OtherTypeCallback} [otherTypeCallback] Defaults to\n * function which throws on encountering `@other`\n * @property {boolean} [autostart=true]\n * @property {boolean} [ignoreEvalErrors=false]\n */\n\n\n/**\n * @overload\n * @param {string} opts JSON path to evaluate\n * @param {AnyInput} [expr] JSON object to evaluate against\n * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired\n * payload per `resultType`, 2) `\"value\"|\"property\"`, 3) Full returned\n * object with all payloads\n * @param {OtherTypeCallback} [callback] If `@other()` is at the\n * end of one's query, this will be invoked with the value of the item,\n * its path, its parent, and its parent's property name, and it should\n * return a boolean indicating whether the supplied value belongs to the\n * \"other\" type or not (or it may handle transformations and return\n * `false`).\n * @param {undefined} [otherTypeCallback]\n * @returns {unknown|JSONPathClass}\n */\n/**\n * @overload\n * @param {JSONPathOptions} opts If a string, will be treated as\n * `expr`\n * @returns {unknown|JSONPathClass}\n */\n/**\n * @param {JSONPathOptions|string} opts If a string, will be treated as `expr`\n * @param {string|AnyInput} [expr] JSON path to evaluate\n * @param {AnyInput|JSONPathCallback} [obj] JSON object to evaluate against\n * @param {JSONPathCallback|OtherTypeCallback} [callback] Passed 3\n * arguments: 1) desired payload per `resultType`,\n * 2) `\"value\"|\"property\"`, 3) Full returned object with\n * all payloads\n * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the end\n * of one's query, this will be invoked with the value of the item, its\n * path, its parent, and its parent's property name, and it should return\n * a boolean indicating whether the supplied value belongs to the \"other\"\n * type or not (or it may handle transformations and return `false`).\n * @throws {Error}\n * @returns {unknown|JSONPathClass}\n */\nfunction JSONPath (opts, expr, obj, callback, otherTypeCallback) {\n try {\n if (opts && typeof opts === 'object') {\n return new JSONPathClass(opts);\n }\n return new JSONPathClass(\n opts,\n expr,\n /** @type {JSONPathCallback|undefined} */ (obj),\n /** @type {OtherTypeCallback|undefined} */ (callback),\n /** @type {undefined} */ (otherTypeCallback)\n );\n } catch (e) {\n // eslint-disable-next-line no-restricted-syntax -- Within the file\n if (!(e instanceof NewError)) {\n throw e;\n }\n return e.value;\n }\n}\n\n/**\n *\n */\nclass JSONPathClass {\n /**\n * @overload\n * @param {string} opts JSON path to evaluate\n * @param {AnyInput} [expr] JSON object to evaluate against\n * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired\n * payload per `resultType`, 2) `\"value\"|\"property\"`, 3) Full returned\n * object with all payloads\n * @param {OtherTypeCallback} [callback] If `@other()` is at the\n * end of one's query, this will be invoked with the value of the item,\n * its path, its parent, and its parent's property name, and it should\n * return a boolean indicating whether the supplied value belongs to the\n * \"other\" type or not (or it may handle transformations and return\n * `false`).\n * @param {undefined} [otherTypeCallback]\n * @returns {JSONPath|JSONPathClass}\n */\n /**\n * @overload\n * @param {JSONPathOptions} opts If a string, will be treated as\n * `expr`\n */\n /**\n * @param {null|string|JSONPathOptions} opts If a string, will be treated as\n * `expr`\n * @param {string|AnyInput} [expr] JSON path to evaluate\n * @param {AnyInput|JSONPathCallback} [obj] JSON object to evaluate against\n * @param {JSONPathCallback|OtherTypeCallback} [callback] Passed 3\n * arguments: 1) desired payload per `resultType`,\n * 2) `\"value\"|\"property\"`, 3) Full returned\n * object with all payloads\n * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the\n * end of one's query, this will be invoked with the value of the item,\n * its path, its parent, and its parent's property name, and it should\n * return a boolean indicating whether the supplied value belongs to the\n * \"other\" type or not (or it may handle transformations and return\n * `false`).\n */\n constructor (opts, expr, obj, callback, otherTypeCallback) {\n if (typeof opts === 'string') {\n otherTypeCallback = /** @type {OtherTypeCallback} */ (\n callback\n );\n callback = /** @type {JSONPathCallback} */ (\n obj\n );\n obj = expr;\n expr = opts;\n opts = null;\n }\n const optObj = opts && typeof opts === 'object';\n opts ||= /** @type {JSONPathOptions} */ ({});\n /** @type {ResultType|undefined} */\n this.currResultType = undefined;\n\n /** @type {EvalValue|undefined} */\n this.currEval = undefined;\n\n /** @type {OtherTypeCallback|undefined} */\n this.currOtherTypeCallback = undefined;\n\n /** @type {SafeScriptType} */\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line unicorn/no-undeclared-class-members, no-unused-expressions -- On prototype\n this.safeVm;\n\n /** @type {ScriptType} */\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line unicorn/no-undeclared-class-members, no-unused-expressions -- On prototype\n this.vm;\n\n /** @type {SandboxType|undefined} */\n this.currSandbox = undefined;\n\n this._hasParentSelector = false;\n\n this.json = opts.json || obj;\n this.path = opts.path || expr;\n this.resultType = opts.resultType || 'value';\n this.flatten = opts.flatten || false;\n this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true;\n this.sandbox = opts.sandbox || {};\n this.eval = opts.eval === undefined ? 'safe' : opts.eval;\n this.ignoreEvalErrors = (typeof opts.ignoreEvalErrors === 'undefined')\n ? false\n : opts.ignoreEvalErrors;\n this.parent = opts.parent || null;\n this.parentProperty = opts.parentProperty || null;\n this.callback = opts.callback ||\n /** @type {JSONPathCallback} */\n (callback) ||\n null;\n this.otherTypeCallback = opts.otherTypeCallback ||\n otherTypeCallback ||\n function () {\n throw new TypeError(\n 'You must supply an otherTypeCallback callback option ' +\n 'with the @other() operator.'\n );\n };\n\n if (opts.autostart !== false) {\n const args = /** @type {JSONPathOptions} */ ({\n path: (optObj ? opts.path : expr)\n });\n if (!optObj && obj !== undefined) {\n args.json = obj;\n } else if ('json' in opts) {\n args.json = opts.json;\n }\n const ret = this.evaluate(args);\n if (!ret || typeof ret !== 'object') {\n throw new NewError(ret);\n }\n\n // eslint-disable-next-line @stylistic/max-len -- Long\n // @ts-expect-error - Constructor returns evaluate result for legacy API\n // eslint-disable-next-line no-constructor-return -- Legacy API\n return ret;\n }\n }\n\n // PUBLIC METHODS\n\n /**\n * @overload\n * @param {JSONPathOptions} [expr]\n * @returns {ReturnObject|ReturnObject[]|undefined|unknown}\n */\n\n /**\n * @overload\n * @param {PathType|undefined} [expr]\n * @param {AnyInput} [json]\n * @param {JSONPathCallback|null} [callback]\n * @param {OtherTypeCallback} [otherTypeCallback]\n * @returns {ReturnObject|ReturnObject[]|undefined|unknown}\n */\n\n /**\n * @param {PathType|JSONPathOptions|undefined} [expr]\n * @param {AnyInput} [json]\n * @param {JSONPathCallback|null} [callback]\n * @param {OtherTypeCallback} [otherTypeCallback]\n * @returns {ReturnObject|ReturnObject[]|undefined|unknown}\n */\n evaluate (\n expr, json, callback, otherTypeCallback\n ) {\n let currParent = this.parent,\n currParentProperty = this.parentProperty;\n let {flatten, wrap} = this;\n\n this.currResultType = this.resultType;\n this.currEval = this.eval;\n this.currSandbox = this.sandbox;\n callback ||= this.callback;\n this.currOtherTypeCallback = otherTypeCallback ||\n this.otherTypeCallback;\n\n if (expr && typeof expr === 'object' && !Array.isArray(expr)) {\n const exprObj = expr;\n if (!exprObj.path && exprObj.path !== '') {\n throw new TypeError(\n 'You must supply a \"path\" property when providing an ' +\n 'object argument to JSONPath.evaluate().'\n );\n }\n if (!(Object.hasOwn(exprObj, 'json'))) {\n throw new TypeError(\n 'You must supply a \"json\" property when providing an ' +\n 'object argument to JSONPath.evaluate().'\n );\n }\n ({json} = exprObj);\n flatten = Object.hasOwn(exprObj, 'flatten')\n ? exprObj.flatten ?? flatten\n : flatten;\n this.currResultType = Object.hasOwn(exprObj, 'resultType')\n ? exprObj.resultType\n : this.currResultType;\n this.currSandbox = Object.hasOwn(exprObj, 'sandbox')\n ? exprObj.sandbox\n : this.currSandbox;\n wrap = Object.hasOwn(exprObj, 'wrap') ? exprObj.wrap : wrap;\n this.currEval = Object.hasOwn(exprObj, 'eval')\n ? exprObj.eval\n : this.currEval;\n callback = Object.hasOwn(exprObj, 'callback')\n ? exprObj.callback\n : callback;\n this.currOtherTypeCallback = Object.hasOwn(\n exprObj, 'otherTypeCallback'\n )\n ? exprObj.otherTypeCallback\n : this.currOtherTypeCallback;\n currParent = Object.hasOwn(exprObj, 'parent')\n ? exprObj.parent ?? currParent\n : currParent;\n currParentProperty = Object.hasOwn(exprObj, 'parentProperty')\n ? exprObj.parentProperty ?? currParentProperty\n : currParentProperty;\n expr = exprObj.path;\n } else {\n json ||= this.json;\n expr ||= this.path;\n }\n currParent ||= null;\n currParentProperty ||= null;\n\n if (Array.isArray(expr)) {\n expr = JSONPath.toPathString(expr);\n }\n if (!json || (!expr && expr !== '')) {\n return undefined;\n }\n\n const exprList = JSONPath.toPathArray(\n /** @type {string} */\n (expr)\n );\n if (exprList[0] === '$' && exprList.length > 1) {\n exprList.shift();\n }\n this._hasParentSelector = false;\n const traceResult = this._trace(\n exprList, json, ['$'], currParent,\n currParentProperty,\n callback ?? undefined,\n undefined\n );\n\n // eslint-disable-next-line @stylistic/max-len -- Long\n /* c8 ignore next 2 -- Unreachable: _trace returns array when hasArrExpr set */\n const result = (\n Array.isArray(traceResult) ? traceResult : [traceResult]\n ).filter((ea) => {\n return ea && !ea.isParentSelector;\n });\n\n if (!result.length) {\n // eslint-disable-next-line @stylistic/max-len -- Long\n /* c8 ignore next -- Unreachable: valid queries always produce results */\n return wrap ? [] : undefined;\n }\n if (!wrap && result.length === 1 && !result[0].hasArrExpr) {\n const preferredOutput = this._getPreferredOutput(result[0]);\n return preferredOutput;\n }\n const reduced = result.reduce(\n (rslt, ea) => {\n const valOrPath = this._getPreferredOutput(ea);\n if (flatten && Array.isArray(valOrPath)) {\n rslt = rslt.concat(valOrPath);\n } else {\n rslt.push(valOrPath);\n }\n return rslt;\n },\n /** @type {UnknownResult[]} */\n ([])\n );\n\n return reduced;\n }\n\n // PRIVATE METHODS\n\n /**\n * @param {ReturnObject} ea\n * @returns {PreferredOutput}\n */\n _getPreferredOutput (ea) {\n const resultType = this.currResultType;\n switch (resultType) {\n case 'all': {\n const path = Array.isArray(ea.path)\n ? ea.path\n : JSONPath.toPathArray(ea.path);\n ea.pointer = JSONPath.toPointer(/** @type {string[]} */ (path));\n ea.path = typeof ea.path === 'string'\n ? ea.path\n : JSONPath.toPathString(/** @type {string[]} */ (ea.path));\n return ea;\n } case 'value': case 'parent': case 'parentProperty':\n return ea[resultType];\n case 'path':\n if (typeof ea.path === 'string') {\n return ea.path;\n }\n return JSONPath.toPathString(/** @type {string[]} */ (ea.path));\n case 'pointer': {\n const pathArray = Array.isArray(ea.path)\n ? ea.path\n : JSONPath.toPathArray(ea.path);\n return JSONPath.toPointer(/** @type {string[]} */ (pathArray));\n }\n default:\n throw new TypeError('Unknown result type');\n }\n }\n\n /**\n * @param {ReturnObject} fullRetObj\n * @param {JSONPathCallback|undefined} callback\n * @param {\"value\"|\"property\"} type\n * @returns {void}\n */\n _handleCallback (fullRetObj, callback, type) {\n // Early return if no callback provided (defensive\n // check for internal calls)\n if (!callback) {\n return;\n }\n const preferredOutput = this._getPreferredOutput(fullRetObj);\n if (Array.isArray(fullRetObj.path)) {\n fullRetObj.path = JSONPath.toPathString(\n /** @type {string[]} */ (fullRetObj.path)\n );\n }\n callback(preferredOutput, type, fullRetObj);\n }\n\n /**\n *\n * @param {ExpressionArray} expr\n * @param {unknown} val\n * @param {ExpressionArray} path\n * @param {ParentValue} parent\n * @param {ParentProperty} parentPropName\n * @param {JSONPathCallback|undefined} callback\n * @param {boolean|undefined} hasArrExpr\n * @param {boolean} [literalPriority]\n * @returns {ReturnObject|ReturnObject[]}\n */\n _trace (\n expr, val, path, parent, parentPropName, callback, hasArrExpr,\n literalPriority\n ) {\n // No expr to follow? return path and value as the result of\n // this trace branch\n let retObj;\n if (!expr.length) {\n retObj = {\n path,\n value: val,\n parent,\n parentProperty: parentPropName,\n hasArrExpr\n };\n this._handleCallback(retObj, callback, 'value');\n return retObj;\n }\n\n const loc = /** @type {string} */ (expr[0]), x = expr.slice(1);\n\n // We need to gather the return value of recursive trace calls in order\n // to do the parent sel computation.\n /** @type {ReturnObject[]} */\n const ret = [];\n /**\n *\n * @param {ReturnObject|ReturnObject[]} elems\n * @returns {void}\n */\n function addRet (elems) {\n if (Array.isArray(elems)) {\n // This was causing excessive stack size in Node (with or\n // without Babel) against our performance test:\n // `ret.push(...elems);`\n elems.forEach((t) => {\n ret.push(t);\n });\n } else {\n ret.push(elems);\n }\n }\n if (val && (typeof loc !== 'string' || literalPriority) &&\n Object.hasOwn(val, /** @type {PropertyKey} */ (loc))\n ) { // simple case--directly follow property\n const valObj = /** @type {Record} */ (val);\n addRet(this._trace(\n x, valObj[/** @type {string} */ (loc)],\n push(path, loc),\n val, /** @type {string|number} */ (loc), callback,\n hasArrExpr\n ));\n // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if`\n } else if (loc === '*') { // all child properties\n this._walk(val, (m) => {\n const valObj = /** @type {Record} */ (val);\n addRet(this._trace(\n x, valObj[m], push(path, m), val, m, callback, true, true\n ));\n });\n } else if (loc === '..') { // all descendent parent properties\n // Check remaining expression with val's immediate children\n addRet(\n this._trace(x, val, path, parent, parentPropName, callback,\n hasArrExpr)\n );\n this._walk(val, (m) => {\n // We don't join m and x here because we only want parents,\n // not scalar values\n const valObj = /** @type {Record} */ (val);\n if (typeof valObj[m] === 'object') {\n // Keep going with recursive descent on val's\n // object children\n addRet(this._trace(\n expr.slice(),\n valObj[m],\n push(path, m),\n val,\n m,\n callback,\n true\n ));\n }\n });\n // The parent sel computation is handled in the frame above using the\n // ancestor object of val\n } else if (loc === '^') {\n // This is not a final endpoint, so we do not invoke the\n // callback here\n this._hasParentSelector = true;\n return /** @type {ReturnObject} */ ({\n path: path.slice(0, -1),\n expr: x,\n isParentSelector: true,\n value: undefined,\n parent: undefined,\n parentProperty: null\n });\n } else if (loc === '~') { // property name\n retObj = {\n path: push(path, loc),\n value: parentPropName,\n parent,\n parentProperty: null\n };\n this._handleCallback(retObj, callback, 'property');\n return retObj;\n } else if (loc === '$') { // root only\n addRet(this._trace(x, val, path, null, null, callback, hasArrExpr));\n // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient\n } else if ((/^(-?\\d*):(-?\\d*):?(\\d*)$/u).test(loc)) { // [start:end:step] Python slice syntax\n const sliceResult = this._slice(\n loc, x, val, path, parent, parentPropName, callback\n );\n if (sliceResult) {\n addRet(sliceResult);\n }\n } else if (loc.indexOf('?(') === 0) { // [?(expr)] (filtering)\n if (this.currEval === false) {\n throw new Error(\n 'Eval [?(expr)] prevented in JSONPath expression.'\n );\n }\n const safeLoc = loc.replace(/^\\?\\((.*?)\\)$/u, '$1');\n // check for a nested filter expression\n // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient\n const nested = (/@.?([^?]*)[['](\\??\\(.*?\\))(?!.\\)\\])[\\]']/gu).exec(safeLoc);\n if (nested) {\n // find if there are matches in the nested expression\n // add them to the result set if there is at least one match\n this._walk(val, (m) => {\n const npath = [nested[2]];\n const valObj2 = /** @type {Record} */ (\n val\n );\n const nvalue = /** @type {ValueType} */ (nested[1]\n ? /** @type {Record} */ (\n valObj2[m]\n )[nested[1]]\n : valObj2[m]);\n const filterResults = this._trace(npath, nvalue, path,\n parent, parentPropName, callback, true);\n // eslint-disable-next-line @stylistic/max-len -- Long\n /* c8 ignore next 3 -- Unreachable: _trace always returns array for nested filters */\n const filterArray = Array.isArray(filterResults)\n ? filterResults\n : [filterResults];\n if (filterArray.length > 0) {\n addRet(this._trace(x, valObj2[m], push(path, m), val,\n m, callback, true));\n }\n });\n } else {\n const valObj3 = /** @type {Record} */ (val);\n this._walk(val, (m) => {\n if (this._eval(safeLoc, valObj3[m], m, path, parent,\n parentPropName)) {\n addRet(this._trace(x, valObj3[m], push(path, m), val, m,\n callback, true));\n }\n });\n }\n } else if (loc[0] === '(') { // [(expr)] (dynamic property/index)\n if (this.currEval === false) {\n throw new Error(\n 'Eval [(expr)] prevented in JSONPath expression.'\n );\n }\n // As this will resolve to a property name (but we don't know it\n // yet), property and parent information is relative to the\n const evalResult = this._eval(\n /** @type {string} */ (loc),\n val, /** @type {string|number} */ (path.at(-1)),\n path.slice(0, -1), parent, parentPropName\n );\n const exprToUse = /** @type {string|number} */ (\n evalResult !== undefined ? evalResult : ''\n );\n addRet(this._trace(unshift(\n exprToUse,\n x\n ), val, path, parent, parentPropName, callback, hasArrExpr));\n } else if (loc[0] === '@') { // value type: @boolean(), etc.\n let addType = false;\n const valueType = /** @type {ValueType} */ (loc).slice(1, -2);\n switch (valueType) {\n case 'scalar':\n if (!val || !(['object', 'function'].includes(typeof val))) {\n addType = true;\n }\n break;\n case 'boolean': case 'string': case 'undefined': case 'function':\n if (typeof val === valueType) {\n addType = true;\n }\n break;\n case 'integer':\n if (Number.isFinite(val) &&\n !(/** @type {number} */ (val) % 1)) {\n addType = true;\n }\n break;\n case 'number':\n if (Number.isFinite(val)) {\n addType = true;\n }\n break;\n case 'nonFinite':\n if (typeof val === 'number' && !Number.isFinite(val)) {\n addType = true;\n }\n break;\n case 'object':\n if (val && typeof val === valueType) {\n addType = true;\n }\n break;\n case 'array':\n if (Array.isArray(val)) {\n addType = true;\n }\n break;\n case 'other':\n addType = this.currOtherTypeCallback?.(\n val, path, parent,\n /** @type {string|null} */ (parentPropName)\n ) ?? false;\n break;\n case 'null':\n if (val === null) {\n addType = true;\n }\n break;\n /* c8 ignore next 2 */\n default:\n throw new TypeError('Unknown value type ' + valueType);\n }\n if (addType) {\n retObj = {\n path, value: val, parent, parentProperty: parentPropName,\n hasArrExpr\n };\n this._handleCallback(retObj, callback, 'value');\n return retObj;\n }\n // `-escaped property\n } else if (val && loc[0] === '`' &&\n Object.hasOwn(val, loc.slice(1))\n ) {\n const locProp = loc.slice(1);\n const valObj = /** @type {Record} */ (val);\n addRet(this._trace(\n x, valObj[locProp], push(path, locProp), val, locProp, callback,\n hasArrExpr, true\n ));\n } else if (loc.includes(',')) { // [name1,name2,...]\n const parts = loc.split(',');\n for (const part of parts) {\n addRet(this._trace(\n unshift(part, x),\n val,\n path,\n parent,\n parentPropName,\n callback,\n true\n ));\n }\n // simple case--directly follow property\n } else if (\n !literalPriority && val && Object.hasOwn(val, loc)\n ) {\n const valObj = /** @type {Record} */ (val);\n addRet(\n this._trace(x, valObj[loc], push(path, loc), val, loc, callback,\n hasArrExpr, true)\n );\n }\n\n // We check the resulting values for parent selections. For parent\n // selections we discard the value object and continue the trace with\n // the current val object\n if (this._hasParentSelector) {\n for (let t = 0; t < ret.length; t++) {\n const rett = ret[t];\n if (rett && rett.isParentSelector) {\n const exprToUse = /** @type {ExpressionArray} */ (\n rett.expr\n );\n const pathToUse = /** @type {ExpressionArray} */ (\n rett.path\n );\n const tmp = this._trace(\n exprToUse,\n val,\n pathToUse,\n parent,\n parentPropName,\n callback,\n hasArrExpr\n );\n if (Array.isArray(tmp)) {\n ret[t] = tmp[0];\n const tl = tmp.length;\n for (let tt = 1; tt < tl; tt++) {\n t++;\n ret.splice(t, 0, tmp[tt]);\n }\n } else {\n ret[t] = tmp;\n }\n }\n }\n }\n return ret;\n }\n\n /**\n * @param {unknown} val\n * @param {(prop: string|number) => void} f\n * @returns {void}\n */\n _walk (val, f) {\n if (Array.isArray(val)) {\n const n = val.length;\n for (let i = 0; i < n; i++) {\n f(i);\n }\n } else if (val && typeof val === 'object') {\n Object.keys(val).forEach((m) => {\n f(m);\n });\n }\n }\n\n /**\n * @param {string} loc\n * @param {ExpressionArray} expr\n * @param {unknown} val\n * @param {ExpressionArray} path\n * @param {ParentValue} parent\n * @param {ParentProperty} parentPropName\n * @param {JSONPathCallback|undefined} callback\n * @returns {ReturnObject[]|undefined}\n */\n _slice (\n loc, expr, val, path, parent, parentPropName, callback\n ) {\n if (!Array.isArray(val)) {\n return undefined;\n }\n const len = val.length, parts = loc.split(':'),\n step = (parts[2] && Number(parts[2])) || 1;\n let start = (parts[0] && Number(parts[0])) || 0,\n end = parts[1] ? Number(parts[1]) : len;\n start = (start < 0) ? Math.max(0, start + len) : Math.min(len, start);\n end = (end < 0) ? Math.max(0, end + len) : Math.min(len, end);\n /** @type {ReturnObject[]} */\n const ret = [];\n for (let i = start; i < end; i += step) {\n const tmp = this._trace(\n unshift(i, expr),\n val,\n path,\n parent,\n parentPropName,\n callback,\n true\n );\n // Should only be possible to be an array here since first part of\n // ``unshift(i, expr)` passed in above would not be empty,\n // nor `~`, nor begin with `@` (as could return objects)\n // This was causing excessive stack size in Node (with or\n // without Babel) against our performance test: `ret.push(...tmp);`\n // eslint-disable-next-line @stylistic/max-len -- Long\n /* c8 ignore next -- Unreachable: _trace returns array when expr non-empty */\n const tmpArray = Array.isArray(tmp) ? tmp : [tmp];\n tmpArray.forEach((t) => {\n ret.push(t);\n });\n }\n return ret;\n }\n\n /**\n * @param {string} code\n * @param {unknown} _v\n * @param {string|number} _vname\n * @param {ExpressionArray} path\n * @param {ParentValue} parent\n * @param {ParentProperty} parentPropName\n * @returns {UnknownResult}\n */\n _eval (\n code, _v, _vname, path, parent, parentPropName\n ) {\n if (this.currSandbox) {\n this.currSandbox._$_parentProperty = parentPropName;\n this.currSandbox._$_parent = parent;\n this.currSandbox._$_property = _vname;\n this.currSandbox._$_root = this.json;\n this.currSandbox._$_v = _v;\n }\n\n const containsPath = code.includes('@path');\n if (containsPath) {\n // eslint-disable-next-line @stylistic/max-len -- Long\n /* c8 ignore next -- Unreachable: currSandbox set in evaluate() before _eval */\n const currSandbox = this.currSandbox ?? {};\n currSandbox._$_path = JSONPath.toPathString(\n /** @type {string[]} */ (path.concat([_vname]))\n );\n }\n\n const scriptCacheKey = this.currEval + 'Script:' + code;\n if (!Object.hasOwn(JSONPath.cache, scriptCacheKey)) {\n let script = code\n .replaceAll('@parentProperty', '_$_parentProperty')\n .replaceAll('@parent', '_$_parent')\n .replaceAll('@property', '_$_property')\n .replaceAll('@root', '_$_root')\n .replaceAll(/@([.\\s)[])/gu, '_$_v$1');\n if (containsPath) {\n script = script.replaceAll('@path', '_$_path');\n }\n const evalType = /** @type {string|boolean|undefined} */ (\n this.currEval\n );\n if (['safe', true, undefined].includes(evalType)) {\n const {cache} = JSONPath;\n cache[scriptCacheKey] = new (\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line unicorn/no-undeclared-class-members -- Prototype\n this.safeVm\n ).Script(script);\n } else if (this.currEval === 'native') {\n const {cache} = JSONPath;\n cache[scriptCacheKey] = new (\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line unicorn/no-undeclared-class-members -- Prototype\n this.vm\n ).Script(script);\n } else if (\n typeof this.currEval === 'function' &&\n this.currEval.prototype &&\n Object.hasOwn(this.currEval.prototype, 'runInNewContext')\n ) {\n const CurrEval = this.currEval;\n const {cache} = JSONPath;\n // eslint-disable-next-line @stylistic/max-len -- Long\n // @ts-expect-error - Type checked above to have proper constructor\n cache[scriptCacheKey] = new CurrEval(script);\n } else if (typeof this.currEval === 'function') {\n const {cache} = JSONPath;\n // Type narrowing: at this point currEval is a function\n // but not a constructor\n const evalFunc = /** @type {EvalCallback} */ (this.currEval);\n cache[scriptCacheKey] = {\n runInNewContext: (\n /** @type {ContextItem} */ context\n ) => evalFunc(script, context)\n };\n } else {\n throw new TypeError(\n `Unknown \"eval\" property \"${this.currEval}\"`\n );\n }\n }\n\n try {\n const {cache} = JSONPath;\n\n /**\n * @typedef {{\n * runInNewContext: (\n * ctx: SandboxType|undefined\n * ) => EvaluatedResult\n * }} RunInNewContext\n */\n\n return /** @type {RunInNewContext} */ (\n cache[scriptCacheKey]\n ).runInNewContext(\n this.currSandbox\n );\n } catch (e) {\n if (this.ignoreEvalErrors) {\n return false;\n }\n const error = /** @type {Error} */ (e);\n throw new Error('jsonPath: ' + error.message + ': ' + code, {\n cause: e\n });\n }\n }\n}\n\nJSONPathClass.prototype.safeVm = {\n Script: SafeScript\n};\n\n// PUBLIC CLASS PROPERTIES AND METHODS\n\n// Could store the cache object itself\n\n/** @type {Record} */\nJSONPath.cache = {};\n\n/**\n * @param {string[]} pathArr Array to convert\n * @returns {string} The path string\n */\nJSONPath.toPathString = function (pathArr) {\n const x = pathArr, n = x.length;\n let p = '$';\n for (let i = 1; i < n; i++) {\n if (!(/^(~|\\^|@.*?\\(\\))$/u).test(x[i])) {\n p += (/^[0-9*]+$/u).test(x[i]) ? ('[' + x[i] + ']') : (\"['\" + x[i] + \"']\");\n }\n }\n return p;\n};\n\n/**\n * @param {string[]} pointer JSON Path array\n * @returns {string} JSON Pointer\n */\nJSONPath.toPointer = function (pointer) {\n const x = pointer, n = x.length;\n let p = '';\n for (let i = 1; i < n; i++) {\n if (!(/^(~|\\^|@.*?\\(\\))$/u).test(x[i])) {\n p += '/' + x[i].toString()\n .replaceAll('~', '~0')\n .replaceAll('/', '~1');\n }\n }\n return p;\n};\n\n/**\n * @param {string} expr Expression to convert\n * @returns {string[]}\n */\nJSONPath.toPathArray = function (expr) {\n const {cache} = JSONPath;\n if (Object.hasOwn(cache, expr)) {\n return /** @type {string[]} */ (cache[expr]).concat();\n }\n /** @type {string[]} */\n const subx = [];\n const normalized = expr\n // Properties\n .replaceAll(\n /@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\\(\\)/gu,\n ';$&;'\n )\n // Parenthetical evaluations (filtering and otherwise), directly\n // within brackets or single quotes\n .replaceAll(/[['](\\??\\(.*?\\))[\\]'](?!.\\])/gu, function ($0, $1) {\n return '[#' +\n // eslint-disable-next-line @stylistic/max-len -- Long\n // eslint-disable-next-line unicorn/no-return-array-push -- Optimization\n (subx.push($1) - 1) +\n ']';\n })\n // Escape periods and tildes within properties\n .replaceAll(/\\[['\"]([^'\\]]*)['\"]\\]/gu, function ($0, prop) {\n return \"['\" + prop\n .replaceAll('.', '%@%')\n .replaceAll('~', '%%@@%%') +\n \"']\";\n })\n // Properties operator\n .replaceAll('~', ';~;')\n // Split by property boundaries\n // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient\n .replaceAll(/['\"]?\\.['\"]?(?![^[]*\\])|\\[['\"]?/gu, ';')\n // Reinsert periods within properties\n .replaceAll('%@%', '.')\n // Reinsert tildes within properties\n .replaceAll('%%@@%%', '~')\n // Parent\n .replaceAll(/(?:;)?(\\^+)(?:;)?/gu, function ($0, ups) {\n return ';' + ups.split('').join(';') + ';';\n })\n // Descendents\n .replaceAll(/;;;|;;/gu, ';..;')\n // Remove trailing\n .replaceAll(/;$|'?\\]|'$/gu, '');\n\n const exprList = normalized.split(';').map(function (exp) {\n const match = exp.match(/#(\\d+)/u);\n return !match || !match[1] ? exp : subx[Number(match[1])];\n });\n cache[expr] = exprList;\n return /** @type {string[]} */ (cache[expr]).concat();\n};\n\nexport {JSONPath, JSONPathClass};\n","import {JSONPath, JSONPathClass} from './jsonpath.js';\n\n/**\n * @typedef {import('./jsonpath.js').AnyInput} AnyInput\n */\n/**\n * @typedef {import('./jsonpath.js').SandboxCallback} SandboxCallback\n */\n/**\n * @typedef {import('./jsonpath.js').SandboxPropertyValue} SandboxPropertyValue\n */\n/**\n * @typedef {import('./jsonpath.js').ExpressionArray} ExpressionArray\n */\n/**\n * @typedef {import('./jsonpath.js').ValueType} ValueType\n */\n/**\n * @typedef {import('./jsonpath.js').ParentValue} ParentValue\n */\n/**\n * @typedef {import('./jsonpath.js').UnknownResult} UnknownResult\n */\n/**\n * @typedef {import('./jsonpath.js').ParentProperty} ParentProperty\n */\n/**\n * @typedef {import('./jsonpath.js').PreferredOutput} PreferredOutput\n */\n/**\n * @typedef {import('./jsonpath.js').ReturnObject} ReturnObject\n */\n/**\n * @typedef {import('./jsonpath.js').JSONPathCallback} JSONPathCallback\n */\n/**\n * @typedef {import('./jsonpath.js').OtherTypeCallback} OtherTypeCallback\n */\n/**\n * @typedef {import('./jsonpath.js').ContextItem} ContextItem\n */\n/**\n * @typedef {import('./jsonpath.js').EvaluatedResult} EvaluatedResult\n */\n/**\n * @typedef {import('./jsonpath.js').EvalCallback} EvalCallback\n */\n/**\n * @typedef {import('./jsonpath.js').EvalClass} EvalClass\n */\n/**\n * @typedef {import('./jsonpath.js').ResultType} ResultType\n */\n/**\n * @typedef {import('./jsonpath.js').EvalValue} EvalValue\n */\n/**\n * @typedef {import('./jsonpath.js').PathType} PathType\n */\n/**\n * @typedef {import('./jsonpath.js').SafeScriptType} SafeScriptType\n */\n/**\n * @typedef {import('./jsonpath.js').ScriptType} ScriptType\n */\n/**\n * @typedef {import('./jsonpath.js').SandboxType} SandboxType\n */\n/**\n * @typedef {import('./jsonpath.js').JSONPathOptions} JSONPathOptions\n */\n\n/**\n * @template T\n * @callback ConditionCallback\n * @param {T} item\n * @returns {boolean}\n */\n\n/**\n * Copy items out of one array into another.\n * @template T\n * @param {T[]} source Array with items to copy\n * @param {T[]} target Array to which to copy\n * @param {ConditionCallback} conditionCb Callback passed the current item;\n * will move item if evaluates to `true`\n * @returns {void}\n */\nconst moveToAnotherArray = function (source, target, conditionCb) {\n const il = source.length;\n for (let i = 0; i < il; i++) {\n const item = source[i];\n if (conditionCb(item)) {\n target.push(source.splice(i--, 1)[0]);\n }\n }\n};\n\n/**\n * In-browser replacement for NodeJS' VM.Script.\n */\nclass Script {\n /**\n * @param {string} expr Expression to evaluate\n */\n constructor (expr) {\n this.code = expr;\n }\n\n /**\n * @param {SandboxType} context Object whose items will be added\n * to evaluation\n * @returns {EvaluatedResult} Result of evaluated code\n */\n runInNewContext (context) {\n let expr = this.code;\n const keys = Object.keys(context);\n const funcs = /** @type {string[]} */ ([]);\n moveToAnotherArray(keys, funcs, (key) => {\n return typeof context[key] === 'function';\n });\n const values = keys.map((vr) => {\n return context[vr];\n });\n\n const funcString = funcs.reduce((s, func) => {\n let fString = context[func].toString();\n if (!(/function/u).test(fString)) {\n fString = 'function ' + fString;\n }\n return 'var ' + func + '=' + fString + ';' + s;\n }, '');\n\n expr = funcString + expr;\n\n // Mitigate https://perfectionkills.com/global-eval-what-are-the-options/#new_function\n if (!(/(['\"])use strict\\1/u).test(expr) && !keys.includes('arguments')) {\n expr = 'var arguments = undefined;' + expr;\n }\n\n // Remove last semi so `return` will be inserted before\n // the previous one instead, allowing for the return\n // of a bare ending expression\n expr = expr.replace(/;\\s*$/u, '');\n\n // Insert `return`\n const lastStatementEnd = expr.lastIndexOf(';');\n const code =\n lastStatementEnd !== -1\n ? expr.slice(0, lastStatementEnd + 1) +\n ' return ' +\n expr.slice(lastStatementEnd + 1)\n : ' return ' + expr;\n\n // eslint-disable-next-line no-new-func -- User's choice\n return new Function(...keys, code)(...values);\n }\n}\n\nJSONPathClass.prototype.vm = {\n Script\n};\n\nexport {JSONPath, JSONPathClass, Script};\n"],"names":["Jsep","version","toString","addUnaryOp","op_name","max_unop_len","Math","max","length","unary_ops","addBinaryOp","precedence","isRightAssociative","max_binop_len","binary_ops","right_associative","add","delete","addIdentifierChar","char","additional_identifier_chars","addLiteral","literal_name","literal_value","literals","removeUnaryOp","getMaxKeyLen","removeAllUnaryOps","removeIdentifierChar","removeBinaryOp","removeAllBinaryOps","removeLiteral","removeAllLiterals","this","expr","charAt","index","code","charCodeAt","constructor","parse","obj","Object","keys","map","k","isDecimalDigit","ch","binaryPrecedence","op_val","isIdentifierStart","String","fromCharCode","has","isIdentifierPart","throwError","message","error","Error","description","runHook","name","node","hooks","env","context","run","searchHook","find","callback","call","gobbleSpaces","SPACE_CODE","TAB_CODE","LF_CODE","CR_CODE","nodes","gobbleExpressions","type","COMPOUND","body","untilICode","ch_i","SEMCOL_CODE","COMMA_CODE","gobbleExpression","push","gobbleBinaryExpression","gobbleBinaryOp","to_check","substr","tc_len","hasOwnProperty","biop","prec","stack","biop_info","left","right","i","cur_biop","gobbleToken","value","right_a","comparePrev","prev","pop","BINARY_EXP","operator","PERIOD_CODE","gobbleNumericLiteral","SQUOTE_CODE","DQUOTE_CODE","gobbleStringLiteral","OBRACK_CODE","gobbleArray","argument","UNARY_EXP","prefix","gobbleIdentifier","LITERAL","raw","this_str","THIS_EXP","OPAREN_CODE","gobbleGroup","gobbleTokenProperty","QUMARK_CODE","optional","MEMBER_EXP","computed","object","property","CBRACK_CODE","CALL_EXP","arguments","gobbleArguments","CPAREN_CODE","callee","chCode","number","parseFloat","str","startIndex","quote","closed","substring","start","IDENTIFIER","slice","termination","args","separator_count","arg","SEQUENCE_EXP","expressions","ARRAY_EXP","elements","first","Array","isArray","forEach","assign","plugins","jsep","registered","register","plugin","init","COLON_CODE","Set","true","false","null","stdClassProps","getOwnPropertyNames","filter","prop","includes","undefined","m","ternary","test","consequent","alternate","newTest","patternIndex","inCharSet","pattern","flags","RegExp","e","assignmentOperators","updateOperators","assignmentPrecedence","updateNodeTypes","updateBinariesToAssignments","values","val","op","some","c","jsepRegex","jsepAssignment","BLOCKED_PROTO_PROPERTIES","SafeEval","evalAst","ast","subs","evalBinaryExpression","evalCompound","evalConditionalExpression","evalIdentifier","evalLiteral","evalMemberExpression","evalUnaryExpression","evalArrayExpression","evalCallExpression","evalAssignmentExpression","SyntaxError","cause","||","a","b","&&","|","^","&","==","!=","===","!==","<",">","<=",">=","<<",">>",">>>","+","-","*","/","%","last","hasOwn","ReferenceError","TypeError","result","Function","bind","typeof","void","el","func","id","arr","item","unshift","NewError","options","super","JSONPath","opts","otherTypeCallback","JSONPathClass","optObj","currResultType","currEval","currOtherTypeCallback","safeVm","vm","currSandbox","_hasParentSelector","json","path","resultType","flatten","wrap","sandbox","eval","ignoreEvalErrors","parent","parentProperty","autostart","ret","evaluate","currParent","currParentProperty","exprObj","toPathString","exprList","toPathArray","shift","traceResult","_trace","ea","isParentSelector","hasArrExpr","_getPreferredOutput","reduce","rslt","valOrPath","concat","pointer","toPointer","pathArray","_handleCallback","fullRetObj","preferredOutput","parentPropName","literalPriority","retObj","loc","x","addRet","elems","t","valObj","_walk","sliceResult","_slice","indexOf","safeLoc","replace","nested","exec","npath","valObj2","nvalue","filterResults","valObj3","_eval","evalResult","at","exprToUse","addType","valueType","Number","isFinite","locProp","parts","split","part","rett","pathToUse","tmp","tl","tt","splice","f","n","len","step","end","min","_v","_vname","_$_parentProperty","_$_parent","_$_property","_$_root","_$_v","containsPath","_$_path","scriptCacheKey","cache","script","replaceAll","evalType","Script","prototype","CurrEval","evalFunc","runInNewContext","keyMap","create","pathArr","p","subx","$0","$1","ups","join","exp","match","funcs","source","target","conditionCb","il","moveToAnotherArray","key","vr","s","fString","lastStatementEnd","lastIndexOf"],"mappings":"+OAgGA,MAAMA,EAIL,kBAAWC,GAEV,MAAO,OACR,CAKA,eAAOC,GACN,MAAO,wCAA0CF,EAAKC,OACvD,CAQA,iBAAOE,CAAWC,GAGjB,OAFAJ,EAAKK,aAAeC,KAAKC,IAAIH,EAAQI,OAAQR,EAAKK,cAClDL,EAAKS,UAAUL,GAAW,EACnBJ,CACR,CASA,kBAAOU,CAAYN,EAASO,EAAYC,GASvC,OARAZ,EAAKa,cAAgBP,KAAKC,IAAIH,EAAQI,OAAQR,EAAKa,eACnDb,EAAKc,WAAWV,GAAWO,EACvBC,EACHZ,EAAKe,kBAAkBC,IAAIZ,GAG3BJ,EAAKe,kBAAkBE,OAAOb,GAExBJ,CACR,CAOA,wBAAOkB,CAAkBC,GAExB,OADAnB,EAAKoB,4BAA4BJ,IAAIG,GAC9BnB,CACR,CAQA,iBAAOqB,CAAWC,EAAcC,GAE/B,OADAvB,EAAKwB,SAASF,GAAgBC,EACvBvB,CACR,CAOA,oBAAOyB,CAAcrB,GAKpB,cAJOJ,EAAKS,UAAUL,GAClBA,EAAQI,SAAWR,EAAKK,eAC3BL,EAAKK,aAAeL,EAAK0B,aAAa1B,EAAKS,YAErCT,CACR,CAMA,wBAAO2B,GAIN,OAHA3B,EAAKS,UAAY,CAAA,EACjBT,EAAKK,aAAe,EAEbL,CACR,CAOA,2BAAO4B,CAAqBT,GAE3B,OADAnB,EAAKoB,4BAA4BH,OAAOE,GACjCnB,CACR,CAOA,qBAAO6B,CAAezB,GAQrB,cAPOJ,EAAKc,WAAWV,GAEnBA,EAAQI,SAAWR,EAAKa,gBAC3Bb,EAAKa,cAAgBb,EAAK0B,aAAa1B,EAAKc,aAE7Cd,EAAKe,kBAAkBE,OAAOb,GAEvBJ,CACR,CAMA,yBAAO8B,GAIN,OAHA9B,EAAKc,WA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AAO,IAAM6I,EAAU,IAAMD,GAC9C,IAEiBxW,EAGd,sBAAuBoJ,KAAKpJ,IAAUS,EAAKuI,SAAS,eACtDhJ,EAAO,6BAA+BA,GAM1CA,EAAOA,EAAKkS,QAAQ,SAAU,IAG9B,MAAMwE,EAAmB1W,EAAK2W,YAAY,KACpCxW,GACmB,IAArBuW,EACM1W,EAAKmH,MAAM,EAAGuP,EAAmB,GACjC,WACA1W,EAAKmH,MAAMuP,EAAmB,GAC9B,WAAa1W,EAGvB,OAAO,IAAIuN,YAAY9M,EAAMN,EAAtB,IAA+BgK,EAC1C,EAGJoE,EAAc0G,UAAUpG,GAAK,CACzBmG","x_google_ignoreList":[0,1,2]} \ No newline at end of file diff --git a/dist/index-node-cjs.cjs b/dist/index-node-cjs.cjs index 99e86669..e17c9a6c 100644 --- a/dist/index-node-cjs.cjs +++ b/dist/index-node-cjs.cjs @@ -1199,8 +1199,30 @@ const plugin = { } }; +/* eslint-disable unicorn/no-top-level-side-effects -- Temporary? */ /* eslint-disable no-bitwise -- Convenient */ +/** + * @import {EvaluatedResult, UnknownResult} from './jsonpath.js'; + */ + +/** + * @typedef {import('@jsep-plugin/assignment'). + * AssignmentExpression} AssignmentExpression + */ + +/** + * @typedef {any} Substitution + */ + +/** + * @typedef {any} AnyParameter + */ + +/** + * @typedef {Record} Substitutions + */ + // register plugins jsep.plugins.register(index, plugin); jsep.addUnaryOp('typeof'); @@ -1211,37 +1233,50 @@ const BLOCKED_PROTO_PROPERTIES = new Set(['constructor', '__proto__', '__defineG const SafeEval = { /** * @param {jsep.Expression} ast - * @param {Record} subs + * @param {Substitutions} subs + * @returns {UnknownResult} */ evalAst(ast, subs) { switch (ast.type) { case 'BinaryExpression': case 'LogicalExpression': - return SafeEval.evalBinaryExpression(ast, subs); + return SafeEval.evalBinaryExpression(/** @type {jsep.BinaryExpression} */ast, subs); case 'Compound': - return SafeEval.evalCompound(ast, subs); + return SafeEval.evalCompound(/** @type {jsep.Compound} */ast, subs); case 'ConditionalExpression': - return SafeEval.evalConditionalExpression(ast, subs); + return SafeEval.evalConditionalExpression(/** @type {jsep.ConditionalExpression} */ast, subs); case 'Identifier': - return SafeEval.evalIdentifier(ast, subs); + return SafeEval.evalIdentifier(/** @type {jsep.Identifier} */ast, subs); case 'Literal': - return SafeEval.evalLiteral(ast, subs); + return SafeEval.evalLiteral(/** @type {jsep.Literal} */ast); case 'MemberExpression': - return SafeEval.evalMemberExpression(ast, subs); + return SafeEval.evalMemberExpression(/** @type {jsep.MemberExpression} */ast, subs); case 'UnaryExpression': - return SafeEval.evalUnaryExpression(ast, subs); + return SafeEval.evalUnaryExpression(/** @type {jsep.UnaryExpression} */ast, subs); case 'ArrayExpression': - return SafeEval.evalArrayExpression(ast, subs); + return SafeEval.evalArrayExpression(/** @type {jsep.ArrayExpression} */ast, subs); case 'CallExpression': - return SafeEval.evalCallExpression(ast, subs); + return SafeEval.evalCallExpression(/** @type {jsep.CallExpression} */ast, subs); case 'AssignmentExpression': - return SafeEval.evalAssignmentExpression(ast, subs); + return SafeEval.evalAssignmentExpression(/** @type {AssignmentExpression} */ast, subs); default: - throw SyntaxError('Unexpected expression', ast); + throw new SyntaxError('Unexpected expression', { + cause: ast + }); } }, + /** + * @param {jsep.BinaryExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalBinaryExpression(ast, subs) { - const result = { + /** + * @typedef {{ + * [key: string]: (a: AnyParameter, b: AnyParameter) => UnknownResult + * }} OperatorTable + */ + const result = /** @type {OperatorTable} */{ '||': (a, b) => a || b(), '&&': (a, b) => a && b(), '|': (a, b) => a | b(), @@ -1268,14 +1303,18 @@ const SafeEval = { }[ast.operator](SafeEval.evalAst(ast.left, subs), () => SafeEval.evalAst(ast.right, subs)); return result; }, + /** + * @param {jsep.Compound} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalCompound(ast, subs) { let last; for (let i = 0; i < ast.body.length; i++) { - if (ast.body[i].type === 'Identifier' && ['var', 'let', 'const'].includes(ast.body[i].name) && ast.body[i + 1] && ast.body[i + 1].type === 'AssignmentExpression') { + if (ast.body[i].type === 'Identifier' && ['var', 'let', 'const'].includes(/** @type {jsep.Identifier} */ + ast.body[i].name) && Object.hasOwn(ast.body, i + 1) && ast.body[i + 1].type === 'AssignmentExpression') { // var x=2; is detected as // [{Identifier var}, {AssignmentExpression x=2}] - // eslint-disable-next-line @stylistic/max-len -- Long - // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient i += 1; } const expr = ast.body[i]; @@ -1283,71 +1322,120 @@ const SafeEval = { } return last; }, + /** + * @param {jsep.ConditionalExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalConditionalExpression(ast, subs) { if (SafeEval.evalAst(ast.test, subs)) { return SafeEval.evalAst(ast.consequent, subs); } return SafeEval.evalAst(ast.alternate, subs); }, + /** + * @param {jsep.Identifier} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalIdentifier(ast, subs) { if (Object.hasOwn(subs, ast.name)) { return subs[ast.name]; } - throw ReferenceError(`${ast.name} is not defined`); + throw new ReferenceError(`${ast.name} is not defined`); }, + /** + * @param {jsep.Literal} ast + * @returns {UnknownResult} + */ evalLiteral(ast) { return ast.value; }, + /** + * @param {jsep.MemberExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalMemberExpression(ast, subs) { const prop = String( // NOTE: `String(value)` throws error when // value has overwritten the toString method to return non-string // i.e. `value = {toString: () => []}` - ast.computed ? SafeEval.evalAst(ast.property) // `object[property]` + ast.computed ? SafeEval.evalAst(ast.property, {}) // `object[property]` : ast.property.name // `object.property` property is Identifier ); const obj = SafeEval.evalAst(ast.object, subs); if (obj === undefined || obj === null) { - throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); + throw new TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); } if (!Object.hasOwn(obj, prop) && BLOCKED_PROTO_PROPERTIES.has(prop)) { - throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); + throw new TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); } - const result = obj[prop]; + const result = /** @type {Record} */obj[prop]; if (typeof result === 'function' && result !== Function) { return result.bind(obj); // arrow functions aren't affected by bind. } return result; }, + /** + * @param {jsep.UnaryExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalUnaryExpression(ast, subs) { - const result = { - '-': a => -SafeEval.evalAst(a, subs), + /** + * @typedef {{ + * [key: string]: (a: AnyParameter) => UnknownResult + * }} UnaryOperatorTable + */ + const result = /** @type {UnaryOperatorTable} */{ + '-': a => -(/** @type {EvaluatedResult} */ + SafeEval.evalAst(a, subs)), '!': a => !SafeEval.evalAst(a, subs), - '~': a => ~SafeEval.evalAst(a, subs), + '~': a => ~(/** @type {EvaluatedResult} */ + SafeEval.evalAst(a, subs)), // eslint-disable-next-line no-implicit-coercion -- API - '+': a => +SafeEval.evalAst(a, subs), + '+': a => +(/** @type {EvaluatedResult} */ + SafeEval.evalAst(a, subs)), typeof: a => typeof SafeEval.evalAst(a, subs), - // eslint-disable-next-line no-void, sonarjs/void-use -- feature + // eslint-disable-next-line no-void -- Ok void: a => void SafeEval.evalAst(a, subs) }[ast.operator](ast.argument); return result; }, + /** + * @param {jsep.ArrayExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalArrayExpression(ast, subs) { - return ast.elements.map(el => SafeEval.evalAst(el, subs)); + return ast.elements.map(el => SafeEval.evalAst(/** @type {jsep.Expression} */ + el, subs)); }, + /** + * @param {jsep.CallExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalCallExpression(ast, subs) { const args = ast.arguments.map(arg => SafeEval.evalAst(arg, subs)); const func = SafeEval.evalAst(ast.callee, subs); if (func === Function) { throw new Error('Function constructor is disabled'); } - return func(...args); + return (/** @type {(...args: AnyParameter[]) => UnknownResult} */ + func)(...args); }, + /** + * @param {AssignmentExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalAssignmentExpression(ast, subs) { if (ast.left.type !== 'Identifier') { - throw SyntaxError('Invalid left-hand side in assignment'); + throw new SyntaxError('Invalid left-hand side in assignment'); } - const id = ast.left.name; + const id = /** @type {jsep.Identifier} */ast.left.name; const value = SafeEval.evalAst(ast.right, subs); subs[id] = value; return subs[id]; @@ -1379,25 +1467,57 @@ class SafeScript { } /* eslint-disable camelcase -- Convenient for escaping */ +/* eslint-disable class-methods-use-this -- Consistent monkey-patching */ +/* eslint-disable unicorn/prefer-private-class-fields -- Allow + monkey-patching */ + +/** + * @import {Script} from './jsonpath-browser.js'; + */ + +/** + * @typedef {any} AnyInput + */ + +/** + * @typedef {((...args: any[]) => any)} SandboxCallback + */ +/** + * @typedef {any|SandboxCallback} SandboxPropertyValue + */ /** - * @typedef {null|boolean|number|string|object|GenericArray} JSONObject + * @typedef {(string|number)[]} ExpressionArray */ /** - * @typedef {any} AnyItem + * @typedef {"scalar"|"boolean"|"string"|"undefined"| + * "function"|"integer"|"number"|"nonFinite"|"object"| + * "array"|"other"|"null"} ValueType */ /** - * @typedef {any} AnyResult + * @typedef {unknown} ParentValue + */ + +/** + * @typedef {unknown} UnknownResult + */ + +/** + * @typedef {string|number|null} ParentProperty + */ + +/** + * @typedef {unknown|ParentValue|string|ReturnObject} PreferredOutput */ /** * Copies array and then pushes item into it. - * @param {GenericArray} arr Array to copy and into which to push - * @param {AnyItem} item Array item to add (to end) - * @returns {GenericArray} Copy of the original array + * @param {ExpressionArray} arr Array to copy and into which to push + * @param {string|number} item Array item to add (to end) + * @returns {ExpressionArray} Copy of the original array */ function push(arr, item) { arr = arr.slice(); @@ -1406,9 +1526,9 @@ function push(arr, item) { } /** * Copies array and then unshifts item into it. - * @param {AnyItem} item Array item to add (to beginning) - * @param {GenericArray} arr Array to copy and into which to unshift - * @returns {GenericArray} Copy of the original array + * @param {string|number} item Array item to add (to beginning) + * @param {ExpressionArray} arr Array to copy and into which to unshift + * @returns {ExpressionArray} Copy of the original array */ function unshift(item, arr) { arr = arr.slice(); @@ -1422,11 +1542,11 @@ function unshift(item, arr) { */ class NewError extends Error { /** - * @param {AnyResult} value The evaluated scalar value + * @param {UnknownResult} value The evaluated scalar value + * @param {ErrorOptions} [options] */ - constructor(value) { - super('JSONPath should not be called with "new" (it prevents return ' + 'of (unwrapped) scalar values)'); - this.avoidNew = true; + constructor(value, options) { + super('JSONPath should not be called with "new" (it prevents return ' + 'of (unwrapped) scalar values)', options); this.value = value; this.name = 'NewError'; } @@ -1434,15 +1554,20 @@ class NewError extends Error { /** * @typedef {object} ReturnObject -* @property {string} path -* @property {JSONObject} value -* @property {object|GenericArray} parent -* @property {string} parentProperty +* @property {ExpressionArray|string} path +* @property {unknown} value +* @property {ParentValue} parent +* @property {ParentProperty} parentProperty +* @property {boolean} [isParentSelector] +* @property {boolean} [hasArrExpr] +* @property {ExpressionArray} [expr] +* @property {string} [pointer] */ /** * @callback JSONPathCallback -* @param {string|object} preferredOutput +* @param {any} preferredOutput Using `any` type instead of `PreferredOutput` so +* that user can supply flexible type * @param {"value"|"property"} type * @param {ReturnObject} fullRetObj * @returns {void} @@ -1450,10 +1575,10 @@ class NewError extends Error { /** * @callback OtherTypeCallback -* @param {JSONObject} val -* @param {string} path -* @param {object|GenericArray} parent -* @param {string} parentPropName +* @param {unknown} val +* @param {ExpressionArray} path +* @param {ParentValue} parent +* @param {string|null} parentPropName * @returns {boolean} */ @@ -1476,513 +1601,806 @@ class NewError extends Error { * @typedef {typeof SafeScript} EvalClass */ +/** + * @typedef {"value"|"path"|"pointer"|"parent"|"parentProperty"| + * "all"} ResultType + */ + +/** + * @typedef {EvalCallback|EvalClass|'safe'|'native'|boolean} EvalValue + */ + +/** + * @typedef {string|string[]} PathType + */ + +/** + * @typedef {{Script: typeof SafeScript}} SafeScriptType + */ + +/** + * @typedef {import('node:vm')|{Script: typeof Script}} ScriptType + */ + +/** + * @typedef {{ + * _$_path?: string, + * _$_parentProperty?: ParentProperty, + * _$_parent?: ParentValue, + * _$_property?: string|number, + * _$_root?: AnyInput, + * _$_v?: unknown, + * [key: string]: SandboxPropertyValue + * }} SandboxType + */ + /** * @typedef {object} JSONPathOptions - * @property {JSON} json - * @property {string|string[]} path - * @property {"value"|"path"|"pointer"|"parent"|"parentProperty"| - * "all"} [resultType="value"] + * @property {AnyInput} [json] + * @property {PathType} [path] + * @property {ResultType} [resultType="value"] * @property {boolean} [flatten=false] * @property {boolean} [wrap=true] - * @property {object} [sandbox={}] - * @property {EvalCallback|EvalClass|'safe'|'native'| - * boolean} [eval = 'safe'] - * @property {object|GenericArray|null} [parent=null] + * @property {SandboxType} [sandbox={}] + * @property {EvalValue} [eval='safe'] + * @property {any|null} [parent=null] * @property {string|null} [parentProperty=null] * @property {JSONPathCallback} [callback] * @property {OtherTypeCallback} [otherTypeCallback] Defaults to * function which throws on encountering `@other` * @property {boolean} [autostart=true] + * @property {boolean} [ignoreEvalErrors=false] */ /** - * @param {string|JSONPathOptions} opts If a string, will be treated as `expr` - * @param {string} [expr] JSON path to evaluate - * @param {JSON} [obj] JSON object to evaluate against - * @param {JSONPathCallback} [callback] Passed 3 arguments: 1) desired payload - * per `resultType`, 2) `"value"|"property"`, 3) Full returned object with + * @overload + * @param {string} opts JSON path to evaluate + * @param {AnyInput} [expr] JSON object to evaluate against + * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired + * payload per `resultType`, 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [callback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + * @param {undefined} [otherTypeCallback] + * @returns {unknown|JSONPathClass} + */ +/** + * @overload + * @param {JSONPathOptions} opts If a string, will be treated as + * `expr` + * @returns {unknown|JSONPathClass} + */ +/** + * @param {JSONPathOptions|string} opts If a string, will be treated as `expr` + * @param {string|AnyInput} [expr] JSON path to evaluate + * @param {AnyInput|JSONPathCallback} [obj] JSON object to evaluate against + * @param {JSONPathCallback|OtherTypeCallback} [callback] Passed 3 + * arguments: 1) desired payload per `resultType`, + * 2) `"value"|"property"`, 3) Full returned object with * all payloads * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the end * of one's query, this will be invoked with the value of the item, its * path, its parent, and its parent's property name, and it should return * a boolean indicating whether the supplied value belongs to the "other" * type or not (or it may handle transformations and return `false`). - * @returns {JSONPath} - * @class + * @throws {Error} + * @returns {unknown|JSONPathClass} */ function JSONPath(opts, expr, obj, callback, otherTypeCallback) { - // eslint-disable-next-line no-restricted-syntax -- Allow for pseudo-class - if (!(this instanceof JSONPath)) { - try { - return new JSONPath(opts, expr, obj, callback, otherTypeCallback); - } catch (e) { - if (!e.avoidNew) { - throw e; - } - return e.value; - } - } - if (typeof opts === 'string') { - otherTypeCallback = callback; - callback = obj; - obj = expr; - expr = opts; - opts = null; - } - const optObj = opts && typeof opts === 'object'; - opts = opts || {}; - this.json = opts.json || obj; - this.path = opts.path || expr; - this.resultType = opts.resultType || 'value'; - this.flatten = opts.flatten || false; - this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true; - this.sandbox = opts.sandbox || {}; - this.eval = opts.eval === undefined ? 'safe' : opts.eval; - this.ignoreEvalErrors = typeof opts.ignoreEvalErrors === 'undefined' ? false : opts.ignoreEvalErrors; - this.parent = opts.parent || null; - this.parentProperty = opts.parentProperty || null; - this.callback = opts.callback || callback || null; - this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () { - throw new TypeError('You must supply an otherTypeCallback callback option ' + 'with the @other() operator.'); - }; - if (opts.autostart !== false) { - const args = { - path: optObj ? opts.path : expr - }; - if (!optObj) { - args.json = obj; - } else if ('json' in opts) { - args.json = opts.json; + try { + if (opts && typeof opts === 'object') { + return new JSONPathClass(opts); } - const ret = this.evaluate(args); - if (!ret || typeof ret !== 'object') { - throw new NewError(ret); + return new JSONPathClass(opts, expr, /** @type {JSONPathCallback|undefined} */obj, /** @type {OtherTypeCallback|undefined} */callback, /** @type {undefined} */otherTypeCallback); + } catch (e) { + // eslint-disable-next-line no-restricted-syntax -- Within the file + if (!(e instanceof NewError)) { + throw e; } - return ret; + return e.value; } } -// PUBLIC METHODS -JSONPath.prototype.evaluate = function (expr, json, callback, otherTypeCallback) { - let currParent = this.parent, - currParentProperty = this.parentProperty; - let { - flatten, - wrap - } = this; - this.currResultType = this.resultType; - this.currEval = this.eval; - this.currSandbox = this.sandbox; - callback = callback || this.callback; - this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; - json = json || this.json; - expr = expr || this.path; - if (expr && typeof expr === 'object' && !Array.isArray(expr)) { - if (!expr.path && expr.path !== '') { - throw new TypeError('You must supply a "path" property when providing an object ' + 'argument to JSONPath.evaluate().'); - } - if (!Object.hasOwn(expr, 'json')) { - throw new TypeError('You must supply a "json" property when providing an object ' + 'argument to JSONPath.evaluate().'); - } - ({ - json - } = expr); - flatten = Object.hasOwn(expr, 'flatten') ? expr.flatten : flatten; - this.currResultType = Object.hasOwn(expr, 'resultType') ? expr.resultType : this.currResultType; - this.currSandbox = Object.hasOwn(expr, 'sandbox') ? expr.sandbox : this.currSandbox; - wrap = Object.hasOwn(expr, 'wrap') ? expr.wrap : wrap; - this.currEval = Object.hasOwn(expr, 'eval') ? expr.eval : this.currEval; - callback = Object.hasOwn(expr, 'callback') ? expr.callback : callback; - this.currOtherTypeCallback = Object.hasOwn(expr, 'otherTypeCallback') ? expr.otherTypeCallback : this.currOtherTypeCallback; - currParent = Object.hasOwn(expr, 'parent') ? expr.parent : currParent; - currParentProperty = Object.hasOwn(expr, 'parentProperty') ? expr.parentProperty : currParentProperty; - expr = expr.path; - } - currParent = currParent || null; - currParentProperty = currParentProperty || null; - if (Array.isArray(expr)) { - expr = JSONPath.toPathString(expr); - } - if (!expr && expr !== '' || !json) { - return undefined; - } - const exprList = JSONPath.toPathArray(expr); - if (exprList[0] === '$' && exprList.length > 1) { - exprList.shift(); - } - this._hasParentSelector = null; - const result = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback).filter(function (ea) { - return ea && !ea.isParentSelector; - }); - if (!result.length) { - return wrap ? [] : undefined; - } - if (!wrap && result.length === 1 && !result[0].hasArrExpr) { - return this._getPreferredOutput(result[0]); - } - return result.reduce((rslt, ea) => { - const valOrPath = this._getPreferredOutput(ea); - if (flatten && Array.isArray(valOrPath)) { - rslt = rslt.concat(valOrPath); - } else { - rslt.push(valOrPath); - } - return rslt; - }, []); -}; - -// PRIVATE METHODS - -JSONPath.prototype._getPreferredOutput = function (ea) { - const resultType = this.currResultType; - switch (resultType) { - case 'all': - { - const path = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path); - ea.pointer = JSONPath.toPointer(path); - ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(ea.path); - return ea; - } - case 'value': - case 'parent': - case 'parentProperty': - return ea[resultType]; - case 'path': - return JSONPath.toPathString(ea[resultType]); - case 'pointer': - return JSONPath.toPointer(ea.path); - default: - throw new TypeError('Unknown result type'); - } -}; -JSONPath.prototype._handleCallback = function (fullRetObj, callback, type) { - if (callback) { - const preferredOutput = this._getPreferredOutput(fullRetObj); - fullRetObj.path = typeof fullRetObj.path === 'string' ? fullRetObj.path : JSONPath.toPathString(fullRetObj.path); - // eslint-disable-next-line n/callback-return -- No need to return - callback(preferredOutput, type, fullRetObj); - } -}; - /** * - * @param {string} expr - * @param {JSONObject} val - * @param {string} path - * @param {object|GenericArray} parent - * @param {string} parentPropName - * @param {JSONPathCallback} callback - * @param {boolean} hasArrExpr - * @param {boolean} literalPriority - * @returns {ReturnObject|ReturnObject[]} */ -JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, callback, hasArrExpr, literalPriority) { - // No expr to follow? return path and value as the result of - // this trace branch - let retObj; - if (!expr.length) { - retObj = { - path, - value: val, - parent, - parentProperty: parentPropName, - hasArrExpr +class JSONPathClass { + /** + * @overload + * @param {string} opts JSON path to evaluate + * @param {AnyInput} [expr] JSON object to evaluate against + * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired + * payload per `resultType`, 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [callback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + * @param {undefined} [otherTypeCallback] + * @returns {JSONPath|JSONPathClass} + */ + /** + * @overload + * @param {JSONPathOptions} opts If a string, will be treated as + * `expr` + */ + /** + * @param {null|string|JSONPathOptions} opts If a string, will be treated as + * `expr` + * @param {string|AnyInput} [expr] JSON path to evaluate + * @param {AnyInput|JSONPathCallback} [obj] JSON object to evaluate against + * @param {JSONPathCallback|OtherTypeCallback} [callback] Passed 3 + * arguments: 1) desired payload per `resultType`, + * 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + */ + constructor(opts, expr, obj, callback, otherTypeCallback) { + if (typeof opts === 'string') { + otherTypeCallback = /** @type {OtherTypeCallback} */ + callback; + callback = /** @type {JSONPathCallback} */ + obj; + obj = expr; + expr = opts; + opts = null; + } + const optObj = opts && typeof opts === 'object'; + opts ||= /** @type {JSONPathOptions} */{}; + /** @type {ResultType|undefined} */ + this.currResultType = undefined; + + /** @type {EvalValue|undefined} */ + this.currEval = undefined; + + /** @type {OtherTypeCallback|undefined} */ + this.currOtherTypeCallback = undefined; + + /** @type {SafeScriptType} */ + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members, no-unused-expressions -- On prototype + this.safeVm; + + /** @type {ScriptType} */ + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members, no-unused-expressions -- On prototype + this.vm; + + /** @type {SandboxType|undefined} */ + this.currSandbox = undefined; + this._hasParentSelector = false; + this.json = opts.json || obj; + this.path = opts.path || expr; + this.resultType = opts.resultType || 'value'; + this.flatten = opts.flatten || false; + this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true; + this.sandbox = opts.sandbox || {}; + this.eval = opts.eval === undefined ? 'safe' : opts.eval; + this.ignoreEvalErrors = typeof opts.ignoreEvalErrors === 'undefined' ? false : opts.ignoreEvalErrors; + this.parent = opts.parent || null; + this.parentProperty = opts.parentProperty || null; + this.callback = opts.callback || (/** @type {JSONPathCallback} */ + callback) || null; + this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () { + throw new TypeError('You must supply an otherTypeCallback callback option ' + 'with the @other() operator.'); }; - this._handleCallback(retObj, callback, 'value'); - return retObj; + if (opts.autostart !== false) { + const args = /** @type {JSONPathOptions} */{ + path: optObj ? opts.path : expr + }; + if (!optObj && obj !== undefined) { + args.json = obj; + } else if ('json' in opts) { + args.json = opts.json; + } + const ret = this.evaluate(args); + if (!ret || typeof ret !== 'object') { + throw new NewError(ret); + } + + // eslint-disable-next-line @stylistic/max-len -- Long + // @ts-expect-error - Constructor returns evaluate result for legacy API + // eslint-disable-next-line no-constructor-return -- Legacy API + return ret; + } } - const loc = expr[0], - x = expr.slice(1); - // We need to gather the return value of recursive trace calls in order to - // do the parent sel computation. - const ret = []; + // PUBLIC METHODS + /** - * - * @param {ReturnObject|ReturnObject[]} elems - * @returns {void} + * @overload + * @param {JSONPathOptions} [expr] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} */ - function addRet(elems) { - if (Array.isArray(elems)) { - // This was causing excessive stack size in Node (with or - // without Babel) against our performance test: - // `ret.push(...elems);` - elems.forEach(t => { - ret.push(t); - }); + + /** + * @overload + * @param {PathType|undefined} [expr] + * @param {AnyInput} [json] + * @param {JSONPathCallback|null} [callback] + * @param {OtherTypeCallback} [otherTypeCallback] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + + /** + * @param {PathType|JSONPathOptions|undefined} [expr] + * @param {AnyInput} [json] + * @param {JSONPathCallback|null} [callback] + * @param {OtherTypeCallback} [otherTypeCallback] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + evaluate(expr, json, callback, otherTypeCallback) { + let currParent = this.parent, + currParentProperty = this.parentProperty; + let { + flatten, + wrap + } = this; + this.currResultType = this.resultType; + this.currEval = this.eval; + this.currSandbox = this.sandbox; + callback ||= this.callback; + this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; + if (expr && typeof expr === 'object' && !Array.isArray(expr)) { + const exprObj = expr; + if (!exprObj.path && exprObj.path !== '') { + throw new TypeError('You must supply a "path" property when providing an ' + 'object argument to JSONPath.evaluate().'); + } + if (!Object.hasOwn(exprObj, 'json')) { + throw new TypeError('You must supply a "json" property when providing an ' + 'object argument to JSONPath.evaluate().'); + } + ({ + json + } = exprObj); + flatten = Object.hasOwn(exprObj, 'flatten') ? exprObj.flatten ?? flatten : flatten; + this.currResultType = Object.hasOwn(exprObj, 'resultType') ? exprObj.resultType : this.currResultType; + this.currSandbox = Object.hasOwn(exprObj, 'sandbox') ? exprObj.sandbox : this.currSandbox; + wrap = Object.hasOwn(exprObj, 'wrap') ? exprObj.wrap : wrap; + this.currEval = Object.hasOwn(exprObj, 'eval') ? exprObj.eval : this.currEval; + callback = Object.hasOwn(exprObj, 'callback') ? exprObj.callback : callback; + this.currOtherTypeCallback = Object.hasOwn(exprObj, 'otherTypeCallback') ? exprObj.otherTypeCallback : this.currOtherTypeCallback; + currParent = Object.hasOwn(exprObj, 'parent') ? exprObj.parent ?? currParent : currParent; + currParentProperty = Object.hasOwn(exprObj, 'parentProperty') ? exprObj.parentProperty ?? currParentProperty : currParentProperty; + expr = exprObj.path; } else { - ret.push(elems); + json ||= this.json; + expr ||= this.path; } - } - if ((typeof loc !== 'string' || literalPriority) && val && Object.hasOwn(val, loc)) { - // simple case--directly follow property - addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr)); - // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if` - } else if (loc === '*') { - // all child properties - this._walk(val, m => { - addRet(this._trace(x, val[m], push(path, m), val, m, callback, true, true)); - }); - } else if (loc === '..') { - // all descendent parent properties - // Check remaining expression with val's immediate children - addRet(this._trace(x, val, path, parent, parentPropName, callback, hasArrExpr)); - this._walk(val, m => { - // We don't join m and x here because we only want parents, - // not scalar values - if (typeof val[m] === 'object') { - // Keep going with recursive descent on val's - // object children - addRet(this._trace(expr.slice(), val[m], push(path, m), val, m, callback, true)); - } + currParent ||= null; + currParentProperty ||= null; + if (Array.isArray(expr)) { + expr = JSONPath.toPathString(expr); + } + if (!json || !expr && expr !== '') { + return undefined; + } + const exprList = JSONPath.toPathArray(/** @type {string} */ + expr); + if (exprList[0] === '$' && exprList.length > 1) { + exprList.shift(); + } + this._hasParentSelector = false; + const traceResult = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback ?? undefined, undefined); + + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next 2 -- Unreachable: _trace returns array when hasArrExpr set */ + const result = (Array.isArray(traceResult) ? traceResult : [traceResult]).filter(ea => { + return ea && !ea.isParentSelector; }); - // The parent sel computation is handled in the frame above using the - // ancestor object of val - } else if (loc === '^') { - // This is not a final endpoint, so we do not invoke the callback here - this._hasParentSelector = true; - return { - path: path.slice(0, -1), - expr: x, - isParentSelector: true - }; - } else if (loc === '~') { - // property name - retObj = { - path: push(path, loc), - value: parentPropName, - parent, - parentProperty: null - }; - this._handleCallback(retObj, callback, 'property'); - return retObj; - } else if (loc === '$') { - // root only - addRet(this._trace(x, val, path, null, null, callback, hasArrExpr)); - } else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(loc)) { - // [start:end:step] Python slice syntax - addRet(this._slice(loc, x, val, path, parent, parentPropName, callback)); - } else if (loc.indexOf('?(') === 0) { - // [?(expr)] (filtering) - if (this.currEval === false) { - throw new Error('Eval [?(expr)] prevented in JSONPath expression.'); - } - const safeLoc = loc.replace(/^\?\((.*?)\)$/u, '$1'); - // check for a nested filter expression - const nested = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(safeLoc); - if (nested) { - // find if there are matches in the nested expression - // add them to the result set if there is at least one match - this._walk(val, m => { - const npath = [nested[2]]; - const nvalue = nested[1] ? val[m][nested[1]] : val[m]; - const filterResults = this._trace(npath, nvalue, path, parent, parentPropName, callback, true); - if (filterResults.length > 0) { - addRet(this._trace(x, val[m], push(path, m), val, m, callback, true)); - } - }); - } else { - this._walk(val, m => { - if (this._eval(safeLoc, val[m], m, path, parent, parentPropName)) { - addRet(this._trace(x, val[m], push(path, m), val, m, callback, true)); - } - }); + if (!result.length) { + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: valid queries always produce results */ + return wrap ? [] : undefined; } - } else if (loc[0] === '(') { - // [(expr)] (dynamic property/index) - if (this.currEval === false) { - throw new Error('Eval [(expr)] prevented in JSONPath expression.'); - } - // As this will resolve to a property name (but we don't know it - // yet), property and parent information is relative to the - // parent of the property to which this expression will resolve - addRet(this._trace(unshift(this._eval(loc, val, path.at(-1), path.slice(0, -1), parent, parentPropName), x), val, path, parent, parentPropName, callback, hasArrExpr)); - } else if (loc[0] === '@') { - // value type: @boolean(), etc. - let addType = false; - const valueType = loc.slice(1, -2); - switch (valueType) { - case 'scalar': - if (!val || !['object', 'function'].includes(typeof val)) { - addType = true; - } - break; - case 'boolean': - case 'string': - case 'undefined': - case 'function': - if (typeof val === valueType) { - addType = true; - } - break; - case 'integer': - if (Number.isFinite(val) && !(val % 1)) { - addType = true; - } - break; - case 'number': - if (Number.isFinite(val)) { - addType = true; - } - break; - case 'nonFinite': - if (typeof val === 'number' && !Number.isFinite(val)) { - addType = true; - } - break; - case 'object': - if (val && typeof val === valueType) { - addType = true; + if (!wrap && result.length === 1 && !result[0].hasArrExpr) { + const preferredOutput = this._getPreferredOutput(result[0]); + return preferredOutput; + } + const reduced = result.reduce((rslt, ea) => { + const valOrPath = this._getPreferredOutput(ea); + if (flatten && Array.isArray(valOrPath)) { + rslt = rslt.concat(valOrPath); + } else { + rslt.push(valOrPath); + } + return rslt; + }, /** @type {UnknownResult[]} */ + []); + return reduced; + } + + // PRIVATE METHODS + + /** + * @param {ReturnObject} ea + * @returns {PreferredOutput} + */ + _getPreferredOutput(ea) { + const resultType = this.currResultType; + switch (resultType) { + case 'all': + { + const path = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path); + ea.pointer = JSONPath.toPointer(/** @type {string[]} */path); + ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(/** @type {string[]} */ea.path); + return ea; } - break; - case 'array': - if (Array.isArray(val)) { - addType = true; + case 'value': + case 'parent': + case 'parentProperty': + return ea[resultType]; + case 'path': + if (typeof ea.path === 'string') { + return ea.path; } - break; - case 'other': - addType = this.currOtherTypeCallback(val, path, parent, parentPropName); - break; - case 'null': - if (val === null) { - addType = true; + return JSONPath.toPathString(/** @type {string[]} */ea.path); + case 'pointer': + { + const pathArray = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path); + return JSONPath.toPointer(/** @type {string[]} */pathArray); } - break; - /* c8 ignore next 2 */ default: - throw new TypeError('Unknown value type ' + valueType); + throw new TypeError('Unknown result type'); } - if (addType) { + } + + /** + * @param {ReturnObject} fullRetObj + * @param {JSONPathCallback|undefined} callback + * @param {"value"|"property"} type + * @returns {void} + */ + _handleCallback(fullRetObj, callback, type) { + // Early return if no callback provided (defensive + // check for internal calls) + if (!callback) { + return; + } + const preferredOutput = this._getPreferredOutput(fullRetObj); + if (Array.isArray(fullRetObj.path)) { + fullRetObj.path = JSONPath.toPathString(/** @type {string[]} */fullRetObj.path); + } + callback(preferredOutput, type, fullRetObj); + } + + /** + * + * @param {ExpressionArray} expr + * @param {unknown} val + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @param {JSONPathCallback|undefined} callback + * @param {boolean|undefined} hasArrExpr + * @param {boolean} [literalPriority] + * @returns {ReturnObject|ReturnObject[]} + */ + _trace(expr, val, path, parent, parentPropName, callback, hasArrExpr, literalPriority) { + // No expr to follow? return path and value as the result of + // this trace branch + let retObj; + if (!expr.length) { retObj = { path, value: val, parent, - parentProperty: parentPropName + parentProperty: parentPropName, + hasArrExpr }; this._handleCallback(retObj, callback, 'value'); return retObj; } - // `-escaped property - } else if (loc[0] === '`' && val && Object.hasOwn(val, loc.slice(1))) { - const locProp = loc.slice(1); - addRet(this._trace(x, val[locProp], push(path, locProp), val, locProp, callback, hasArrExpr, true)); - } else if (loc.includes(',')) { - // [name1,name2,...] - const parts = loc.split(','); - for (const part of parts) { - addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback, true)); - } - // simple case--directly follow property - } else if (!literalPriority && val && Object.hasOwn(val, loc)) { - addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr, true)); - } + const loc = /** @type {string} */expr[0], + x = expr.slice(1); + + // We need to gather the return value of recursive trace calls in order + // to do the parent sel computation. + /** @type {ReturnObject[]} */ + const ret = []; + /** + * + * @param {ReturnObject|ReturnObject[]} elems + * @returns {void} + */ + function addRet(elems) { + if (Array.isArray(elems)) { + // This was causing excessive stack size in Node (with or + // without Babel) against our performance test: + // `ret.push(...elems);` + elems.forEach(t => { + ret.push(t); + }); + } else { + ret.push(elems); + } + } + if (val && (typeof loc !== 'string' || literalPriority) && Object.hasOwn(val, /** @type {PropertyKey} */loc)) { + // simple case--directly follow property + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[(/** @type {string} */loc)], push(path, loc), val, /** @type {string|number} */loc, callback, hasArrExpr)); + // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if` + } else if (loc === '*') { + // all child properties + this._walk(val, m => { + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[m], push(path, m), val, m, callback, true, true)); + }); + } else if (loc === '..') { + // all descendent parent properties + // Check remaining expression with val's immediate children + addRet(this._trace(x, val, path, parent, parentPropName, callback, hasArrExpr)); + this._walk(val, m => { + // We don't join m and x here because we only want parents, + // not scalar values + const valObj = /** @type {Record} */val; + if (typeof valObj[m] === 'object') { + // Keep going with recursive descent on val's + // object children + addRet(this._trace(expr.slice(), valObj[m], push(path, m), val, m, callback, true)); + } + }); + // The parent sel computation is handled in the frame above using the + // ancestor object of val + } else if (loc === '^') { + // This is not a final endpoint, so we do not invoke the + // callback here + this._hasParentSelector = true; + return /** @type {ReturnObject} */{ + path: path.slice(0, -1), + expr: x, + isParentSelector: true, + value: undefined, + parent: undefined, + parentProperty: null + }; + } else if (loc === '~') { + // property name + retObj = { + path: push(path, loc), + value: parentPropName, + parent, + parentProperty: null + }; + this._handleCallback(retObj, callback, 'property'); + return retObj; + } else if (loc === '$') { + // root only + addRet(this._trace(x, val, path, null, null, callback, hasArrExpr)); + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient + } else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(loc)) { + // [start:end:step] Python slice syntax + const sliceResult = this._slice(loc, x, val, path, parent, parentPropName, callback); + if (sliceResult) { + addRet(sliceResult); + } + } else if (loc.indexOf('?(') === 0) { + // [?(expr)] (filtering) + if (this.currEval === false) { + throw new Error('Eval [?(expr)] prevented in JSONPath expression.'); + } + const safeLoc = loc.replace(/^\?\((.*?)\)$/u, '$1'); + // check for a nested filter expression + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient + const nested = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(safeLoc); + if (nested) { + // find if there are matches in the nested expression + // add them to the result set if there is at least one match + this._walk(val, m => { + const npath = [nested[2]]; + const valObj2 = /** @type {Record} */ + val; + const nvalue = /** @type {ValueType} */nested[1] ? /** @type {Record} */valObj2[m][nested[1]] : valObj2[m]; + const filterResults = this._trace(npath, nvalue, path, parent, parentPropName, callback, true); + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next 3 -- Unreachable: _trace always returns array for nested filters */ + const filterArray = Array.isArray(filterResults) ? filterResults : [filterResults]; + if (filterArray.length > 0) { + addRet(this._trace(x, valObj2[m], push(path, m), val, m, callback, true)); + } + }); + } else { + const valObj3 = /** @type {Record} */val; + this._walk(val, m => { + if (this._eval(safeLoc, valObj3[m], m, path, parent, parentPropName)) { + addRet(this._trace(x, valObj3[m], push(path, m), val, m, callback, true)); + } + }); + } + } else if (loc[0] === '(') { + // [(expr)] (dynamic property/index) + if (this.currEval === false) { + throw new Error('Eval [(expr)] prevented in JSONPath expression.'); + } + // As this will resolve to a property name (but we don't know it + // yet), property and parent information is relative to the + const evalResult = this._eval(/** @type {string} */loc, val, /** @type {string|number} */path.at(-1), path.slice(0, -1), parent, parentPropName); + const exprToUse = /** @type {string|number} */ + evalResult !== undefined ? evalResult : ''; + addRet(this._trace(unshift(exprToUse, x), val, path, parent, parentPropName, callback, hasArrExpr)); + } else if (loc[0] === '@') { + // value type: @boolean(), etc. + let addType = false; + const valueType = /** @type {ValueType} */loc.slice(1, -2); + switch (valueType) { + case 'scalar': + if (!val || !['object', 'function'].includes(typeof val)) { + addType = true; + } + break; + case 'boolean': + case 'string': + case 'undefined': + case 'function': + if (typeof val === valueType) { + addType = true; + } + break; + case 'integer': + if (Number.isFinite(val) && !(/** @type {number} */val % 1)) { + addType = true; + } + break; + case 'number': + if (Number.isFinite(val)) { + addType = true; + } + break; + case 'nonFinite': + if (typeof val === 'number' && !Number.isFinite(val)) { + addType = true; + } + break; + case 'object': + if (val && typeof val === valueType) { + addType = true; + } + break; + case 'array': + if (Array.isArray(val)) { + addType = true; + } + break; + case 'other': + addType = this.currOtherTypeCallback?.(val, path, parent, /** @type {string|null} */parentPropName) ?? false; + break; + case 'null': + if (val === null) { + addType = true; + } + break; + /* c8 ignore next 2 */ + default: + throw new TypeError('Unknown value type ' + valueType); + } + if (addType) { + retObj = { + path, + value: val, + parent, + parentProperty: parentPropName, + hasArrExpr + }; + this._handleCallback(retObj, callback, 'value'); + return retObj; + } + // `-escaped property + } else if (val && loc[0] === '`' && Object.hasOwn(val, loc.slice(1))) { + const locProp = loc.slice(1); + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[locProp], push(path, locProp), val, locProp, callback, hasArrExpr, true)); + } else if (loc.includes(',')) { + // [name1,name2,...] + const parts = loc.split(','); + for (const part of parts) { + addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback, true)); + } + // simple case--directly follow property + } else if (!literalPriority && val && Object.hasOwn(val, loc)) { + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[loc], push(path, loc), val, loc, callback, hasArrExpr, true)); + } - // We check the resulting values for parent selections. For parent - // selections we discard the value object and continue the trace with the - // current val object - if (this._hasParentSelector) { - for (let t = 0; t < ret.length; t++) { - const rett = ret[t]; - if (rett && rett.isParentSelector) { - const tmp = this._trace(rett.expr, val, rett.path, parent, parentPropName, callback, hasArrExpr); - if (Array.isArray(tmp)) { - ret[t] = tmp[0]; - const tl = tmp.length; - for (let tt = 1; tt < tl; tt++) { - // eslint-disable-next-line @stylistic/max-len -- Long - // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient - t++; - ret.splice(t, 0, tmp[tt]); + // We check the resulting values for parent selections. For parent + // selections we discard the value object and continue the trace with + // the current val object + if (this._hasParentSelector) { + for (let t = 0; t < ret.length; t++) { + const rett = ret[t]; + if (rett && rett.isParentSelector) { + const exprToUse = /** @type {ExpressionArray} */ + rett.expr; + const pathToUse = /** @type {ExpressionArray} */ + rett.path; + const tmp = this._trace(exprToUse, val, pathToUse, parent, parentPropName, callback, hasArrExpr); + if (Array.isArray(tmp)) { + ret[t] = tmp[0]; + const tl = tmp.length; + for (let tt = 1; tt < tl; tt++) { + t++; + ret.splice(t, 0, tmp[tt]); + } + } else { + ret[t] = tmp; } - } else { - ret[t] = tmp; } } } + return ret; } - return ret; -}; -JSONPath.prototype._walk = function (val, f) { - if (Array.isArray(val)) { - const n = val.length; - for (let i = 0; i < n; i++) { - f(i); - } - } else if (val && typeof val === 'object') { - Object.keys(val).forEach(m => { - f(m); - }); - } -}; -JSONPath.prototype._slice = function (loc, expr, val, path, parent, parentPropName, callback) { - if (!Array.isArray(val)) { - return undefined; - } - const len = val.length, - parts = loc.split(':'), - step = parts[2] && Number.parseInt(parts[2]) || 1; - let start = parts[0] && Number.parseInt(parts[0]) || 0, - end = parts[1] ? Number.parseInt(parts[1]) : len; - start = start < 0 ? Math.max(0, start + len) : Math.min(len, start); - end = end < 0 ? Math.max(0, end + len) : Math.min(len, end); - const ret = []; - for (let i = start; i < end; i += step) { - const tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback, true); - // Should only be possible to be an array here since first part of - // ``unshift(i, expr)` passed in above would not be empty, nor `~`, - // nor begin with `@` (as could return objects) - // This was causing excessive stack size in Node (with or - // without Babel) against our performance test: `ret.push(...tmp);` - tmp.forEach(t => { - ret.push(t); - }); + + /** + * @param {unknown} val + * @param {(prop: string|number) => void} f + * @returns {void} + */ + _walk(val, f) { + if (Array.isArray(val)) { + const n = val.length; + for (let i = 0; i < n; i++) { + f(i); + } + } else if (val && typeof val === 'object') { + Object.keys(val).forEach(m => { + f(m); + }); + } } - return ret; -}; -JSONPath.prototype._eval = function (code, _v, _vname, path, parent, parentPropName) { - this.currSandbox._$_parentProperty = parentPropName; - this.currSandbox._$_parent = parent; - this.currSandbox._$_property = _vname; - this.currSandbox._$_root = this.json; - this.currSandbox._$_v = _v; - const containsPath = code.includes('@path'); - if (containsPath) { - this.currSandbox._$_path = JSONPath.toPathString(path.concat([_vname])); + + /** + * @param {string} loc + * @param {ExpressionArray} expr + * @param {unknown} val + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @param {JSONPathCallback|undefined} callback + * @returns {ReturnObject[]|undefined} + */ + _slice(loc, expr, val, path, parent, parentPropName, callback) { + if (!Array.isArray(val)) { + return undefined; + } + const len = val.length, + parts = loc.split(':'), + step = parts[2] && Number(parts[2]) || 1; + let start = parts[0] && Number(parts[0]) || 0, + end = parts[1] ? Number(parts[1]) : len; + start = start < 0 ? Math.max(0, start + len) : Math.min(len, start); + end = end < 0 ? Math.max(0, end + len) : Math.min(len, end); + /** @type {ReturnObject[]} */ + const ret = []; + for (let i = start; i < end; i += step) { + const tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback, true); + // Should only be possible to be an array here since first part of + // ``unshift(i, expr)` passed in above would not be empty, + // nor `~`, nor begin with `@` (as could return objects) + // This was causing excessive stack size in Node (with or + // without Babel) against our performance test: `ret.push(...tmp);` + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: _trace returns array when expr non-empty */ + const tmpArray = Array.isArray(tmp) ? tmp : [tmp]; + tmpArray.forEach(t => { + ret.push(t); + }); + } + return ret; } - const scriptCacheKey = this.currEval + 'Script:' + code; - if (!JSONPath.cache[scriptCacheKey]) { - let script = code.replaceAll('@parentProperty', '_$_parentProperty').replaceAll('@parent', '_$_parent').replaceAll('@property', '_$_property').replaceAll('@root', '_$_root').replaceAll(/@([.\s)[])/gu, '_$_v$1'); + + /** + * @param {string} code + * @param {unknown} _v + * @param {string|number} _vname + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @returns {UnknownResult} + */ + _eval(code, _v, _vname, path, parent, parentPropName) { + if (this.currSandbox) { + this.currSandbox._$_parentProperty = parentPropName; + this.currSandbox._$_parent = parent; + this.currSandbox._$_property = _vname; + this.currSandbox._$_root = this.json; + this.currSandbox._$_v = _v; + } + const containsPath = code.includes('@path'); if (containsPath) { - script = script.replaceAll('@path', '_$_path'); - } - if (this.currEval === 'safe' || this.currEval === true || this.currEval === undefined) { - JSONPath.cache[scriptCacheKey] = new this.safeVm.Script(script); - } else if (this.currEval === 'native') { - JSONPath.cache[scriptCacheKey] = new this.vm.Script(script); - } else if (typeof this.currEval === 'function' && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, 'runInNewContext')) { - const CurrEval = this.currEval; - JSONPath.cache[scriptCacheKey] = new CurrEval(script); - } else if (typeof this.currEval === 'function') { - JSONPath.cache[scriptCacheKey] = { - runInNewContext: context => this.currEval(script, context) - }; - } else { - throw new TypeError(`Unknown "eval" property "${this.currEval}"`); + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: currSandbox set in evaluate() before _eval */ + const currSandbox = this.currSandbox ?? {}; + currSandbox._$_path = JSONPath.toPathString(/** @type {string[]} */path.concat([_vname])); } - } - try { - return JSONPath.cache[scriptCacheKey].runInNewContext(this.currSandbox); - } catch (e) { - if (this.ignoreEvalErrors) { - return false; + const scriptCacheKey = this.currEval + 'Script:' + code; + if (!Object.hasOwn(JSONPath.cache, scriptCacheKey)) { + let script = code.replaceAll('@parentProperty', '_$_parentProperty').replaceAll('@parent', '_$_parent').replaceAll('@property', '_$_property').replaceAll('@root', '_$_root').replaceAll(/@([.\s)[])/gu, '_$_v$1'); + if (containsPath) { + script = script.replaceAll('@path', '_$_path'); + } + const evalType = /** @type {string|boolean|undefined} */ + this.currEval; + if (['safe', true, undefined].includes(evalType)) { + const { + cache + } = JSONPath; + cache[scriptCacheKey] = new + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members -- Prototype + this.safeVm.Script(script); + } else if (this.currEval === 'native') { + const { + cache + } = JSONPath; + cache[scriptCacheKey] = new + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members -- Prototype + this.vm.Script(script); + } else if (typeof this.currEval === 'function' && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, 'runInNewContext')) { + const CurrEval = this.currEval; + const { + cache + } = JSONPath; + // eslint-disable-next-line @stylistic/max-len -- Long + // @ts-expect-error - Type checked above to have proper constructor + cache[scriptCacheKey] = new CurrEval(script); + } else if (typeof this.currEval === 'function') { + const { + cache + } = JSONPath; + // Type narrowing: at this point currEval is a function + // but not a constructor + const evalFunc = /** @type {EvalCallback} */this.currEval; + cache[scriptCacheKey] = { + runInNewContext: (/** @type {ContextItem} */context) => evalFunc(script, context) + }; + } else { + throw new TypeError(`Unknown "eval" property "${this.currEval}"`); + } + } + try { + const { + cache + } = JSONPath; + + /** + * @typedef {{ + * runInNewContext: ( + * ctx: SandboxType|undefined + * ) => EvaluatedResult + * }} RunInNewContext + */ + + return /** @type {RunInNewContext} */cache[scriptCacheKey].runInNewContext(this.currSandbox); + } catch (e) { + if (this.ignoreEvalErrors) { + return false; + } + const error = /** @type {Error} */e; + throw new Error('jsonPath: ' + error.message + ': ' + code, { + cause: e + }); } - throw new Error('jsonPath: ' + e.message + ': ' + code); } +} +JSONPathClass.prototype.safeVm = { + Script: SafeScript }; // PUBLIC CLASS PROPERTIES AND METHODS // Could store the cache object itself + +/** @type {Record} */ JSONPath.cache = {}; /** @@ -2002,7 +2420,7 @@ JSONPath.toPathString = function (pathArr) { }; /** - * @param {string} pointer JSON Path + * @param {string[]} pointer JSON Path array * @returns {string} JSON Pointer */ JSONPath.toPointer = function (pointer) { @@ -2025,9 +2443,10 @@ JSONPath.toPathArray = function (expr) { const { cache } = JSONPath; - if (cache[expr]) { - return cache[expr].concat(); + if (Object.hasOwn(cache, expr)) { + return /** @type {string[]} */cache[expr].concat(); } + /** @type {string[]} */ const subx = []; const normalized = expr // Properties @@ -2035,7 +2454,10 @@ JSONPath.toPathArray = function (expr) { // Parenthetical evaluations (filtering and otherwise), directly // within brackets or single quotes .replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function ($0, $1) { - return '[#' + (subx.push($1) - 1) + ']'; + return '[#' + ( + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-return-array-push -- Optimization + subx.push($1) - 1) + ']'; }) // Escape periods and tildes within properties .replaceAll(/\[['"]([^'\]]*)['"]\]/gu, function ($0, prop) { @@ -2044,6 +2466,7 @@ JSONPath.toPathArray = function (expr) { // Properties operator .replaceAll('~', ';~;') // Split by property boundaries + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient .replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu, ';') // Reinsert periods within properties .replaceAll('%@%', '.') @@ -2059,15 +2482,83 @@ JSONPath.toPathArray = function (expr) { .replaceAll(/;$|'?\]|'$/gu, ''); const exprList = normalized.split(';').map(function (exp) { const match = exp.match(/#(\d+)/u); - return !match || !match[1] ? exp : subx[match[1]]; + return !match || !match[1] ? exp : subx[Number(match[1])]; }); cache[expr] = exprList; - return cache[expr].concat(); -}; -JSONPath.prototype.safeVm = { - Script: SafeScript + return /** @type {string[]} */cache[expr].concat(); }; -JSONPath.prototype.vm = vm; +/** + * @typedef {import('./jsonpath.js').AnyInput} AnyInput + */ +/** + * @typedef {import('./jsonpath.js').SandboxCallback} SandboxCallback + */ +/** + * @typedef {import('./jsonpath.js').SandboxPropertyValue} SandboxPropertyValue + */ +/** + * @typedef {import('./jsonpath.js').ExpressionArray} ExpressionArray + */ +/** + * @typedef {import('./jsonpath.js').ValueType} ValueType + */ +/** + * @typedef {import('./jsonpath.js').ParentValue} ParentValue + */ +/** + * @typedef {import('./jsonpath.js').UnknownResult} UnknownResult + */ +/** + * @typedef {import('./jsonpath.js').ParentProperty} ParentProperty + */ +/** + * @typedef {import('./jsonpath.js').PreferredOutput} PreferredOutput + */ +/** + * @typedef {import('./jsonpath.js').ReturnObject} ReturnObject + */ +/** + * @typedef {import('./jsonpath.js').JSONPathCallback} JSONPathCallback + */ +/** + * @typedef {import('./jsonpath.js').OtherTypeCallback} OtherTypeCallback + */ +/** + * @typedef {import('./jsonpath.js').ContextItem} ContextItem + */ +/** + * @typedef {import('./jsonpath.js').EvaluatedResult} EvaluatedResult + */ +/** + * @typedef {import('./jsonpath.js').EvalCallback} EvalCallback + */ +/** + * @typedef {import('./jsonpath.js').EvalClass} EvalClass + */ +/** + * @typedef {import('./jsonpath.js').ResultType} ResultType + */ +/** + * @typedef {import('./jsonpath.js').EvalValue} EvalValue + */ +/** + * @typedef {import('./jsonpath.js').PathType} PathType + */ +/** + * @typedef {import('./jsonpath.js').SafeScriptType} SafeScriptType + */ +/** + * @typedef {import('./jsonpath.js').ScriptType} ScriptType + */ +/** + * @typedef {import('./jsonpath.js').SandboxType} SandboxType + */ +/** + * @typedef {import('./jsonpath.js').JSONPathOptions} JSONPathOptions + */ + +JSONPathClass.prototype.vm = vm; exports.JSONPath = JSONPath; +exports.JSONPathClass = JSONPathClass; diff --git a/dist/index-node-esm.js b/dist/index-node-esm.js index 29bbf5e8..83a33043 100644 --- a/dist/index-node-esm.js +++ b/dist/index-node-esm.js @@ -1197,8 +1197,30 @@ const plugin = { } }; +/* eslint-disable unicorn/no-top-level-side-effects -- Temporary? */ /* eslint-disable no-bitwise -- Convenient */ +/** + * @import {EvaluatedResult, UnknownResult} from './jsonpath.js'; + */ + +/** + * @typedef {import('@jsep-plugin/assignment'). + * AssignmentExpression} AssignmentExpression + */ + +/** + * @typedef {any} Substitution + */ + +/** + * @typedef {any} AnyParameter + */ + +/** + * @typedef {Record} Substitutions + */ + // register plugins jsep.plugins.register(index, plugin); jsep.addUnaryOp('typeof'); @@ -1209,37 +1231,50 @@ const BLOCKED_PROTO_PROPERTIES = new Set(['constructor', '__proto__', '__defineG const SafeEval = { /** * @param {jsep.Expression} ast - * @param {Record} subs + * @param {Substitutions} subs + * @returns {UnknownResult} */ evalAst(ast, subs) { switch (ast.type) { case 'BinaryExpression': case 'LogicalExpression': - return SafeEval.evalBinaryExpression(ast, subs); + return SafeEval.evalBinaryExpression(/** @type {jsep.BinaryExpression} */ast, subs); case 'Compound': - return SafeEval.evalCompound(ast, subs); + return SafeEval.evalCompound(/** @type {jsep.Compound} */ast, subs); case 'ConditionalExpression': - return SafeEval.evalConditionalExpression(ast, subs); + return SafeEval.evalConditionalExpression(/** @type {jsep.ConditionalExpression} */ast, subs); case 'Identifier': - return SafeEval.evalIdentifier(ast, subs); + return SafeEval.evalIdentifier(/** @type {jsep.Identifier} */ast, subs); case 'Literal': - return SafeEval.evalLiteral(ast, subs); + return SafeEval.evalLiteral(/** @type {jsep.Literal} */ast); case 'MemberExpression': - return SafeEval.evalMemberExpression(ast, subs); + return SafeEval.evalMemberExpression(/** @type {jsep.MemberExpression} */ast, subs); case 'UnaryExpression': - return SafeEval.evalUnaryExpression(ast, subs); + return SafeEval.evalUnaryExpression(/** @type {jsep.UnaryExpression} */ast, subs); case 'ArrayExpression': - return SafeEval.evalArrayExpression(ast, subs); + return SafeEval.evalArrayExpression(/** @type {jsep.ArrayExpression} */ast, subs); case 'CallExpression': - return SafeEval.evalCallExpression(ast, subs); + return SafeEval.evalCallExpression(/** @type {jsep.CallExpression} */ast, subs); case 'AssignmentExpression': - return SafeEval.evalAssignmentExpression(ast, subs); + return SafeEval.evalAssignmentExpression(/** @type {AssignmentExpression} */ast, subs); default: - throw SyntaxError('Unexpected expression', ast); + throw new SyntaxError('Unexpected expression', { + cause: ast + }); } }, + /** + * @param {jsep.BinaryExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalBinaryExpression(ast, subs) { - const result = { + /** + * @typedef {{ + * [key: string]: (a: AnyParameter, b: AnyParameter) => UnknownResult + * }} OperatorTable + */ + const result = /** @type {OperatorTable} */{ '||': (a, b) => a || b(), '&&': (a, b) => a && b(), '|': (a, b) => a | b(), @@ -1266,14 +1301,18 @@ const SafeEval = { }[ast.operator](SafeEval.evalAst(ast.left, subs), () => SafeEval.evalAst(ast.right, subs)); return result; }, + /** + * @param {jsep.Compound} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalCompound(ast, subs) { let last; for (let i = 0; i < ast.body.length; i++) { - if (ast.body[i].type === 'Identifier' && ['var', 'let', 'const'].includes(ast.body[i].name) && ast.body[i + 1] && ast.body[i + 1].type === 'AssignmentExpression') { + if (ast.body[i].type === 'Identifier' && ['var', 'let', 'const'].includes(/** @type {jsep.Identifier} */ + ast.body[i].name) && Object.hasOwn(ast.body, i + 1) && ast.body[i + 1].type === 'AssignmentExpression') { // var x=2; is detected as // [{Identifier var}, {AssignmentExpression x=2}] - // eslint-disable-next-line @stylistic/max-len -- Long - // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient i += 1; } const expr = ast.body[i]; @@ -1281,71 +1320,120 @@ const SafeEval = { } return last; }, + /** + * @param {jsep.ConditionalExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalConditionalExpression(ast, subs) { if (SafeEval.evalAst(ast.test, subs)) { return SafeEval.evalAst(ast.consequent, subs); } return SafeEval.evalAst(ast.alternate, subs); }, + /** + * @param {jsep.Identifier} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalIdentifier(ast, subs) { if (Object.hasOwn(subs, ast.name)) { return subs[ast.name]; } - throw ReferenceError(`${ast.name} is not defined`); + throw new ReferenceError(`${ast.name} is not defined`); }, + /** + * @param {jsep.Literal} ast + * @returns {UnknownResult} + */ evalLiteral(ast) { return ast.value; }, + /** + * @param {jsep.MemberExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalMemberExpression(ast, subs) { const prop = String( // NOTE: `String(value)` throws error when // value has overwritten the toString method to return non-string // i.e. `value = {toString: () => []}` - ast.computed ? SafeEval.evalAst(ast.property) // `object[property]` + ast.computed ? SafeEval.evalAst(ast.property, {}) // `object[property]` : ast.property.name // `object.property` property is Identifier ); const obj = SafeEval.evalAst(ast.object, subs); if (obj === undefined || obj === null) { - throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); + throw new TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); } if (!Object.hasOwn(obj, prop) && BLOCKED_PROTO_PROPERTIES.has(prop)) { - throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); + throw new TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); } - const result = obj[prop]; + const result = /** @type {Record} */obj[prop]; if (typeof result === 'function' && result !== Function) { return result.bind(obj); // arrow functions aren't affected by bind. } return result; }, + /** + * @param {jsep.UnaryExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalUnaryExpression(ast, subs) { - const result = { - '-': a => -SafeEval.evalAst(a, subs), + /** + * @typedef {{ + * [key: string]: (a: AnyParameter) => UnknownResult + * }} UnaryOperatorTable + */ + const result = /** @type {UnaryOperatorTable} */{ + '-': a => -(/** @type {EvaluatedResult} */ + SafeEval.evalAst(a, subs)), '!': a => !SafeEval.evalAst(a, subs), - '~': a => ~SafeEval.evalAst(a, subs), + '~': a => ~(/** @type {EvaluatedResult} */ + SafeEval.evalAst(a, subs)), // eslint-disable-next-line no-implicit-coercion -- API - '+': a => +SafeEval.evalAst(a, subs), + '+': a => +(/** @type {EvaluatedResult} */ + SafeEval.evalAst(a, subs)), typeof: a => typeof SafeEval.evalAst(a, subs), - // eslint-disable-next-line no-void, sonarjs/void-use -- feature + // eslint-disable-next-line no-void -- Ok void: a => void SafeEval.evalAst(a, subs) }[ast.operator](ast.argument); return result; }, + /** + * @param {jsep.ArrayExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalArrayExpression(ast, subs) { - return ast.elements.map(el => SafeEval.evalAst(el, subs)); + return ast.elements.map(el => SafeEval.evalAst(/** @type {jsep.Expression} */ + el, subs)); }, + /** + * @param {jsep.CallExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalCallExpression(ast, subs) { const args = ast.arguments.map(arg => SafeEval.evalAst(arg, subs)); const func = SafeEval.evalAst(ast.callee, subs); if (func === Function) { throw new Error('Function constructor is disabled'); } - return func(...args); + return (/** @type {(...args: AnyParameter[]) => UnknownResult} */ + func)(...args); }, + /** + * @param {AssignmentExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalAssignmentExpression(ast, subs) { if (ast.left.type !== 'Identifier') { - throw SyntaxError('Invalid left-hand side in assignment'); + throw new SyntaxError('Invalid left-hand side in assignment'); } - const id = ast.left.name; + const id = /** @type {jsep.Identifier} */ast.left.name; const value = SafeEval.evalAst(ast.right, subs); subs[id] = value; return subs[id]; @@ -1377,25 +1465,57 @@ class SafeScript { } /* eslint-disable camelcase -- Convenient for escaping */ +/* eslint-disable class-methods-use-this -- Consistent monkey-patching */ +/* eslint-disable unicorn/prefer-private-class-fields -- Allow + monkey-patching */ + +/** + * @import {Script} from './jsonpath-browser.js'; + */ + +/** + * @typedef {any} AnyInput + */ + +/** + * @typedef {((...args: any[]) => any)} SandboxCallback + */ +/** + * @typedef {any|SandboxCallback} SandboxPropertyValue + */ /** - * @typedef {null|boolean|number|string|object|GenericArray} JSONObject + * @typedef {(string|number)[]} ExpressionArray */ /** - * @typedef {any} AnyItem + * @typedef {"scalar"|"boolean"|"string"|"undefined"| + * "function"|"integer"|"number"|"nonFinite"|"object"| + * "array"|"other"|"null"} ValueType */ /** - * @typedef {any} AnyResult + * @typedef {unknown} ParentValue + */ + +/** + * @typedef {unknown} UnknownResult + */ + +/** + * @typedef {string|number|null} ParentProperty + */ + +/** + * @typedef {unknown|ParentValue|string|ReturnObject} PreferredOutput */ /** * Copies array and then pushes item into it. - * @param {GenericArray} arr Array to copy and into which to push - * @param {AnyItem} item Array item to add (to end) - * @returns {GenericArray} Copy of the original array + * @param {ExpressionArray} arr Array to copy and into which to push + * @param {string|number} item Array item to add (to end) + * @returns {ExpressionArray} Copy of the original array */ function push(arr, item) { arr = arr.slice(); @@ -1404,9 +1524,9 @@ function push(arr, item) { } /** * Copies array and then unshifts item into it. - * @param {AnyItem} item Array item to add (to beginning) - * @param {GenericArray} arr Array to copy and into which to unshift - * @returns {GenericArray} Copy of the original array + * @param {string|number} item Array item to add (to beginning) + * @param {ExpressionArray} arr Array to copy and into which to unshift + * @returns {ExpressionArray} Copy of the original array */ function unshift(item, arr) { arr = arr.slice(); @@ -1420,11 +1540,11 @@ function unshift(item, arr) { */ class NewError extends Error { /** - * @param {AnyResult} value The evaluated scalar value + * @param {UnknownResult} value The evaluated scalar value + * @param {ErrorOptions} [options] */ - constructor(value) { - super('JSONPath should not be called with "new" (it prevents return ' + 'of (unwrapped) scalar values)'); - this.avoidNew = true; + constructor(value, options) { + super('JSONPath should not be called with "new" (it prevents return ' + 'of (unwrapped) scalar values)', options); this.value = value; this.name = 'NewError'; } @@ -1432,15 +1552,20 @@ class NewError extends Error { /** * @typedef {object} ReturnObject -* @property {string} path -* @property {JSONObject} value -* @property {object|GenericArray} parent -* @property {string} parentProperty +* @property {ExpressionArray|string} path +* @property {unknown} value +* @property {ParentValue} parent +* @property {ParentProperty} parentProperty +* @property {boolean} [isParentSelector] +* @property {boolean} [hasArrExpr] +* @property {ExpressionArray} [expr] +* @property {string} [pointer] */ /** * @callback JSONPathCallback -* @param {string|object} preferredOutput +* @param {any} preferredOutput Using `any` type instead of `PreferredOutput` so +* that user can supply flexible type * @param {"value"|"property"} type * @param {ReturnObject} fullRetObj * @returns {void} @@ -1448,10 +1573,10 @@ class NewError extends Error { /** * @callback OtherTypeCallback -* @param {JSONObject} val -* @param {string} path -* @param {object|GenericArray} parent -* @param {string} parentPropName +* @param {unknown} val +* @param {ExpressionArray} path +* @param {ParentValue} parent +* @param {string|null} parentPropName * @returns {boolean} */ @@ -1474,513 +1599,806 @@ class NewError extends Error { * @typedef {typeof SafeScript} EvalClass */ +/** + * @typedef {"value"|"path"|"pointer"|"parent"|"parentProperty"| + * "all"} ResultType + */ + +/** + * @typedef {EvalCallback|EvalClass|'safe'|'native'|boolean} EvalValue + */ + +/** + * @typedef {string|string[]} PathType + */ + +/** + * @typedef {{Script: typeof SafeScript}} SafeScriptType + */ + +/** + * @typedef {import('node:vm')|{Script: typeof Script}} ScriptType + */ + +/** + * @typedef {{ + * _$_path?: string, + * _$_parentProperty?: ParentProperty, + * _$_parent?: ParentValue, + * _$_property?: string|number, + * _$_root?: AnyInput, + * _$_v?: unknown, + * [key: string]: SandboxPropertyValue + * }} SandboxType + */ + /** * @typedef {object} JSONPathOptions - * @property {JSON} json - * @property {string|string[]} path - * @property {"value"|"path"|"pointer"|"parent"|"parentProperty"| - * "all"} [resultType="value"] + * @property {AnyInput} [json] + * @property {PathType} [path] + * @property {ResultType} [resultType="value"] * @property {boolean} [flatten=false] * @property {boolean} [wrap=true] - * @property {object} [sandbox={}] - * @property {EvalCallback|EvalClass|'safe'|'native'| - * boolean} [eval = 'safe'] - * @property {object|GenericArray|null} [parent=null] + * @property {SandboxType} [sandbox={}] + * @property {EvalValue} [eval='safe'] + * @property {any|null} [parent=null] * @property {string|null} [parentProperty=null] * @property {JSONPathCallback} [callback] * @property {OtherTypeCallback} [otherTypeCallback] Defaults to * function which throws on encountering `@other` * @property {boolean} [autostart=true] + * @property {boolean} [ignoreEvalErrors=false] */ /** - * @param {string|JSONPathOptions} opts If a string, will be treated as `expr` - * @param {string} [expr] JSON path to evaluate - * @param {JSON} [obj] JSON object to evaluate against - * @param {JSONPathCallback} [callback] Passed 3 arguments: 1) desired payload - * per `resultType`, 2) `"value"|"property"`, 3) Full returned object with + * @overload + * @param {string} opts JSON path to evaluate + * @param {AnyInput} [expr] JSON object to evaluate against + * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired + * payload per `resultType`, 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [callback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + * @param {undefined} [otherTypeCallback] + * @returns {unknown|JSONPathClass} + */ +/** + * @overload + * @param {JSONPathOptions} opts If a string, will be treated as + * `expr` + * @returns {unknown|JSONPathClass} + */ +/** + * @param {JSONPathOptions|string} opts If a string, will be treated as `expr` + * @param {string|AnyInput} [expr] JSON path to evaluate + * @param {AnyInput|JSONPathCallback} [obj] JSON object to evaluate against + * @param {JSONPathCallback|OtherTypeCallback} [callback] Passed 3 + * arguments: 1) desired payload per `resultType`, + * 2) `"value"|"property"`, 3) Full returned object with * all payloads * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the end * of one's query, this will be invoked with the value of the item, its * path, its parent, and its parent's property name, and it should return * a boolean indicating whether the supplied value belongs to the "other" * type or not (or it may handle transformations and return `false`). - * @returns {JSONPath} - * @class + * @throws {Error} + * @returns {unknown|JSONPathClass} */ function JSONPath(opts, expr, obj, callback, otherTypeCallback) { - // eslint-disable-next-line no-restricted-syntax -- Allow for pseudo-class - if (!(this instanceof JSONPath)) { - try { - return new JSONPath(opts, expr, obj, callback, otherTypeCallback); - } catch (e) { - if (!e.avoidNew) { - throw e; - } - return e.value; - } - } - if (typeof opts === 'string') { - otherTypeCallback = callback; - callback = obj; - obj = expr; - expr = opts; - opts = null; - } - const optObj = opts && typeof opts === 'object'; - opts = opts || {}; - this.json = opts.json || obj; - this.path = opts.path || expr; - this.resultType = opts.resultType || 'value'; - this.flatten = opts.flatten || false; - this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true; - this.sandbox = opts.sandbox || {}; - this.eval = opts.eval === undefined ? 'safe' : opts.eval; - this.ignoreEvalErrors = typeof opts.ignoreEvalErrors === 'undefined' ? false : opts.ignoreEvalErrors; - this.parent = opts.parent || null; - this.parentProperty = opts.parentProperty || null; - this.callback = opts.callback || callback || null; - this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () { - throw new TypeError('You must supply an otherTypeCallback callback option ' + 'with the @other() operator.'); - }; - if (opts.autostart !== false) { - const args = { - path: optObj ? opts.path : expr - }; - if (!optObj) { - args.json = obj; - } else if ('json' in opts) { - args.json = opts.json; + try { + if (opts && typeof opts === 'object') { + return new JSONPathClass(opts); } - const ret = this.evaluate(args); - if (!ret || typeof ret !== 'object') { - throw new NewError(ret); + return new JSONPathClass(opts, expr, /** @type {JSONPathCallback|undefined} */obj, /** @type {OtherTypeCallback|undefined} */callback, /** @type {undefined} */otherTypeCallback); + } catch (e) { + // eslint-disable-next-line no-restricted-syntax -- Within the file + if (!(e instanceof NewError)) { + throw e; } - return ret; + return e.value; } } -// PUBLIC METHODS -JSONPath.prototype.evaluate = function (expr, json, callback, otherTypeCallback) { - let currParent = this.parent, - currParentProperty = this.parentProperty; - let { - flatten, - wrap - } = this; - this.currResultType = this.resultType; - this.currEval = this.eval; - this.currSandbox = this.sandbox; - callback = callback || this.callback; - this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; - json = json || this.json; - expr = expr || this.path; - if (expr && typeof expr === 'object' && !Array.isArray(expr)) { - if (!expr.path && expr.path !== '') { - throw new TypeError('You must supply a "path" property when providing an object ' + 'argument to JSONPath.evaluate().'); - } - if (!Object.hasOwn(expr, 'json')) { - throw new TypeError('You must supply a "json" property when providing an object ' + 'argument to JSONPath.evaluate().'); - } - ({ - json - } = expr); - flatten = Object.hasOwn(expr, 'flatten') ? expr.flatten : flatten; - this.currResultType = Object.hasOwn(expr, 'resultType') ? expr.resultType : this.currResultType; - this.currSandbox = Object.hasOwn(expr, 'sandbox') ? expr.sandbox : this.currSandbox; - wrap = Object.hasOwn(expr, 'wrap') ? expr.wrap : wrap; - this.currEval = Object.hasOwn(expr, 'eval') ? expr.eval : this.currEval; - callback = Object.hasOwn(expr, 'callback') ? expr.callback : callback; - this.currOtherTypeCallback = Object.hasOwn(expr, 'otherTypeCallback') ? expr.otherTypeCallback : this.currOtherTypeCallback; - currParent = Object.hasOwn(expr, 'parent') ? expr.parent : currParent; - currParentProperty = Object.hasOwn(expr, 'parentProperty') ? expr.parentProperty : currParentProperty; - expr = expr.path; - } - currParent = currParent || null; - currParentProperty = currParentProperty || null; - if (Array.isArray(expr)) { - expr = JSONPath.toPathString(expr); - } - if (!expr && expr !== '' || !json) { - return undefined; - } - const exprList = JSONPath.toPathArray(expr); - if (exprList[0] === '$' && exprList.length > 1) { - exprList.shift(); - } - this._hasParentSelector = null; - const result = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback).filter(function (ea) { - return ea && !ea.isParentSelector; - }); - if (!result.length) { - return wrap ? [] : undefined; - } - if (!wrap && result.length === 1 && !result[0].hasArrExpr) { - return this._getPreferredOutput(result[0]); - } - return result.reduce((rslt, ea) => { - const valOrPath = this._getPreferredOutput(ea); - if (flatten && Array.isArray(valOrPath)) { - rslt = rslt.concat(valOrPath); - } else { - rslt.push(valOrPath); - } - return rslt; - }, []); -}; - -// PRIVATE METHODS - -JSONPath.prototype._getPreferredOutput = function (ea) { - const resultType = this.currResultType; - switch (resultType) { - case 'all': - { - const path = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path); - ea.pointer = JSONPath.toPointer(path); - ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(ea.path); - return ea; - } - case 'value': - case 'parent': - case 'parentProperty': - return ea[resultType]; - case 'path': - return JSONPath.toPathString(ea[resultType]); - case 'pointer': - return JSONPath.toPointer(ea.path); - default: - throw new TypeError('Unknown result type'); - } -}; -JSONPath.prototype._handleCallback = function (fullRetObj, callback, type) { - if (callback) { - const preferredOutput = this._getPreferredOutput(fullRetObj); - fullRetObj.path = typeof fullRetObj.path === 'string' ? fullRetObj.path : JSONPath.toPathString(fullRetObj.path); - // eslint-disable-next-line n/callback-return -- No need to return - callback(preferredOutput, type, fullRetObj); - } -}; - /** * - * @param {string} expr - * @param {JSONObject} val - * @param {string} path - * @param {object|GenericArray} parent - * @param {string} parentPropName - * @param {JSONPathCallback} callback - * @param {boolean} hasArrExpr - * @param {boolean} literalPriority - * @returns {ReturnObject|ReturnObject[]} */ -JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, callback, hasArrExpr, literalPriority) { - // No expr to follow? return path and value as the result of - // this trace branch - let retObj; - if (!expr.length) { - retObj = { - path, - value: val, - parent, - parentProperty: parentPropName, - hasArrExpr +class JSONPathClass { + /** + * @overload + * @param {string} opts JSON path to evaluate + * @param {AnyInput} [expr] JSON object to evaluate against + * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired + * payload per `resultType`, 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [callback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + * @param {undefined} [otherTypeCallback] + * @returns {JSONPath|JSONPathClass} + */ + /** + * @overload + * @param {JSONPathOptions} opts If a string, will be treated as + * `expr` + */ + /** + * @param {null|string|JSONPathOptions} opts If a string, will be treated as + * `expr` + * @param {string|AnyInput} [expr] JSON path to evaluate + * @param {AnyInput|JSONPathCallback} [obj] JSON object to evaluate against + * @param {JSONPathCallback|OtherTypeCallback} [callback] Passed 3 + * arguments: 1) desired payload per `resultType`, + * 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + */ + constructor(opts, expr, obj, callback, otherTypeCallback) { + if (typeof opts === 'string') { + otherTypeCallback = /** @type {OtherTypeCallback} */ + callback; + callback = /** @type {JSONPathCallback} */ + obj; + obj = expr; + expr = opts; + opts = null; + } + const optObj = opts && typeof opts === 'object'; + opts ||= /** @type {JSONPathOptions} */{}; + /** @type {ResultType|undefined} */ + this.currResultType = undefined; + + /** @type {EvalValue|undefined} */ + this.currEval = undefined; + + /** @type {OtherTypeCallback|undefined} */ + this.currOtherTypeCallback = undefined; + + /** @type {SafeScriptType} */ + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members, no-unused-expressions -- On prototype + this.safeVm; + + /** @type {ScriptType} */ + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members, no-unused-expressions -- On prototype + this.vm; + + /** @type {SandboxType|undefined} */ + this.currSandbox = undefined; + this._hasParentSelector = false; + this.json = opts.json || obj; + this.path = opts.path || expr; + this.resultType = opts.resultType || 'value'; + this.flatten = opts.flatten || false; + this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true; + this.sandbox = opts.sandbox || {}; + this.eval = opts.eval === undefined ? 'safe' : opts.eval; + this.ignoreEvalErrors = typeof opts.ignoreEvalErrors === 'undefined' ? false : opts.ignoreEvalErrors; + this.parent = opts.parent || null; + this.parentProperty = opts.parentProperty || null; + this.callback = opts.callback || (/** @type {JSONPathCallback} */ + callback) || null; + this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () { + throw new TypeError('You must supply an otherTypeCallback callback option ' + 'with the @other() operator.'); }; - this._handleCallback(retObj, callback, 'value'); - return retObj; + if (opts.autostart !== false) { + const args = /** @type {JSONPathOptions} */{ + path: optObj ? opts.path : expr + }; + if (!optObj && obj !== undefined) { + args.json = obj; + } else if ('json' in opts) { + args.json = opts.json; + } + const ret = this.evaluate(args); + if (!ret || typeof ret !== 'object') { + throw new NewError(ret); + } + + // eslint-disable-next-line @stylistic/max-len -- Long + // @ts-expect-error - Constructor returns evaluate result for legacy API + // eslint-disable-next-line no-constructor-return -- Legacy API + return ret; + } } - const loc = expr[0], - x = expr.slice(1); - // We need to gather the return value of recursive trace calls in order to - // do the parent sel computation. - const ret = []; + // PUBLIC METHODS + /** - * - * @param {ReturnObject|ReturnObject[]} elems - * @returns {void} + * @overload + * @param {JSONPathOptions} [expr] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} */ - function addRet(elems) { - if (Array.isArray(elems)) { - // This was causing excessive stack size in Node (with or - // without Babel) against our performance test: - // `ret.push(...elems);` - elems.forEach(t => { - ret.push(t); - }); + + /** + * @overload + * @param {PathType|undefined} [expr] + * @param {AnyInput} [json] + * @param {JSONPathCallback|null} [callback] + * @param {OtherTypeCallback} [otherTypeCallback] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + + /** + * @param {PathType|JSONPathOptions|undefined} [expr] + * @param {AnyInput} [json] + * @param {JSONPathCallback|null} [callback] + * @param {OtherTypeCallback} [otherTypeCallback] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + evaluate(expr, json, callback, otherTypeCallback) { + let currParent = this.parent, + currParentProperty = this.parentProperty; + let { + flatten, + wrap + } = this; + this.currResultType = this.resultType; + this.currEval = this.eval; + this.currSandbox = this.sandbox; + callback ||= this.callback; + this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; + if (expr && typeof expr === 'object' && !Array.isArray(expr)) { + const exprObj = expr; + if (!exprObj.path && exprObj.path !== '') { + throw new TypeError('You must supply a "path" property when providing an ' + 'object argument to JSONPath.evaluate().'); + } + if (!Object.hasOwn(exprObj, 'json')) { + throw new TypeError('You must supply a "json" property when providing an ' + 'object argument to JSONPath.evaluate().'); + } + ({ + json + } = exprObj); + flatten = Object.hasOwn(exprObj, 'flatten') ? exprObj.flatten ?? flatten : flatten; + this.currResultType = Object.hasOwn(exprObj, 'resultType') ? exprObj.resultType : this.currResultType; + this.currSandbox = Object.hasOwn(exprObj, 'sandbox') ? exprObj.sandbox : this.currSandbox; + wrap = Object.hasOwn(exprObj, 'wrap') ? exprObj.wrap : wrap; + this.currEval = Object.hasOwn(exprObj, 'eval') ? exprObj.eval : this.currEval; + callback = Object.hasOwn(exprObj, 'callback') ? exprObj.callback : callback; + this.currOtherTypeCallback = Object.hasOwn(exprObj, 'otherTypeCallback') ? exprObj.otherTypeCallback : this.currOtherTypeCallback; + currParent = Object.hasOwn(exprObj, 'parent') ? exprObj.parent ?? currParent : currParent; + currParentProperty = Object.hasOwn(exprObj, 'parentProperty') ? exprObj.parentProperty ?? currParentProperty : currParentProperty; + expr = exprObj.path; } else { - ret.push(elems); + json ||= this.json; + expr ||= this.path; } - } - if ((typeof loc !== 'string' || literalPriority) && val && Object.hasOwn(val, loc)) { - // simple case--directly follow property - addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr)); - // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if` - } else if (loc === '*') { - // all child properties - this._walk(val, m => { - addRet(this._trace(x, val[m], push(path, m), val, m, callback, true, true)); - }); - } else if (loc === '..') { - // all descendent parent properties - // Check remaining expression with val's immediate children - addRet(this._trace(x, val, path, parent, parentPropName, callback, hasArrExpr)); - this._walk(val, m => { - // We don't join m and x here because we only want parents, - // not scalar values - if (typeof val[m] === 'object') { - // Keep going with recursive descent on val's - // object children - addRet(this._trace(expr.slice(), val[m], push(path, m), val, m, callback, true)); - } + currParent ||= null; + currParentProperty ||= null; + if (Array.isArray(expr)) { + expr = JSONPath.toPathString(expr); + } + if (!json || !expr && expr !== '') { + return undefined; + } + const exprList = JSONPath.toPathArray(/** @type {string} */ + expr); + if (exprList[0] === '$' && exprList.length > 1) { + exprList.shift(); + } + this._hasParentSelector = false; + const traceResult = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback ?? undefined, undefined); + + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next 2 -- Unreachable: _trace returns array when hasArrExpr set */ + const result = (Array.isArray(traceResult) ? traceResult : [traceResult]).filter(ea => { + return ea && !ea.isParentSelector; }); - // The parent sel computation is handled in the frame above using the - // ancestor object of val - } else if (loc === '^') { - // This is not a final endpoint, so we do not invoke the callback here - this._hasParentSelector = true; - return { - path: path.slice(0, -1), - expr: x, - isParentSelector: true - }; - } else if (loc === '~') { - // property name - retObj = { - path: push(path, loc), - value: parentPropName, - parent, - parentProperty: null - }; - this._handleCallback(retObj, callback, 'property'); - return retObj; - } else if (loc === '$') { - // root only - addRet(this._trace(x, val, path, null, null, callback, hasArrExpr)); - } else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(loc)) { - // [start:end:step] Python slice syntax - addRet(this._slice(loc, x, val, path, parent, parentPropName, callback)); - } else if (loc.indexOf('?(') === 0) { - // [?(expr)] (filtering) - if (this.currEval === false) { - throw new Error('Eval [?(expr)] prevented in JSONPath expression.'); - } - const safeLoc = loc.replace(/^\?\((.*?)\)$/u, '$1'); - // check for a nested filter expression - const nested = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(safeLoc); - if (nested) { - // find if there are matches in the nested expression - // add them to the result set if there is at least one match - this._walk(val, m => { - const npath = [nested[2]]; - const nvalue = nested[1] ? val[m][nested[1]] : val[m]; - const filterResults = this._trace(npath, nvalue, path, parent, parentPropName, callback, true); - if (filterResults.length > 0) { - addRet(this._trace(x, val[m], push(path, m), val, m, callback, true)); - } - }); - } else { - this._walk(val, m => { - if (this._eval(safeLoc, val[m], m, path, parent, parentPropName)) { - addRet(this._trace(x, val[m], push(path, m), val, m, callback, true)); - } - }); + if (!result.length) { + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: valid queries always produce results */ + return wrap ? [] : undefined; } - } else if (loc[0] === '(') { - // [(expr)] (dynamic property/index) - if (this.currEval === false) { - throw new Error('Eval [(expr)] prevented in JSONPath expression.'); - } - // As this will resolve to a property name (but we don't know it - // yet), property and parent information is relative to the - // parent of the property to which this expression will resolve - addRet(this._trace(unshift(this._eval(loc, val, path.at(-1), path.slice(0, -1), parent, parentPropName), x), val, path, parent, parentPropName, callback, hasArrExpr)); - } else if (loc[0] === '@') { - // value type: @boolean(), etc. - let addType = false; - const valueType = loc.slice(1, -2); - switch (valueType) { - case 'scalar': - if (!val || !['object', 'function'].includes(typeof val)) { - addType = true; - } - break; - case 'boolean': - case 'string': - case 'undefined': - case 'function': - if (typeof val === valueType) { - addType = true; - } - break; - case 'integer': - if (Number.isFinite(val) && !(val % 1)) { - addType = true; - } - break; - case 'number': - if (Number.isFinite(val)) { - addType = true; - } - break; - case 'nonFinite': - if (typeof val === 'number' && !Number.isFinite(val)) { - addType = true; - } - break; - case 'object': - if (val && typeof val === valueType) { - addType = true; + if (!wrap && result.length === 1 && !result[0].hasArrExpr) { + const preferredOutput = this._getPreferredOutput(result[0]); + return preferredOutput; + } + const reduced = result.reduce((rslt, ea) => { + const valOrPath = this._getPreferredOutput(ea); + if (flatten && Array.isArray(valOrPath)) { + rslt = rslt.concat(valOrPath); + } else { + rslt.push(valOrPath); + } + return rslt; + }, /** @type {UnknownResult[]} */ + []); + return reduced; + } + + // PRIVATE METHODS + + /** + * @param {ReturnObject} ea + * @returns {PreferredOutput} + */ + _getPreferredOutput(ea) { + const resultType = this.currResultType; + switch (resultType) { + case 'all': + { + const path = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path); + ea.pointer = JSONPath.toPointer(/** @type {string[]} */path); + ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(/** @type {string[]} */ea.path); + return ea; } - break; - case 'array': - if (Array.isArray(val)) { - addType = true; + case 'value': + case 'parent': + case 'parentProperty': + return ea[resultType]; + case 'path': + if (typeof ea.path === 'string') { + return ea.path; } - break; - case 'other': - addType = this.currOtherTypeCallback(val, path, parent, parentPropName); - break; - case 'null': - if (val === null) { - addType = true; + return JSONPath.toPathString(/** @type {string[]} */ea.path); + case 'pointer': + { + const pathArray = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path); + return JSONPath.toPointer(/** @type {string[]} */pathArray); } - break; - /* c8 ignore next 2 */ default: - throw new TypeError('Unknown value type ' + valueType); + throw new TypeError('Unknown result type'); } - if (addType) { + } + + /** + * @param {ReturnObject} fullRetObj + * @param {JSONPathCallback|undefined} callback + * @param {"value"|"property"} type + * @returns {void} + */ + _handleCallback(fullRetObj, callback, type) { + // Early return if no callback provided (defensive + // check for internal calls) + if (!callback) { + return; + } + const preferredOutput = this._getPreferredOutput(fullRetObj); + if (Array.isArray(fullRetObj.path)) { + fullRetObj.path = JSONPath.toPathString(/** @type {string[]} */fullRetObj.path); + } + callback(preferredOutput, type, fullRetObj); + } + + /** + * + * @param {ExpressionArray} expr + * @param {unknown} val + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @param {JSONPathCallback|undefined} callback + * @param {boolean|undefined} hasArrExpr + * @param {boolean} [literalPriority] + * @returns {ReturnObject|ReturnObject[]} + */ + _trace(expr, val, path, parent, parentPropName, callback, hasArrExpr, literalPriority) { + // No expr to follow? return path and value as the result of + // this trace branch + let retObj; + if (!expr.length) { retObj = { path, value: val, parent, - parentProperty: parentPropName + parentProperty: parentPropName, + hasArrExpr }; this._handleCallback(retObj, callback, 'value'); return retObj; } - // `-escaped property - } else if (loc[0] === '`' && val && Object.hasOwn(val, loc.slice(1))) { - const locProp = loc.slice(1); - addRet(this._trace(x, val[locProp], push(path, locProp), val, locProp, callback, hasArrExpr, true)); - } else if (loc.includes(',')) { - // [name1,name2,...] - const parts = loc.split(','); - for (const part of parts) { - addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback, true)); - } - // simple case--directly follow property - } else if (!literalPriority && val && Object.hasOwn(val, loc)) { - addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr, true)); - } + const loc = /** @type {string} */expr[0], + x = expr.slice(1); + + // We need to gather the return value of recursive trace calls in order + // to do the parent sel computation. + /** @type {ReturnObject[]} */ + const ret = []; + /** + * + * @param {ReturnObject|ReturnObject[]} elems + * @returns {void} + */ + function addRet(elems) { + if (Array.isArray(elems)) { + // This was causing excessive stack size in Node (with or + // without Babel) against our performance test: + // `ret.push(...elems);` + elems.forEach(t => { + ret.push(t); + }); + } else { + ret.push(elems); + } + } + if (val && (typeof loc !== 'string' || literalPriority) && Object.hasOwn(val, /** @type {PropertyKey} */loc)) { + // simple case--directly follow property + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[(/** @type {string} */loc)], push(path, loc), val, /** @type {string|number} */loc, callback, hasArrExpr)); + // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if` + } else if (loc === '*') { + // all child properties + this._walk(val, m => { + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[m], push(path, m), val, m, callback, true, true)); + }); + } else if (loc === '..') { + // all descendent parent properties + // Check remaining expression with val's immediate children + addRet(this._trace(x, val, path, parent, parentPropName, callback, hasArrExpr)); + this._walk(val, m => { + // We don't join m and x here because we only want parents, + // not scalar values + const valObj = /** @type {Record} */val; + if (typeof valObj[m] === 'object') { + // Keep going with recursive descent on val's + // object children + addRet(this._trace(expr.slice(), valObj[m], push(path, m), val, m, callback, true)); + } + }); + // The parent sel computation is handled in the frame above using the + // ancestor object of val + } else if (loc === '^') { + // This is not a final endpoint, so we do not invoke the + // callback here + this._hasParentSelector = true; + return /** @type {ReturnObject} */{ + path: path.slice(0, -1), + expr: x, + isParentSelector: true, + value: undefined, + parent: undefined, + parentProperty: null + }; + } else if (loc === '~') { + // property name + retObj = { + path: push(path, loc), + value: parentPropName, + parent, + parentProperty: null + }; + this._handleCallback(retObj, callback, 'property'); + return retObj; + } else if (loc === '$') { + // root only + addRet(this._trace(x, val, path, null, null, callback, hasArrExpr)); + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient + } else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(loc)) { + // [start:end:step] Python slice syntax + const sliceResult = this._slice(loc, x, val, path, parent, parentPropName, callback); + if (sliceResult) { + addRet(sliceResult); + } + } else if (loc.indexOf('?(') === 0) { + // [?(expr)] (filtering) + if (this.currEval === false) { + throw new Error('Eval [?(expr)] prevented in JSONPath expression.'); + } + const safeLoc = loc.replace(/^\?\((.*?)\)$/u, '$1'); + // check for a nested filter expression + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient + const nested = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(safeLoc); + if (nested) { + // find if there are matches in the nested expression + // add them to the result set if there is at least one match + this._walk(val, m => { + const npath = [nested[2]]; + const valObj2 = /** @type {Record} */ + val; + const nvalue = /** @type {ValueType} */nested[1] ? /** @type {Record} */valObj2[m][nested[1]] : valObj2[m]; + const filterResults = this._trace(npath, nvalue, path, parent, parentPropName, callback, true); + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next 3 -- Unreachable: _trace always returns array for nested filters */ + const filterArray = Array.isArray(filterResults) ? filterResults : [filterResults]; + if (filterArray.length > 0) { + addRet(this._trace(x, valObj2[m], push(path, m), val, m, callback, true)); + } + }); + } else { + const valObj3 = /** @type {Record} */val; + this._walk(val, m => { + if (this._eval(safeLoc, valObj3[m], m, path, parent, parentPropName)) { + addRet(this._trace(x, valObj3[m], push(path, m), val, m, callback, true)); + } + }); + } + } else if (loc[0] === '(') { + // [(expr)] (dynamic property/index) + if (this.currEval === false) { + throw new Error('Eval [(expr)] prevented in JSONPath expression.'); + } + // As this will resolve to a property name (but we don't know it + // yet), property and parent information is relative to the + const evalResult = this._eval(/** @type {string} */loc, val, /** @type {string|number} */path.at(-1), path.slice(0, -1), parent, parentPropName); + const exprToUse = /** @type {string|number} */ + evalResult !== undefined ? evalResult : ''; + addRet(this._trace(unshift(exprToUse, x), val, path, parent, parentPropName, callback, hasArrExpr)); + } else if (loc[0] === '@') { + // value type: @boolean(), etc. + let addType = false; + const valueType = /** @type {ValueType} */loc.slice(1, -2); + switch (valueType) { + case 'scalar': + if (!val || !['object', 'function'].includes(typeof val)) { + addType = true; + } + break; + case 'boolean': + case 'string': + case 'undefined': + case 'function': + if (typeof val === valueType) { + addType = true; + } + break; + case 'integer': + if (Number.isFinite(val) && !(/** @type {number} */val % 1)) { + addType = true; + } + break; + case 'number': + if (Number.isFinite(val)) { + addType = true; + } + break; + case 'nonFinite': + if (typeof val === 'number' && !Number.isFinite(val)) { + addType = true; + } + break; + case 'object': + if (val && typeof val === valueType) { + addType = true; + } + break; + case 'array': + if (Array.isArray(val)) { + addType = true; + } + break; + case 'other': + addType = this.currOtherTypeCallback?.(val, path, parent, /** @type {string|null} */parentPropName) ?? false; + break; + case 'null': + if (val === null) { + addType = true; + } + break; + /* c8 ignore next 2 */ + default: + throw new TypeError('Unknown value type ' + valueType); + } + if (addType) { + retObj = { + path, + value: val, + parent, + parentProperty: parentPropName, + hasArrExpr + }; + this._handleCallback(retObj, callback, 'value'); + return retObj; + } + // `-escaped property + } else if (val && loc[0] === '`' && Object.hasOwn(val, loc.slice(1))) { + const locProp = loc.slice(1); + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[locProp], push(path, locProp), val, locProp, callback, hasArrExpr, true)); + } else if (loc.includes(',')) { + // [name1,name2,...] + const parts = loc.split(','); + for (const part of parts) { + addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback, true)); + } + // simple case--directly follow property + } else if (!literalPriority && val && Object.hasOwn(val, loc)) { + const valObj = /** @type {Record} */val; + addRet(this._trace(x, valObj[loc], push(path, loc), val, loc, callback, hasArrExpr, true)); + } - // We check the resulting values for parent selections. For parent - // selections we discard the value object and continue the trace with the - // current val object - if (this._hasParentSelector) { - for (let t = 0; t < ret.length; t++) { - const rett = ret[t]; - if (rett && rett.isParentSelector) { - const tmp = this._trace(rett.expr, val, rett.path, parent, parentPropName, callback, hasArrExpr); - if (Array.isArray(tmp)) { - ret[t] = tmp[0]; - const tl = tmp.length; - for (let tt = 1; tt < tl; tt++) { - // eslint-disable-next-line @stylistic/max-len -- Long - // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient - t++; - ret.splice(t, 0, tmp[tt]); + // We check the resulting values for parent selections. For parent + // selections we discard the value object and continue the trace with + // the current val object + if (this._hasParentSelector) { + for (let t = 0; t < ret.length; t++) { + const rett = ret[t]; + if (rett && rett.isParentSelector) { + const exprToUse = /** @type {ExpressionArray} */ + rett.expr; + const pathToUse = /** @type {ExpressionArray} */ + rett.path; + const tmp = this._trace(exprToUse, val, pathToUse, parent, parentPropName, callback, hasArrExpr); + if (Array.isArray(tmp)) { + ret[t] = tmp[0]; + const tl = tmp.length; + for (let tt = 1; tt < tl; tt++) { + t++; + ret.splice(t, 0, tmp[tt]); + } + } else { + ret[t] = tmp; } - } else { - ret[t] = tmp; } } } + return ret; } - return ret; -}; -JSONPath.prototype._walk = function (val, f) { - if (Array.isArray(val)) { - const n = val.length; - for (let i = 0; i < n; i++) { - f(i); - } - } else if (val && typeof val === 'object') { - Object.keys(val).forEach(m => { - f(m); - }); - } -}; -JSONPath.prototype._slice = function (loc, expr, val, path, parent, parentPropName, callback) { - if (!Array.isArray(val)) { - return undefined; - } - const len = val.length, - parts = loc.split(':'), - step = parts[2] && Number.parseInt(parts[2]) || 1; - let start = parts[0] && Number.parseInt(parts[0]) || 0, - end = parts[1] ? Number.parseInt(parts[1]) : len; - start = start < 0 ? Math.max(0, start + len) : Math.min(len, start); - end = end < 0 ? Math.max(0, end + len) : Math.min(len, end); - const ret = []; - for (let i = start; i < end; i += step) { - const tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback, true); - // Should only be possible to be an array here since first part of - // ``unshift(i, expr)` passed in above would not be empty, nor `~`, - // nor begin with `@` (as could return objects) - // This was causing excessive stack size in Node (with or - // without Babel) against our performance test: `ret.push(...tmp);` - tmp.forEach(t => { - ret.push(t); - }); + + /** + * @param {unknown} val + * @param {(prop: string|number) => void} f + * @returns {void} + */ + _walk(val, f) { + if (Array.isArray(val)) { + const n = val.length; + for (let i = 0; i < n; i++) { + f(i); + } + } else if (val && typeof val === 'object') { + Object.keys(val).forEach(m => { + f(m); + }); + } } - return ret; -}; -JSONPath.prototype._eval = function (code, _v, _vname, path, parent, parentPropName) { - this.currSandbox._$_parentProperty = parentPropName; - this.currSandbox._$_parent = parent; - this.currSandbox._$_property = _vname; - this.currSandbox._$_root = this.json; - this.currSandbox._$_v = _v; - const containsPath = code.includes('@path'); - if (containsPath) { - this.currSandbox._$_path = JSONPath.toPathString(path.concat([_vname])); + + /** + * @param {string} loc + * @param {ExpressionArray} expr + * @param {unknown} val + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @param {JSONPathCallback|undefined} callback + * @returns {ReturnObject[]|undefined} + */ + _slice(loc, expr, val, path, parent, parentPropName, callback) { + if (!Array.isArray(val)) { + return undefined; + } + const len = val.length, + parts = loc.split(':'), + step = parts[2] && Number(parts[2]) || 1; + let start = parts[0] && Number(parts[0]) || 0, + end = parts[1] ? Number(parts[1]) : len; + start = start < 0 ? Math.max(0, start + len) : Math.min(len, start); + end = end < 0 ? Math.max(0, end + len) : Math.min(len, end); + /** @type {ReturnObject[]} */ + const ret = []; + for (let i = start; i < end; i += step) { + const tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback, true); + // Should only be possible to be an array here since first part of + // ``unshift(i, expr)` passed in above would not be empty, + // nor `~`, nor begin with `@` (as could return objects) + // This was causing excessive stack size in Node (with or + // without Babel) against our performance test: `ret.push(...tmp);` + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: _trace returns array when expr non-empty */ + const tmpArray = Array.isArray(tmp) ? tmp : [tmp]; + tmpArray.forEach(t => { + ret.push(t); + }); + } + return ret; } - const scriptCacheKey = this.currEval + 'Script:' + code; - if (!JSONPath.cache[scriptCacheKey]) { - let script = code.replaceAll('@parentProperty', '_$_parentProperty').replaceAll('@parent', '_$_parent').replaceAll('@property', '_$_property').replaceAll('@root', '_$_root').replaceAll(/@([.\s)[])/gu, '_$_v$1'); + + /** + * @param {string} code + * @param {unknown} _v + * @param {string|number} _vname + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @returns {UnknownResult} + */ + _eval(code, _v, _vname, path, parent, parentPropName) { + if (this.currSandbox) { + this.currSandbox._$_parentProperty = parentPropName; + this.currSandbox._$_parent = parent; + this.currSandbox._$_property = _vname; + this.currSandbox._$_root = this.json; + this.currSandbox._$_v = _v; + } + const containsPath = code.includes('@path'); if (containsPath) { - script = script.replaceAll('@path', '_$_path'); - } - if (this.currEval === 'safe' || this.currEval === true || this.currEval === undefined) { - JSONPath.cache[scriptCacheKey] = new this.safeVm.Script(script); - } else if (this.currEval === 'native') { - JSONPath.cache[scriptCacheKey] = new this.vm.Script(script); - } else if (typeof this.currEval === 'function' && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, 'runInNewContext')) { - const CurrEval = this.currEval; - JSONPath.cache[scriptCacheKey] = new CurrEval(script); - } else if (typeof this.currEval === 'function') { - JSONPath.cache[scriptCacheKey] = { - runInNewContext: context => this.currEval(script, context) - }; - } else { - throw new TypeError(`Unknown "eval" property "${this.currEval}"`); + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: currSandbox set in evaluate() before _eval */ + const currSandbox = this.currSandbox ?? {}; + currSandbox._$_path = JSONPath.toPathString(/** @type {string[]} */path.concat([_vname])); } - } - try { - return JSONPath.cache[scriptCacheKey].runInNewContext(this.currSandbox); - } catch (e) { - if (this.ignoreEvalErrors) { - return false; + const scriptCacheKey = this.currEval + 'Script:' + code; + if (!Object.hasOwn(JSONPath.cache, scriptCacheKey)) { + let script = code.replaceAll('@parentProperty', '_$_parentProperty').replaceAll('@parent', '_$_parent').replaceAll('@property', '_$_property').replaceAll('@root', '_$_root').replaceAll(/@([.\s)[])/gu, '_$_v$1'); + if (containsPath) { + script = script.replaceAll('@path', '_$_path'); + } + const evalType = /** @type {string|boolean|undefined} */ + this.currEval; + if (['safe', true, undefined].includes(evalType)) { + const { + cache + } = JSONPath; + cache[scriptCacheKey] = new + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members -- Prototype + this.safeVm.Script(script); + } else if (this.currEval === 'native') { + const { + cache + } = JSONPath; + cache[scriptCacheKey] = new + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members -- Prototype + this.vm.Script(script); + } else if (typeof this.currEval === 'function' && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, 'runInNewContext')) { + const CurrEval = this.currEval; + const { + cache + } = JSONPath; + // eslint-disable-next-line @stylistic/max-len -- Long + // @ts-expect-error - Type checked above to have proper constructor + cache[scriptCacheKey] = new CurrEval(script); + } else if (typeof this.currEval === 'function') { + const { + cache + } = JSONPath; + // Type narrowing: at this point currEval is a function + // but not a constructor + const evalFunc = /** @type {EvalCallback} */this.currEval; + cache[scriptCacheKey] = { + runInNewContext: (/** @type {ContextItem} */context) => evalFunc(script, context) + }; + } else { + throw new TypeError(`Unknown "eval" property "${this.currEval}"`); + } + } + try { + const { + cache + } = JSONPath; + + /** + * @typedef {{ + * runInNewContext: ( + * ctx: SandboxType|undefined + * ) => EvaluatedResult + * }} RunInNewContext + */ + + return /** @type {RunInNewContext} */cache[scriptCacheKey].runInNewContext(this.currSandbox); + } catch (e) { + if (this.ignoreEvalErrors) { + return false; + } + const error = /** @type {Error} */e; + throw new Error('jsonPath: ' + error.message + ': ' + code, { + cause: e + }); } - throw new Error('jsonPath: ' + e.message + ': ' + code); } +} +JSONPathClass.prototype.safeVm = { + Script: SafeScript }; // PUBLIC CLASS PROPERTIES AND METHODS // Could store the cache object itself + +/** @type {Record} */ JSONPath.cache = {}; /** @@ -2000,7 +2418,7 @@ JSONPath.toPathString = function (pathArr) { }; /** - * @param {string} pointer JSON Path + * @param {string[]} pointer JSON Path array * @returns {string} JSON Pointer */ JSONPath.toPointer = function (pointer) { @@ -2023,9 +2441,10 @@ JSONPath.toPathArray = function (expr) { const { cache } = JSONPath; - if (cache[expr]) { - return cache[expr].concat(); + if (Object.hasOwn(cache, expr)) { + return /** @type {string[]} */cache[expr].concat(); } + /** @type {string[]} */ const subx = []; const normalized = expr // Properties @@ -2033,7 +2452,10 @@ JSONPath.toPathArray = function (expr) { // Parenthetical evaluations (filtering and otherwise), directly // within brackets or single quotes .replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function ($0, $1) { - return '[#' + (subx.push($1) - 1) + ']'; + return '[#' + ( + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-return-array-push -- Optimization + subx.push($1) - 1) + ']'; }) // Escape periods and tildes within properties .replaceAll(/\[['"]([^'\]]*)['"]\]/gu, function ($0, prop) { @@ -2042,6 +2464,7 @@ JSONPath.toPathArray = function (expr) { // Properties operator .replaceAll('~', ';~;') // Split by property boundaries + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient .replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu, ';') // Reinsert periods within properties .replaceAll('%@%', '.') @@ -2057,15 +2480,82 @@ JSONPath.toPathArray = function (expr) { .replaceAll(/;$|'?\]|'$/gu, ''); const exprList = normalized.split(';').map(function (exp) { const match = exp.match(/#(\d+)/u); - return !match || !match[1] ? exp : subx[match[1]]; + return !match || !match[1] ? exp : subx[Number(match[1])]; }); cache[expr] = exprList; - return cache[expr].concat(); -}; -JSONPath.prototype.safeVm = { - Script: SafeScript + return /** @type {string[]} */cache[expr].concat(); }; -JSONPath.prototype.vm = vm; +/** + * @typedef {import('./jsonpath.js').AnyInput} AnyInput + */ +/** + * @typedef {import('./jsonpath.js').SandboxCallback} SandboxCallback + */ +/** + * @typedef {import('./jsonpath.js').SandboxPropertyValue} SandboxPropertyValue + */ +/** + * @typedef {import('./jsonpath.js').ExpressionArray} ExpressionArray + */ +/** + * @typedef {import('./jsonpath.js').ValueType} ValueType + */ +/** + * @typedef {import('./jsonpath.js').ParentValue} ParentValue + */ +/** + * @typedef {import('./jsonpath.js').UnknownResult} UnknownResult + */ +/** + * @typedef {import('./jsonpath.js').ParentProperty} ParentProperty + */ +/** + * @typedef {import('./jsonpath.js').PreferredOutput} PreferredOutput + */ +/** + * @typedef {import('./jsonpath.js').ReturnObject} ReturnObject + */ +/** + * @typedef {import('./jsonpath.js').JSONPathCallback} JSONPathCallback + */ +/** + * @typedef {import('./jsonpath.js').OtherTypeCallback} OtherTypeCallback + */ +/** + * @typedef {import('./jsonpath.js').ContextItem} ContextItem + */ +/** + * @typedef {import('./jsonpath.js').EvaluatedResult} EvaluatedResult + */ +/** + * @typedef {import('./jsonpath.js').EvalCallback} EvalCallback + */ +/** + * @typedef {import('./jsonpath.js').EvalClass} EvalClass + */ +/** + * @typedef {import('./jsonpath.js').ResultType} ResultType + */ +/** + * @typedef {import('./jsonpath.js').EvalValue} EvalValue + */ +/** + * @typedef {import('./jsonpath.js').PathType} PathType + */ +/** + * @typedef {import('./jsonpath.js').SafeScriptType} SafeScriptType + */ +/** + * @typedef {import('./jsonpath.js').ScriptType} ScriptType + */ +/** + * @typedef {import('./jsonpath.js').SandboxType} SandboxType + */ +/** + * @typedef {import('./jsonpath.js').JSONPathOptions} JSONPathOptions + */ + +JSONPathClass.prototype.vm = vm; -export { JSONPath }; +export { JSONPath, JSONPathClass }; diff --git a/dist/jsonpath-browser.d.ts b/dist/jsonpath-browser.d.ts new file mode 100644 index 00000000..435ca625 --- /dev/null +++ b/dist/jsonpath-browser.d.ts @@ -0,0 +1,44 @@ +export type AnyInput = import("./jsonpath.js").AnyInput; +export type SandboxCallback = import("./jsonpath.js").SandboxCallback; +export type SandboxPropertyValue = import("./jsonpath.js").SandboxPropertyValue; +export type UnknownArray = import("./jsonpath.js").UnknownArray; +export type ValueType = import("./jsonpath.js").ValueType; +export type ParentValue = import("./jsonpath.js").ParentValue; +export type UnknownItem = import("./jsonpath.js").UnknownItem; +export type UnknownResult = import("./jsonpath.js").UnknownResult; +export type ParentProperty = import("./jsonpath.js").ParentProperty; +export type PreferredOutput = import("./jsonpath.js").PreferredOutput; +export type ReturnObject = import("./jsonpath.js").ReturnObject; +export type JSONPathCallback = import("./jsonpath.js").JSONPathCallback; +export type OtherTypeCallback = import("./jsonpath.js").OtherTypeCallback; +export type ContextItem = import("./jsonpath.js").ContextItem; +export type EvaluatedResult = import("./jsonpath.js").EvaluatedResult; +export type EvalCallback = import("./jsonpath.js").EvalCallback; +export type EvalClass = import("./jsonpath.js").EvalClass; +export type ResultType = import("./jsonpath.js").ResultType; +export type EvalValue = import("./jsonpath.js").EvalValue; +export type PathType = import("./jsonpath.js").PathType; +export type SafeScriptType = import("./jsonpath.js").SafeScriptType; +export type ScriptType = import("./jsonpath.js").ScriptType; +export type SandboxType = import("./jsonpath.js").SandboxType; +export type JSONPathOptions = import("./jsonpath.js").JSONPathOptions; +export type ConditionCallback = (item: T) => boolean; +import { JSONPath } from './jsonpath.js'; +import { JSONPathClass } from './jsonpath.js'; +/** + * In-browser replacement for NodeJS' VM.Script. + */ +export class Script { + /** + * @param {string} expr Expression to evaluate + */ + constructor(expr: string); + code: string; + /** + * @param {SandboxType} context Object whose items will be added + * to evaluation + * @returns {EvaluatedResult} Result of evaluated code + */ + runInNewContext(context: SandboxType): EvaluatedResult; +} +export { JSONPath, JSONPathClass }; diff --git a/dist/jsonpath-node.d.cts b/dist/jsonpath-node.d.cts new file mode 100644 index 00000000..881f83ec --- /dev/null +++ b/dist/jsonpath-node.d.cts @@ -0,0 +1,2 @@ +import * as jsonpath from './jsonpath-node.js'; +export = jsonpath; diff --git a/dist/jsonpath-node.d.ts b/dist/jsonpath-node.d.ts new file mode 100644 index 00000000..31e9e991 --- /dev/null +++ b/dist/jsonpath-node.d.ts @@ -0,0 +1,27 @@ +export type AnyInput = import("./jsonpath.js").AnyInput; +export type SandboxCallback = import("./jsonpath.js").SandboxCallback; +export type SandboxPropertyValue = import("./jsonpath.js").SandboxPropertyValue; +export type UnknownArray = import("./jsonpath.js").UnknownArray; +export type ValueType = import("./jsonpath.js").ValueType; +export type ParentValue = import("./jsonpath.js").ParentValue; +export type UnknownItem = import("./jsonpath.js").UnknownItem; +export type UnknownResult = import("./jsonpath.js").UnknownResult; +export type ParentProperty = import("./jsonpath.js").ParentProperty; +export type PreferredOutput = import("./jsonpath.js").PreferredOutput; +export type ReturnObject = import("./jsonpath.js").ReturnObject; +export type JSONPathCallback = import("./jsonpath.js").JSONPathCallback; +export type OtherTypeCallback = import("./jsonpath.js").OtherTypeCallback; +export type ContextItem = import("./jsonpath.js").ContextItem; +export type EvaluatedResult = import("./jsonpath.js").EvaluatedResult; +export type EvalCallback = import("./jsonpath.js").EvalCallback; +export type EvalClass = import("./jsonpath.js").EvalClass; +export type ResultType = import("./jsonpath.js").ResultType; +export type EvalValue = import("./jsonpath.js").EvalValue; +export type PathType = import("./jsonpath.js").PathType; +export type SafeScriptType = import("./jsonpath.js").SafeScriptType; +export type ScriptType = import("./jsonpath.js").ScriptType; +export type SandboxType = import("./jsonpath.js").SandboxType; +export type JSONPathOptions = import("./jsonpath.js").JSONPathOptions; +import { JSONPath } from './jsonpath.js'; +import { JSONPathClass } from './jsonpath.js'; +export { JSONPath, JSONPathClass }; diff --git a/dist/jsonpath.d.ts b/dist/jsonpath.d.ts new file mode 100644 index 00000000..bb756088 --- /dev/null +++ b/dist/jsonpath.d.ts @@ -0,0 +1,227 @@ +export type AnyInput = any; +export type SandboxCallback = ((...args: any[]) => any); +export type SandboxPropertyValue = any | SandboxCallback; +export type UnknownArray = unknown[]; +export type ValueType = "scalar" | "boolean" | "string" | "undefined" | "function" | "integer" | "number" | "nonFinite" | "object" | "array" | "other" | "null"; +export type ParentValue = unknown; +export type UnknownItem = unknown; +export type UnknownResult = unknown; +export type ParentProperty = string | number | null; +export type PreferredOutput = unknown | ParentValue | string | ReturnObject; +export type ReturnObject = { + path: UnknownArray | string; + value: unknown; + parent: ParentValue; + parentProperty: ParentProperty; + isParentSelector?: boolean | undefined; + hasArrExpr?: boolean | undefined; + expr?: UnknownArray | undefined; + pointer?: string | undefined; +}; +export type JSONPathCallback = (preferredOutput: any, type: "value" | "property", fullRetObj: ReturnObject) => void; +export type OtherTypeCallback = (val: unknown, path: UnknownArray, parent: ParentValue, parentPropName: string | null) => boolean; +export type ContextItem = any; +export type EvaluatedResult = any; +export type EvalCallback = (code: string, context: ContextItem) => EvaluatedResult; +export type EvalClass = typeof SafeScript; +export type ResultType = "value" | "path" | "pointer" | "parent" | "parentProperty" | "all"; +export type EvalValue = EvalCallback | EvalClass | "safe" | "native" | boolean; +export type PathType = string | string[]; +export type SafeScriptType = { + Script: typeof SafeScript; +}; +export type ScriptType = typeof import("node:vm") | { + Script: typeof Script; +}; +export type SandboxType = { + _$_path?: string; + _$_parentProperty?: ParentProperty; + _$_parent?: unknown; + _$_property?: string | number; + _$_root?: AnyInput; + _$_v?: unknown; + [key: string]: SandboxPropertyValue; +}; +export type JSONPathOptions = { + json?: AnyInput; + path?: PathType | undefined; + resultType?: ResultType | undefined; + flatten?: boolean | undefined; + wrap?: boolean | undefined; + sandbox?: SandboxType | undefined; + eval?: EvalValue | undefined; + parent?: any | null; + parentProperty?: string | null | undefined; + callback?: JSONPathCallback | undefined; + /** + * Defaults to + * function which throws on encountering `@other` + */ + otherTypeCallback?: OtherTypeCallback | undefined; + autostart?: boolean | undefined; + ignoreEvalErrors?: boolean | undefined; +}; +/** + * @overload + * @param {string} opts JSON path to evaluate + * @param {AnyInput} [expr] JSON object to evaluate against + * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired + * payload per `resultType`, 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [callback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + * @param {undefined} [otherTypeCallback] + * @returns {unknown|JSONPathClass} + */ +export function JSONPath(opts: string, expr?: AnyInput, obj?: JSONPathCallback | undefined, callback?: OtherTypeCallback | undefined, otherTypeCallback?: undefined): unknown | JSONPathClass; +/** + * @overload + * @param {JSONPathOptions} opts If a string, will be treated as + * `expr` + * @returns {unknown|JSONPathClass} + */ +export function JSONPath(opts: JSONPathOptions): unknown | JSONPathClass; +export namespace JSONPath { + let cache: {}; + /** + * @param {string[]} pathArr Array to convert + * @returns {string} The path string + */ + function toPathString(pathArr: string[]): string; + /** + * @param {string[]} pointer JSON Path array + * @returns {string} JSON Pointer + */ + function toPointer(pointer: string[]): string; + /** + * @param {string} expr Expression to convert + * @returns {string[]} + */ + function toPathArray(expr: string): string[]; +} +/** + * + */ +export class JSONPathClass { + /** + * @overload + * @param {string} opts JSON path to evaluate + * @param {AnyInput} [expr] JSON object to evaluate against + * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired + * payload per `resultType`, 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [callback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + * @param {undefined} [otherTypeCallback] + * @returns {JSONPath|JSONPathClass} + */ + constructor(opts: string, expr?: AnyInput, obj?: JSONPathCallback | undefined, callback?: OtherTypeCallback | undefined, otherTypeCallback?: undefined); + /** + * @overload + * @param {JSONPathOptions} opts If a string, will be treated as + * `expr` + */ + constructor(opts: JSONPathOptions); + /** @type {ResultType|undefined} */ + currResultType: ResultType | undefined; + /** @type {EvalValue|undefined} */ + currEval: EvalValue | undefined; + /** @type {OtherTypeCallback|undefined} */ + currOtherTypeCallback: OtherTypeCallback | undefined; + /** @type {SafeScriptType} */ + safeVm: SafeScriptType; + /** @type {ScriptType} */ + vm: ScriptType; + /** @type {SandboxType|undefined} */ + currSandbox: SandboxType | undefined; + _hasParentSelector: boolean; + json: any; + path: any; + resultType: ResultType; + flatten: boolean; + wrap: boolean | undefined; + sandbox: SandboxType; + eval: EvalValue; + ignoreEvalErrors: boolean; + parent: any; + parentProperty: string | null; + callback: JSONPathCallback; + otherTypeCallback: OtherTypeCallback; + /** + * @overload + * @param {JSONPathOptions} [expr] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + evaluate(expr?: JSONPathOptions | undefined): ReturnObject | ReturnObject[] | undefined | unknown; + /** + * @overload + * @param {PathType|undefined} [expr] + * @param {AnyInput} [json] + * @param {JSONPathCallback|null} [callback] + * @param {OtherTypeCallback} [otherTypeCallback] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + evaluate(expr?: PathType | undefined, json?: AnyInput, callback?: JSONPathCallback | null | undefined, otherTypeCallback?: OtherTypeCallback | undefined): ReturnObject | ReturnObject[] | undefined | unknown; + /** + * @param {ReturnObject} ea + * @returns {PreferredOutput} + */ + _getPreferredOutput(ea: ReturnObject): PreferredOutput; + /** + * @param {ReturnObject} fullRetObj + * @param {JSONPathCallback|undefined} callback + * @param {"value"|"property"} type + * @returns {void} + */ + _handleCallback(fullRetObj: ReturnObject, callback: JSONPathCallback | undefined, type: "value" | "property"): void; + /** + * + * @param {UnknownArray} expr + * @param {unknown} val + * @param {UnknownArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @param {JSONPathCallback|undefined} callback + * @param {boolean|undefined} hasArrExpr + * @param {boolean} [literalPriority] + * @returns {ReturnObject|ReturnObject[]} + */ + _trace(expr: UnknownArray, val: unknown, path: UnknownArray, parent: ParentValue, parentPropName: ParentProperty, callback: JSONPathCallback | undefined, hasArrExpr: boolean | undefined, literalPriority?: boolean): ReturnObject | ReturnObject[]; + /** + * @param {unknown} val + * @param {(prop: string|number) => void} f + * @returns {void} + */ + _walk(val: unknown, f: (prop: string | number) => void): void; + /** + * @param {string} loc + * @param {UnknownArray} expr + * @param {unknown} val + * @param {UnknownArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @param {JSONPathCallback|undefined} callback + * @returns {ReturnObject[]|undefined} + */ + _slice(loc: string, expr: UnknownArray, val: unknown, path: UnknownArray, parent: ParentValue, parentPropName: ParentProperty, callback: JSONPathCallback | undefined): ReturnObject[] | undefined; + /** + * @param {string} code + * @param {unknown} _v + * @param {string|number} _vname + * @param {UnknownArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @returns {UnknownResult} + */ + _eval(code: string, _v: unknown, _vname: string | number, path: UnknownArray, parent: ParentValue, parentPropName: ParentProperty): UnknownResult; +} +import { SafeScript } from './Safe-Script.js'; +import type { Script } from './jsonpath-browser.js'; diff --git a/eslint.config.js b/eslint.config.js index bbda9fee..4bc71bb8 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,6 +1,6 @@ import ashNazg from 'eslint-config-ash-nazg'; -export default [ +export default /** @type {import('eslint').Linter.Config} */ ([ { ignores: [ '.github', @@ -32,9 +32,9 @@ export default [ { files: ['*.md/*.js', '*.md/*.html'], rules: { - 'import/unambiguous': 0, - 'import/no-commonjs': 0, - 'import/no-unresolved': ['error', { + 'import-x/unambiguous': 0, + 'import-x/no-commonjs': 0, + 'import-x/no-unresolved': ['error', { ignore: ['jsonpath-plus'] }], 'sonarjs/no-internal-api-use': 0, @@ -45,7 +45,7 @@ export default [ 'no-unused-vars': ['error', { varsIgnorePattern: 'json|result' }], - 'import/no-extraneous-dependencies': 0, + 'import-x/no-extraneous-dependencies': 0, 'n/no-extraneous-import': ['error', { allowModules: ['jsonpath-plus'] }], @@ -66,20 +66,25 @@ export default [ globals: { assert: 'readonly', expect: 'readonly', - jsonpath: 'readonly' + jsonpath: 'readonly', + JSONPathClass: 'readonly' } }, rules: { '@stylistic/quotes': 0, '@stylistic/quote-props': 0, - 'import/unambiguous': 0, + 'import-x/unambiguous': 0, + // Not DOM here + 'unicorn/better-dom-traversing': 0, // Todo: Reenable '@stylistic/max-len': 0 } }, { rules: { - '@stylistic/indent': ['error', 4, {outerIIFEBody: 0}], + '@stylistic/indent': ['error', 4, { + SwitchCase: 0, outerIIFEBody: 0 + }], 'promise/prefer-await-to-callbacks': 0, // Disable for now @@ -92,4 +97,4 @@ export default [ 'unicorn/prefer-spread': 0 } } -]; +]); diff --git a/package.json b/package.json index 808ac423..7af7d62e 100644 --- a/package.json +++ b/package.json @@ -11,17 +11,29 @@ "exports": { "./package.json": "./package.json", ".": { - "types": "./src/jsonpath.d.ts", - "browser": "./dist/index-browser-esm.js", - "umd": "./dist/index-browser-umd.cjs", - "import": "./dist/index-node-esm.js", - "require": "./dist/index-node-cjs.cjs", - "default": "./dist/index-browser-esm.js" + "browser": { + "types": "./dist/jsonpath-browser.d.ts", + "default": "./dist/index-browser-esm.js" + }, + "umd": { + "types": "./dist/jsonpath-browser.d.ts", + "default": "./dist/index-browser-umd.cjs" + }, + "import": { + "types": "./dist/jsonpath-node.d.ts", + "default": "./dist/index-node-esm.js" + }, + "require": { + "types": "./dist/jsonpath-node.d.cts", + "default": "./dist/index-node-cjs.cjs" + }, + "default": { + "types": "./dist/jsonpath.d.ts", + "default": "./dist/index-browser-esm.js" + } } }, - "module": "dist/index-node-esm.js", - "browser": "dist/index-browser-esm.js", - "types": "./src/jsonpath.d.ts", + "types": "./dist/jsonpath.d.ts", "description": "A JS implementation of JSONPath with some additional operators", "contributors": [ { @@ -68,25 +80,29 @@ "jsep": "^1.4.0" }, "devDependencies": { - "@babel/core": "^7.28.5", - "@babel/preset-env": "^7.28.5", - "@rollup/plugin-babel": "^6.1.0", + "@arethetypeswrong/cli": "^0.18.5", + "@babel/core": "^8.0.1", + "@babel/preset-env": "^8.0.2", + "@rollup/plugin-babel": "^7.1.0", "@rollup/plugin-node-resolve": "^16.0.3", - "@rollup/plugin-terser": "^0.4.4", - "c8": "^10.1.3", - "chai": "^6.2.1", + "@rollup/plugin-terser": "^1.0.0", + "@types/chai": "^5.2.3", + "@types/mocha": "^10.0.10", + "@types/node": "^26.1.2", + "c8": "^12.0.0", + "chai": "^6.2.2", "coveradge": "^0.8.2", - "eslint": "^9.39.1", - "eslint-config-ash-nazg": "^39.8.0", + "eslint": "^10.8.0", + "eslint-config-ash-nazg": "^41.0.0", "http-server": "^14.1.1", - "license-badger": "^0.22.1", - "mocha": "^11.7.5", + "license-badger": "^0.23.0", + "mocha": "^11.7.6", "mocha-badge-generator": "^0.11.0", "mocha-multi-reporters": "^1.5.1", - "open-cli": "^8.0.0", - "rollup": "4.59.0", - "typedoc": "^0.28.14", - "typescript": "^5.9.3" + "open-cli": "^9.0.0", + "rollup": "4.62.3", + "typedoc": "^0.28.20", + "typescript": "^6.0.3" }, "keywords": [ "json", @@ -103,8 +119,8 @@ ], "exclude": [ ".mocharc.cjs", + ".ncurc.cjs", "eslint.config.js", - "src/jsonpath.d.ts", "rollup.config.js", ".idea", "coverage", @@ -117,7 +133,8 @@ ] }, "scripts": { - "prepublishOnly": "pnpm i", + "prepublishOnly": "pnpm i && npm run build", + "attw": "attw --pack .", "license-badge": "license-badger --corrections --uncategorizedLicenseTemplate \"\\${license} (\\${name} (\\${version}))\" --filteredTypes=nonempty --textTemplate \"License types\n(project, deps, and bundled devDeps)\" --packageJson --production badges/licenses-badge.svg", "license-badge-dev": "license-badger --corrections --filteredTypes=nonempty --textTemplate \"License types\n(all devDeps)\" --allDevelopment badges/licenses-badge-dev.svg", "license-badges": "npm run license-badge && npm run license-badge-dev", @@ -129,13 +146,15 @@ "open": "open-cli http://localhost:8084/demo/ && npm start", "start": "http-server -p 8084", "cli": "./bin/jsonpath-cli.js package.json name", - "typescript": "tsc", + "tsc-prod": "tsc -p tsconfig-prod.json", + "tsc": "tsc", "mocha": "mocha --require test-helpers/node-env.js --reporter-options configFile=mocha-multi-reporters.json test", "c8": "rm -Rf ./coverage && rm -Rf ./node_modules/.cache && c8 --all npm run mocha && npm run coverage-badge", "rollup": "rollup -c", + "build": "npm run rollup && npm run tsc-prod", "eslint": "eslint .", "lint": "npm run eslint", - "test": "npm run eslint && npm run rollup && npm run c8 && npm run typescript", + "test": "npm run eslint && npm run rollup && npm run c8 && npm run tsc", "browser-test": "npm run eslint && npm run rollup && open-cli http://localhost:8084/test/ && npm start" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index acfef52f..949517f7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,610 +18,628 @@ importers: specifier: ^1.4.0 version: 1.4.0 devDependencies: + '@arethetypeswrong/cli': + specifier: ^0.18.5 + version: 0.18.5 '@babel/core': - specifier: ^7.28.5 - version: 7.28.5 + specifier: ^8.0.1 + version: 8.0.1 '@babel/preset-env': - specifier: ^7.28.5 - version: 7.28.5(@babel/core@7.28.5) + specifier: ^8.0.2 + version: 8.0.2(@babel/core@8.0.1) '@rollup/plugin-babel': - specifier: ^6.1.0 - version: 6.1.0(@babel/core@7.28.5)(rollup@4.59.0) + specifier: ^7.1.0 + version: 7.1.0(@babel/core@8.0.1)(rollup@4.62.3)(supports-color@8.1.1) '@rollup/plugin-node-resolve': specifier: ^16.0.3 - version: 16.0.3(rollup@4.59.0) + version: 16.0.3(rollup@4.62.3) '@rollup/plugin-terser': - specifier: ^0.4.4 - version: 0.4.4(rollup@4.59.0) + specifier: ^1.0.0 + version: 1.0.0(rollup@4.62.3) + '@types/chai': + specifier: ^5.2.3 + version: 5.2.3 + '@types/mocha': + specifier: ^10.0.10 + version: 10.0.10 + '@types/node': + specifier: ^26.1.2 + version: 26.1.2 c8: - specifier: ^10.1.3 - version: 10.1.3 + specifier: ^12.0.0 + version: 12.0.0 chai: - specifier: ^6.2.1 - version: 6.2.1 + specifier: ^6.2.2 + version: 6.2.2 coveradge: specifier: ^0.8.2 version: 0.8.2 eslint: - specifier: ^9.39.1 - version: 9.39.1 + specifier: ^10.8.0 + version: 10.8.0(supports-color@8.1.1) eslint-config-ash-nazg: - specifier: ^39.8.0 - version: 39.8.0(@babel/core@7.28.5)(eslint@9.39.1)(typescript@5.9.3) + specifier: ^41.0.0 + version: 41.0.0(@babel/core@8.0.1)(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint-plugin-import@2.32.0)(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1)(ts-declaration-location@1.0.7(typescript@6.0.3))(typescript@6.0.3) http-server: specifier: ^14.1.1 - version: 14.1.1 + version: 14.1.1(debug@4.4.3(supports-color@8.1.1))(supports-color@8.1.1) license-badger: - specifier: ^0.22.1 - version: 0.22.1 + specifier: ^0.23.0 + version: 0.23.0(supports-color@8.1.1) mocha: - specifier: ^11.7.5 - version: 11.7.5 + specifier: ^11.7.6 + version: 11.7.6 mocha-badge-generator: specifier: ^0.11.0 version: 0.11.0 mocha-multi-reporters: specifier: ^1.5.1 - version: 1.5.1(mocha@11.7.5) + version: 1.5.1(mocha@11.7.6)(supports-color@8.1.1) open-cli: - specifier: ^8.0.0 - version: 8.0.0 + specifier: ^9.0.0 + version: 9.0.0(supports-color@8.1.1) rollup: - specifier: 4.59.0 - version: 4.59.0 + specifier: 4.62.3 + version: 4.62.3 typedoc: - specifier: ^0.28.14 - version: 0.28.14(typescript@5.9.3) + specifier: ^0.28.20 + version: 0.28.20(typescript@6.0.3) typescript: - specifier: ^5.9.3 - version: 5.9.3 + specifier: ^6.0.3 + version: 6.0.3 packages: - '@babel/code-frame@7.27.1': - resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} - engines: {node: '>=6.9.0'} + '@andrewbranch/untar.js@1.0.3': + resolution: {integrity: sha512-Jh15/qVmrLGhkKJBdXlK1+9tY4lZruYjsgkDFj08ZmDiWVBLJcqkok7Z0/R0In+i1rScBpJlSvrTS2Lm41Pbnw==} + + '@arethetypeswrong/cli@0.18.5': + resolution: {integrity: sha512-gM+8vRsQOD/Uc7EnBedUhkG5OCsDWE4uoak5QvomGpMpaky0Eh41p04nIMgrWb8EOmqZUJGc6zz9hsP6E56R7g==} + engines: {node: '>=20'} + hasBin: true + + '@arethetypeswrong/core@0.18.5': + resolution: {integrity: sha512-9ytjzGwxjm9Uz7I9avfbt5vlQt6uk9uRRESzJjqrznl6WKvI6dwYTo+vJ3U02Wrq/mR3iql/PzhvHhKdJIAjDQ==} + engines: {node: '>=20'} '@babel/code-frame@7.29.0': resolution: {integrity: sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.28.5': - resolution: {integrity: sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==} - engines: {node: '>=6.9.0'} + '@babel/code-frame@8.0.0': + resolution: {integrity: sha512-dYYg153EyN2Ekbqw2zAsbd6/JR+9N2SEoC7YV2GyyqMM7x9bLDTjBD6XBhSMLH0wtIVyJj03jWNriQhaN+eoCw==} + engines: {node: ^22.18.0 || >=24.11.0} - '@babel/core@7.28.5': - resolution: {integrity: sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==} - engines: {node: '>=6.9.0'} + '@babel/compat-data@8.0.0': + resolution: {integrity: sha512-DOjnob/cXOUgDOozCDeq/aK2p5y8dUIVdf6tNhEV1HQRd6I8aQ4f4fbtHRVEvb6lP3BGomrKHiS8ICAASSVQSw==} + engines: {node: ^22.18.0 || >=24.11.0} - '@babel/eslint-parser@7.28.5': - resolution: {integrity: sha512-fcdRcWahONYo+JRnJg1/AekOacGvKx12Gu0qXJXFi2WBqQA1i7+O5PaxRB7kxE/Op94dExnCiiar6T09pvdHpA==} - engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} - peerDependencies: - '@babel/core': ^7.11.0 - eslint: ^7.5.0 || ^8.0.0 || ^9.0.0 + '@babel/core@8.0.1': + resolution: {integrity: sha512-5FgxM4dLQpMJHSiVATk8foW263dVHQHBVpXYiimNECVWG01f4nFyEbQixeT6Mwvg7TayREJ2gpKl3o2RoMdnqw==} + engines: {node: ^22.18.0 || >=24.11.0} - '@babel/eslint-plugin@7.27.1': - resolution: {integrity: sha512-vOG/EipZbIAcREK6XI4JRO3B3uZr70/KIhsrNLO9RXcgLMaW0sTsBpNeTpQUyelB0HsbWd45NIsuTgD3mqr/Og==} - engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} + '@babel/eslint-parser@8.0.1': + resolution: {integrity: sha512-2javO8pAQv/ld6sS6OcxoLAlzZEZy+xm99bnoAfMhzKSumKhdF5wylpbZB7XTorWr3KLPtx5K95eduJPOy1mzA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/eslint-parser': ^7.11.0 - eslint: ^7.5.0 || ^8.0.0 || ^9.0.0 + '@babel/core': ^8.0.0 + eslint: ^9.0.0 || ^10.0.0 - '@babel/generator@7.28.5': - resolution: {integrity: sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==} - engines: {node: '>=6.9.0'} + '@babel/eslint-plugin@8.0.1': + resolution: {integrity: sha512-nHigH34PJCSbkPeK4PEzfwfy6O8VWfeucP2ZP8nwf0QcKZBxcX+uD6Zp8uMxrvYvWXYmlhYwU+Ix5N5TMjq3qQ==} + engines: {node: ^22.18.0 || >=24.11.0} + peerDependencies: + '@babel/core': ^8.0.0 + '@babel/eslint-parser': ^8.0.1 + eslint: ^9.0.0 || ^10.0.0 '@babel/generator@7.29.1': resolution: {integrity: sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==} engines: {node: '>=6.9.0'} - '@babel/helper-annotate-as-pure@7.27.3': - resolution: {integrity: sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==} - engines: {node: '>=6.9.0'} + '@babel/generator@8.0.0': + resolution: {integrity: sha512-NT9NrVwJsbSV6Y2FSstWa71EETOnzrjkL5/wX3D2mYHtKM+qvqB1DvR4D0Setb/gDBsHzRICifwEWMO8CnTF6g==} + engines: {node: ^22.18.0 || >=24.11.0} - '@babel/helper-compilation-targets@7.27.2': - resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==} - engines: {node: '>=6.9.0'} + '@babel/helper-annotate-as-pure@8.0.0': + resolution: {integrity: sha512-NSpMkMsvvZqzThJ0p1B02cbtA2ObEyfBvq950bmNkyxsxvcxwhvvCB036rKhlEnuBBo30bOrk13u3FzlKSoRrw==} + engines: {node: ^22.18.0 || >=24.11.0} - '@babel/helper-create-class-features-plugin@7.28.5': - resolution: {integrity: sha512-q3WC4JfdODypvxArsJQROfupPBq9+lMwjKq7C33GhbFYJsufD0yd/ziwD+hJucLeWsnFPWZjsU2DNFqBPE7jwQ==} - engines: {node: '>=6.9.0'} + '@babel/helper-compilation-targets@8.0.0': + resolution: {integrity: sha512-JwculLABZvyPvyLBpwU/E/IbH2uM3mnxNtIJpxnIfb24y1PrdVxK5Dqjle4DpgqpGRnwgC7G8IkzPdSXZrO1Ew==} + engines: {node: ^22.18.0 || >=24.11.0} + + '@babel/helper-create-class-features-plugin@8.0.1': + resolution: {integrity: sha512-++t3ZktzlLmASAxIlxeXQK9Z2YwUafYGYcvGBFevqOqt16HozVHStUoQvWD09fzAZOb/uJGpUTBuGK41AJAuOA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0 + '@babel/core': ^8.0.0 - '@babel/helper-create-regexp-features-plugin@7.28.5': - resolution: {integrity: sha512-N1EhvLtHzOvj7QQOUCCS3NrPJP8c5W6ZXCHDn7Yialuy1iu4r5EmIYkXlKNqT99Ciw+W0mDqWoR6HWMZlFP3hw==} - engines: {node: '>=6.9.0'} + '@babel/helper-create-regexp-features-plugin@8.0.1': + resolution: {integrity: sha512-PydTbcVTiIfVweHMeY1u3MslaD/ZzvnaTNhJp+7ghofelLWshF66Ckc/ZsjStfvRQIKQ4uVG0yEJucyDtyrWgw==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0 + '@babel/core': ^8.0.0 - '@babel/helper-define-polyfill-provider@0.6.5': - resolution: {integrity: sha512-uJnGFcPsWQK8fvjgGP5LZUZZsYGIoPeRjSF5PGwrelYgq7Q15/Ft9NGFp1zglwgIv//W0uG4BevRuSJRyylZPg==} + '@babel/helper-define-polyfill-provider@1.0.0': + resolution: {integrity: sha512-9jzVaTeZyXRDKTgUnNzcPQMO8y0ga3o+Z4fKjNet9Fcx7slgKa83qRbz0EwROSd6qO6CoEe/HQszqSPKb5lhkw==} + engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: - '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + '@babel/core': ^7.4.0 || ^8.0.0 '@babel/helper-globals@7.28.0': resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} engines: {node: '>=6.9.0'} - '@babel/helper-member-expression-to-functions@7.28.5': - resolution: {integrity: sha512-cwM7SBRZcPCLgl8a7cY0soT1SptSzAlMH39vwiRpOQkJlh53r5hdHwLSCZpQdVLT39sZt+CRpNwYG4Y2v77atg==} - engines: {node: '>=6.9.0'} + '@babel/helper-globals@8.0.0': + resolution: {integrity: sha512-lLozHOM6sWWlxNo8CYqHy4MBZeTvHXNgVPBfPOGsjPKUzHC2Az9QwB6gxdQmpwHl6GlQtbGgS+lj5887guDiLw==} + engines: {node: ^22.18.0 || >=24.11.0} - '@babel/helper-module-imports@7.27.1': - resolution: {integrity: sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==} - engines: {node: '>=6.9.0'} + '@babel/helper-member-expression-to-functions@8.0.0': + resolution: {integrity: sha512-xkXrMbtk87Gk7+oKBVmBc6EORg/Qwx++AHESldmHkpvG8wgccdhJJFwrzqlF382Fk8wfXhJHWE/g/43QvEGNPQ==} + engines: {node: ^22.18.0 || >=24.11.0} '@babel/helper-module-imports@7.28.6': resolution: {integrity: sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==} engines: {node: '>=6.9.0'} - '@babel/helper-module-transforms@7.28.3': - resolution: {integrity: sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 + '@babel/helper-module-imports@8.0.0': + resolution: {integrity: sha512-NZ7mSS93o4ndX4KrbD7W8Sf3QT8Qe24PrnFyUcuOPDzK6faqDFKjY9RG7he7+I7FdiQ4llpnosFqzrXa+Vy3Ew==} + engines: {node: ^22.18.0 || >=24.11.0} - '@babel/helper-module-transforms@7.28.6': - resolution: {integrity: sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==} - engines: {node: '>=6.9.0'} + '@babel/helper-module-transforms@8.0.1': + resolution: {integrity: sha512-UgAhl1kqiW5ciE0yCXqqvnb4H2n3IELJ7lIIQRezwDPilPEZX5i+Rvbja9MFTkwUn2biEiSMeV31aUzR4Lwakw==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/helper-optimise-call-expression@7.27.1': - resolution: {integrity: sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==} - engines: {node: '>=6.9.0'} + '@babel/core': ^8.0.0 - '@babel/helper-plugin-utils@7.27.1': - resolution: {integrity: sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==} - engines: {node: '>=6.9.0'} + '@babel/helper-optimise-call-expression@8.0.0': + resolution: {integrity: sha512-3W6satvtPuCUkUx63S2jMoW9EQNYkADgs1HTfufmL7gCmAulHMKupA/12WNz4A0GMMFn/YnWWwqOT9IZrJHQjg==} + engines: {node: ^22.18.0 || >=24.11.0} - '@babel/helper-plugin-utils@7.28.6': - resolution: {integrity: sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==} - engines: {node: '>=6.9.0'} + '@babel/helper-plugin-utils@8.0.1': + resolution: {integrity: sha512-3PKFgjTyPlhFhorfP+SjKQxLViIL++zWjFOO4hGriYU+Bsm983DxEM1JmDRJVWXV0O9npu+xXRqz7Pbd3mh70g==} + engines: {node: ^22.18.0 || >=24.11.0} + peerDependencies: + '@babel/core': ^8.0.0 - '@babel/helper-remap-async-to-generator@7.27.1': - resolution: {integrity: sha512-7fiA521aVw8lSPeI4ZOD3vRFkoqkJcS+z4hFo82bFSH/2tNd6eJ5qCVMS5OzDmZh/kaHQeBaeyxK6wljcPtveA==} - engines: {node: '>=6.9.0'} + '@babel/helper-remap-async-to-generator@8.0.1': + resolution: {integrity: sha512-baAKuLEMmu6BCSY3tuiU7qglM1qOZt6F1SrFScA241oNqksxkxfEZEKztlGRmoVns9AQ5UgArH7RsUEjxWnzgQ==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0 + '@babel/core': ^8.0.0 - '@babel/helper-replace-supers@7.27.1': - resolution: {integrity: sha512-7EHz6qDZc8RYS5ElPoShMheWvEgERonFCs7IAonWLLUTXW59DP14bCZt89/GKyreYn8g3S83m21FelHKbeDCKA==} - engines: {node: '>=6.9.0'} + '@babel/helper-replace-supers@8.0.1': + resolution: {integrity: sha512-B1SZADIcy3tmH8CmWvj4SHi/oAPom4UL3uknTc2QRNsPVLFk/sPnZvQL/8kj7Y5omvjMqie0vklvs6XM4OLW5Q==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0 + '@babel/core': ^8.0.0 - '@babel/helper-skip-transparent-expression-wrappers@7.27.1': - resolution: {integrity: sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==} - engines: {node: '>=6.9.0'} + '@babel/helper-skip-transparent-expression-wrappers@8.0.0': + resolution: {integrity: sha512-xmCA9kP3IhySsqhzwIdWGlDN/1A4cCKNBO/uwZx/3YzmDoMePwno2Q5/Bq0q+tYaKbeF940YiKV/kaW8Mzvpjw==} + engines: {node: ^22.18.0 || >=24.11.0} '@babel/helper-string-parser@7.27.1': resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} engines: {node: '>=6.9.0'} + '@babel/helper-string-parser@8.0.0': + resolution: {integrity: sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==} + engines: {node: ^22.18.0 || >=24.11.0} + '@babel/helper-validator-identifier@7.28.5': resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-option@7.27.1': - resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} - engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@8.0.4': + resolution: {integrity: sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==} + engines: {node: ^22.18.0 || >=24.11.0} - '@babel/helper-wrap-function@7.28.3': - resolution: {integrity: sha512-zdf983tNfLZFletc0RRXYrHrucBEg95NIFMkn6K9dbeMYnsgHaSBGcQqdsCSStG2PYwRre0Qc2NNSCXbG+xc6g==} - engines: {node: '>=6.9.0'} + '@babel/helper-validator-option@8.0.0': + resolution: {integrity: sha512-U4Dybxh4WESWHt5XhBeExi4DrY0/DNK1aHpQbsrQXCUbFHuMweT0TpLEWKvaraV2Y6fS+ZXunsZ8zIuZIgvF2Q==} + engines: {node: ^22.18.0 || >=24.11.0} - '@babel/helpers@7.28.4': - resolution: {integrity: sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==} - engines: {node: '>=6.9.0'} + '@babel/helper-wrap-function@8.0.0': + resolution: {integrity: sha512-Qpm8+wi5xfDkBfollanwriCcKniFfBmMmaKB01GVM6VGzKXo1fdxosZp04qEr5HM+LKhwr3hG1yRy8+ORsficA==} + engines: {node: ^22.18.0 || >=24.11.0} - '@babel/parser@7.28.5': - resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==} - engines: {node: '>=6.0.0'} - hasBin: true + '@babel/helpers@8.0.0': + resolution: {integrity: sha512-wfbi91pM3py96oIiJEz7qIpyXDytgr9zQC1HEWwlGNVRAEmItuU/0a41ZUKu1sJGyhhOIpc4t5vk4PYzt8wpsg==} + engines: {node: ^22.18.0 || >=24.11.0} '@babel/parser@7.29.3': resolution: {integrity: sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA==} engines: {node: '>=6.0.0'} hasBin: true - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.28.5': - resolution: {integrity: sha512-87GDMS3tsmMSi/3bWOte1UblL+YUTFMV8SZPZ2eSEL17s74Cw/l63rR6NmGVKMYW2GYi85nE+/d6Hw5N0bEk2Q==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 + '@babel/parser@8.0.4': + resolution: {integrity: sha512-srpptsAkEbbNIC/q8nT7o+m6CQe8CJUTV/t7MYc9NnWlgYVtHOb7JH6SorxMhN0kuRJjVqXbKClG6xSbPtzz+g==} + engines: {node: ^22.18.0 || >=24.11.0} + hasBin: true - '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.27.1': - resolution: {integrity: sha512-qNeq3bCKnGgLkEXUuFry6dPlGfCdQNZbn7yUAPCInwAJHMU7THJfrBSozkcWq5sNM6RcF3S8XyQL2A52KNR9IA==} - engines: {node: '>=6.9.0'} + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@8.0.1': + resolution: {integrity: sha512-Ytgjjne4RnG3Oig7ik+NfY4ebRY30BPptVkkyu1f72eINJXRM3/bkU++tIc5aPvyLmo4KH20avq0xJ2o+9aEnw==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0 + '@babel/core': ^8.0.0 - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.27.1': - resolution: {integrity: sha512-g4L7OYun04N1WyqMNjldFwlfPCLVkgB54A/YCXICZYBsvJJE3kByKv9c9+R/nAfmIfjl2rKYLNyMHboYbZaWaA==} - engines: {node: '>=6.9.0'} + '@babel/plugin-bugfix-safari-class-field-initializer-scope@8.0.1': + resolution: {integrity: sha512-X7pAMBhuKluA7UfwZNvKN0XVVu/AGeo84Z75eJl85rcb8J2aBzLK92btahM1X5h0oi0QIrbe0qIMA/0+4Buk7w==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0 + '@babel/core': ^8.0.0 - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.27.1': - resolution: {integrity: sha512-oO02gcONcD5O1iTLi/6frMJBIwWEHceWGSGqrpCmEL8nogiS6J9PBlE48CaK20/Jx1LuRml9aDftLgdjXT8+Cw==} - engines: {node: '>=6.9.0'} + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@8.0.1': + resolution: {integrity: sha512-DJviKTxYfH0hFwnMiW4dnPyMGzS3Hrr4zUfXl1zwQ0QiGlGlNYklLoPSYEQr8S7nau0/K7NdQjTh0qbYuyFjCA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.13.0 + '@babel/core': ^8.0.0 - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.28.3': - resolution: {integrity: sha512-b6YTX108evsvE4YgWyQ921ZAFFQm3Bn+CA3+ZXlNVnPhx+UfsVURoPjfGAPCjBgrqo30yX/C2nZGX96DxvR9Iw==} - engines: {node: '>=6.9.0'} + '@babel/plugin-bugfix-safari-rest-destructuring-rhs-array@8.0.1': + resolution: {integrity: sha512-DmR/N+B9+4PbURFj4+zdnWj49/PFAnK2bn8+E4ZAmwn3J5QCxnbG7Ep6aRfz9M8Aw+rBro0kIJQycvzFpl4buQ==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0 + '@babel/core': ^8.0.0 - '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2': - resolution: {integrity: sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==} - engines: {node: '>=6.9.0'} + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@8.0.1': + resolution: {integrity: sha512-x8bi0LFVD2xkULjfNn+hCMg16yAFHAM9fS/ThSFeYBi+0MP9K6qcY2BZb4urUwC7PYtEy5wPe6TKjOEjXrCGFA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-syntax-import-assertions@7.27.1': - resolution: {integrity: sha512-UT/Jrhw57xg4ILHLFnzFpPDlMbcdEicaAtjPQpbj9wa8T4r5KVWCimHcL/460g8Ht0DMxDyjsLgiWSkVjnwPFg==} - engines: {node: '>=6.9.0'} + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@8.0.1': + resolution: {integrity: sha512-P8+RN2n7ts2s1vnE+lXdHYf+dhnmcGSen/kWzBsVluT9Sey5AqmcRXYWlHqgQxaNlKTD5YMa1tf5z4d1v8W88w==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-syntax-import-attributes@7.27.1': - resolution: {integrity: sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==} - engines: {node: '>=6.9.0'} + '@babel/plugin-syntax-import-attributes@8.0.0-rc.1': + resolution: {integrity: sha512-s83ap4oHMLn97WG6vXH5ljObnqqEhRMSOtmObfpzVnYAw/+TzRtflORkEAM+LGE5+1uBEKE/gUjqpaN9QhQIMA==} + engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-unicode-sets-regex@7.18.6': - resolution: {integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-arrow-functions@8.0.1': + resolution: {integrity: sha512-o/gr7kRlq3PKLLuYth4udOsrC7geBerti+QtwPeyxMOsEQO1d8kDHqk9r2PtMx2y9i8FG7tzyTerfv1yMLSMsQ==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-arrow-functions@7.27.1': - resolution: {integrity: sha512-8Z4TGic6xW70FKThA5HYEKKyBpOOsucTOD1DjU3fZxDg+K3zBJcXMFnt/4yQiZnf5+MiOMSXQ9PaEK/Ilh1DeA==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-async-generator-functions@8.0.1': + resolution: {integrity: sha512-kqnSMF1YHBzuiQrl68675i5Ma1oljvo+SJsNEZFZVBu5BUrVIZm9KId3ui2PdtLK2sv2zM8sJnjPDfgLxQlEqQ==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-async-generator-functions@7.28.0': - resolution: {integrity: sha512-BEOdvX4+M765icNPZeidyADIvQ1m1gmunXufXxvRESy/jNNyfovIqUyE7MVgGBjWktCoJlzvFA1To2O4ymIO3Q==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-async-to-generator@8.0.1': + resolution: {integrity: sha512-e1jmmEU4p2Lx64sA1+EF8e8/RxPuegzbXcEbmFp5alDyLE+f2ViUpZ77bRWMXzihTwgVVmn/TOpqDbAuS5g1Ew==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-async-to-generator@7.27.1': - resolution: {integrity: sha512-NREkZsZVJS4xmTr8qzE5y8AfIPqsdQfRuUiLRTEzb7Qii8iFWCyDKaUV2c0rCuh4ljDZ98ALHP/PetiBV2nddA==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-block-scoped-functions@8.0.1': + resolution: {integrity: sha512-0V97/gcf7LIgPieEiK1YT0eXa18XJFSLOTZjzEZhA9SJIqZhD/IwGUrCitBzXSmnGCP7hchwC6svHtJ/Eidcpg==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-block-scoped-functions@7.27.1': - resolution: {integrity: sha512-cnqkuOtZLapWYZUYM5rVIdv1nXYuFVIltZ6ZJ7nIj585QsjKM5dhL2Fu/lICXZ1OyIAFc7Qy+bvDAtTXqGrlhg==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-block-scoping@8.0.1': + resolution: {integrity: sha512-HxiQvKsSCs2jOmMhjDrooHaZYOy6W8bqwXp/zjdgPjsNrda6tK9/CH3a/cVIeg6ge3hSS02ALqvqgIo4rTsuSg==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-block-scoping@7.28.5': - resolution: {integrity: sha512-45DmULpySVvmq9Pj3X9B+62Xe+DJGov27QravQJU1LLcapR6/10i+gYVAucGGJpHBp5mYxIMK4nDAT/QDLr47g==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-class-properties@8.0.1': + resolution: {integrity: sha512-tORnYiVhIHnKj90TgbSZXrO24f9oEpA6MgFxpIDSKKlHv7AzBIRhkMlYevanueLNYaQXqZWarfCgXM4bWTfNiw==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-class-properties@7.27.1': - resolution: {integrity: sha512-D0VcalChDMtuRvJIu3U/fwWjf8ZMykz5iZsg77Nuj821vCKI3zCyRLwRdWbsuJ/uRwZhZ002QtCqIkwC/ZkvbA==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-class-static-block@8.0.1': + resolution: {integrity: sha512-NEVK+L0Le8h8tJ+IK0CGS5y9Yi1ZHxLj6M5PeanhMFuq9aSo0XI+Wtmbuyop6fTNukOm7ORNntf/kwid891vqQ==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-class-static-block@7.28.3': - resolution: {integrity: sha512-LtPXlBbRoc4Njl/oh1CeD/3jC+atytbnf/UqLoqTDcEYGUPj022+rvfkbDYieUrSj3CaV4yHDByPE+T2HwfsJg==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-classes@8.0.1': + resolution: {integrity: sha512-phwyCES8kIMAdVOFw25ztmgAvkl2G+TvUv7azUYyrlR1Qoo3eLJC/MU3MGUKFZ4BWtsJ1NTJM1lKRLzKbswg7w==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.12.0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-classes@7.28.4': - resolution: {integrity: sha512-cFOlhIYPBv/iBoc+KS3M6et2XPtbT2HiCRfBXWtfpc9OAyostldxIf9YAYB6ypURBBbx+Qv6nyrLzASfJe+hBA==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-computed-properties@8.0.1': + resolution: {integrity: sha512-i4l3OGLO8DUDcwdnyraOvILbhqdUf4QgfzhVxSOSzRy49XKXrY7pwaSg9gDSKmhZfNPrEMciBSJSciQh/CjB1A==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-computed-properties@7.27.1': - resolution: {integrity: sha512-lj9PGWvMTVksbWiDT2tW68zGS/cyo4AkZ/QTp0sQT0mjPopCmrSkzxeXkznjqBxzDI6TclZhOJbBmbBLjuOZUw==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-destructuring@8.0.1': + resolution: {integrity: sha512-RtR8uLDl0QcCmqMNIkM8gmDeYZ3rS0ZH+sa+I6sfc09yFoqfp9AEPgBstq9KyfVb0lFCVSRFfJXCI70FIl5ccw==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-destructuring@7.28.5': - resolution: {integrity: sha512-Kl9Bc6D0zTUcFUvkNuQh4eGXPKKNDOJQXVyyM4ZAQPMveniJdxi8XMJwLo+xSoW3MIq81bD33lcUe9kZpl0MCw==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-dotall-regex@8.0.1': + resolution: {integrity: sha512-czOUoSaZljJ92yu+bYlXqb/UBN8K9daNCob/B6/7nthSvfGP6YhCnfqD64XWfyb2dN4ypxALNplApoJrsMd4fw==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-dotall-regex@7.27.1': - resolution: {integrity: sha512-gEbkDVGRvjj7+T1ivxrfgygpT7GUd4vmODtYpbs0gZATdkX8/iSnOtZSxiZnsgm1YjTgjI6VKBGSJJevkrclzw==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-duplicate-keys@8.0.1': + resolution: {integrity: sha512-kNnVLkxFUEcTtCyB5PFVQ5Xoy88Bk1lU/ZgDu97CW8eNhRH2Wsiy8Sq5l5dFnwtIUYjzsXHU77jUy1W5AtGSIw==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-duplicate-keys@7.27.1': - resolution: {integrity: sha512-MTyJk98sHvSs+cvZ4nOauwTTG1JeonDjSGvGGUNHreGQns+Mpt6WX/dVzWBHgg+dYZhkC4X+zTDfkTU+Vy9y7Q==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-duplicate-named-capturing-groups-regex@8.0.1': + resolution: {integrity: sha512-Tv43P47o6fuHgBL7HLHQg3WKXohW9CEUGjLtnCDW27yJLK0zKUdTTqREbZbycNHA83hewMjde5tF6ekrHu9bAA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.27.1': - resolution: {integrity: sha512-hkGcueTEzuhB30B3eJCbCYeCaaEQOmQR0AdvzpD4LoN0GXMWzzGSuRrxR2xTnCrvNbVwK9N6/jQ92GSLfiZWoQ==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-dynamic-import@8.0.1': + resolution: {integrity: sha512-AS9GlgKc43tJNRu7yOvLaTko4qmdOb+8M69uNS8i421WLO20eVez7LdG5khKdi8E0LIQpYzzzdGIrdXWnO753g==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-dynamic-import@7.27.1': - resolution: {integrity: sha512-MHzkWQcEmjzzVW9j2q8LGjwGWpG2mjwaaB0BNQwst3FIjqsg8Ct/mIZlvSPJvfi9y2AC8mi/ktxbFVL9pZ1I4A==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-explicit-resource-management@8.0.1': + resolution: {integrity: sha512-VzDIYwBlLCpV6mJfloRdJm8HmYnMqs7O+bGha8yfg2kP7jAdxeCw6yZBVBeaKKQUThtSU52iy+3lB7DhYsbOBA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-explicit-resource-management@7.28.0': - resolution: {integrity: sha512-K8nhUcn3f6iB+P3gwCv/no7OdzOZQcKchW6N389V6PD8NUWKZHzndOd9sPDVbMoBsbmjMqlB4L9fm+fEFNVlwQ==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-exponentiation-operator@8.0.1': + resolution: {integrity: sha512-DsZvUUklUmDQ7d2vp+VjqgUWD51mGxhZZ1FPdPP9Hcj0vsgGUKX+zEBGp/vzB1O5PZUxWT/Euq5fu39M9dm9wg==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-exponentiation-operator@7.28.5': - resolution: {integrity: sha512-D4WIMaFtwa2NizOp+dnoFjRez/ClKiC2BqqImwKd1X28nqBtZEyCYJ2ozQrrzlxAFrcrjxo39S6khe9RNDlGzw==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-export-namespace-from@8.0.1': + resolution: {integrity: sha512-bFzznm46bvWGaTYKle3iolbBJ+oPBfUjwCPesxlFE3SQ7DaY9EHf/8Y5ZzrodKJi8JDdcAyaVWaDUSVyhULh0g==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-export-namespace-from@7.27.1': - resolution: {integrity: sha512-tQvHWSZ3/jH2xuq/vZDy0jNn+ZdXJeM8gHvX4lnJmsc3+50yPlWdZXIc5ay+umX+2/tJIqHqiEqcJvxlmIvRvQ==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-for-of@8.0.1': + resolution: {integrity: sha512-rpeXtgELjpIBQH/+YmyFlD9timPEVCyqY+TNednzoeoTYvXSBEeUvYnYE+BK8rB8m6hHiNK7aL9QWKhGifEJCw==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-for-of@7.27.1': - resolution: {integrity: sha512-BfbWFFEJFQzLCQ5N8VocnCtA8J1CLkNTe2Ms2wocj75dd6VpiqS5Z5quTYcUoo4Yq+DN0rtikODccuv7RU81sw==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-function-name@8.0.1': + resolution: {integrity: sha512-H1L/JfPf3CqmubuaiZaquXKQ8MRs4YWSsgRllkTviM8TafcCNnlvc4/fJZ3rXP8HmFM+/Bg+TlsPehUI9BtDFA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-function-name@7.27.1': - resolution: {integrity: sha512-1bQeydJF9Nr1eBCMMbC+hdwmRlsv5XYOMu03YSWFwNs0HsAmtSxxF1fyuYPqemVldVyFmlCU7w8UE14LupUSZQ==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-json-strings@8.0.1': + resolution: {integrity: sha512-Mowp8X0J6p7ZehLU82B5e65te2uuSeDHyxrEROwEAS2VKXNXssfw5ZMqhY7k9iXTsOv1Xs/49G3lDCj9Vvw8qQ==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-json-strings@7.27.1': - resolution: {integrity: sha512-6WVLVJiTjqcQauBhn1LkICsR2H+zm62I3h9faTDKt1qP4jn2o72tSvqMwtGFKGTpojce0gJs+76eZ2uCHRZh0Q==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-literals@8.0.1': + resolution: {integrity: sha512-ai7kfPRcfyUV1EszXoF1PvL3IuJoCuH08WSEPoRcJTWfZZ55VL/rcfvbVY16QLA3jjbzzSneQSoCtD3L6OyUjw==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-literals@7.27.1': - resolution: {integrity: sha512-0HCFSepIpLTkLcsi86GG3mTUzxV5jpmbv97hTETW3yzrAij8aqlD36toB1D0daVFJM8NK6GvKO0gslVQmm+zZA==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-logical-assignment-operators@8.0.1': + resolution: {integrity: sha512-Emvtr5zkEGyCNAmt+qKD5EUh8G0RbxV9EZWrDdX0LuVy5tBq1B3fOIslvVF9aCJmpnwS/AvAT53b9LxAZyXlng==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-logical-assignment-operators@7.28.5': - resolution: {integrity: sha512-axUuqnUTBuXyHGcJEVVh9pORaN6wC5bYfE7FGzPiaWa3syib9m7g+/IT/4VgCOe2Upef43PHzeAvcrVek6QuuA==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-member-expression-literals@8.0.1': + resolution: {integrity: sha512-3Axi9abnyGsm/hh6DsKPZ1Cr9fTtKqS7w0Ig5g12mU269YclpH8pV3xMln2vPLexXgUp6S6L+I06d9/YOLfRKA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-member-expression-literals@7.27.1': - resolution: {integrity: sha512-hqoBX4dcZ1I33jCSWcXrP+1Ku7kdqXf1oeah7ooKOIiAdKQ+uqftgCFNOSzA5AMS2XIHEYeGFg4cKRCdpxzVOQ==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-modules-amd@8.0.1': + resolution: {integrity: sha512-FDdhET8y1YFDNRuoynqSf23WTzbBBpbIB2oRrlFX7YYm9uWtFvJDSD1r/epBSjfPkOjeaaLgRW9xNnt3JGx46A==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-modules-amd@7.27.1': - resolution: {integrity: sha512-iCsytMg/N9/oFq6n+gFTvUYDZQOMK5kEdeYxmxt91fcJGycfxVP9CnrxoliM0oumFERba2i8ZtwRUCMhvP1LnA==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-modules-commonjs@8.0.1': + resolution: {integrity: sha512-PMuzulWrrzFNmY3lXSk/tV9NRb7y0eZZLJY4UEo2TKszroxvUZHAPPi+T9FDyrQhod+TQA+t+8/QYaaMpiEuhA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-modules-commonjs@7.27.1': - resolution: {integrity: sha512-OJguuwlTYlN0gBZFRPqwOGNWssZjfIUdS7HMYtN8c1KmwpwHFBwTeFZrg9XZa+DFTitWOW5iTAG7tyCUPsCCyw==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-modules-systemjs@8.0.1': + resolution: {integrity: sha512-0NEHanXmnFEnfT2dLKTXnu7m8GXFsnxRgteBC2aH21hYMBwAgxu5dcTdi/Eg+ToI1HbZe0CHwz4XRLgRNQhYoQ==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-modules-systemjs@7.29.4': - resolution: {integrity: sha512-N7QmZ0xRZfjHOfZeQLJjwgX2zS9pdGHSVl/cjSGlo4dXMqvurfxXDMKY4RqEKzPozV78VMcd0lxyG13mlbKc4w==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-modules-umd@8.0.1': + resolution: {integrity: sha512-XKTa2J2MdkmbVEeChq9f7Or0VYcsF0NyVBgytRyeN9F+J+ETAB2SHhfkG4toz/ssuU0i+h/QgJ6ddo5YakSQcA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-modules-umd@7.27.1': - resolution: {integrity: sha512-iQBE/xC5BV1OxJbp6WG7jq9IWiD+xxlZhLrdwpPkTX3ydmXdvoCpyfJN7acaIBZaOqTfr76pgzqBJflNbeRK+w==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-named-capturing-groups-regex@8.0.1': + resolution: {integrity: sha512-zCHu+Jr2gTdJE48lN9SV/kXueCW2M79mKtKJc/ttfzzr/jvgdQdCd17RADMqFRQc/25MLxdtjTmlD0HSAMOlIQ==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-named-capturing-groups-regex@7.27.1': - resolution: {integrity: sha512-SstR5JYy8ddZvD6MhV0tM/j16Qds4mIpJTOd1Yu9J9pJjH93bxHECF7pgtc28XvkzTD6Pxcm/0Z73Hvk7kb3Ng==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-new-target@8.0.1': + resolution: {integrity: sha512-QSQxVg1x4PuOuhWUs4Y9u+x9Y+ER8z6G3tC+bDLBzvoOrNLJrEBQLRnwrTP8e5klihAw6Z+e9X5RjdAKcAGapA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-new-target@7.27.1': - resolution: {integrity: sha512-f6PiYeqXQ05lYq3TIfIDu/MtliKUbNwkGApPUvyo6+tc7uaR4cPjPe7DFPr15Uyycg2lZU6btZ575CuQoYh7MQ==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-nullish-coalescing-operator@8.0.1': + resolution: {integrity: sha512-AgCJAmQLF7+PtsK79wJqr4xJ2StHCXlz7JL5CVFP4HejJx25Tk6yl1ZrXvi0cKh3VGDVnfVxefxnrpsBirgpyQ==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-nullish-coalescing-operator@7.27.1': - resolution: {integrity: sha512-aGZh6xMo6q9vq1JGcw58lZ1Z0+i0xB2x0XaauNIUXd6O1xXc3RwoWEBlsTQrY4KQ9Jf0s5rgD6SiNkaUdJegTA==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-numeric-separator@8.0.1': + resolution: {integrity: sha512-it2DmUyLIA1GQUXlFDEnI+/G89mTgxndnAiZYpW8xYR6LboblfirMqiWJeTna5uypQJg7viTT4D1iEURRtFcfw==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-numeric-separator@7.27.1': - resolution: {integrity: sha512-fdPKAcujuvEChxDBJ5c+0BTaS6revLV7CJL08e4m3de8qJfNIuCc2nc7XJYOjBoTMJeqSmwXJ0ypE14RCjLwaw==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-object-rest-spread@8.0.1': + resolution: {integrity: sha512-VmxkDu6bBdbxRzqn6E93hYucug4OVa6svSO19W//vVzNUGAmQzk3QRyHyyEtfcjSLR3NWfRsWwVM9zExLmd+2w==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-object-rest-spread@7.28.4': - resolution: {integrity: sha512-373KA2HQzKhQCYiRVIRr+3MjpCObqzDlyrM6u4I201wL8Mp2wHf7uB8GhDwis03k2ti8Zr65Zyyqs1xOxUF/Ew==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-object-super@8.0.1': + resolution: {integrity: sha512-fDkPXRTRKGm25bAq01q82UM4ypPqdVXCwphUUm4t1dL01fGIG0v8KRvT+4BjhMAtRxtPuI34t5Vs7yjRgs3ZgQ==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-object-super@7.27.1': - resolution: {integrity: sha512-SFy8S9plRPbIcxlJ8A6mT/CxFdJx/c04JEctz4jf8YZaVS2px34j7NXRrlGlHkN/M2gnpL37ZpGRGVFLd3l8Ng==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-optional-catch-binding@8.0.1': + resolution: {integrity: sha512-b2OQ74uGliyATcasTjxGy2O/86UI/n+EN4juB4EMfEwTi9j9uq70PuP0L8fW77vfRY66gO/YoTo/WbIdQ/Si1g==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-optional-catch-binding@7.27.1': - resolution: {integrity: sha512-txEAEKzYrHEX4xSZN4kJ+OfKXFVSWKB2ZxM9dpcE3wT7smwkNmXo5ORRlVzMVdJbD+Q8ILTgSD7959uj+3Dm3Q==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-optional-chaining@8.0.1': + resolution: {integrity: sha512-WtRS1c94lZGpGHxYLXMEWeoMVcuv8nkiyr8BTs6OYZv7N3Y9xVE8nbdFIl4lDJH6aH8/pLhqAQOL69d/WI9WdA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-optional-chaining@7.28.5': - resolution: {integrity: sha512-N6fut9IZlPnjPwgiQkXNhb+cT8wQKFlJNqcZkWlcTqkcqx6/kU4ynGmLFoa4LViBSirn05YAwk+sQBbPfxtYzQ==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-parameters@8.0.1': + resolution: {integrity: sha512-IIwRqroW0CYQwR6+3pnmu27z+H98poScWdnov8z6osumMeEsFxAFBBsDS2CFk2jFpPlGqVr89jK/HXO6i5DzxQ==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-parameters@7.27.7': - resolution: {integrity: sha512-qBkYTYCb76RRxUM6CcZA5KRu8K4SM8ajzVeUgVdMVO9NN9uI/GaVmBg/WKJJGnNokV9SY8FxNOVWGXzqzUidBg==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-private-methods@8.0.1': + resolution: {integrity: sha512-TrFCGcXaVDh6S5IRhmLSRTY9H80VTCMQWnZtzBRg4RWg3KCLmdmsmj4M15kZAPZfoPkWL/SJb4em3Py/vOiX8g==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-private-methods@7.27.1': - resolution: {integrity: sha512-10FVt+X55AjRAYI9BrdISN9/AQWHqldOeZDUoLyif1Kn05a56xVBXb8ZouL8pZ9jem8QpXaOt8TS7RHUIS+GPA==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-private-property-in-object@8.0.1': + resolution: {integrity: sha512-e+yfOqSYBZaf3PARpiQkjZrpWYgmcFLhK+1tevh2CpHR1O9/36IdyPnAZusESX5nzVV/XZTDAtQBRLa8HPT5Dw==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-private-property-in-object@7.27.1': - resolution: {integrity: sha512-5J+IhqTi1XPa0DXF83jYOaARrX+41gOewWbkPyjMNRDqgOCqdffGh8L3f/Ek5utaEBZExjSAzcyjmV9SSAWObQ==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-property-literals@8.0.1': + resolution: {integrity: sha512-Z/qx4cxUtYR1nt7XWRutObPxDks98fEYsjWbVeKEqZH6y3AGknmgzCqmHf2FHWZCl1DfoPeuJY+3hZ+35D+2tg==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-property-literals@7.27.1': - resolution: {integrity: sha512-oThy3BCuCha8kDZ8ZkgOg2exvPYUlprMukKQXI1r1pJ47NCvxfkEy8vK+r/hT9nF0Aa4H1WUPZZjHTFtAhGfmQ==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-regenerator@8.0.2': + resolution: {integrity: sha512-aFfsjCRYducRV4dPnpsBbdRkLjboca9FVDg6HZCgy0Ahvk2ZQ/2exmCRC5qS9P6rsWwrmIheNaIM6A1j2F8KMA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-regenerator@7.28.4': - resolution: {integrity: sha512-+ZEdQlBoRg9m2NnzvEeLgtvBMO4tkFBw5SQIUgLICgTrumLoU7lr+Oghi6km2PFj+dbUt2u1oby2w3BDO9YQnA==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-regexp-modifiers@8.0.1': + resolution: {integrity: sha512-02ITRDBesPdTYU0oShAzERwEPzozOUQSXlz3qrt8JGuhalBJQv9z5NjgHJPC9sS3Fsam8gDtfAEpBnqZwUIdjQ==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-regexp-modifiers@7.27.1': - resolution: {integrity: sha512-TtEciroaiODtXvLZv4rmfMhkCv8jx3wgKpL68PuiPh2M4fvz5jhsA7697N1gMvkvr/JTF13DrFYyEbY9U7cVPA==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-reserved-words@8.0.1': + resolution: {integrity: sha512-+aykZi7ZP3U84veqfJXm3HhPZGddWFi64g7jr0ni6tb1zel+1ey+SL+IRKPoZXFyFqvYEsoqrmx4PyEJRlHl/Q==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-reserved-words@7.27.1': - resolution: {integrity: sha512-V2ABPHIJX4kC7HegLkYoDpfg9PVmuWy/i6vUM5eGK22bx4YVFD3M5F0QQnWQoDs6AGsUWTVOopBiMFQgHaSkVw==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-shorthand-properties@8.0.1': + resolution: {integrity: sha512-JddANd9yPVH8dYgVoNkqAH5BftnsDxFpG51Zas7sc6F3poz5QWcejHNGO8a/57IX5ByjGSzEmYk9Z7ZMa5MWaw==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-shorthand-properties@7.27.1': - resolution: {integrity: sha512-N/wH1vcn4oYawbJ13Y/FxcQrWk63jhfNa7jef0ih7PHSIHX2LB7GWE1rkPrOnka9kwMxb6hMl19p7lidA+EHmQ==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-spread@8.0.1': + resolution: {integrity: sha512-O9Bw9FyxlSw1SlMg3S82/GKNZ0x77RPbHezotEy1JTlIM/vk6WO8jW1iF+iTiKLOXNvi+b+LZ9t77Gi+Q0FhGg==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-spread@7.27.1': - resolution: {integrity: sha512-kpb3HUqaILBJcRFVhFUs6Trdd4mkrzcGXss+6/mxUd273PfbWqSDHRzMT2234gIg2QYfAjvXLSquP1xECSg09Q==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-sticky-regex@8.0.1': + resolution: {integrity: sha512-IsVP6WrZZQdaG2zLmeKwWiI+ua2NB5L1+f77C2/8z2NCDz7uxlIA/lnwocYOJk9PXcOC2sZgRls3LN4XpNduzQ==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-sticky-regex@7.27.1': - resolution: {integrity: sha512-lhInBO5bi/Kowe2/aLdBAawijx+q1pQzicSgnkB6dUPc1+RC8QmJHKf2OjvU+NZWitguJHEaEmbV6VWEouT58g==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-template-literals@8.0.1': + resolution: {integrity: sha512-JXvtj5+BJA9Qv3prDzW2z2DkGTJNmG0BObTdUD03STiu1Jr4fNQkQy3hYZgPL46a2RjcuhwBMYf49BOuJ98gnA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-template-literals@7.27.1': - resolution: {integrity: sha512-fBJKiV7F2DxZUkg5EtHKXQdbsbURW3DZKQUWphDum0uRP6eHGGa/He9mc0mypL680pb+e/lDIthRohlv8NCHkg==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-typeof-symbol@8.0.1': + resolution: {integrity: sha512-+wJoxgxP2gtey0UMUOMhzMMji2XHO/Uu6MXUh/r5Yhc2jngKzK/wFxY2WNe4UCaRcMvCb4gcnB8wIgFXJsocXg==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-typeof-symbol@7.27.1': - resolution: {integrity: sha512-RiSILC+nRJM7FY5srIyc4/fGIwUhyDuuBSdWn4y6yT6gm652DpCHZjIipgn6B7MQ1ITOUnAKWixEUjQRIBIcLw==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-unicode-escapes@8.0.1': + resolution: {integrity: sha512-TAXJepIJ6vZphytTwcf+LuXi2M2ZWI43VCqNw+1ZZLPP/38Z1A8j4Mahvg8kqDgMOSM/cakk+hedTJCiw3jQuQ==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-unicode-escapes@7.27.1': - resolution: {integrity: sha512-Ysg4v6AmF26k9vpfFuTZg8HRfVWzsh1kVfowA23y9j/Gu6dOuahdUVhkLqpObp3JIv27MLSii6noRnuKN8H0Mg==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-unicode-property-regex@8.0.1': + resolution: {integrity: sha512-zjBN9tSMSuomNDfurL69Gf7+v4D2t5uI1mSZaYJDo88SKpbduhCXqtxH7Tx66iCF6caWYwnBzSM0tnCozmQq5Q==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-unicode-property-regex@7.27.1': - resolution: {integrity: sha512-uW20S39PnaTImxp39O5qFlHLS9LJEmANjMG7SxIhap8rCHqu0Ik+tLEPX5DKmHn6CsWQ7j3lix2tFOa5YtL12Q==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-unicode-regex@8.0.1': + resolution: {integrity: sha512-v0oO83cvT5lwbcIVRShpx4vaHD8AvM9IBowsQuTeP+kGmhh3recJQs33Bl6dlo3/2g9amlznLbFGn4VJbPCJqA==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-unicode-regex@7.27.1': - resolution: {integrity: sha512-xvINq24TRojDuyt6JGtHmkVkrfVV3FPT16uytxImLeBZqW3/H52yN+kM1MGuyPkIQxrzKwPHs5U/MP3qKyzkGw==} - engines: {node: '>=6.9.0'} + '@babel/plugin-transform-unicode-sets-regex@8.0.1': + resolution: {integrity: sha512-MlQeyS0K7gh0XNeLBMS/3Z07HjDOKhA7xm2L18GyxOXyiFHI9E+ZuQ4mFYmcLjluXsE/Wf6dABIqZvKpKw0Z3w==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^8.0.0 - '@babel/plugin-transform-unicode-sets-regex@7.27.1': - resolution: {integrity: sha512-EtkOujbc4cgvb0mlpQefi4NTPBzhSIevblFevACNLUspmrALgmEBdL/XfnyyITfd8fKBZrZys92zOWcik7j9Tw==} - engines: {node: '>=6.9.0'} + '@babel/preset-env@8.0.2': + resolution: {integrity: sha512-CUGLn9hNBCF/eXnwdFAWERbniCcXCRvnKwLV9fegeUEIqv7YlU2MepsWMMM54GcILx5XYMnRh+JAL+K5G+mK6g==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@babel/core': ^7.0.0 + '@babel/core': ^8.0.0 - '@babel/preset-env@7.28.5': - resolution: {integrity: sha512-S36mOoi1Sb6Fz98fBfE+UZSpYw5mJm0NUHtIKrOuNcqeFauy1J6dIvXm2KRVKobOSaGq4t/hBXdN4HGU3wL9Wg==} - engines: {node: '>=6.9.0'} + '@babel/preset-modules@0.2.0': + resolution: {integrity: sha512-yz0RBN2fx4fjCeFcTWsWgL7PxSRltvTa0Qg14HkWCU3qS8MO7ZSJlBVbGceynd5C9NsJwwUHNQD3dc6tYO+jqQ==} peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/preset-modules@0.1.6-no-external-plugins': - resolution: {integrity: sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==} - peerDependencies: - '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 - - '@babel/template@7.27.2': - resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} - engines: {node: '>=6.9.0'} + '@babel/core': ^8.0.0 '@babel/template@7.28.6': resolution: {integrity: sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.28.5': - resolution: {integrity: sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==} - engines: {node: '>=6.9.0'} + '@babel/template@8.0.0': + resolution: {integrity: sha512-eAD0QW/AlbamBbw0FeGiwasbCVPq5ncW0HNVyLP3B9czqLyh4gvw+5JTSNt6le9+ziAU7mqDZsKTHf3jTb4chQ==} + engines: {node: ^22.18.0 || >=24.11.0} '@babel/traverse@7.29.0': resolution: {integrity: sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==} engines: {node: '>=6.9.0'} - '@babel/types@7.28.5': - resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==} - engines: {node: '>=6.9.0'} + '@babel/traverse@8.0.4': + resolution: {integrity: sha512-bZnmqzGG8UZneG1lLxBoWIH0G6Gr1D846Yu4/3XnY6FhCndMR49u26nTY08u/dAxWmLWF9vGQOuC+84FfIUoeg==} + engines: {node: ^22.18.0 || >=24.11.0} '@babel/types@7.29.0': resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==} engines: {node: '>=6.9.0'} + '@babel/types@8.0.4': + resolution: {integrity: sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g==} + engines: {node: ^22.18.0 || >=24.11.0} + '@bcoe/v8-coverage@1.0.2': resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} @@ -629,12 +647,22 @@ packages: '@blueoak/list@15.0.0': resolution: {integrity: sha512-xW5Xb9Fr3WtYAOwavxxWL0CaJK/ReT+HKb5/R6dR1p9RVJ55MTdaxPdeTKY2ukhFchv2YHPMM8YuZyfyLqxedg==} + '@borewit/text-codec@0.2.2': + resolution: {integrity: sha512-DDaRehssg1aNrH4+2hnj1B7vnUGEjU6OIlyRdkMd0aUdIUvKXrJfXsy8LVtXAy7DRvYVluWbMspsRhz2lcW0mQ==} + + '@braidai/lang@1.1.2': + resolution: {integrity: sha512-qBcknbBufNHlui137Hft8xauQMTZDKdophmLFv05r2eNmdIv/MlPuP4TdUknHG68UdWLgVZwgxVe735HzJNIwA==} + '@brettz9/eslint-plugin@3.0.0': resolution: {integrity: sha512-QprVr0jsyljALm5HXtXh+1IorN8v2uBYWdEjQ6bJ8Q/al7WOOy6rbne8Ruzy/fvSaEL56f1RdXMyDmMYmAb0MQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: '>=7.20.0' + '@colors/colors@1.5.0': + resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} + engines: {node: '>=0.1.90'} + '@emnapi/core@1.7.1': resolution: {integrity: sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg==} @@ -644,19 +672,25 @@ packages: '@emnapi/wasi-threads@1.1.0': resolution: {integrity: sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==} - '@es-joy/jsdoccomment@0.76.0': - resolution: {integrity: sha512-g+RihtzFgGTx2WYCuTHbdOXJeAlGnROws0TeALx9ow/ZmOROOZkVg5wp/B44n0WJgI4SQFP1eWM2iRPlU2Y14w==} - engines: {node: '>=20.11.0'} + '@es-joy/jsdoccomment@0.90.0': + resolution: {integrity: sha512-51x9KxyTAN6guZOCd+lmcDdkhgdMdP/6iMMtg9dyhCWDc3+iSUyoB7f/9WAM/yGHmGFq25Vd6bXRR7CZcB+tog==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@es-joy/resolve.exports@1.2.0': resolution: {integrity: sha512-Q9hjxWI5xBM+qW2enxfe8wDKdFWMfd0Z29k5ZJnuBqD/CasY5Zryj09aCA6owbGATWz+39p5uIdaHXpopOcG8g==} engines: {node: '>=10'} - '@eslint-community/eslint-plugin-eslint-comments@4.5.0': - resolution: {integrity: sha512-MAhuTKlr4y/CE3WYX26raZjy+I/kS2PLKSzvfmDCGrBLTFHOYwqROZdr4XwPgXwX3K9rjzMr4pSmUWGnzsUyMg==} + '@eslint-community/eslint-plugin-eslint-comments@4.7.2': + resolution: {integrity: sha512-LF03qURSwEWm2dz5wtdDCzNk+7Opl0X7q6I3undsaIuNsEiNvRV3BCtqu14Q/6Pzg1tBj44LcxpW2EpSLZStZw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 + + '@eslint-community/eslint-utils@4.10.1': + resolution: {integrity: sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 '@eslint-community/eslint-utils@4.9.0': resolution: {integrity: sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==} @@ -664,52 +698,57 @@ packages: peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.12.1': - resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint-community/regexpp@4.12.2': resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/config-array@0.21.1': - resolution: {integrity: sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/config-array@0.23.5': + resolution: {integrity: sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@eslint/config-helpers@0.4.2': - resolution: {integrity: sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/config-helpers@0.7.0': + resolution: {integrity: sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@eslint/core@0.17.0': - resolution: {integrity: sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/core@1.2.1': + resolution: {integrity: sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@eslint/eslintrc@3.3.1': - resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/css-tree@4.0.5': + resolution: {integrity: sha512-iPmijIAq4hlIJB86PYmY/fcZORHtjphSqICDbwuw32A/JmkhZQ/K/6TjHE03zqf3n5yABpVcbRAMG8Mi9ojy8g==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@eslint/js@9.39.1': - resolution: {integrity: sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/js@10.0.1': + resolution: {integrity: sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + peerDependencies: + eslint: ^10.0.0 + peerDependenciesMeta: + eslint: + optional: true - '@eslint/markdown@7.5.1': - resolution: {integrity: sha512-R8uZemG9dKTbru/DQRPblbJyXpObwKzo8rv1KYGGuPUPtjM4LXBYM9q5CIZAComzZupws3tWbDwam5AFpPLyJQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/markdown@8.0.3': + resolution: {integrity: sha512-rBTSSShrq7e4O+PWfeE4azH4/CWPNrC+VGxBXiW00o3vYVJnznsZiDayj3KC9JztIMVRZxZHn2nrDIUau/4j7A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@eslint/object-schema@2.1.7': - resolution: {integrity: sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/object-schema@3.0.5': + resolution: {integrity: sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@eslint/plugin-kit@0.4.1': - resolution: {integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/plugin-kit@0.7.2': + resolution: {integrity: sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@fintechstudios/eslint-plugin-chai-as-promised@3.1.0': resolution: {integrity: sha512-Y3TmITTwc5u8hoW0GWxle1hKiVadDqDHyLQaTv+e+xVDHazn361QIEY9NbWqNsXP0jzrSskpnhkBr++h+PciEw==} engines: {node: '>=8.10.0'} - '@gerrit0/mini-shiki@3.15.0': - resolution: {integrity: sha512-L5IHdZIDa4bG4yJaOzfasOH/o22MCesY0mx+n6VATbaiCtMeR59pdRqYk4bEiQkIHfxsHPNgdi7VJlZb2FhdMQ==} + '@gar/promise-retry@1.0.3': + resolution: {integrity: sha512-GmzA9ckNokPypTg10pgpeHNQe7ph+iIKKmhKu3Ob9ANkswreCx7R3cKmY781K8QK3AqVL3xVh9A42JvIAbkkSA==} + engines: {node: ^20.17.0 || >=22.9.0} + + '@gerrit0/mini-shiki@3.23.0': + resolution: {integrity: sha512-bEMORlG0cqdjVyCEuU0cDQbORWX+kYCeo0kV1lbxF5bt4r7SID2l9bqsxJEM0zndaxpOUT7riCyIVEuqq/Ynxg==} '@humanfs/core@0.19.1': resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} @@ -731,6 +770,10 @@ packages: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + '@isaacs/string-locale-compare@1.1.0': resolution: {integrity: sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ==} @@ -745,9 +788,6 @@ packages: '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} - '@jridgewell/remapping@2.3.5': - resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} - '@jridgewell/resolve-uri@3.1.2': resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} @@ -773,15 +813,18 @@ packages: peerDependencies: jsep: ^0.4.0||^1.0.0 + '@loaderkit/resolve@1.0.6': + resolution: {integrity: sha512-G8FdIoF5CypfwmD9rl8BXod5HDn8JqB0CCNBXDTaRZ+yRYhARrrSToX1zg1zy9jX3zLqigsELwhT4gNtkdQAUg==} + '@mdn/browser-compat-data@5.7.6': resolution: {integrity: sha512-7xdrMX0Wk7grrTZQwAoy1GkvPMFoizStUoL+VmtUkAxegbCCec+3FKwOM6yc/uGU5+BEczQHXAlWiqvM8JeENg==} + '@mdn/browser-compat-data@6.1.5': + resolution: {integrity: sha512-PzdZZzRhcXvKB0begee28n5lvwAcinGKYuLZOVxHAZm+n7y01ddEGfdS1ZXRuVcV+ndG6mSEAE8vgudom5UjYg==} + '@napi-rs/wasm-runtime@0.2.12': resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==} - '@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1': - resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} - '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -794,67 +837,63 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@nolyfill/is-core-module@1.0.39': - resolution: {integrity: sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==} - engines: {node: '>=12.4.0'} - - '@npmcli/agent@2.2.2': - resolution: {integrity: sha512-OrcNPXdpSl9UX7qPVRWbmWMCSXrcDa2M9DvrbOTj7ao1S4PlqVFYv9/yLKMkrJKZ/V5A/kDBC690or307i26Og==} - engines: {node: ^16.14.0 || >=18.0.0} + '@npmcli/agent@4.0.2': + resolution: {integrity: sha512-EUEuWAxnL07Sp5/iC/1X6Xj+XThUvnbei9zfRWZdEXa7lss9RTHMhAHBeg+MZ5To9s/gGaSI+UwZTPdYMvKSeg==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/arborist@7.5.4': - resolution: {integrity: sha512-nWtIc6QwwoUORCRNzKx4ypHqCk3drI+5aeYdMTQQiRCcn4lOOgfQh7WyZobGYTxXPSq1VwV53lkpN/BRlRk08g==} - engines: {node: ^16.14.0 || >=18.0.0} + '@npmcli/arborist@9.9.0': + resolution: {integrity: sha512-tzsb1R8mx0k0drlLDT/9ckEYaQHIaWnUti/ci2IaFoQqdqwfmYrc+90p1+QEZC/ocvqcxBep9P1xKw4FbAGofw==} + engines: {node: ^20.17.0 || >=22.9.0} hasBin: true - '@npmcli/fs@3.1.1': - resolution: {integrity: sha512-q9CRWjpHCMIh5sVyefoD1cA7PkvILqCZsnSOEUUivORLjxCO/Irmue2DprETiNgEqktDBZaM1Bi+jrarx1XdCg==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + '@npmcli/fs@5.0.0': + resolution: {integrity: sha512-7OsC1gNORBEawOa5+j2pXN9vsicaIOH5cPXxoR6fJOmH6/EXpJB2CajXOu1fPRFun2m1lktEFX11+P89hqO/og==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/git@5.0.8': - resolution: {integrity: sha512-liASfw5cqhjNW9UFd+ruwwdEf/lbOAQjLL2XY2dFW/bkJheXDYZgOyul/4gVvEV4BWkTXjYGmDqMw9uegdbJNQ==} - engines: {node: ^16.14.0 || >=18.0.0} + '@npmcli/git@7.0.2': + resolution: {integrity: sha512-oeolHDjExNAJAnlYP2qzNjMX/Xi9bmu78C9dIGr4xjobrSKbuMYCph8lTzn4vnW3NjIqVmw/f8BCfouqyJXlRg==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/installed-package-contents@2.1.0': - resolution: {integrity: sha512-c8UuGLeZpm69BryRykLuKRyKFZYJsZSCT4aVY5ds4omyZqJ172ApzgfKJ5eV/r3HgLdUYgFVe54KSFVjKoe27w==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + '@npmcli/installed-package-contents@4.0.0': + resolution: {integrity: sha512-yNyAdkBxB72gtZ4GrwXCM0ZUedo9nIbOMKfGjt6Cu6DXf0p8y1PViZAKDC8q8kv/fufx0WTjRBdSlyrvnP7hmA==} + engines: {node: ^20.17.0 || >=22.9.0} hasBin: true - '@npmcli/map-workspaces@3.0.6': - resolution: {integrity: sha512-tkYs0OYnzQm6iIRdfy+LcLBjcKuQCeE5YLb8KnrIlutJfheNaPvPpgoFEyEFgbjzl5PLZ3IA/BWAwRU0eHuQDA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + '@npmcli/map-workspaces@5.0.3': + resolution: {integrity: sha512-o2grssXo1e774E5OtEwwrgoszYRh0lqkJH+Pb9r78UcqdGJRDRfhpM8DvZPjzNLLNYeD/rNbjOKM3Ss5UABROw==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/metavuln-calculator@7.1.1': - resolution: {integrity: sha512-Nkxf96V0lAx3HCpVda7Vw4P23RILgdi/5K1fmj2tZkWIYLpXAN8k2UVVOsW16TsS5F8Ws2I7Cm+PU1/rsVF47g==} - engines: {node: ^16.14.0 || >=18.0.0} + '@npmcli/metavuln-calculator@9.0.3': + resolution: {integrity: sha512-94GLSYhLXF2t2LAC7pDwLaM4uCARzxShyAQKsirmlNcpidH89VA4/+K1LbJmRMgz5gy65E/QBBWQdUvGLe2Frg==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/name-from-folder@2.0.0': - resolution: {integrity: sha512-pwK+BfEBZJbKdNYpHHRTNBwBoqrN/iIMO0AiGvYsp3Hoaq0WbgGSWQR6SCldZovoDpY3yje5lkFUe6gsDgJ2vg==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + '@npmcli/name-from-folder@4.0.0': + resolution: {integrity: sha512-qfrhVlOSqmKM8i6rkNdZzABj8MKEITGFAY+4teqBziksCQAOLutiAxM1wY2BKEd8KjUSpWmWCYxvXr0y4VTlPg==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/node-gyp@3.0.0': - resolution: {integrity: sha512-gp8pRXC2oOxu0DUE1/M3bYtb1b3/DbJ5aM113+XJBgfXdussRAsX0YOrOhdd8WvnAR6auDBvJomGAkLKA5ydxA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + '@npmcli/node-gyp@5.0.0': + resolution: {integrity: sha512-uuG5HZFXLfyFKqg8QypsmgLQW7smiRjVc45bqD/ofZZcR/uxEjgQU8qDPv0s9TEeMUiAAU/GC5bR6++UdTirIQ==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/package-json@5.2.1': - resolution: {integrity: sha512-f7zYC6kQautXHvNbLEWgD/uGu1+xCn9izgqBfgItWSx22U0ZDekxN08A1vM8cTxj/cRVe0Q94Ode+tdoYmIOOQ==} - engines: {node: ^16.14.0 || >=18.0.0} + '@npmcli/package-json@7.0.5': + resolution: {integrity: sha512-iVuTlG3ORq2iaVa1IWUxAO/jIp77tUKBhoMjuzYW2kL4MLN1bi/ofqkZ7D7OOwh8coAx1/S2ge0rMdGv8sLSOQ==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/promise-spawn@7.0.2': - resolution: {integrity: sha512-xhfYPXoV5Dy4UkY0D+v2KkwvnDfiA/8Mt3sWCGI/hM03NsYIH8ZaG6QzS9x7pje5vHZBZJ2v6VRFVTWACnqcmQ==} - engines: {node: ^16.14.0 || >=18.0.0} + '@npmcli/promise-spawn@9.0.1': + resolution: {integrity: sha512-OLUaoqBuyxeTqUvjA3FZFiXUfYC1alp3Sa99gW3EUDz3tZ3CbXDdcZ7qWKBzicrJleIgucoWamWH1saAmH/l2Q==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/query@3.1.0': - resolution: {integrity: sha512-C/iR0tk7KSKGldibYIB9x8GtO/0Bd0I2mhOaDb8ucQL/bQVTmGoeREaFj64Z5+iCBRf3dQfed0CjJL7I8iTkiQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + '@npmcli/query@5.0.0': + resolution: {integrity: sha512-8TZWfTQOsODpLqo9SVhVjHovmKXNpevHU0gO9e+y4V4fRIOneiXy0u0sMP9LmS71XivrEWfZWg50ReH4WRT4aQ==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/redact@2.0.1': - resolution: {integrity: sha512-YgsR5jCQZhVmTJvjduTOIHph0L73pK8xwMVaDY0PatySqVM9AZj93jpoXYSJqfHFxFkN9dmqTw6OiqExsS3LPw==} - engines: {node: ^16.14.0 || >=18.0.0} + '@npmcli/redact@4.0.0': + resolution: {integrity: sha512-gOBg5YHMfZy+TfHArfVogwgfBeQnKbbGo3pSUyK/gSI0AVu+pEiDVcKlQb0D8Mg1LNRZILZ6XG8I5dJ4KuAd9Q==} + engines: {node: ^20.17.0 || >=22.9.0} - '@npmcli/run-script@8.1.0': - resolution: {integrity: sha512-y7efHHwghQfk28G2z3tlZ67pLG0XdfYbcVG26r7YIXALRsrVQcTq4/tdenSmdOrEsNahIYA/eh8aEVROWGFUDg==} - engines: {node: ^16.14.0 || >=18.0.0} + '@npmcli/run-script@10.0.4': + resolution: {integrity: sha512-mGUWr1uMnf0le2TwfOZY4SFxZGXGfm4Jtay/nwAa2FLNAKXUoUwaGwBMNH36UHPtinWfTSJ3nqFQr0091CxVGg==} + engines: {node: ^20.17.0 || >=22.9.0} '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} @@ -872,13 +911,13 @@ packages: resolution: {integrity: sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==} engines: {node: '>=12'} - '@rollup/plugin-babel@6.1.0': - resolution: {integrity: sha512-dFZNuFD2YRcoomP4oYf+DvQNSUA9ih+A3vUqopQx5EdtPGo3WBnQcI/S8pwpz91UsGfL0HsMSOlaMld8HrbubA==} + '@rollup/plugin-babel@7.1.0': + resolution: {integrity: sha512-h9Y+xYha6p4wKO+FwdiPIkE+eIYCm8MzZPpX1iARIoFBnmKP9CnpT1p9dDf/DTFm6fyN8PmuLyRI5qZgchnitw==} engines: {node: '>=14.0.0'} peerDependencies: '@babel/core': ^7.0.0 '@types/babel__core': ^7.1.9 - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + rollup: ^2.0.0||^3.0.0||^4.0.0 peerDependenciesMeta: '@types/babel__core': optional: true @@ -894,9 +933,9 @@ packages: rollup: optional: true - '@rollup/plugin-terser@0.4.4': - resolution: {integrity: sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==} - engines: {node: '>=14.0.0'} + '@rollup/plugin-terser@1.0.0': + resolution: {integrity: sha512-FnCxhTBx6bMOYQrar6C8h3scPt8/JwIzw3+AJ2K++6guogH5fYaIFia+zZuhqv0eo1RN7W1Pz630SyvLbDjhtQ==} + engines: {node: '>=20.0.0'} peerDependencies: rollup: ^2.0.0||^3.0.0||^4.0.0 peerDependenciesMeta: @@ -912,141 +951,141 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.59.0': - resolution: {integrity: sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==} + '@rollup/rollup-android-arm-eabi@4.62.3': + resolution: {integrity: sha512-c0wdcekXtQvvn5Tsrk/+op/gUArrbWaFduBnTLP2l1cKLSQs4diMWjJw3m6A0DdzT8dAAX95KpkJ3qynCePbmw==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.59.0': - resolution: {integrity: sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==} + '@rollup/rollup-android-arm64@4.62.3': + resolution: {integrity: sha512-3YjElDdWN+qXAFbJ/CzPV+0wspLqh54k/I6GfdYtEJRqg7buSgc1yPM3B+93j1M4neobtkATHZTmxK2AMVGfnA==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.59.0': - resolution: {integrity: sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==} + '@rollup/rollup-darwin-arm64@4.62.3': + resolution: {integrity: sha512-Pch2pFNOxxz1hTjypIdPyRTR6riiwRl84+VcN9djS680fw+Co1nAJINrdpqp7KV0NvyuU8ilZXZCjd7ykJl1GQ==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.59.0': - resolution: {integrity: sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==} + '@rollup/rollup-darwin-x64@4.62.3': + resolution: {integrity: sha512-LEuncFUHFiF8t4yZVZvvZA1wk0pjAscRnsrn1EfTEmN4HXotBi2YtcnLRyaK6UbuczW7xZS5ES+81Rdz8Z0T6g==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.59.0': - resolution: {integrity: sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==} + '@rollup/rollup-freebsd-arm64@4.62.3': + resolution: {integrity: sha512-zvBUvsQUpOWALdDsk6qbS8bXf2VxmPisuudNDrY7x0p0jBdsoZl8HsHczIOgkQiZldmcacMKtBzpoGVNeIe2bQ==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.59.0': - resolution: {integrity: sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==} + '@rollup/rollup-freebsd-x64@4.62.3': + resolution: {integrity: sha512-C2KmNrcSem/AMg984H/dev+si0lieQGdXdR/lYGJnuumXnFb9Y7QdiI62obFdLlxRYLBv4P0eUVIDbD4c1vVvw==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.59.0': - resolution: {integrity: sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==} + '@rollup/rollup-linux-arm-gnueabihf@4.62.3': + resolution: {integrity: sha512-ggXnsTAEzNQx74XpunRsiZ9aBZDsI7XIa0hm2nzR9f4WzH5/f/d73ZSDaC5ejJ8YLY4NW+V3wr0tjOaeCq8hqA==} cpu: [arm] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm-musleabihf@4.59.0': - resolution: {integrity: sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==} + '@rollup/rollup-linux-arm-musleabihf@4.62.3': + resolution: {integrity: sha512-2vng+FlzNUhKZxtej3IUqJgbZoQk2M/dwQM20+ULV0R/E/8tr9/P6uEf2iiGIk4HL0zMKh5Jry7mUHdUOvyGgA==} cpu: [arm] os: [linux] libc: [musl] - '@rollup/rollup-linux-arm64-gnu@4.59.0': - resolution: {integrity: sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==} + '@rollup/rollup-linux-arm64-gnu@4.62.3': + resolution: {integrity: sha512-LLLFZKt4/Nraf9rxDkhiU8QVgLF4WmCkfr0L4fj0fPfIZFBib0DeiFk1hhaYKd03LFAFJcxHslhDFlNJLylf5Q==} cpu: [arm64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm64-musl@4.59.0': - resolution: {integrity: sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==} + '@rollup/rollup-linux-arm64-musl@4.62.3': + resolution: {integrity: sha512-WJkdQCvS9sWNOUBJZfQRKpZGFBztRzcowI+nndmflKgU4XY+3a420FgTOSKTsVqJbnzSxeT4vaJalpOaPo2YCQ==} cpu: [arm64] os: [linux] libc: [musl] - '@rollup/rollup-linux-loong64-gnu@4.59.0': - resolution: {integrity: sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==} + '@rollup/rollup-linux-loong64-gnu@4.62.3': + resolution: {integrity: sha512-PwHXCCS2n64/1Ot6rP1YEYA02MGYBcQlr8CSZZyrUG2O7NH6NklYmvr9v3Jy+5e/eDeNchc/ukmKJi9LuflMIQ==} cpu: [loong64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-loong64-musl@4.59.0': - resolution: {integrity: sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==} + '@rollup/rollup-linux-loong64-musl@4.62.3': + resolution: {integrity: sha512-vUjxINQu3RC8NZS3ykk1gN65gIz8pAopOq2HXuZhiIxHdx7TFvDG+jgrdSgInu1Eza4/Rfi2VzZgyIgEH4WOaw==} cpu: [loong64] os: [linux] libc: [musl] - '@rollup/rollup-linux-ppc64-gnu@4.59.0': - resolution: {integrity: sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==} + '@rollup/rollup-linux-ppc64-gnu@4.62.3': + resolution: {integrity: sha512-wzko4aJ13+0G3kGnviCg5gnXFKd40izKsrf2uOw12US4XqprkDrmwOpeW14aSNa37V8bfPcz5Fkob6LZ3BAPmA==} cpu: [ppc64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-ppc64-musl@4.59.0': - resolution: {integrity: sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==} + '@rollup/rollup-linux-ppc64-musl@4.62.3': + resolution: {integrity: sha512-8120ue0JUMSwy11stlwnfdX3pPd+WZYGCDBwEHWtIHi6pOpZmsEF5QKB7a/UN+XFdqvobxz98kv8RTqikyCEBw==} cpu: [ppc64] os: [linux] libc: [musl] - '@rollup/rollup-linux-riscv64-gnu@4.59.0': - resolution: {integrity: sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==} + '@rollup/rollup-linux-riscv64-gnu@4.62.3': + resolution: {integrity: sha512-XLFHnR3tXMjbOCh2vtVJHmxt+995uJsTERQyseFDRA0xxMxyTZPLa3OIUlyFaO4mF/Lu0FjmWHCuPXJT1n/IOg==} cpu: [riscv64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-riscv64-musl@4.59.0': - resolution: {integrity: sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==} + '@rollup/rollup-linux-riscv64-musl@4.62.3': + resolution: {integrity: sha512-se6yXvNGMIl0f+RQzyh7XAmia8/9kplQx424wnG2w0C1oi6XgO6Y8otKhdXFHbHs88Ihavzmvh1NWjuovE76BQ==} cpu: [riscv64] os: [linux] libc: [musl] - '@rollup/rollup-linux-s390x-gnu@4.59.0': - resolution: {integrity: sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==} + '@rollup/rollup-linux-s390x-gnu@4.62.3': + resolution: {integrity: sha512-gNoxRefktVIiGflpONuxWWXZAzIQG++z9qHO3xKwk4WdDMuQja3JHGfE1u0i3PfPDyvhypdk+WrgIJqLhGG7sg==} cpu: [s390x] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.59.0': - resolution: {integrity: sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==} + '@rollup/rollup-linux-x64-gnu@4.62.3': + resolution: {integrity: sha512-V4KtWtQfAFMU7+9/A/VDps/VI8CHd3cYz0L8sgJzz8qK7eY7wI4ruFD82UYIYvW9Z4DtlTfhQcsl4XyPHW5uSg==} cpu: [x64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-musl@4.59.0': - resolution: {integrity: sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==} + '@rollup/rollup-linux-x64-musl@4.62.3': + resolution: {integrity: sha512-LBx9LYXvj2CBkMkjLdNAWLwH0MLMin7do2VcVo9kVPibGLkY0BQQut2fv7NVqkXqZ/CrAu9LqDHVV1xHCMpCPw==} cpu: [x64] os: [linux] libc: [musl] - '@rollup/rollup-openbsd-x64@4.59.0': - resolution: {integrity: sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==} + '@rollup/rollup-openbsd-x64@4.62.3': + resolution: {integrity: sha512-ABVf3Q0RCu7NcyCCOZQI0pJ3GuSdfSl8EXcy88QtdceIMIoCUdfhsJChZ64L9zVM2aJHjde1Bhn5uqSRcX9ySA==} cpu: [x64] os: [openbsd] - '@rollup/rollup-openharmony-arm64@4.59.0': - resolution: {integrity: sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==} + '@rollup/rollup-openharmony-arm64@4.62.3': + resolution: {integrity: sha512-+2Cy/ldweGBLlPIKsQLF8U5N44a0KDdbrk1rAjHOM9M2K+kGdIVjHLmmrZIcx+9Ny3ke/1JomCsDI1ocb11+sg==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.59.0': - resolution: {integrity: sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==} + '@rollup/rollup-win32-arm64-msvc@4.62.3': + resolution: {integrity: sha512-dtZvzc8BedpSaFNy75x6uiWwAGTH+aZHDtdrqP6qk+WcLJrfti6sGje1ZJ9UxyzDLF23d/mV+PaMwuC0hL7UVA==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.59.0': - resolution: {integrity: sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==} + '@rollup/rollup-win32-ia32-msvc@4.62.3': + resolution: {integrity: sha512-Rj8Ra4noo+aYy7sKBggCx0407mws34kAb1ySyWuq5DAtFBQdkSwnsjCgPrhPe9cvgBKZIukpE+CVHvORCS93kQ==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.59.0': - resolution: {integrity: sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==} + '@rollup/rollup-win32-x64-gnu@4.62.3': + resolution: {integrity: sha512-vp7N084ew/odXn2gi/mzm9mUkQu9l6AiN6dt4IeUM2Uvm9o+cVmP+YkqbMOteLbiGgqBBlJZjIMYVCfOOIVbVQ==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.59.0': - resolution: {integrity: sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==} + '@rollup/rollup-win32-x64-msvc@4.62.3': + resolution: {integrity: sha512-MOG/3gTOn4Fwf574RVOaY61I5o6P90legkFADiTyn1hyjNydT+cerU2rLUwPdZkKKyJ+iT+K9p7WXK4LM1Ka6g==} cpu: [x64] os: [win32] @@ -1057,67 +1096,75 @@ packages: '@rtsao/scc@1.1.0': resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} - '@shikijs/engine-oniguruma@3.15.0': - resolution: {integrity: sha512-HnqFsV11skAHvOArMZdLBZZApRSYS4LSztk2K3016Y9VCyZISnlYUYsL2hzlS7tPqKHvNqmI5JSUJZprXloMvA==} + '@shikijs/engine-oniguruma@3.23.0': + resolution: {integrity: sha512-1nWINwKXxKKLqPibT5f4pAFLej9oZzQTsby8942OTlsJzOBZ0MWKiwzMsd+jhzu8YPCHAswGnnN1YtQfirL35g==} - '@shikijs/langs@3.15.0': - resolution: {integrity: sha512-WpRvEFvkVvO65uKYW4Rzxs+IG0gToyM8SARQMtGGsH4GDMNZrr60qdggXrFOsdfOVssG/QQGEl3FnJ3EZ+8w8A==} + '@shikijs/langs@3.23.0': + resolution: {integrity: sha512-2Ep4W3Re5aB1/62RSYQInK9mM3HsLeB91cHqznAJMuylqjzNVAVCMnNWRHFtcNHXsoNRayP9z1qj4Sq3nMqYXg==} - '@shikijs/themes@3.15.0': - resolution: {integrity: sha512-8ow2zWb1IDvCKjYb0KiLNrK4offFdkfNVPXb1OZykpLCzRU6j+efkY+Y7VQjNlNFXonSw+4AOdGYtmqykDbRiQ==} + '@shikijs/themes@3.23.0': + resolution: {integrity: sha512-5qySYa1ZgAT18HR/ypENL9cUSGOeI2x+4IvYJu4JgVJdizn6kG4ia5Q1jDEOi7gTbN4RbuYtmHh0W3eccOrjMA==} - '@shikijs/types@3.15.0': - resolution: {integrity: sha512-BnP+y/EQnhihgHy4oIAN+6FFtmfTekwOLsQbRw9hOKwqgNy8Bdsjq8B05oAt/ZgvIWWFrshV71ytOrlPfYjIJw==} + '@shikijs/types@3.23.0': + resolution: {integrity: sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ==} '@shikijs/vscode-textmate@10.0.2': resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} - '@sigstore/bundle@2.3.2': - resolution: {integrity: sha512-wueKWDk70QixNLB363yHc2D2ItTgYiMTdPwK8D9dKQMR3ZQ0c35IxP5xnwQ8cNLoCgCRcHf14kE+CLIvNX1zmA==} - engines: {node: ^16.14.0 || >=18.0.0} + '@sigstore/bundle@4.0.0': + resolution: {integrity: sha512-NwCl5Y0V6Di0NexvkTqdoVfmjTaQwoLM236r89KEojGmq/jMls8S+zb7yOwAPdXvbwfKDlP+lmXgAL4vKSQT+A==} + engines: {node: ^20.17.0 || >=22.9.0} - '@sigstore/core@1.1.0': - resolution: {integrity: sha512-JzBqdVIyqm2FRQCulY6nbQzMpJJpSiJ8XXWMhtOX9eKgaXXpfNOF53lzQEjIydlStnd/eFtuC1dW4VYdD93oRg==} - engines: {node: ^16.14.0 || >=18.0.0} + '@sigstore/core@3.2.1': + resolution: {integrity: sha512-qRsxPnCrbC/puegGxKuynfnxgLiHqWStrSjxkoB4YKqq3Z3s4cyZyj42ZdWFAEblNP65C+rBH8EuREHIXoi83g==} + engines: {node: ^20.17.0 || >=22.9.0} - '@sigstore/protobuf-specs@0.3.3': - resolution: {integrity: sha512-RpacQhBlwpBWd7KEJsRKcBQalbV28fvkxwTOJIqhIuDysMMaJW47V4OqW30iJB9uRpqOSxxEAQFdr8tTattReQ==} + '@sigstore/protobuf-specs@0.5.1': + resolution: {integrity: sha512-/ScWUhhoFasJsSRGTVBwId1loQjjnjAfE4djL6ZhrXRpNCmPTnUKF5Jokd58ILseOMjzET3UrMOtJPS9sYeI0g==} engines: {node: ^18.17.0 || >=20.5.0} - '@sigstore/sign@2.3.2': - resolution: {integrity: sha512-5Vz5dPVuunIIvC5vBb0APwo7qKA4G9yM48kPWJT+OEERs40md5GoUR1yedwpekWZ4m0Hhw44m6zU+ObsON+iDA==} - engines: {node: ^16.14.0 || >=18.0.0} + '@sigstore/sign@4.1.1': + resolution: {integrity: sha512-Hf4xglukg0XXQ2RiD5vSoLjdPe8OBUPA8XeVjUObheuDcWdYWrnH/BNmxZCzkAy68MzmNCxXLeurJvs6hcP2OQ==} + engines: {node: ^20.17.0 || >=22.9.0} - '@sigstore/tuf@2.3.4': - resolution: {integrity: sha512-44vtsveTPUpqhm9NCrbU8CWLe3Vck2HO1PNLw7RIajbB7xhtn5RBPm1VNSCMwqGYHhDsBJG8gDF0q4lgydsJvw==} - engines: {node: ^16.14.0 || >=18.0.0} + '@sigstore/tuf@4.0.2': + resolution: {integrity: sha512-TCAzTy0xzdP79EnxSjq9KQ3eaR7+FmudLC6eRKknVKZbV7ZNlGLClAAQb/HMNJ5n2OBNk2GT1tEmU0xuPr+SLQ==} + engines: {node: ^20.17.0 || >=22.9.0} - '@sigstore/verify@1.2.1': - resolution: {integrity: sha512-8iKx79/F73DKbGfRf7+t4dqrc0bRr0thdPrxAtCKWRm/F0tG71i6O1rvlnScncJLLBZHn3h8M3c1BSUAb9yu8g==} - engines: {node: ^16.14.0 || >=18.0.0} + '@sigstore/verify@3.1.1': + resolution: {integrity: sha512-qv7+G3J2cc6wwFj3yKvXOamzqhMwSk1ogPGmhpS8iXllcPrJaIIBA+4HbttlHVu1pqWTdmaCH/WE7UOC51kdoA==} + engines: {node: ^20.17.0 || >=22.9.0} '@sindresorhus/base62@1.0.0': resolution: {integrity: sha512-TeheYy0ILzBEI/CO55CP6zJCSdSWeRtGnHy8U8dWSUH4I68iqTsy7HkMktR4xakThc9jotkPQUXT4ITdbV7cHA==} engines: {node: '>=18'} + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + '@sindresorhus/is@5.6.0': resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==} engines: {node: '>=14.16'} - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} + '@sindresorhus/merge-streams@4.0.0': + resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} engines: {node: '>=18'} - '@stylistic/eslint-plugin@5.6.0': - resolution: {integrity: sha512-owEc4B8ME+O/xyZOkLVyLqPMsUgJXIM4XzCm5Vt3WvRXpyoOfYxgA+JkEiFqXPCI8+Nc2BzAT+KGAK7QleGs8Q==} + '@stylistic/eslint-plugin@5.10.0': + resolution: {integrity: sha512-nPK52ZHvot8Ju/0A4ucSX1dcPV2/1clx0kLcH5wDmrE4naKso7TUC/voUyU1O9OTKTrR6MYip6LP0ogEMQ9jPQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: '>=9.0.0' + eslint: ^9.0.0 || ^10.0.0 '@szmarczak/http-timer@5.0.1': resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} engines: {node: '>=14.16'} + '@tokenizer/inflate@0.4.1': + resolution: {integrity: sha512-2mAv+8pkG6GIZiF1kNg1jAjh27IDxEPKwdGul3snfztFerfPGI1LjDezZp3i7BElXompqEtPmoPx6c2wgtWsOA==} + engines: {node: '>=18'} + '@tokenizer/token@0.3.0': resolution: {integrity: sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==} @@ -1129,22 +1176,31 @@ packages: resolution: {integrity: sha512-yVtV8zsdo8qFHe+/3kw81dSLyF7D576A5cCFCi4X7B39tWT7SekaEFUnvnWJHz+9qO7qJTah1JbrDjWKqFtdWA==} engines: {node: ^16.14.0 || >=18.0.0} - '@tufjs/models@2.0.1': - resolution: {integrity: sha512-92F7/SFyufn4DXsha9+QfKnN03JGqtMFMXgSHbZOo8JG59WkTni7UzAouNQDf7AuP9OAMxVOPQcqG3sB7w+kkg==} - engines: {node: ^16.14.0 || >=18.0.0} + '@tufjs/models@4.1.0': + resolution: {integrity: sha512-Y8cK9aggNRsqJVaKUlEYs4s7CvQ1b1ta2DVPyAimb0I2qhzjNk+A+mxvll/klL0RlfuIUei8BF7YWiua4kQqww==} + engines: {node: ^20.17.0 || >=22.9.0} '@tybys/wasm-util@0.10.1': resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} - '@types/estree@1.0.8': - resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/esrecurse@4.3.1': + resolution: {integrity: sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==} '@types/estree@1.0.9': resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + '@types/gensync@1.0.5': + resolution: {integrity: sha512-MbsRCT7mTikHwKZ0X+LVUTLRrZZRLipTuXEO9qOYO+zmjMVk81axyClMROf6uoPD9MRVu46bx8zoR0Ad9q3NAg==} + '@types/hast@3.0.4': resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} @@ -1154,26 +1210,38 @@ packages: '@types/istanbul-lib-coverage@2.0.6': resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + '@types/jsesc@2.5.1': + resolution: {integrity: sha512-9VN+6yxLOPLOav+7PwjZbxiID2bVaeq0ED4qSQmdQTdjnXJSaCVKTR58t15oqH1H5t8Ng2ZX1SabJVoN9Q34bw==} + '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} '@types/json5@0.0.29': resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + '@types/katex@0.16.8': + resolution: {integrity: sha512-trgaNyfU+Xh2Tc+ABIb44a5AYUpicB3uwirOioeOkNPPbmgRNtcWyDeeFRzjPZENO9Vq8gvVqfhaaXWLlevVwg==} + '@types/mdast@4.0.4': resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} + '@types/mocha@10.0.10': + resolution: {integrity: sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==} + '@types/ms@2.1.0': resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} + '@types/node@26.1.2': + resolution: {integrity: sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg==} + '@types/resolve@1.20.2': resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} - '@typescript-eslint/types@8.47.0': - resolution: {integrity: sha512-nHAE6bMKsizhA2uuYZbEbmp5z2UpffNrPEqiKIeN7VsV6UY/roxanWfoRrf6x/k9+Obf+GQdkm0nPU+vnMXo9A==} + '@typescript-eslint/types@8.65.0': + resolution: {integrity: sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@unrs/resolver-binding-android-arm-eabi@1.11.1': @@ -1279,9 +1347,9 @@ packages: cpu: [x64] os: [win32] - abbrev@2.0.0: - resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + abbrev@4.0.0: + resolution: {integrity: sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==} + engines: {node: ^20.17.0 || >=22.9.0} abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} @@ -1297,20 +1365,25 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + acorn@8.17.0: + resolution: {integrity: sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==} + engines: {node: '>=0.4.0'} + hasBin: true + agent-base@7.1.4: resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} engines: {node: '>= 14'} - aggregate-error@3.1.0: - resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} - engines: {node: '>=8'} - ajv@6.15.0: resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} ansi-align@3.0.1: resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} + ansi-escapes@7.3.0: + resolution: {integrity: sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==} + engines: {node: '>=18'} + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -1331,6 +1404,9 @@ packages: resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} engines: {node: '>=12'} + any-promise@1.3.0: + resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} + are-docs-informative@0.0.2: resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==} engines: {node: '>=14'} @@ -1385,6 +1461,10 @@ packages: resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} engines: {node: '>= 0.4'} + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + ast-metadata-inferer@0.8.1: resolution: {integrity: sha512-ht3Dm6Zr7SXv6t1Ra6gFo0+kLDglHGrEbYihTkcycrbHw7WCcuhBzPlJYHEsIpycaUwzsJHje+vUcxXUX4ztTA==} @@ -1402,24 +1482,19 @@ packages: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} - babel-plugin-polyfill-corejs2@0.4.14: - resolution: {integrity: sha512-Co2Y9wX854ts6U8gAAPXfn0GmAyctHuK8n0Yhfjd6t30g7yvKjspvvOo9yG+z52PZRgFErt7Ka2pYnXCjLKEpg==} - peerDependencies: - '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - - babel-plugin-polyfill-corejs3@0.13.0: - resolution: {integrity: sha512-U+GNwMdSFgzVmfhNm8GJUX88AadB3uo9KpJqS3FaqNIPKgySuvMb+bHPsOmmuWyIcuqZj/pzt1RUIUZns4y2+A==} + babel-plugin-polyfill-corejs3@1.0.0: + resolution: {integrity: sha512-yIkslVjbmml2Xjb6XhFW7lISXHsqk6cesxTdDsXoMom4Lnb99DbD3OQbSOoM5Z+ASh8YXYaLAsRQrU2Jeh3Qig==} + engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: - '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - - babel-plugin-polyfill-regenerator@0.6.5: - resolution: {integrity: sha512-ISqQ2frbiNU9vIJkzg7dlPpznPZ4jOiUQ1uSmB0fEHeowtN3COYRsXr/xexn64NpU13P06jc/L5TgiJXOgrbEg==} - peerDependencies: - '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + '@babel/core': ^7.4.0 || ^8.0.0 balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + balanced-match@4.0.4: + resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} + engines: {node: 18 || 20 || >=22} + base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -1428,13 +1503,18 @@ packages: engines: {node: '>=6.0.0'} hasBin: true + baseline-browser-mapping@2.11.4: + resolution: {integrity: sha512-s4+sLr9mZ/CyqeRritFeYV/Zx73OAtmaHn6kkBS1XRoJn1hrg3xIDUcpicAEX68tkcIN0iBCgti31C8zxtkhsQ==} + engines: {node: '>=6.0.0'} + hasBin: true + basic-auth@2.0.1: resolution: {integrity: sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==} engines: {node: '>= 0.8'} - bin-links@4.0.4: - resolution: {integrity: sha512-cMtq4W5ZsEwcutJrVId+a/tjt8GSbS+h0oNkdl6+6rBuEv8Ot33Bevj5KPm40t309zuhVic8NjpuL42QCiJWWA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + bin-links@6.0.2: + resolution: {integrity: sha512-frE1t78WOwJ45PKV2cF2tNPjTcs9L1J9s6VkrV59wanRP4GlaomuxYPVma7BwthMg8WnfSory4w5PTE6FZZ81w==} + engines: {node: ^20.17.0 || >=22.9.0} boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} @@ -1453,6 +1533,10 @@ packages: brace-expansion@2.1.0: resolution: {integrity: sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==} + brace-expansion@5.0.8: + resolution: {integrity: sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==} + engines: {node: 20 || >=22} + braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} @@ -1465,6 +1549,11 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true + browserslist@4.28.7: + resolution: {integrity: sha512-JxV13hNrFxqjOc8alRbq9dK1MM79NEXYpma2B2J4wAtpWS5zIEIKqWPGCl7N4o7Uc7B7itylh7SuDujATRyyTw==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} @@ -1487,9 +1576,9 @@ packages: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} - c8@10.1.3: - resolution: {integrity: sha512-LvcyrOAaOnrrlMpW22n690PUvxiq4Uf9WMhQwNJ9vgagkL/ph1+D4uvjvDA5XCbykrc0sx+ay6pVi9YZ1GnhyA==} - engines: {node: '>=18'} + c8@12.0.0: + resolution: {integrity: sha512-4zpJvrd1nKWutnnKC2pXkFmb6iM1l+ffN//o1CzlTNwW7GSOs9a1xrLqkC48nU8oEkjmPZLPiwMsIaOvoF4Pqg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=23} hasBin: true peerDependencies: monocart-coverage-reports: ^2 @@ -1497,9 +1586,9 @@ packages: monocart-coverage-reports: optional: true - cacache@18.0.4: - resolution: {integrity: sha512-B+L5iIa9mgcjLbliir2th36yEwPftrzteHYujzsx3dFP/31GCHcIeS8f5MGd80odLOjaOvSpU3EEAmRQptkxLQ==} - engines: {node: ^16.14.0 || >=18.0.0} + cacache@20.0.4: + resolution: {integrity: sha512-M3Lab8NPYlZU2exsL3bMVvMrMqgwCnMWfdZbK28bn3pK6APT/Te/I8hjRPNu1uwORY9a1eEQoifXbKPQMfMTOA==} + engines: {node: ^20.17.0 || >=22.9.0} cacheable-lookup@7.0.0: resolution: {integrity: sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==} @@ -1521,10 +1610,6 @@ packages: resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} engines: {node: '>= 0.4'} - callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} - camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} @@ -1544,11 +1629,14 @@ packages: caniuse-lite@1.0.30001793: resolution: {integrity: sha512-iwSsYWaCOoh26cV8NwNRViHlrfUvYsHDfRVcbtmw0Kg6PJIZZXwMkj1442FYLBGkeUf1juAsU3DTfxW579mrPA==} + caniuse-lite@1.0.30001806: + resolution: {integrity: sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==} + ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} - chai@6.2.1: - resolution: {integrity: sha512-p4Z49OGG5W/WBCPSS/dH3jQ73kD6tiMmUM+bckNK6Jr5JHMG3k9bg/BvKR8lKmtVBKmOiuVaV2ws8s9oSbwysg==} + chai@6.2.2: + resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} engines: {node: '>=18'} chalk-template@0.4.0: @@ -1570,6 +1658,10 @@ packages: change-case@5.4.4: resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==} + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + character-entities@2.0.2: resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} @@ -1577,37 +1669,48 @@ packages: resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} engines: {node: '>= 14.16.0'} - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} ci-info@3.9.0: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} - ci-info@4.3.1: - resolution: {integrity: sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==} + ci-info@4.4.0: + resolution: {integrity: sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==} engines: {node: '>=8'} - clean-regexp@1.0.0: - resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==} - engines: {node: '>=4'} - - clean-stack@2.2.0: - resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} - engines: {node: '>=6'} + cjs-module-lexer@1.4.3: + resolution: {integrity: sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==} cli-boxes@3.0.0: resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==} engines: {node: '>=10'} + cli-highlight@2.1.11: + resolution: {integrity: sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==} + engines: {node: '>=8.0.0', npm: '>=5.0.0'} + hasBin: true + + cli-table3@0.6.5: + resolution: {integrity: sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==} + engines: {node: 10.* || >= 12.*} + + cliui@7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} - cmd-shim@6.0.3: - resolution: {integrity: sha512-FMabTRlc5t5zjdenF6mS0MBeFZm0XqHqeOkcskKFb/LYCcRQ5fVgLOHVc4Lq9CqABd9zhjwPjMBCJvMCziSVtA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + cliui@9.0.1: + resolution: {integrity: sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==} + engines: {node: '>=20'} + + cmd-shim@8.0.0: + resolution: {integrity: sha512-Jk/BK6NCapZ58BKUxlSI+ouKRbjH1NLZCgJkYoab+vEHUY3f6OzpNBN9u7HFSv9J6TRDGs4PLOHezoKGaFRSCA==} + engines: {node: ^20.17.0 || >=22.9.0} color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} @@ -1658,6 +1761,10 @@ packages: resolution: {integrity: sha512-PqMLy5+YGwhMh1wS04mVG44oqDsgyLRSKJBdOo1bnYhMKBW65gZF1dRp2OZRhiTjgUHljy99qkO7bsctLaw35Q==} engines: {node: '>=12.20.0'} + commander@10.0.1: + resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} + engines: {node: '>=14'} + commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -1665,12 +1772,21 @@ packages: resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} engines: {node: '>= 10'} + commander@8.3.0: + resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} + engines: {node: '>= 12'} + comment-parser@1.4.1: resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==} engines: {node: '>= 12.0.0'} - common-ancestor-path@1.0.1: - resolution: {integrity: sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==} + comment-parser@1.4.7: + resolution: {integrity: sha512-0h+uSNtQGW3D98eQt3jJ8L06Fves8hncB4V/PKdw/Qb8Hnk19VaKuTr55UNRYiSoVa7WwrFls+rh3ux9agmkeQ==} + engines: {node: '>= 12.0.0'} + + common-ancestor-path@2.0.0: + resolution: {integrity: sha512-dnN3ibLeoRf2HNC+OlCiNc5d2zxbLJXOtiZUudNFSXZrNSydxcCsSpRzXwfu7BBWCIfHPw+xTayeBvJCP/D8Ng==} + engines: {node: '>= 18'} concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -1686,11 +1802,15 @@ packages: resolution: {integrity: sha512-N4oog6YJWbR9kGyXvS7jEykLDXIE2C0ILYqNBZBp9iwiJpoCBWYsuAdW6PPFn6w06jjnC+3JstVvWHO4cZqvRg==} engines: {node: '>=18'} + convert-hrtime@5.0.0: + resolution: {integrity: sha512-lOETlkIeYSJWcbbcvjRKGxVMXJR+8+OQb/mTPbA4ObPMytYIsUbuOE0Jzy60hjARYszq1id0j8KgVhC+WGZVTg==} + engines: {node: '>=12'} + convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - core-js-compat@3.47.0: - resolution: {integrity: sha512-IGfuznZ/n7Kp9+nypamBhvwdwLsW6KC8IOaURw2doAK5e98AG3acVLdh0woOnEqCfUtS+Vu882JE4k/DAm3ItQ==} + core-js-compat@3.49.0: + resolution: {integrity: sha512-VQXt1jr9cBz03b331DFDCCP90b3fanciLkgiOoy8SBHy06gNf+vQ1A3WFLqG7I8TipYIKeYK9wxd0tUrvHcOZA==} correct-license-metadata@1.4.0: resolution: {integrity: sha512-nvbNpK/aYCbztZWGi9adIPqR+ZcQmZTWNT7eMYLvkaVGroN1nTHiVuuNPl7pK6ZNx1mvDztlRBJtfUdrVwKJ5A==} @@ -1818,6 +1938,10 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} + detect-indent@7.0.2: + resolution: {integrity: sha512-y+8xyqdGLL+6sh0tVeHcfP/QDd8gUgbasolJJpY7NgeQGSZ739bDtSiaiDgtoicy+mtYB81dKLxO9xRhCyIB3A==} + engines: {node: '>=12.20'} + devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} @@ -1879,6 +2003,9 @@ packages: electron-to-chromium@1.5.255: resolution: {integrity: sha512-Z9oIp4HrFF/cZkDPMpz2XSuVpc1THDpT4dlmATFlJUIBVCy9Vap5/rIXsASP1CscBacBqhabwh8vLctqBwEerQ==} + electron-to-chromium@1.5.396: + resolution: {integrity: sha512-yHiw2Y3C3H9U6TMbOfoWK/BPreiOPXRfTWPBwQBoZG6/8TB6eOPnsy5oaRYuatR7Fw2SJ4kKforgufeo7fq0EQ==} + emoji-regex@10.6.0: resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} @@ -1888,8 +2015,12 @@ packages: emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - encoding@0.1.13: - resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + empathic@2.0.1: + resolution: {integrity: sha512-YGRs8knHhKHVShLkFET/rWAU8kmHbOV5LwN938RHI0pljAJ1Gf6SzXsSmRaEzcXTtOOmVqJ5+WtQPL5uigY50Q==} + engines: {node: '>=14'} enhanced-resolve@5.18.3: resolution: {integrity: sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww==} @@ -1906,12 +2037,17 @@ packages: resolution: {integrity: sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==} engines: {node: '>=0.12'} + entities@7.0.1: + resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==} + engines: {node: '>=0.12'} + env-paths@2.2.1: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} - err-code@2.0.3: - resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} + environment@1.1.0: + resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} + engines: {node: '>=18'} es-abstract@1.24.0: resolution: {integrity: sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==} @@ -1925,9 +2061,9 @@ packages: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} - es-file-traverse@2.0.1: - resolution: {integrity: sha512-NvoZH3rRsmzMlXrNladYMmG0VYADqgRK2CLCDIEgGe7YxSayq2jbjtp50qa6Bm3rnErW7kM2j/p7cBjeQSH5nw==} - engines: {node: ^20.11.0 || >=22.0.0} + es-file-traverse@3.0.0: + resolution: {integrity: sha512-CEBr2uB5zkYOpdrJOXHNl3yRUehGf+9FBpXB/uKUq4gW3QNKWi9JVaB/F2BG+Xz1GtqdN4A3ipzBFnIj3jRZwQ==} + engines: {node: ^20.11.0 || >=22.16.0} hasBin: true es-object-atoms@1.1.1: @@ -1986,18 +2122,27 @@ packages: peerDependencies: eslint: '>=6.0.0' - eslint-config-ash-nazg@39.8.0: - resolution: {integrity: sha512-51sJll80mAadRBiMydxv/MDMU42JLRu8xoneN3OFcfp4wDXx+SAZ+IbUIsUwSdyu9yuUpK3/cRKfVSwRfutIag==} + eslint-config-ash-nazg@41.0.0: + resolution: {integrity: sha512-UjnqDfVMamYOAJ5ewLKemz/TUe/gWY48TA5Z2qwxvKAgJdocR/mXxYvDgybDMIVPbYHZ0d+6FZhLSNw2omvl7w==} engines: {node: '>=20.0.0'} peerDependencies: - eslint: ^9.6.0 + eslint: ^10.0.0 + + eslint-import-context@0.1.9: + resolution: {integrity: sha512-K9Hb+yRaGAGUbwjhFNHvSmmkZs9+zbuoe3kFQ4V1wYjrepUFYM2dZAfNtjbbj3qsPfUfsA68Bx/ICWQMi+C8Eg==} + engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + peerDependencies: + unrs-resolver: ^1.0.0 + peerDependenciesMeta: + unrs-resolver: + optional: true eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - eslint-import-resolver-typescript@3.10.1: - resolution: {integrity: sha512-A1rHYb06zjMGAxdLSkN2fXPBwuSaQ0iO5M/hdyS0Ajj1VBaRp0sPD3dn1FhME3c/JluGFbwSxyCfqdSbtQLAHQ==} - engines: {node: ^14.18.0 || >=16.0.0} + eslint-import-resolver-typescript@4.4.5: + resolution: {integrity: sha512-nbE5XLph6TLtGYcu/U6e6ZVXyKBhbDWK5cLGk76eJ7NdZpwf1P9EFkpt1Z01mNZNrrilsAYWKH6zUkL4reoXbw==} + engines: {node: ^16.17.0 || >=18.6.0} peerDependencies: eslint: '*' eslint-plugin-import: '*' @@ -2029,8 +2174,8 @@ packages: eslint-import-resolver-webpack: optional: true - eslint-plugin-array-func@5.1.0: - resolution: {integrity: sha512-+OULB0IQdENBmBf8pHMPPObgV6QyfeXFin483jPonOaiurI9UFmc8UydWriK5f5Gel8xBhQLA6NzMwbck1BUJw==} + eslint-plugin-array-func@5.1.1: + resolution: {integrity: sha512-TbVGk+yLqXHgtrS4DnYzg2Ycuk5y+lYFy5NgT748neQdJvNIYUucxp2QQjPU7dwbs9xp9fyktgtK069y9rNdig==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=8.51.0' @@ -2039,28 +2184,32 @@ packages: resolution: {integrity: sha512-0RccqS5zfNFnwomz2OhpaIaK/Z5f0RypBiR4Va+nTo1QncPHQC2YxQk+IbHb3SY4Lj4hToQ9IXejzZSqF0Ae9A==} engines: {node: '>=18.18.0'} - eslint-plugin-chai-expect@3.1.0: - resolution: {integrity: sha512-a9F8b38hhJsR7fgDEfyMxppZXCnCW6OOHj7cQfygsm9guXqdSzfpwrHX5FT93gSExDqD71HQglF1lLkGBwhJ+g==} - engines: {node: 10.* || 12.* || || 14.* || 16.* || >= 18.*} + eslint-plugin-chai-expect@4.1.0: + resolution: {integrity: sha512-9Ldti0tyxlvbc4BAQ5lNkHsXjgH518aGO5cg53hv2V9jfEfmyAcrmJeG9+tkeq7gwoRNm+fITlwAgZsK12Mejw==} + engines: {node: '>= 20'} peerDependencies: - eslint: '>=2.0.0 <= 9.x' + eslint: '>=2.0.0 <=10.x' - eslint-plugin-chai-friendly@1.1.0: - resolution: {integrity: sha512-+T1rClpDdXkgBAhC16vRQMI5umiWojVqkj9oUTdpma50+uByCZM/oBfxitZiOkjMRlm725mwFfz/RVgyDRvCKA==} + eslint-plugin-chai-friendly@1.2.1: + resolution: {integrity: sha512-mV3EOJLDr8+L+LS8uCkP711fnNHz+4PsmPyz18xwkvjJwfLRlnx0Eu6CFnb5B+dW5ahoav2jVer2KFYsmIuv3A==} engines: {node: '>=0.10.0'} peerDependencies: eslint: '>=3.0.0' - eslint-plugin-compat@6.0.2: - resolution: {integrity: sha512-1ME+YfJjmOz1blH0nPZpHgjMGK4kjgEeoYqGCqoBPQ/mGu/dJzdoP0f1C8H2jcWZjzhZjAMccbM/VdXhPORIfA==} - engines: {node: '>=18.x'} + eslint-plugin-compat@7.0.2: + resolution: {integrity: sha512-gN8hF+4NzMsHUbr4m/TYZK0FtW3DcV4g8rXpTsY2EV5xiRD8jsilUlB9lNSkGGX0veDCxMhKSWbSd+faJByQDA==} + engines: {node: '>=22.x'} peerDependencies: - eslint: ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 + eslint: ^9.0.0 || ^10.0.0 - eslint-plugin-cypress@5.2.0: - resolution: {integrity: sha512-vuCUBQloUSILxtJrUWV39vNIQPlbg0L7cTunEAzvaUzv9LFZZym+KFLH18n9j2cZuFPdlxOqTubCvg5se0DyGw==} + eslint-plugin-cypress@6.4.3: + resolution: {integrity: sha512-2/ulKNnCn+0vbaDI/6KovgGKsR/Y/bA+KMAkxRbHl2IAMd/UzU24ZOXpncR+QPBlaXqfAJ9NMCzdwX9Gjhm9AQ==} peerDependencies: + '@typescript-eslint/parser': '>=8' eslint: '>=9' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true eslint-plugin-es-x@7.8.0: resolution: {integrity: sha512-7Ds8+wAAoV3T+LAKeu39Y5BzXCrGKrcISfgKEqTS4BDN8SFEDQd0S43jiQ8vIa3wUKD07qitZdfzlenSi8/0qQ==} @@ -2073,10 +2222,23 @@ packages: peerDependencies: eslint: '>=5.14.1' - eslint-plugin-html@8.1.3: - resolution: {integrity: sha512-cnCdO7yb/jrvgSJJAfRkGDOwLu1AOvNdw8WCD6nh/2C4RnxuI4tz6QjMEAmmSiHSeugq/fXcIO8yBpIBQrMZCg==} + eslint-plugin-html@8.1.4: + resolution: {integrity: sha512-Eno3oPEj3s6AhvDJ5zHhnHPDvXp6LNFXuy3w51fNebOKYuTrfjOHUGwP+mOrGFpR6eOJkO1xkB8ivtbfMjbMjg==} engines: {node: '>=16.0.0'} + eslint-plugin-import-x@4.17.1: + resolution: {integrity: sha512-4cdstYkKCyjumM2Q9NSI03K8D2a9F4Ssz33K2lv2hQa4KmR9jPLwk3uWGtNvclfqBrPGfGuMBwsGMbe6dMRbfg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + '@typescript-eslint/utils': ^8.56.0 + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + eslint-import-resolver-node: '*' + peerDependenciesMeta: + '@typescript-eslint/utils': + optional: true + eslint-import-resolver-node: + optional: true + eslint-plugin-import@2.32.0: resolution: {integrity: sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==} engines: {node: '>=4'} @@ -2087,11 +2249,11 @@ packages: '@typescript-eslint/parser': optional: true - eslint-plugin-jsdoc@61.2.1: - resolution: {integrity: sha512-Htacti3dbkNm4rlp/Bk9lqhv+gi6US9jyN22yaJ42G6wbteiTbNLChQwi25jr/BN+NOzDWhZHvCDdrhX0F8dXQ==} - engines: {node: '>=20.11.0'} + eslint-plugin-jsdoc@63.3.1: + resolution: {integrity: sha512-yVyTPtOY2tA8EjTwUtaM3pFxj9i/3m4/FSPMv5gMnDHSSleCpzIYQLyV8KnVmEIkkPpNhDlkDQ99mTfjxgqLxA==} + engines: {node: ^22.13.0 || >=24} peerDependencies: - eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 + eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 eslint-plugin-mocha-cleanup@1.11.3: resolution: {integrity: sha512-LL4yt52+asxZmeqU6Ypr5XxN6CzJTKxu/YsbHEr0L/pArcS/acn49nNfrJluRSJ8N9MD1mtuI/V1jEfjPzQ1qQ==} @@ -2099,60 +2261,56 @@ packages: peerDependencies: eslint: '>=0.8.0' - eslint-plugin-mocha@11.2.0: - resolution: {integrity: sha512-nMdy3tEXZac8AH5Z/9hwUkSfWu8xHf4XqwB5UEQzyTQGKcNlgFeciRAjLjliIKC3dR1Ex/a2/5sqgQzvYRkkkA==} + eslint-plugin-mocha@12.0.0: + resolution: {integrity: sha512-vMjec/KRiKxpdA5dKIYV5xRORrSnPvvfD2El3FGtUX2pP7JTP75KRCrwtBqRmKd8a8QWet1MsBKmfZIbQ6gdhA==} + engines: {node: '>=22.0.0'} peerDependencies: - eslint: '>=9.0.0' + eslint: '>=10.2.0' - eslint-plugin-n@17.23.1: - resolution: {integrity: sha512-68PealUpYoHOBh332JLLD9Sj7OQUDkFpmcfqt8R9sySfFSeuGJjMTJQvCRRB96zO3A/PELRLkPrzsHmzEFQQ5A==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint-plugin-n@18.2.2: + resolution: {integrity: sha512-gOO0lIqwEjZ750kv9/SptCWArUoAZXJoBr0vYWTO2dCBxctHUXlBIigiC8xuxxr/NKqgIT6Ehz1xRcilj8a5cA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} peerDependencies: - eslint: '>=8.23.0' + eslint: '>=8.57.1' + ts-declaration-location: ^1.0.6 + typescript: '>=5.0.0' + peerDependenciesMeta: + ts-declaration-location: + optional: true + typescript: + optional: true - eslint-plugin-no-unsanitized@4.1.4: - resolution: {integrity: sha512-cjAoZoq3J+5KJuycYYOWrc0/OpZ7pl2Z3ypfFq4GtaAgheg+L7YGxUo2YS3avIvo/dYU5/zR2hXu3v81M9NxhQ==} + eslint-plugin-no-unsanitized@4.1.5: + resolution: {integrity: sha512-MSB4hXPVFQrI8weqzs6gzl7reP2k/qSjtCoL2vUMSDejIIq9YL1ZKvq5/ORBXab/PvfBBrWO2jWviYpL+4Ghfg==} peerDependencies: - eslint: ^8 || ^9 + eslint: ^9 || ^10 - eslint-plugin-no-use-extend-native@0.7.2: - resolution: {integrity: sha512-hUBlwaTXIO1GzTwPT6pAjvYwmSHe4XduDhAiQvur4RUujmBUFjd8Nb2+e7WQdsQ+nGHWGRlogcUWXJRGqizTWw==} + eslint-plugin-no-use-extend-native@0.7.3: + resolution: {integrity: sha512-kYJhgZkiZIavu/wIwrO+n4GemQcMX53kWCNZNr7nGMkRD1aBFLkDpBivEYP7nIJINCo9fzPbFjrpeX5kr2Qbww==} engines: {node: '>=18.18.0'} peerDependencies: - eslint: ^9.3.0 + eslint: ^9.3.0 || ^10.0.0 - eslint-plugin-promise@7.2.1: - resolution: {integrity: sha512-SWKjd+EuvWkYaS+uN2csvj0KoP43YTu7+phKQ5v+xw6+A0gutVX2yqCeCkC3uLCJFiPfR2dD8Es5L7yUsmvEaA==} + eslint-plugin-promise@7.3.0: + resolution: {integrity: sha512-6uGiOR0INuujr6PEQmeSSP7GbIMJ/ebEXXiEzb/nOj68LknH5Pxzb/AbZivmr6VE6TkTE8rTjRK9zhKpK6HsRA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 + eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 - eslint-plugin-sonarjs@3.0.5: - resolution: {integrity: sha512-dI62Ff3zMezUToi161hs2i1HX1ie8Ia2hO0jtNBfdgRBicAG4ydy2WPt0rMTrAe3ZrlqhpAO3w1jcQEdneYoFA==} + eslint-plugin-sonarjs@4.2.0: + resolution: {integrity: sha512-bqADfuNtTL7VK6RU29eoiFTtaaBKIpVPuX3bOl+rBpWSBa0zIBVZlqZNZQjfP6s4iXkAJokv5IsD8OsACkwApg==} peerDependencies: - eslint: ^8.0.0 || ^9.0.0 + eslint: ^8.0.0 || ^9.0.0 || ^10.0.0 - eslint-plugin-unicorn@62.0.0: - resolution: {integrity: sha512-HIlIkGLkvf29YEiS/ImuDZQbP12gWyx5i3C6XrRxMvVdqMroCI9qoVYCoIl17ChN+U89pn9sVwLxhIWj5nEc7g==} - engines: {node: ^20.10.0 || >=21.0.0} + eslint-plugin-unicorn@72.0.0: + resolution: {integrity: sha512-hqO6ksoOHO+ZhdseTuKRVQbx9U7PRO/cv8qAR1mctwzdVO2hYud8uS9luAhp43RJgziYgHAph8eHyipT8GL0ng==} + engines: {node: '>=22'} peerDependencies: - eslint: '>=9.38.0' + eslint: '>=10.4' - eslint-rule-composer@0.3.0: - resolution: {integrity: sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==} - engines: {node: '>=4.0.0'} - - eslint-scope@5.1.1: - resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} - engines: {node: '>=8.0.0'} - - eslint-scope@8.4.0: - resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - eslint-visitor-keys@2.1.0: - resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} - engines: {node: '>=10'} + eslint-scope@9.1.2: + resolution: {integrity: sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} @@ -2162,9 +2320,13 @@ packages: resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.39.1: - resolution: {integrity: sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint-visitor-keys@5.0.1: + resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + eslint@10.8.0: + resolution: {integrity: sha512-nuKKvN+oIBO0koN7Tm7dlkmnkc21mtt0QJLwAKzjLq14y6lRTdVG36MZHJ8eQHwdJMwZbQNMlPOYedMq/oVJvQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} hasBin: true peerDependencies: jiti: '*' @@ -2184,23 +2346,23 @@ packages: resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + espree@11.2.0: + resolution: {integrity: sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true - esquery@1.6.0: - resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} + esquery@1.7.0: + resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} engines: {node: '>=0.10'} esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} - estraverse@4.3.0: - resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} - engines: {node: '>=4.0'} - estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} @@ -2260,6 +2422,9 @@ packages: picomatch: optional: true + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + file-entry-cache@8.0.0: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} @@ -2267,9 +2432,9 @@ packages: file-fetch@2.0.1: resolution: {integrity: sha512-jN4OveNyFdDIscQgaKL3vpPN5i4WnoQdWs1VQgT+3+SxsOW4+mQQzgOPQa4BjbKSkjeMv4xi+wLAMUKcL3CFtg==} - file-type@18.7.0: - resolution: {integrity: sha512-ihHtXRzXEziMrQ56VSgU7wkxh55iNchFkosu7Y9/S+tXHdKyrGjVK0ujbqNnsxzea+78MaLhN6PGmfYSAv1ACw==} - engines: {node: '>=14.16'} + file-type@21.3.4: + resolution: {integrity: sha512-Ievi/yy8DS3ygGvT47PjSfdFoX+2isQueoYP1cntFW1JLYAuS4GD7NUPGg4zv2iZfV52uDyk5w5Z0TdpRS6Q1g==} + engines: {node: '>=20'} fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} @@ -2339,10 +2504,6 @@ packages: resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==} engines: {node: '>=0.4.x'} - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - fs-minipass@3.0.3: resolution: {integrity: sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -2355,6 +2516,10 @@ packages: function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + function-timeout@1.0.2: + resolution: {integrity: sha512-939eZS4gJ3htTHAldmyyuzlrD58P03fHG49v2JfFXbV6OhvZKRC9j2yAtdHw/zrp2zXHuv05zMIy40F0ge7spA==} + engines: {node: '>=18'} + function.prototype.name@1.1.8: resolution: {integrity: sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==} engines: {node: '>= 0.4'} @@ -2381,6 +2546,10 @@ packages: resolution: {integrity: sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==} engines: {node: '>=18'} + get-east-asian-width@1.6.0: + resolution: {integrity: sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==} + engines: {node: '>=18'} + get-intrinsic@1.3.0: resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} engines: {node: '>= 0.4'} @@ -2397,10 +2566,6 @@ packages: resolution: {integrity: sha512-YCmOj+4YAeEB5Dd9jfp6ETdejMet4zSxXjNkgaa4npBEKRI9uDOGB5MmAdAgi2OoFGAKshYhCbmLq2DS03CgVA==} engines: {node: '>=18.0.0'} - get-stdin@9.0.0: - resolution: {integrity: sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==} - engines: {node: '>=12'} - get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} @@ -2428,6 +2593,10 @@ packages: deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me hasBin: true + glob@13.0.6: + resolution: {integrity: sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==} + engines: {node: 18 || 20 || >=22} + global-directory@4.0.1: resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} engines: {node: '>=18'} @@ -2436,25 +2605,25 @@ packages: resolution: {integrity: sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==} engines: {node: '>=10'} - globals@14.0.0: - resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} - engines: {node: '>=18'} - globals@15.15.0: resolution: {integrity: sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==} engines: {node: '>=18'} - globals@16.5.0: - resolution: {integrity: sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==} + globals@17.7.0: + resolution: {integrity: sha512-Czmyns5dUsq4seFBR/Kdydhmo8y9kC79hiSkPn0YcGtNnYWnrgt0vjrSjx9tspoDGWm2CMarffRuLjM4xUz8xg==} + engines: {node: '>=18'} + + globals@17.8.0: + resolution: {integrity: sha512-Zz/LMDZScFmkakeL2cTHzf+PbWKdpU3uclqkZT7TjDG58j5WPt0PpA+n9uPI24fZtlw07q0OtEi84K+umsRzqQ==} engines: {node: '>=18'} globalthis@1.0.4: resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} engines: {node: '>= 0.4'} - globby@14.1.0: - resolution: {integrity: sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==} - engines: {node: '>=18'} + globby@16.2.2: + resolution: {integrity: sha512-NLvV9ubZ6NDsJaOpKPy3cQeJpKi9DcWiyCiFUpJPA0YihRqiE6RWaLUmgNNPr8MgPpLZjnBjSmou7uZBRJv9wA==} + engines: {node: '>=20'} globrex@0.1.2: resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} @@ -2512,9 +2681,12 @@ packages: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true - hosted-git-info@7.0.2: - resolution: {integrity: sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==} - engines: {node: ^16.14.0 || >=18.0.0} + highlight.js@10.7.3: + resolution: {integrity: sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==} + + hosted-git-info@9.0.3: + resolution: {integrity: sha512-Hc+ghLoSt6QaYZUv0WBiIvmMDZuZZ7oaDvdH8MbfOO4lOsxdXLEvuC6ePoGs9H1X9oCLyq6+NVN0MKqD+ydxyg==} + engines: {node: ^20.17.0 || >=22.9.0} html-encoding-sniffer@3.0.0: resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==} @@ -2529,6 +2701,9 @@ packages: htmlparser2@10.0.0: resolution: {integrity: sha512-TwAZM+zE5Tq3lrEHvOlvwgj1XLWQCtaaibSN11Q+gGBAS7Y1uZSWwXXRe4iF6OXnaq1riyQAPFOBtYc77Mxq0g==} + htmlparser2@10.1.0: + resolution: {integrity: sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==} + http-cache-semantics@4.2.0: resolution: {integrity: sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==} @@ -2557,12 +2732,20 @@ packages: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + identifier-regex@1.1.0: + resolution: {integrity: sha512-SLX4H/vtcYlYnL7XqnuJKHU7Z8517TgsW9nmQiGOgMCjQ8V/deLYu6bEmbGoXe7WMMhc9+EUGyFFneHja8KabA==} + engines: {node: '>=18'} + ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - ignore-walk@6.0.5: - resolution: {integrity: sha512-VuuG0wCnjhnylG1ABXT3dAuIpTNDs/G8jlpmwXY03fXoXy/8ZK8/T+hMzt8L4WnrLCJgdybqgPagnF/f97cg3A==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + ignore-walk@8.0.0: + resolution: {integrity: sha512-FCeMZT4NiRQGh+YkeKMtWrOmBgWjHjMJ26WQWrRQyoyzqevdaGSakUaJW5xQYmjLlUVk2qUnCjYVBax9EKKg8A==} + engines: {node: ^20.17.0 || >=22.9.0} ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} @@ -2572,22 +2755,17 @@ packages: resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} engines: {node: '>= 4'} - import-fresh@3.3.1: - resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} - engines: {node: '>=6'} - import-lazy@4.0.0: resolution: {integrity: sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==} engines: {node: '>=8'} + import-meta-resolve@4.2.0: + resolution: {integrity: sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==} + imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} - indent-string@4.0.0: - resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} - engines: {node: '>=8'} - indent-string@5.0.0: resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} engines: {node: '>=12'} @@ -2603,9 +2781,9 @@ packages: resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - ini@4.1.3: - resolution: {integrity: sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + ini@6.0.0: + resolution: {integrity: sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ==} + engines: {node: ^20.17.0 || >=22.9.0} internal-slot@1.1.0: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} @@ -2687,11 +2865,19 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-identifier@1.1.0: + resolution: {integrity: sha512-NhOds0mDx9lJu+1lBRO0xbwFo5nobA7GCk/0e5xjr6+6XugX985+0OyGX35BNrTkPAsdLcIKg02HUQJOK8D8kw==} + engines: {node: '>=18'} + is-in-ci@1.0.0: resolution: {integrity: sha512-eUuAjybVTHMYWm/U+vBO1sY/JOCgoPCXRxzdju0K+K0BiGW0SChEL1MLC0PoCIR1OlPo5YAp8HuQoUlsWEICwg==} engines: {node: '>=18'} hasBin: true + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + is-inside-container@1.0.0: resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} engines: {node: '>=14.16'} @@ -2709,9 +2895,6 @@ packages: resolution: {integrity: sha512-IbPf3g3vxm1D902xaBaYp2TUHiXZWwWRu5bM9hgKN9oAQcFaKALV6Gd13PGhXjKE5u2n8s1PhLhdke/E1fchxQ==} engines: {node: '>=18.0.0'} - is-lambda@1.0.1: - resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} - is-map@2.0.3: resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} engines: {node: '>= 0.4'} @@ -2820,9 +3003,9 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - isexe@3.1.1: - resolution: {integrity: sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==} - engines: {node: '>=16'} + isexe@4.0.0: + resolution: {integrity: sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==} + engines: {node: '>=20'} istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} @@ -2839,6 +3022,9 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + js-tokens@10.0.0: + resolution: {integrity: sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==} + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -2854,8 +3040,12 @@ packages: resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} hasBin: true - jsdoc-type-pratt-parser@6.10.0: - resolution: {integrity: sha512-+LexoTRyYui5iOhJGn13N9ZazL23nAHGkXsa1p/C8yeq79WRfLBag6ZZ0FQG2aRoc9yfo59JT9EYCQonOkHKkQ==} + js-yaml@5.2.2: + resolution: {integrity: sha512-dayzUzKkJ1MkuUtZglSebU43utNXH0OWQByK9rKOOuYIO8M5TV1y+n8ALMdG0rdzBnfNkOmZEqrURepb0ejqBw==} + hasBin: true + + jsdoc-type-pratt-parser@7.3.0: + resolution: {integrity: sha512-DoyJXo7x/n48M3NsGOs9QnEws0ft0tV3YsSgvWMNxz2hZtz+Q6fpqUD96lVYX4a+jcEkzHeFNDJOn68TzXfbdA==} engines: {node: '>=20.0.0'} jsep@1.4.0: @@ -2870,9 +3060,9 @@ packages: json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - json-parse-even-better-errors@3.0.2: - resolution: {integrity: sha512-fi0NG4bPjCHunUJffmLd0gxssIgkNmArMvis4iNah6Owg1MCJjWhEcDLmsK6iGkJq3tHwbDkTlce70/tmXN4cQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + json-parse-even-better-errors@5.0.0: + resolution: {integrity: sha512-ZF1nxZ28VhQouRWhUcVlUIN3qwSgPuswK05s/HIaoetAoE/9tngVmCHjSxmSQPav1nd+lPtTL0YZ/2AFdR/iYQ==} + engines: {node: ^20.17.0 || >=22.9.0} json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} @@ -2906,6 +3096,10 @@ packages: just-diff@6.0.2: resolution: {integrity: sha512-S59eriX5u3/QhMNq3v/gm8Kd0w8OS6Tz2FS1NG4blv+z0MuQcBRJyFWjdovM0Rad4/P4aUPFtnkNjMjyMlMSYA==} + katex@0.16.47: + resolution: {integrity: sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg==} + hasBin: true + keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -2925,22 +3119,22 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} - license-badger@0.22.1: - resolution: {integrity: sha512-Nwa/umKFr9dA+dDX6OLqm8NvqMV+vvrFMoE4fAbX+knh5JE1TMGTVdA2M7rE40ZxSSI1zG66btN26u/utSHbXQ==} - engines: {node: ^20.11.0 || >=22.0.0} + license-badger@0.23.0: + resolution: {integrity: sha512-b40/qxgTxmG+RuBQk5wHZLK9XK7nJLTc9Igrvs9MRuY3T9q0OJ9mSQWnRF2v0WDfAdW596/bYj2xpZJAqJ40xg==} + engines: {node: '>=24.0.0'} hasBin: true - license-types@3.1.0: - resolution: {integrity: sha512-coCk+CJr8uaOk5KSaQCon/WErJoa5jV6jkTtJfh7Ly1Q3JRTK/XJGrl7MWl7ck1c2IEKshd2VCO+tvSsj8tjpg==} + license-types@3.2.0: + resolution: {integrity: sha512-gPW/brXZjIxDQusvFGHzObypOi44NE+s558e9Yo/S2QSHSRQ58TpYU0d9ZWkiRKySS4Z6DdI2h406Xb2qdxMmg==} engines: {node: '>=14'} - licensee@11.1.1: - resolution: {integrity: sha512-FpgdKKjvJULlBqYiKtrK7J4Oo7sQO1lHQTUOcxxE4IPQccx6c0tJWMgwVdG46+rPnLPSV7EWD6eWUtAjGO52Lg==} - engines: {node: ^18.12 || ^20.9 || >= 22.7} + licensee@12.0.1: + resolution: {integrity: sha512-LMSs1+p7Gnqw4efSFaJPJJphn6QwugzXP0hD1VupIlGamkSvdxYm0asP3BVpM+DGJ5Bs3Cv1uwYhZokSNOwyPA==} + engines: {node: ^20.20 || ^22.22 || ^24.13 || >= 25.4} hasBin: true - linkify-it@5.0.0: - resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==} + linkify-it@5.0.2: + resolution: {integrity: sha512-ONTm2jCMAVZjgQa/Fy1kScXsuOoF5NPTsoFBdE1KVIZ2vAh/r9+Bqo+0jINCBYnavTPQZz38QzFTme79ENoN3Q==} locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} @@ -2979,27 +3173,43 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - lru-cache@5.1.1: - resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + lru-cache@11.5.2: + resolution: {integrity: sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==} + engines: {node: 20 || >=22} lunr@2.3.9: resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==} + make-asynchronous@1.1.0: + resolution: {integrity: sha512-ayF7iT+44LXdxJLTrTd3TLQpFDDvPCBxXxbv+pMUSuHA5Q8zyAfwkRP6aHHwNVFBUFWtxAHqwNJxF8vMZLAbVg==} + engines: {node: '>=18'} + make-dir@4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} - make-fetch-happen@13.0.1: - resolution: {integrity: sha512-cKTUFc/rbKUd/9meOvgrpJ2WrNzymt6jfRDdwg5UCnVzv9dTpEj9JS5m3wtziXVCjluIXyL8pcaukYqezIzZQA==} - engines: {node: ^16.14.0 || >=18.0.0} + make-fetch-happen@15.0.6: + resolution: {integrity: sha512-Je0fLJ0F5atA7F+eIlLzk+Wkcl57JDf4kf+EW8xiP5E31xOQxkIxTbgf1Oi1Lw9tRI9UEMRdI5Vz2xTzoNU1Jw==} + engines: {node: ^20.17.0 || >=22.9.0} - markdown-it@14.1.1: - resolution: {integrity: sha512-BuU2qnTti9YKgK5N+IeMubp14ZUKUUw7yeJbkjtosvHiP0AZ5c8IAgEMk79D0eC8F23r4Ac/q8cAIFdm2FtyoA==} + markdown-it@14.3.0: + resolution: {integrity: sha512-RCEsPjR+sr0x+AuYp601tKTkgFG4YEPLCzHST3cQ/fhlJkqAkz1L2/Qbp1j9qw5SBwQHFBoW8+hoN5xssOF0Tw==} hasBin: true markdown-table@3.0.4: resolution: {integrity: sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==} + marked-terminal@7.3.0: + resolution: {integrity: sha512-t4rBvPsHc57uE/2nJOLmMbZCQ4tgAccAED3ngXQqW6g+TxA488JzJ+FK3lQkzBQOI1mRV/r/Kq+1ZlJ4D0owQw==} + engines: {node: '>=16.0.0'} + peerDependencies: + marked: '>=1 <16' + + marked@9.1.6: + resolution: {integrity: sha512-jcByLnIFkd5gSXZmjNvS1TlmRhCXZjIzHYlaGkPlLIekG55JDR2Z4va9tZwCiP+/RDERiNhMOFu01xd6O5ct1Q==} + engines: {node: '>= 16'} + hasBin: true + math-intrinsics@1.1.0: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} @@ -3031,6 +3241,9 @@ packages: mdast-util-gfm@3.1.0: resolution: {integrity: sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==} + mdast-util-math@3.0.0: + resolution: {integrity: sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w==} + mdast-util-phrasing@4.1.0: resolution: {integrity: sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==} @@ -3043,12 +3256,15 @@ packages: mdn-data@2.0.14: resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==} + mdn-data@2.29.0: + resolution: {integrity: sha512-pVxQFCcaYUEAH853+v7yoI/qzhxXSq1bTb9obMYGYAN1c3Hen+XDCEvr296XhstrwlSTNgOR7mCSD4JPjbJe5A==} + mdurl@2.0.0: resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==} - meow@12.1.1: - resolution: {integrity: sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==} - engines: {node: '>=16.10'} + meow@14.1.0: + resolution: {integrity: sha512-EDYo6VlmtnumlcBCbh1gLJ//9jvM/ndXHfVXIFrZVr6fGcwTUyCTFNTLCKuY3ffbK8L/+3Mzqnd58RojiZqHVw==} + engines: {node: '>=20'} merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} @@ -3081,6 +3297,9 @@ packages: micromark-extension-gfm@3.0.0: resolution: {integrity: sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==} + micromark-extension-math@3.1.0: + resolution: {integrity: sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg==} + micromark-factory-destination@2.0.1: resolution: {integrity: sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==} @@ -3166,13 +3385,13 @@ packages: resolution: {integrity: sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + minimatch@10.2.5: + resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} + engines: {node: 18 || 20 || >=22} + minimatch@3.1.5: resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==} - minimatch@9.0.5: - resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} - engines: {node: '>=16 || 14 >=14.17'} - minimatch@9.0.9: resolution: {integrity: sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==} engines: {node: '>=16 || 14 >=14.17'} @@ -3184,9 +3403,9 @@ packages: resolution: {integrity: sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==} engines: {node: '>=16 || 14 >=14.17'} - minipass-fetch@3.0.5: - resolution: {integrity: sha512-2N8elDQAtSnFV0Dk7gt15KHsS0Fyz6CbYZ360h0WTYV1Ty46li3rAXVOQj1THMNLdmrD9Vt5pBPtWtVkpwGBqg==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + minipass-fetch@5.0.2: + resolution: {integrity: sha512-2d0q2a8eCi2IRg/IGubCNRJoYbA1+YPXAzQVRFmB45gdGZafyivnZ5YSEfo3JikbjGxOdntGFvBQGqaSMXlAFQ==} + engines: {node: ^20.17.0 || >=22.9.0} minipass-flush@1.0.5: resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==} @@ -3196,30 +3415,25 @@ packages: resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==} engines: {node: '>=8'} - minipass-sized@1.0.3: - resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==} + minipass-sized@2.0.0: + resolution: {integrity: sha512-zSsHhto5BcUVM2m1LurnXY6M//cGhVaegT71OfOXoprxT6o780GZd792ea6FfrQkuU4usHZIUczAQMRUE2plzA==} engines: {node: '>=8'} minipass@3.3.6: resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} engines: {node: '>=8'} - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - minipass@7.1.2: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} mocha-badge-generator@0.11.0: resolution: {integrity: sha512-S0eWVGfLvTWWvKfzMI9JhIpfGa3PrF5bA6By57kd5ckADYRP6jn7IpdSEsKiL6rhu07906P/si+YlTid0VHv8g==} @@ -3232,14 +3446,17 @@ packages: peerDependencies: mocha: '>=3.1.2' - mocha@11.7.5: - resolution: {integrity: sha512-mTT6RgopEYABzXWFx+GcJ+ZQ32kp4fMf0xvpZIIfSq9Z8lC/++MtcCnQ9t5FP2veYEP95FIYSvW+U9fV4xrlig==} + mocha@11.7.6: + resolution: {integrity: sha512-nS9xOGbw2I3cjCpxwZAEJ9xK9lmJ08vEkQvLtz4du9ZrF9UrjRpeJGiIgl2Z+Qs++pmB4ecDe48Fwsh+j+j7xA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + mz@2.7.0: + resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + napi-postinstall@0.3.4: resolution: {integrity: sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} @@ -3248,64 +3465,68 @@ packages: natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - negotiator@0.6.4: - resolution: {integrity: sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==} + negotiator@1.0.0: + resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==} engines: {node: '>= 0.6'} next-tick@1.1.0: resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} - node-gyp@10.3.1: - resolution: {integrity: sha512-Pp3nFHBThHzVtNY7U6JfPjvT/DTE8+o/4xKsLQtBoU+j2HLsGlhcfzflAoUreaJbNmYnX+LlLi0qjV8kpyO6xQ==} - engines: {node: ^16.14.0 || >=18.0.0} + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + node-gyp@12.4.0: + resolution: {integrity: sha512-OMcPNvqTCFUnNaBlmdgq+lfNqY7gTiSmNRDjY3uAXRyudeKZEZxu3CLtjMQrx4zZxCX2b/mpNqTtwuCJgXhHkw==} + engines: {node: ^20.17.0 || >=22.9.0} hasBin: true node-releases@2.0.27: resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} - nopt@7.2.1: - resolution: {integrity: sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true + node-releases@2.0.51: + resolution: {integrity: sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==} + engines: {node: '>=18'} - normalize-package-data@6.0.2: - resolution: {integrity: sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==} - engines: {node: ^16.14.0 || >=18.0.0} + nopt@9.0.0: + resolution: {integrity: sha512-Zhq3a+yFKrYwSBluL4H9XP3m3y5uvQkB/09CwDruCiRmR/UJYnn9W4R48ry0uGC70aeTPKLynBtscP9efFFcPw==} + engines: {node: ^20.17.0 || >=22.9.0} + hasBin: true normalize-url@8.1.0: resolution: {integrity: sha512-X06Mfd/5aKsRHc0O0J5CUedwnPmnDtLF2+nq+KN9KSDlJHkPuh0JUviWjEWMe0SW/9TDdSLVPuk7L5gGTIA1/w==} engines: {node: '>=14.16'} - npm-bundled@3.0.1: - resolution: {integrity: sha512-+AvaheE/ww1JEwRHOrn4WHNzOxGtVp+adrg2AeZS/7KuxGUYFuBta98wYpfHBbJp6Tg6j1NKSEVHNcfZzJHQwQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + npm-bundled@5.0.0: + resolution: {integrity: sha512-JLSpbzh6UUXIEoqPsYBvVNVmyrjVZ1fzEFbqxKkTJQkWBO3xFzFT+KDnSKQWwOQNbuWRwt5LSD6HOTLGIWzfrw==} + engines: {node: ^20.17.0 || >=22.9.0} - npm-install-checks@6.3.0: - resolution: {integrity: sha512-W29RiK/xtpCGqn6f3ixfRYGk+zRyr+Ew9F2E20BfXxT5/euLdA/Nm7fO7OeTGuAmTs30cpgInyJ0cYe708YTZw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + npm-install-checks@8.0.0: + resolution: {integrity: sha512-ScAUdMpyzkbpxoNekQ3tNRdFI8SJ86wgKZSQZdUxT+bj0wVFpsEMWnkXP0twVe1gJyNF5apBWDJhhIbgrIViRA==} + engines: {node: ^20.17.0 || >=22.9.0} npm-license-corrections@1.9.0: resolution: {integrity: sha512-9Tq6y6zop5lsZy6dInbgrCLnqtuN+3jBc9NCusKjbeQL4LRudDkvmCYyInsDOaKN7GIVbBSvDto5MnEqYXVhxQ==} - npm-normalize-package-bin@3.0.1: - resolution: {integrity: sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + npm-normalize-package-bin@5.0.0: + resolution: {integrity: sha512-CJi3OS4JLsNMmr2u07OJlhcrPxCeOeP/4xq67aWNai6TNWWbTrlNDgl8NcFKVlcBKp18GPj+EzbNIgrBfZhsag==} + engines: {node: ^20.17.0 || >=22.9.0} - npm-package-arg@11.0.3: - resolution: {integrity: sha512-sHGJy8sOC1YraBywpzQlIKBE4pBbGbiF95U6Auspzyem956E0+FtDtsx1ZxlOJkQCZ1AFXAY/yuvtFYrOxF+Bw==} - engines: {node: ^16.14.0 || >=18.0.0} + npm-package-arg@13.0.2: + resolution: {integrity: sha512-IciCE3SY3uE84Ld8WZU23gAPPV9rIYod4F+rc+vJ7h7cwAJt9Vk6TVsK60ry7Uj3SRS3bqRRIGuTp9YVlk6WNA==} + engines: {node: ^20.17.0 || >=22.9.0} - npm-packlist@8.0.2: - resolution: {integrity: sha512-shYrPFIS/JLP4oQmAwDyk5HcyysKW8/JLTEA32S0Z5TzvpaeeX2yMFfoK1fjEBnCBvVyIB/Jj/GBFdm0wsgzbA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + npm-packlist@10.0.4: + resolution: {integrity: sha512-uMW73iajD8hiH4ZBxEV3HC+eTnppIqwakjOYuvgddnalIw2lJguKviK1pcUJDlIWm1wSJkchpDZDSVVsZEYRng==} + engines: {node: ^20.17.0 || >=22.9.0} - npm-pick-manifest@9.1.0: - resolution: {integrity: sha512-nkc+3pIIhqHVQr085X9d2JzPzLyjzQS96zbruppqC9aZRm/x8xx6xhI98gHtsfELP2bE+loHq8ZaHFHhe+NauA==} - engines: {node: ^16.14.0 || >=18.0.0} + npm-pick-manifest@11.0.3: + resolution: {integrity: sha512-buzyCfeoGY/PxKqmBqn1IUJrZnUi1VVJTdSSRPGI60tJdUhUoSQFhs0zycJokDdOznQentgrpf8LayEHyyYlqQ==} + engines: {node: ^20.17.0 || >=22.9.0} - npm-registry-fetch@17.1.0: - resolution: {integrity: sha512-5+bKQRH0J1xG1uZ1zMNvxW0VEyoNWgJpY9UDuluPFLKDfJ9u2JmmjmTJV1srBGQOROfdBMiVvnH2Zvpbm+xkVA==} - engines: {node: ^16.14.0 || >=18.0.0} + npm-registry-fetch@19.1.1: + resolution: {integrity: sha512-TakBap6OM1w0H73VZVDf44iFXsOS3h+L4wVMXmbWOQroZgFhMch0juN6XSzBNlD965yIKvWg2dfu7NSiaYLxtw==} + engines: {node: ^20.17.0 || >=22.9.0} nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} @@ -3314,8 +3535,12 @@ packages: resolution: {integrity: sha512-Q/uLAAfjdhrzQWN2czRNh3fDCgXjh7yRIkdHjDgIHTwpFP0BsshxTA3HRNffHR7Iw/XGTH30u8vdMXQ+079urA==} engines: {node: '>=18.0.0'} - object-deep-merge@2.0.0: - resolution: {integrity: sha512-3DC3UMpeffLTHiuXSy/UG4NOIYTLlY9u3V82+djSCLYClWobZiS4ivYzpIUWrRY/nfsJ8cWsKyG3QfyLePmhvg==} + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + + object-deep-merge@2.0.1: + resolution: {integrity: sha512-aKttDKcU3pyZqKcCkDhsMn70WmZFG2JGDQLP9EcLyTSIFQRCPWLAmBZRLJnrVUrhPG1jETEEbfdgbNtJf1LyMg==} object-inspect@1.13.4: resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} @@ -3341,14 +3566,18 @@ packages: resolution: {integrity: sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==} engines: {node: '>= 0.4'} - open-cli@8.0.0: - resolution: {integrity: sha512-3muD3BbfLyzl+aMVSEfn2FfOqGdPYR0O4KNnxXsLEPE2q9OSjBfJAaB6XKbrUzLgymoSMejvb5jpXJfru/Ko2A==} - engines: {node: '>=18'} + obug@2.1.4: + resolution: {integrity: sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==} + engines: {node: '>=12.20.0'} + + open-cli@9.0.0: + resolution: {integrity: sha512-4UHkLVm4tUM/ardg66uY3x1icgfCnunks5eFVFBzASO3b13Ow2Md3xs9YT7yXWFjXOBpauIeh/N9fvbziU1wkg==} + engines: {node: '>=22'} hasBin: true - open@10.2.0: - resolution: {integrity: sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==} - engines: {node: '>=18'} + open@11.0.0: + resolution: {integrity: sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw==} + engines: {node: '>=20'} opener@1.5.2: resolution: {integrity: sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==} @@ -3366,6 +3595,10 @@ packages: resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} engines: {node: '>=12.20'} + p-event@6.0.1: + resolution: {integrity: sha512-Q6Bekk5wpzW5qIyUP4gdMEujObYstZl6DMMOSenwBvV0BlE5LkDwkjs5yHbZmdCEq2o4RJx4tE1vwxFVf2FG1w==} + engines: {node: '>=16.17'} + p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} @@ -3382,9 +3615,13 @@ packages: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} - p-map@4.0.0: - resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} - engines: {node: '>=10'} + p-map@7.0.6: + resolution: {integrity: sha512-I4Prw6ivkd6p8PiYR1tXASOAOBzIJwu0TB7fqaX0c/8c3QAehNYmX57EijyGGGBt3c/BIowGwV03RVBtXvHEVg==} + engines: {node: '>=18'} + + p-timeout@6.1.4: + resolution: {integrity: sha512-MyIV3ZA/PmyBN/ud8vV9XzwTrNtR4jFrObymZYnZqMmW0zA8Z17vnT0rBgFE/TlohB+YCHqXMgZzb3Csp49vqg==} + engines: {node: '>=14.16'} p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} @@ -3401,18 +3638,14 @@ packages: resolution: {integrity: sha512-cbH9IAIJHNj9uXi196JVsRlt7cHKak6u/e6AkL/bkRelZ7rlL3X1YKxsZwa36xipOEKAsdtmaG6aAJoM1fx2zA==} engines: {node: '>=14.16'} - pacote@18.0.6: - resolution: {integrity: sha512-+eK3G27SMwsB8kLIuj4h1FUhHtwiEUo21Tw8wNjmvdlpOEr613edv+8FUsTj/4F/VN5ywGE19X18N7CC2EJk6A==} - engines: {node: ^16.14.0 || >=18.0.0} + pacote@21.5.1: + resolution: {integrity: sha512-KvcJ9iy3crysCsgqc4+PknH/w6jkrp8JN36mpZBPwNaDRwTfMZD37YzRazNstiZUOhuF5pno9f78n9mEJBavwg==} + engines: {node: ^20.17.0 || >=22.9.0} hasBin: true - parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} - - parse-conflict-json@3.0.1: - resolution: {integrity: sha512-01TvEktc68vwbJOtWZluyWeVGWjP+bZwXtPDMQVbBKzbJ/vZBif0L69KH1+cHv1SZ6e0FKLvjyHe8mqsIqYOmw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + parse-conflict-json@5.0.1: + resolution: {integrity: sha512-ZHEmNKMq1wyJXNwLxyHnluPfRAFSIliBvbK/UiOceROt4Xh9Pz0fq49NytIaeaCUf5VR86hwQ/34FCcNU5/LKQ==} + engines: {node: ^20.17.0 || >=22.9.0} parse-imports-exports@0.2.4: resolution: {integrity: sha512-4s6vd6dx1AotCx/RCI2m7t7GCh5bDRUtGNvRfHSP2wbBQdMi67pPe7mtzmgwcaQ8VKK/6IB7Glfyu3qdZJPybQ==} @@ -3420,6 +3653,15 @@ packages: parse-statements@1.0.11: resolution: {integrity: sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA==} + parse5-htmlparser2-tree-adapter@6.0.1: + resolution: {integrity: sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==} + + parse5@5.1.1: + resolution: {integrity: sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==} + + parse5@6.0.1: + resolution: {integrity: sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==} + path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -3435,13 +3677,9 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} - path-type@6.0.0: - resolution: {integrity: sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==} - engines: {node: '>=18'} - - peek-readable@5.4.2: - resolution: {integrity: sha512-peBp3qZyuS6cNIJ2akRNG1uo1WJ1d0wTxg/fxMdZ0BqCVhx242bSFHM9eNqflfJVS9SsgkzgT/1UgnsurBOTMg==} - engines: {node: '>=14.16'} + path-scurry@2.0.2: + resolution: {integrity: sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==} + engines: {node: 18 || 20 || >=22} picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -3466,25 +3704,29 @@ packages: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} - postcss-selector-parser@6.1.2: - resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} + postcss-selector-parser@7.1.4: + resolution: {integrity: sha512-HeP7D2wyhkR+XaK6v4W8oRF62Dsz4flyuczALJp61GckGm42u1saSSJ/0auvcBqxs3jMRFEcPK34At/0JBKdOg==} engines: {node: '>=4'} + powershell-utils@0.1.0: + resolution: {integrity: sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==} + engines: {node: '>=20'} + prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - proc-log@4.2.0: - resolution: {integrity: sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + proc-log@6.1.0: + resolution: {integrity: sha512-iG+GYldRf2BQ0UDUAd6JQ/RwzaQy6mXmsk/IzlYyal4A4SNFw54MeH4/tLkF4I5WoWG9SQwuqWzS99jaFQHBuQ==} + engines: {node: ^20.17.0 || >=22.9.0} process@0.11.10: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} engines: {node: '>= 0.6.0'} - proggy@2.0.0: - resolution: {integrity: sha512-69agxLtnI8xBs9gUGqEnK26UfiexpHy+KUpBQWabiytQjnn5wFY8rklAi7GRfABIuPNnQ/ik48+LGLkYYJcy4A==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + proggy@4.0.0: + resolution: {integrity: sha512-MbA4R+WQT76ZBm/5JUpV9yqcJt92175+Y0Bodg3HgiXzrmKu7Ggq+bpn6y6wHH+gN9NcyKn3yg1+d47VaKwNAQ==} + engines: {node: ^20.17.0 || >=22.9.0} promise-all-reject-late@1.0.1: resolution: {integrity: sha512-vuf0Lf0lOxyQREH7GDIOUMLS7kz+gs8i6B+Yi8dC68a2sychGrHTJYghMBD6k7eUcH0H5P73EckCA48xijWqXw==} @@ -3492,18 +3734,6 @@ packages: promise-call-limit@3.0.2: resolution: {integrity: sha512-mRPQO2T1QQVw11E7+UdCJu7S61eJVWknzml9sC1heAdj1jxl0fWMBypIt9ZOcLFf8FkG995ZD7RnVk7HH72fZw==} - promise-inflight@1.0.1: - resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==} - peerDependencies: - bluebird: '*' - peerDependenciesMeta: - bluebird: - optional: true - - promise-retry@2.0.1: - resolution: {integrity: sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==} - engines: {node: '>=10'} - proto-list@1.2.4: resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} @@ -3534,6 +3764,10 @@ packages: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} + quote-js-string@0.1.0: + resolution: {integrity: sha512-Y3NoRtprEEZQD8RfxMCfS0ZTqc4e+i18OrXEXAvpM6TfC/3y+0L5rNbZiSnbBBEkDfFzbpd8o+cE8q3/anjMGA==} + engines: {node: '>=22'} + randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} @@ -3541,22 +3775,14 @@ packages: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true - read-cmd-shim@4.0.0: - resolution: {integrity: sha512-yILWifhaSEEytfXI76kB9xEEiG1AiozaCJZ83A87ytjRiN+jVibXjedjCRNjoZviinhG+4UkalO3mWTd8u5O0Q==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - read-package-json-fast@3.0.2: - resolution: {integrity: sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + read-cmd-shim@6.0.0: + resolution: {integrity: sha512-1zM5HuOfagXCBWMN83fuFI/x+T/UhZ7k+KIzhrHXcQoeX5+7gmaDYjELQHmmzIodumBHeByBJT4QYS7ufAgs7A==} + engines: {node: ^20.17.0 || >=22.9.0} readable-stream@4.7.0: resolution: {integrity: sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - readable-web-to-node-stream@3.0.4: - resolution: {integrity: sha512-9nX56alTf5bwXQ3ZDipHJhusu9NTQJ/CVPtb/XHAJCXihZeitfJvIRS4GqQ/mfIoOE3IelHMrpayVrosdHBuLw==} - engines: {node: '>=8'} - readdirp@4.1.2: resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} engines: {node: '>= 14.18.0'} @@ -3584,10 +3810,6 @@ packages: resolution: {integrity: sha512-sZuz1dYW/ZsfG17WSAG7eS85r5a0dDsvg+7BiiYR5o6lKCAtUrEwdmRmaGF6rwVj3LcmAeYkOWKEPlbPzN3Y3A==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - regexp-tree@0.1.27: - resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} - hasBin: true - regexp.prototype.flags@1.5.4: resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} engines: {node: '>= 0.4'} @@ -3611,6 +3833,10 @@ packages: resolution: {integrity: sha512-NZQZdC5wOE/H3UT28fVGL+ikOZcEzfMGk/c3iN9UGxzWHMa1op7274oyiUVrAG4B2EuFhus8SvkaYnhvW92p9Q==} hasBin: true + regjsparser@0.13.2: + resolution: {integrity: sha512-NgRBy2Nx/bE+9F27nVHnqcN5HjyLmecqsqx2PJHu3/IEtADD4WuxuXIVExD5PoSDFVrl78dOonfcOe5O+5nbzQ==} + hasBin: true + require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -3629,10 +3855,6 @@ packages: resolve-alpn@1.2.1: resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} - resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} - resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} @@ -3653,16 +3875,12 @@ packages: resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} engines: {node: '>=14.16'} - retry@0.12.0: - resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} - engines: {node: '>= 4'} - reusify@1.1.0: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rollup@4.59.0: - resolution: {integrity: sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==} + rollup@4.62.3: + resolution: {integrity: sha512-Gu0c0iH9FzgX1L1t7ByIbbS3Vmdz+6KHm/EsqmmC71gUQ82yvZRkTK6XzrFObSka91WUVdynqp6nsfilzr5k6Q==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -3709,19 +3927,23 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - semver@7.7.2: - resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==} + semver@7.7.3: + resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} engines: {node: '>=10'} hasBin: true - semver@7.7.3: - resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} + semver@7.8.5: + resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} engines: {node: '>=10'} hasBin: true serialize-javascript@6.0.2: resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} + serialize-javascript@7.0.7: + resolution: {integrity: sha512-YAy8Od6KV+uuwUuU50np8fGB/Aues6Y0nAhA9y/hId74PlKUcme4pXcBD46NWKr1Q4osN/iseZ17YqO1XfmI8g==} + engines: {node: '>=20.0.0'} + set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} @@ -3765,9 +3987,13 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} - sigstore@2.3.1: - resolution: {integrity: sha512-8G+/XDU8wNsJOQS5ysDVO0Etg9/2uA5gR9l4ZwijjlwxBcrU6RPfwi2+jJmbP+Ap1Hlp/nVAaEO4Fj22/SL2gQ==} - engines: {node: ^16.14.0 || >=18.0.0} + sigstore@4.1.1: + resolution: {integrity: sha512-endqECJkfhozrXMK5ngu/UAA0xVcVEFdnHJCElGaExypjW+HK5i6zu3NteLoaX/iFbRUbC3+DjttQs0GARr+5w==} + engines: {node: ^20.17.0 || >=22.9.0} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} slash@5.1.0: resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} @@ -3788,6 +4014,10 @@ packages: resolution: {integrity: sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==} engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} @@ -3810,6 +4040,9 @@ packages: spdx-expression-parse@4.0.0: resolution: {integrity: sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==} + spdx-expression-parse@5.0.0: + resolution: {integrity: sha512-vngmw3Rgn+o2arXNbnZaj5UtOEBuWBfvaI+Wc8GFfykIhA5/vdK9/Sp/XkLv63dykz2rxKDvKEHupF5P0FORcQ==} + spdx-expression-validate@2.0.0: resolution: {integrity: sha512-b3wydZLM+Tc6CFvaRDBOF9d76oGIHNCLYFeHbftFXUWjnfZWganmDmvtM5sm1cRwJc/VDBMLyGGrsLFd1vOxbg==} @@ -3822,8 +4055,8 @@ packages: spdx-ranges@2.1.1: resolution: {integrity: sha512-mcdpQFV7UDAgLpXEE/jOMqvK4LBoO0uTQg0uvXUewmEFhpiZx5yJSZITHB8w1ZahKdhfZqP5GPEOKLyEq5p8XA==} - spdx-satisfies@5.0.1: - resolution: {integrity: sha512-Nwor6W6gzFp8XX4neaKQ7ChV4wmpSh2sSDemMFSzHxpTw460jxFYeOn+jq4ybnSSw/5sc3pjka9MQPouksQNpw==} + spdx-satisfies@6.0.0: + resolution: {integrity: sha512-oOWQocnRbFVtBnBITfFgzjhnOklHossTvI+6C1hB2slvp3HgTsfru5wuo8HY2rQpwSm5JuIhNzIuqOfR5IuojQ==} spdx-whitelisted@1.0.0: resolution: {integrity: sha512-X4FOpUCvZuo42MdB1zAZ/wdX4N0lLcWDozf2KYFVDgtLv8Lx+f31LOYLP2/FcwTzsPi64bS/VwKqklI4RBletg==} @@ -3831,12 +4064,13 @@ packages: sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - ssri@10.0.6: - resolution: {integrity: sha512-MGrFH9Z4NP9Iyhqn16sDtBpRRNJ0Y2hNa6D65h736fVSaPCHr4DM4sWUNvVaSuC+0OBGhwsrydQwmgfg5LncqQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + ssri@13.0.1: + resolution: {integrity: sha512-QUiRf1+u9wPTL/76GTYlKttDEBWV1ga9ZXW8BG6kfdeyyM8LGPix9gROyg9V2+P0xNyF3X2Go526xKFdMZrHSQ==} + engines: {node: ^20.17.0 || >=22.9.0} - stable-hash@0.0.5: - resolution: {integrity: sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA==} + stable-hash-x@0.2.0: + resolution: {integrity: sha512-o3yWv49B/o4QZk5ZcsALc6t0+eCelPc44zZsLtCQnZPDwFpDYSWcDnrv2TtMmMbQ7uKo3J0HTURCqckw23czNQ==} + engines: {node: '>=12.0.0'} stable@0.1.8: resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==} @@ -3861,6 +4095,10 @@ packages: resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} engines: {node: '>=18'} + string-width@8.2.2: + resolution: {integrity: sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==} + engines: {node: '>=20'} + string.prototype.trim@1.2.10: resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==} engines: {node: '>= 0.4'} @@ -3900,9 +4138,9 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - strtok3@7.1.1: - resolution: {integrity: sha512-mKX8HA/cdBqMKUr0MMZAFssCkIGoZeSCMXgnt79yKxNFguMLVFgRe6wB+fsL0NmoHDbeyZXczy7vEPSoo3rkzg==} - engines: {node: '>=16'} + strtok3@10.3.5: + resolution: {integrity: sha512-ki4hZQfh5rX0QDLLkOCj+h+CVNkqmp/CMf8v8kZpkNVK6jGQooMytqzLZYUVYIZcFZ6yDB70EfD8POcFXiF5oA==} + engines: {node: '>=18'} stubborn-fs@2.0.0: resolution: {integrity: sha512-Y0AvSwDw8y+nlSNFXMm2g6L51rBGdAQT20J3YSOqxC53Lo3bjWRtr2BKcfYoAf352WYpsZSTURrA0tqhfgudPA==} @@ -3910,6 +4148,10 @@ packages: stubborn-utils@1.0.2: resolution: {integrity: sha512-zOh9jPYI+xrNOyisSelgym4tolKTJCQd5GBhK0+0xJvcYDcwlOoxF/rnFKQ2KRZknXSG9jWAp66fwP6AxN9STg==} + super-regex@1.1.0: + resolution: {integrity: sha512-WHkws2ZflZe41zj6AolvvmaTrWds/VuyeYr9iPVv/oQeaIoVxMKaushfFWpOGDT+GuBrM/sVqF8KUCYQlSSTdQ==} + engines: {node: '>=18'} + supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -3922,6 +4164,10 @@ packages: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} + supports-hyperlinks@3.2.0: + resolution: {integrity: sha512-zFObLMyZeEwzAoKCyu1B91U79K2t7ApXuQfo8OuxwXLDgcKxuwM+YvcbIhm6QWqz7mHUH1TVytR1PwVVjEuMig==} + engines: {node: '>=14.18'} + supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} @@ -3943,17 +4189,16 @@ packages: resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} engines: {node: '>=6'} - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + tar@7.5.22: + resolution: {integrity: sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==} + engines: {node: '>=18'} temp-dir@3.0.0: resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} engines: {node: '>=14.16'} - tempy@3.1.0: - resolution: {integrity: sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==} + tempy@3.2.0: + resolution: {integrity: sha512-d79HhZya5Djd7am0q+W4RTsSU+D/aJzM+4Y4AGJGuGlgM2L6sx5ZvOYTmZjqPhrDrV6xJTtRSm1JCLj6V6LHLQ==} engines: {node: '>=14.16'} terser@5.44.1: @@ -3961,9 +4206,20 @@ packages: engines: {node: '>=10'} hasBin: true - test-exclude@7.0.1: - resolution: {integrity: sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==} - engines: {node: '>=18'} + test-exclude@8.0.0: + resolution: {integrity: sha512-ZOffsNrXYggvU1mDGHk54I96r26P8SyMjO5slMKSc7+IWmtB/MQKnEC2fP51imB3/pT6YK5cT5E8f+Dd9KdyOQ==} + engines: {node: 20 || >=22} + + thenify-all@1.6.0: + resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} + engines: {node: '>=0.8'} + + thenify@3.3.1: + resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + + time-span@5.1.0: + resolution: {integrity: sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA==} + engines: {node: '>=12'} tinyglobby@0.2.15: resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} @@ -3977,14 +4233,20 @@ packages: resolution: {integrity: sha512-41wJyvKep3yT2tyPqX/4blcfybknGB4D+oETKLs7Q76UiPqRpUJK3hr1nxelyYO0PHKVzJwlu0aCeEAsGI6rpw==} engines: {node: '>=20'} - token-types@5.0.1: - resolution: {integrity: sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==} + token-types@6.1.2: + resolution: {integrity: sha512-dRXchy+C0IgK8WPC6xvCHFRIWYUbqqdEIKPaKo/AcTUNzwLTK6AH7RjdLWsEZcAN/TBdtfUw3PYEgPr5VPr6ww==} engines: {node: '>=14.16'} treeverse@3.0.0: resolution: {integrity: sha512-gcANaAnd2QDZFmHFEOF4k7uc1J/6a6z3DJMd/QwEyxLoKGiptJRwid582r7QIsFlFMIZ3SnxfS52S4hm2DHkuQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + ts-api-utils@2.5.0: + resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==} + engines: {node: '>=18.12'} + peerDependencies: + typescript: '>=4.8.4' + ts-declaration-location@1.0.7: resolution: {integrity: sha512-EDyGAwH1gO0Ausm9gV6T2nUvBgXT5kGoCMJPllOaooZ+4VvJiKBdZE7wK18N1deEowhcUptS+5GXZK8U/fvpwA==} peerDependencies: @@ -3996,9 +4258,9 @@ packages: tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - tuf-js@2.2.1: - resolution: {integrity: sha512-GwIJau9XaA8nLVbUXsN3IlFi7WmQ48gBUrl3FTkkL/XLu/POhBzfmX9hd33FNMX1qAsfl6ozO1iMmW9NC8YniA==} - engines: {node: ^16.14.0 || >=18.0.0} + tuf-js@4.1.0: + resolution: {integrity: sha512-50QV99kCKH5P/Vs4E2Gzp7BopNV+KzTXqWeaxrfu5IQJBOULRsTIS9seSsOVT8ZnGXzCyx55nYWAi4qJzpZKEQ==} + engines: {node: ^20.17.0 || >=22.9.0} type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} @@ -4038,15 +4300,20 @@ packages: typedarray-to-buffer@3.1.5: resolution: {integrity: sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==} - typedoc@0.28.14: - resolution: {integrity: sha512-ftJYPvpVfQvFzpkoSfHLkJybdA/geDJ8BGQt/ZnkkhnBYoYW6lBgPQXu6vqLxO4X75dA55hX8Af847H5KXlEFA==} + typedoc@0.28.20: + resolution: {integrity: sha512-uSKqkh8Cr48vllnEy+jdaAgOeR6Y+QCBW7usgUsKj7gJEfR7stw9U/fE49LBnj2tPRKPY0c0EBJSWe9Appmplg==} engines: {node: '>= 18', pnpm: '>= 10'} hasBin: true peerDependencies: - typescript: 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x || 5.9.x + typescript: 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x || 5.9.x || 6.0.x - typescript@5.9.3: - resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + typescript@5.6.1-rc: + resolution: {integrity: sha512-E3b2+1zEFu84jB0YQi9BORDjz9+jGbwwy1Zi3G0LUNw7a7cePUrHMRNy8aPh53nXpkFGVHSxIZo5vKTfYaFiBQ==} + engines: {node: '>=14.17'} + hasBin: true + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} engines: {node: '>=14.17'} hasBin: true @@ -4065,14 +4332,29 @@ packages: uc.micro@2.1.0: resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} + uint8array-extras@1.5.0: + resolution: {integrity: sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==} + engines: {node: '>=18'} + unbox-primitive@1.1.0: resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} engines: {node: '>= 0.4'} + undici-types@8.3.0: + resolution: {integrity: sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==} + + undici@6.28.0: + resolution: {integrity: sha512-LIY910g9TI13YS95lrMFrs8Rm/u/irgHeTWoKCoteeJ04CUJ92eEfj0rVn+7VKMPBpUPiUoBKfhNyLI23EE/KA==} + engines: {node: '>=18.17'} + unicode-canonical-property-names-ecmascript@2.0.1: resolution: {integrity: sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==} engines: {node: '>=4'} + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + unicode-match-property-ecmascript@2.0.0: resolution: {integrity: sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==} engines: {node: '>=4'} @@ -4085,22 +4367,14 @@ packages: resolution: {integrity: sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ==} engines: {node: '>=4'} - unicorn-magic@0.3.0: - resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==} - engines: {node: '>=18'} + unicorn-magic@0.4.0: + resolution: {integrity: sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw==} + engines: {node: '>=20'} union@0.5.0: resolution: {integrity: sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==} engines: {node: '>= 0.8.0'} - unique-filename@3.0.0: - resolution: {integrity: sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - unique-slug@4.0.0: - resolution: {integrity: sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - unique-string@3.0.0: resolution: {integrity: sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==} engines: {node: '>=12'} @@ -4108,6 +4382,9 @@ packages: unist-util-is@6.0.1: resolution: {integrity: sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==} + unist-util-remove-position@5.0.0: + resolution: {integrity: sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==} + unist-util-stringify-position@4.0.0: resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} @@ -4126,6 +4403,12 @@ packages: peerDependencies: browserslist: '>= 4.21.0' + update-browserslist-db@1.2.3: + resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + update-notifier@6.0.2: resolution: {integrity: sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og==} engines: {node: '>=14.16'} @@ -4147,15 +4430,20 @@ packages: resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} engines: {node: '>=10.12.0'} - validate-npm-package-license@3.0.4: - resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} - validate-npm-package-name@5.0.1: resolution: {integrity: sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - walk-up-path@3.0.1: - resolution: {integrity: sha512-9YlCL/ynK3CTlrSRrDxZvUauLzAswPCrsaCgilqFevUYpeEW0/3ScEjaa3kbW/T0ghhkEr7mv+fpjqn1Y1YuTA==} + validate-npm-package-name@7.0.2: + resolution: {integrity: sha512-hVDIBwsRruT73PbK7uP5ebUt+ezEtCmzZz3F59BSr2F6OVFnJ/6h8liuvdLrQ88Xmnk6/+xGGuq+pG9WwTuy3A==} + engines: {node: ^20.17.0 || >=22.9.0} + + walk-up-path@4.0.0: + resolution: {integrity: sha512-3hu+tD8YzSLGuFYtPRb48vdhKMi0KQV5sn+uWr8+7dMEq/2G/dtLrdDinkLjqq5TIbIBjYJ4Ax/n3YiaW7QM8A==} + engines: {node: 20 || >=22} + + web-worker@1.5.0: + resolution: {integrity: sha512-RiMReJrTAiA+mBjGONMnjVDP2u3p9R1vkcGz6gDIrOMT3oGuYwX2WRMYI9ipkphSuE5XKEhydbhNEJh4NY9mlw==} whatwg-encoding@2.0.0: resolution: {integrity: sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==} @@ -4186,9 +4474,9 @@ packages: engines: {node: '>= 8'} hasBin: true - which@4.0.0: - resolution: {integrity: sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==} - engines: {node: ^16.13.0 || >=18.0.0} + which@6.0.1: + resolution: {integrity: sha512-oGLe46MIrCRqX7ytPUf66EAYvdeMIZYn3WaocqqKZAxrBpkqHfL/qvTyJ/bTk5+AqHCjXmrv3CEWgy368zhRUg==} + engines: {node: ^20.17.0 || >=22.9.0} hasBin: true widest-line@4.0.1: @@ -4229,13 +4517,13 @@ packages: write-file-atomic@3.0.3: resolution: {integrity: sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==} - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + write-file-atomic@7.0.1: + resolution: {integrity: sha512-OTIk8iR8/aCRWBqvxrzxR0hgxWpnYBblY1S5hDWBQfk/VFmJwzmJgQFN3WsoUKHISv2eAwe+PpbUzyL1CKTLXg==} + engines: {node: ^20.17.0 || >=22.9.0} - wsl-utils@0.1.0: - resolution: {integrity: sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==} - engines: {node: '>=18'} + wsl-utils@0.3.1: + resolution: {integrity: sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg==} + engines: {node: '>=20'} xdg-basedir@5.1.0: resolution: {integrity: sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==} @@ -4245,29 +4533,46 @@ packages: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} - yallist@3.1.1: - resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + yaml@2.9.0: resolution: {integrity: sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==} engines: {node: '>= 14.6'} hasBin: true + yargs-parser@20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} + yargs-parser@22.0.0: + resolution: {integrity: sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==} + engines: {node: ^20.19.0 || ^22.12.0 || >=23} + yargs-unparser@2.0.0: resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} engines: {node: '>=10'} + yargs@16.2.2: + resolution: {integrity: sha512-Nt9ZJjXTv5R8MHbqby/wXQ6Gi0Bb3TcYZkR1bzuL4yB2OxWPkXknz513gEF0GoA6tn00UpbPvERW8rzCuWCA6w==} + engines: {node: '>=10'} + yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} + yargs@18.1.0: + resolution: {integrity: sha512-2rAgRKu54VsHkqI0/tYkmluGXHD4KW7yZoycuqDQ15QOTnc2VVfy0nN/1eMhnQLO00A+dwtK20xuCnc1YGeUyg==} + engines: {node: ^20.19.0 || ^22.12.0 || >=23} + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -4277,11 +4582,28 @@ packages: snapshots: - '@babel/code-frame@7.27.1': + '@andrewbranch/untar.js@1.0.3': {} + + '@arethetypeswrong/cli@0.18.5': dependencies: - '@babel/helper-validator-identifier': 7.28.5 - js-tokens: 4.0.0 - picocolors: 1.1.1 + '@arethetypeswrong/core': 0.18.5 + chalk: 4.1.2 + cli-table3: 0.6.5 + commander: 10.0.1 + marked: 9.1.6 + marked-terminal: 7.3.0(marked@9.1.6) + semver: 7.8.5 + + '@arethetypeswrong/core@0.18.5': + dependencies: + '@andrewbranch/untar.js': 1.0.3 + '@loaderkit/resolve': 1.0.6 + cjs-module-lexer: 1.4.3 + fflate: 0.8.3 + lru-cache: 11.5.2 + semver: 7.8.5 + typescript: 5.6.1-rc + validate-npm-package-name: 5.0.1 '@babel/code-frame@7.29.0': dependencies: @@ -4289,698 +4611,603 @@ snapshots: js-tokens: 4.0.0 picocolors: 1.1.1 - '@babel/compat-data@7.28.5': {} + '@babel/code-frame@8.0.0': + dependencies: + '@babel/helper-validator-identifier': 8.0.4 + js-tokens: 10.0.0 + + '@babel/compat-data@8.0.0': {} - '@babel/core@7.28.5': + '@babel/core@8.0.1': dependencies: - '@babel/code-frame': 7.27.1 - '@babel/generator': 7.28.5 - '@babel/helper-compilation-targets': 7.27.2 - '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5) - '@babel/helpers': 7.28.4 - '@babel/parser': 7.28.5 - '@babel/template': 7.27.2 - '@babel/traverse': 7.28.5 - '@babel/types': 7.28.5 - '@jridgewell/remapping': 2.3.5 + '@babel/code-frame': 8.0.0 + '@babel/generator': 8.0.0 + '@babel/helper-compilation-targets': 8.0.0 + '@babel/helpers': 8.0.0 + '@babel/parser': 8.0.4 + '@babel/template': 8.0.0 + '@babel/traverse': 8.0.4 + '@babel/types': 8.0.4 + '@types/gensync': 1.0.5 convert-source-map: 2.0.0 - debug: 4.4.3(supports-color@8.1.1) + empathic: 2.0.1 gensync: 1.0.0-beta.2 + import-meta-resolve: 4.2.0 json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color + obug: 2.1.4 + semver: 7.7.3 - '@babel/eslint-parser@7.28.5(@babel/core@7.28.5)(eslint@9.39.1)': + '@babel/eslint-parser@8.0.1(@babel/core@8.0.1)(eslint@10.8.0(supports-color@8.1.1))': dependencies: - '@babel/core': 7.28.5 - '@nicolo-ribaudo/eslint-scope-5-internals': 5.1.1-v1 - eslint: 9.39.1 - eslint-visitor-keys: 2.1.0 - semver: 6.3.1 + '@babel/core': 8.0.1 + eslint: 10.8.0(supports-color@8.1.1) + eslint-scope: 9.1.2 + eslint-visitor-keys: 5.0.1 + semver: 7.7.3 - '@babel/eslint-plugin@7.27.1(@babel/eslint-parser@7.28.5(@babel/core@7.28.5)(eslint@9.39.1))(eslint@9.39.1)': + '@babel/eslint-plugin@8.0.1(@babel/core@8.0.1)(@babel/eslint-parser@8.0.1(@babel/core@8.0.1)(eslint@10.8.0(supports-color@8.1.1)))(eslint@10.8.0(supports-color@8.1.1))': dependencies: - '@babel/eslint-parser': 7.28.5(@babel/core@7.28.5)(eslint@9.39.1) - eslint: 9.39.1 - eslint-rule-composer: 0.3.0 + '@babel/core': 8.0.1 + '@babel/eslint-parser': 8.0.1(@babel/core@8.0.1)(eslint@10.8.0(supports-color@8.1.1)) + eslint: 10.8.0(supports-color@8.1.1) - '@babel/generator@7.28.5': + '@babel/generator@7.29.1': dependencies: - '@babel/parser': 7.28.5 - '@babel/types': 7.28.5 + '@babel/parser': 7.29.3 + '@babel/types': 7.29.0 '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 jsesc: 3.1.0 - '@babel/generator@7.29.1': + '@babel/generator@8.0.0': dependencies: - '@babel/parser': 7.29.3 - '@babel/types': 7.29.0 + '@babel/parser': 8.0.4 + '@babel/types': 8.0.4 '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 + '@types/jsesc': 2.5.1 jsesc: 3.1.0 - '@babel/helper-annotate-as-pure@7.27.3': + '@babel/helper-annotate-as-pure@8.0.0': dependencies: - '@babel/types': 7.28.5 + '@babel/types': 8.0.4 - '@babel/helper-compilation-targets@7.27.2': + '@babel/helper-compilation-targets@8.0.0': dependencies: - '@babel/compat-data': 7.28.5 - '@babel/helper-validator-option': 7.27.1 + '@babel/compat-data': 8.0.0 + '@babel/helper-validator-option': 8.0.0 browserslist: 4.28.0 - lru-cache: 5.1.1 - semver: 6.3.1 + lru-cache: 11.5.2 + semver: 7.7.3 - '@babel/helper-create-class-features-plugin@7.28.5(@babel/core@7.28.5)': + '@babel/helper-create-class-features-plugin@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-member-expression-to-functions': 7.28.5 - '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/helper-replace-supers': 7.27.1(@babel/core@7.28.5) - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/traverse': 7.28.5 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-annotate-as-pure': 8.0.0 + '@babel/helper-member-expression-to-functions': 8.0.0 + '@babel/helper-optimise-call-expression': 8.0.0 + '@babel/helper-replace-supers': 8.0.1(@babel/core@8.0.1) + '@babel/helper-skip-transparent-expression-wrappers': 8.0.0 + '@babel/traverse': 8.0.4 + semver: 7.8.5 - '@babel/helper-create-regexp-features-plugin@7.28.5(@babel/core@7.28.5)': + '@babel/helper-create-regexp-features-plugin@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-annotate-as-pure': 7.27.3 + '@babel/core': 8.0.1 + '@babel/helper-annotate-as-pure': 8.0.0 regexpu-core: 6.4.0 - semver: 6.3.1 + semver: 7.8.5 - '@babel/helper-define-polyfill-provider@0.6.5(@babel/core@7.28.5)': + '@babel/helper-define-polyfill-provider@1.0.0(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-compilation-targets': 7.27.2 - '@babel/helper-plugin-utils': 7.27.1 - debug: 4.4.3(supports-color@8.1.1) + '@babel/core': 8.0.1 + '@babel/helper-compilation-targets': 8.0.0 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) lodash.debounce: 4.0.8 - resolve: 1.22.11 - transitivePeerDependencies: - - supports-color '@babel/helper-globals@7.28.0': {} - '@babel/helper-member-expression-to-functions@7.28.5': - dependencies: - '@babel/traverse': 7.28.5 - '@babel/types': 7.28.5 - transitivePeerDependencies: - - supports-color + '@babel/helper-globals@8.0.0': {} - '@babel/helper-module-imports@7.27.1': + '@babel/helper-member-expression-to-functions@8.0.0': dependencies: - '@babel/traverse': 7.28.5 - '@babel/types': 7.28.5 - transitivePeerDependencies: - - supports-color + '@babel/traverse': 8.0.4 + '@babel/types': 8.0.4 - '@babel/helper-module-imports@7.28.6': + '@babel/helper-module-imports@7.28.6(supports-color@8.1.1)': dependencies: - '@babel/traverse': 7.29.0 + '@babel/traverse': 7.29.0(supports-color@8.1.1) '@babel/types': 7.29.0 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.28.3(@babel/core@7.28.5)': + '@babel/helper-module-imports@8.0.0': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-module-imports': 7.27.1 - '@babel/helper-validator-identifier': 7.28.5 - '@babel/traverse': 7.28.5 - transitivePeerDependencies: - - supports-color + '@babel/traverse': 8.0.4 + '@babel/types': 8.0.4 - '@babel/helper-module-transforms@7.28.6(@babel/core@7.28.5)': + '@babel/helper-module-transforms@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-module-imports': 7.28.6 - '@babel/helper-validator-identifier': 7.28.5 - '@babel/traverse': 7.29.0 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-module-imports': 8.0.0 + '@babel/helper-validator-identifier': 8.0.4 + '@babel/traverse': 8.0.4 - '@babel/helper-optimise-call-expression@7.27.1': + '@babel/helper-optimise-call-expression@8.0.0': dependencies: - '@babel/types': 7.28.5 + '@babel/types': 8.0.4 - '@babel/helper-plugin-utils@7.27.1': {} - - '@babel/helper-plugin-utils@7.28.6': {} + '@babel/helper-plugin-utils@8.0.1(@babel/core@8.0.1)': + dependencies: + '@babel/core': 8.0.1 - '@babel/helper-remap-async-to-generator@7.27.1(@babel/core@7.28.5)': + '@babel/helper-remap-async-to-generator@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-wrap-function': 7.28.3 - '@babel/traverse': 7.28.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-annotate-as-pure': 8.0.0 + '@babel/helper-wrap-function': 8.0.0 + '@babel/traverse': 8.0.4 - '@babel/helper-replace-supers@7.27.1(@babel/core@7.28.5)': + '@babel/helper-replace-supers@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-member-expression-to-functions': 7.28.5 - '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/traverse': 7.28.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-member-expression-to-functions': 8.0.0 + '@babel/helper-optimise-call-expression': 8.0.0 + '@babel/traverse': 8.0.4 - '@babel/helper-skip-transparent-expression-wrappers@7.27.1': + '@babel/helper-skip-transparent-expression-wrappers@8.0.0': dependencies: - '@babel/traverse': 7.28.5 - '@babel/types': 7.28.5 - transitivePeerDependencies: - - supports-color + '@babel/traverse': 8.0.4 + '@babel/types': 8.0.4 '@babel/helper-string-parser@7.27.1': {} + '@babel/helper-string-parser@8.0.0': {} + '@babel/helper-validator-identifier@7.28.5': {} - '@babel/helper-validator-option@7.27.1': {} + '@babel/helper-validator-identifier@8.0.4': {} - '@babel/helper-wrap-function@7.28.3': - dependencies: - '@babel/template': 7.27.2 - '@babel/traverse': 7.28.5 - '@babel/types': 7.28.5 - transitivePeerDependencies: - - supports-color + '@babel/helper-validator-option@8.0.0': {} - '@babel/helpers@7.28.4': + '@babel/helper-wrap-function@8.0.0': dependencies: - '@babel/template': 7.27.2 - '@babel/types': 7.28.5 + '@babel/template': 8.0.0 + '@babel/traverse': 8.0.4 + '@babel/types': 8.0.4 - '@babel/parser@7.28.5': + '@babel/helpers@8.0.0': dependencies: - '@babel/types': 7.28.5 + '@babel/template': 8.0.0 + '@babel/types': 8.0.4 '@babel/parser@7.29.3': dependencies: '@babel/types': 7.29.0 - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.28.5(@babel/core@7.28.5)': + '@babel/parser@8.0.4': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/traverse': 7.28.5 - transitivePeerDependencies: - - supports-color + '@babel/types': 8.0.4 - '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-bugfix-safari-class-field-initializer-scope@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/plugin-transform-optional-chaining': 7.28.5(@babel/core@7.28.5) - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.28.3(@babel/core@7.28.5)': + '@babel/plugin-bugfix-safari-rest-destructuring-rhs-array@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/traverse': 7.28.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + '@babel/helper-skip-transparent-expression-wrappers': 8.0.0 - '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.28.5)': + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + '@babel/helper-skip-transparent-expression-wrappers': 8.0.0 + '@babel/plugin-transform-optional-chaining': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-syntax-import-assertions@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-syntax-import-attributes@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-syntax-import-attributes@8.0.0-rc.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.28.5)': + '@babel/plugin-transform-arrow-functions@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-arrow-functions@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-async-generator-functions@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + '@babel/helper-remap-async-to-generator': 8.0.1(@babel/core@8.0.1) + '@babel/traverse': 8.0.4 - '@babel/plugin-transform-async-generator-functions@7.28.0(@babel/core@7.28.5)': + '@babel/plugin-transform-async-to-generator@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-remap-async-to-generator': 7.27.1(@babel/core@7.28.5) - '@babel/traverse': 7.28.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-module-imports': 8.0.0 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + '@babel/helper-remap-async-to-generator': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-async-to-generator@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-block-scoped-functions@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-module-imports': 7.27.1 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-remap-async-to-generator': 7.27.1(@babel/core@7.28.5) - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-block-scoped-functions@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-block-scoping@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-block-scoping@7.28.5(@babel/core@7.28.5)': + '@babel/plugin-transform-class-properties@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-create-class-features-plugin': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-class-properties@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-class-static-block@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-create-class-features-plugin': 7.28.5(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-create-class-features-plugin': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-class-static-block@7.28.3(@babel/core@7.28.5)': + '@babel/plugin-transform-classes@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-create-class-features-plugin': 7.28.5(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-annotate-as-pure': 8.0.0 + '@babel/helper-compilation-targets': 8.0.0 + '@babel/helper-globals': 8.0.0 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + '@babel/helper-replace-supers': 8.0.1(@babel/core@8.0.1) + '@babel/traverse': 8.0.4 - '@babel/plugin-transform-classes@7.28.4(@babel/core@7.28.5)': + '@babel/plugin-transform-computed-properties@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-compilation-targets': 7.27.2 - '@babel/helper-globals': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-replace-supers': 7.27.1(@babel/core@7.28.5) - '@babel/traverse': 7.28.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-computed-properties@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-destructuring@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/template': 7.27.2 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-destructuring@7.28.5(@babel/core@7.28.5)': + '@babel/plugin-transform-dotall-regex@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/traverse': 7.28.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-create-regexp-features-plugin': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-dotall-regex@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-duplicate-keys@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-duplicate-keys@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-duplicate-named-capturing-groups-regex@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-create-regexp-features-plugin': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-dynamic-import@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-dynamic-import@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-explicit-resource-management@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-destructuring': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-explicit-resource-management@7.28.0(@babel/core@7.28.5)': + '@babel/plugin-transform-exponentiation-operator@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-destructuring': 7.28.5(@babel/core@7.28.5) - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-exponentiation-operator@7.28.5(@babel/core@7.28.5)': + '@babel/plugin-transform-export-namespace-from@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-export-namespace-from@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-for-of@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + '@babel/helper-skip-transparent-expression-wrappers': 8.0.0 - '@babel/plugin-transform-for-of@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-function-name@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-compilation-targets': 8.0.0 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-function-name@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-json-strings@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-compilation-targets': 7.27.2 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/traverse': 7.28.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-json-strings@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-literals@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-literals@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-logical-assignment-operators@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-logical-assignment-operators@7.28.5(@babel/core@7.28.5)': + '@babel/plugin-transform-member-expression-literals@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-member-expression-literals@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-modules-amd@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-module-transforms': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-modules-amd@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-modules-commonjs@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-module-transforms': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-modules-commonjs@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-modules-systemjs@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-module-transforms': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + '@babel/helper-validator-identifier': 8.0.4 - '@babel/plugin-transform-modules-systemjs@7.29.4(@babel/core@7.28.5)': + '@babel/plugin-transform-modules-umd@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-module-transforms': 7.28.6(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.28.6 - '@babel/helper-validator-identifier': 7.28.5 - '@babel/traverse': 7.29.0 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-module-transforms': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-modules-umd@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-named-capturing-groups-regex@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-create-regexp-features-plugin': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-named-capturing-groups-regex@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-new-target@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-new-target@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-nullish-coalescing-operator@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-nullish-coalescing-operator@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-numeric-separator@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-numeric-separator@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-object-rest-spread@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-compilation-targets': 8.0.0 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-destructuring': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-parameters': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-object-rest-spread@7.28.4(@babel/core@7.28.5)': + '@babel/plugin-transform-object-super@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-compilation-targets': 7.27.2 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-destructuring': 7.28.5(@babel/core@7.28.5) - '@babel/plugin-transform-parameters': 7.27.7(@babel/core@7.28.5) - '@babel/traverse': 7.28.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + '@babel/helper-replace-supers': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-object-super@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-optional-catch-binding@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-replace-supers': 7.27.1(@babel/core@7.28.5) - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-optional-catch-binding@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-optional-chaining@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + '@babel/helper-skip-transparent-expression-wrappers': 8.0.0 - '@babel/plugin-transform-optional-chaining@7.28.5(@babel/core@7.28.5)': + '@babel/plugin-transform-parameters@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-parameters@7.27.7(@babel/core@7.28.5)': + '@babel/plugin-transform-private-methods@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-create-class-features-plugin': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-private-methods@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-private-property-in-object@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-create-class-features-plugin': 7.28.5(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-annotate-as-pure': 8.0.0 + '@babel/helper-create-class-features-plugin': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-private-property-in-object@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-property-literals@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-create-class-features-plugin': 7.28.5(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-property-literals@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-regenerator@8.0.2(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-regenerator@7.28.4(@babel/core@7.28.5)': + '@babel/plugin-transform-regexp-modifiers@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-create-regexp-features-plugin': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-regexp-modifiers@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-reserved-words@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-reserved-words@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-shorthand-properties@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) - '@babel/plugin-transform-shorthand-properties@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-spread@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + '@babel/helper-skip-transparent-expression-wrappers': 8.0.0 - '@babel/plugin-transform-spread@7.27.1(@babel/core@7.28.5)': + '@babel/plugin-transform-sticky-regex@8.0.1(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-sticky-regex@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-transform-template-literals@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-transform-typeof-symbol@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-transform-unicode-escapes@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-transform-unicode-property-regex@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-transform-unicode-regex@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-transform-unicode-sets-regex@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-create-regexp-features-plugin': 7.28.5(@babel/core@7.28.5) - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/preset-env@7.28.5(@babel/core@7.28.5)': - dependencies: - '@babel/compat-data': 7.28.5 - '@babel/core': 7.28.5 - '@babel/helper-compilation-targets': 7.27.2 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/helper-validator-option': 7.27.1 - '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.28.5(@babel/core@7.28.5) - '@babel/plugin-bugfix-safari-class-field-initializer-scope': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.28.3(@babel/core@7.28.5) - '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.28.5) - '@babel/plugin-syntax-import-assertions': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-syntax-import-attributes': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.28.5) - '@babel/plugin-transform-arrow-functions': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-async-generator-functions': 7.28.0(@babel/core@7.28.5) - '@babel/plugin-transform-async-to-generator': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-block-scoped-functions': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-block-scoping': 7.28.5(@babel/core@7.28.5) - '@babel/plugin-transform-class-properties': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-class-static-block': 7.28.3(@babel/core@7.28.5) - '@babel/plugin-transform-classes': 7.28.4(@babel/core@7.28.5) - '@babel/plugin-transform-computed-properties': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-destructuring': 7.28.5(@babel/core@7.28.5) - '@babel/plugin-transform-dotall-regex': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-duplicate-keys': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-duplicate-named-capturing-groups-regex': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-dynamic-import': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-explicit-resource-management': 7.28.0(@babel/core@7.28.5) - '@babel/plugin-transform-exponentiation-operator': 7.28.5(@babel/core@7.28.5) - '@babel/plugin-transform-export-namespace-from': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-for-of': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-function-name': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-json-strings': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-literals': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-logical-assignment-operators': 7.28.5(@babel/core@7.28.5) - '@babel/plugin-transform-member-expression-literals': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-modules-amd': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-modules-commonjs': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-modules-systemjs': 7.29.4(@babel/core@7.28.5) - '@babel/plugin-transform-modules-umd': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-named-capturing-groups-regex': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-new-target': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-nullish-coalescing-operator': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-numeric-separator': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-object-rest-spread': 7.28.4(@babel/core@7.28.5) - '@babel/plugin-transform-object-super': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-optional-catch-binding': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-optional-chaining': 7.28.5(@babel/core@7.28.5) - '@babel/plugin-transform-parameters': 7.27.7(@babel/core@7.28.5) - '@babel/plugin-transform-private-methods': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-private-property-in-object': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-property-literals': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-regenerator': 7.28.4(@babel/core@7.28.5) - '@babel/plugin-transform-regexp-modifiers': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-reserved-words': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-shorthand-properties': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-spread': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-sticky-regex': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-template-literals': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-typeof-symbol': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-unicode-escapes': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-unicode-property-regex': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-unicode-regex': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-transform-unicode-sets-regex': 7.27.1(@babel/core@7.28.5) - '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.28.5) - babel-plugin-polyfill-corejs2: 0.4.14(@babel/core@7.28.5) - babel-plugin-polyfill-corejs3: 0.13.0(@babel/core@7.28.5) - babel-plugin-polyfill-regenerator: 0.6.5(@babel/core@7.28.5) - core-js-compat: 3.47.0 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + + '@babel/plugin-transform-template-literals@8.0.1(@babel/core@8.0.1)': + dependencies: + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + + '@babel/plugin-transform-typeof-symbol@8.0.1(@babel/core@8.0.1)': + dependencies: + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + + '@babel/plugin-transform-unicode-escapes@8.0.1(@babel/core@8.0.1)': + dependencies: + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + + '@babel/plugin-transform-unicode-property-regex@8.0.1(@babel/core@8.0.1)': + dependencies: + '@babel/core': 8.0.1 + '@babel/helper-create-regexp-features-plugin': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + + '@babel/plugin-transform-unicode-regex@8.0.1(@babel/core@8.0.1)': + dependencies: + '@babel/core': 8.0.1 + '@babel/helper-create-regexp-features-plugin': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + + '@babel/plugin-transform-unicode-sets-regex@8.0.1(@babel/core@8.0.1)': + dependencies: + '@babel/core': 8.0.1 + '@babel/helper-create-regexp-features-plugin': 8.0.1(@babel/core@8.0.1) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + + '@babel/preset-env@8.0.2(@babel/core@8.0.1)': + dependencies: + '@babel/compat-data': 8.0.0 + '@babel/core': 8.0.1 + '@babel/helper-compilation-targets': 8.0.0 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + '@babel/helper-validator-option': 8.0.0 + '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-bugfix-safari-class-field-initializer-scope': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-bugfix-safari-rest-destructuring-rhs-array': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-arrow-functions': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-async-generator-functions': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-async-to-generator': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-block-scoped-functions': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-block-scoping': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-class-properties': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-class-static-block': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-classes': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-computed-properties': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-destructuring': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-dotall-regex': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-duplicate-keys': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-duplicate-named-capturing-groups-regex': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-dynamic-import': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-explicit-resource-management': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-exponentiation-operator': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-export-namespace-from': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-for-of': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-function-name': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-json-strings': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-literals': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-logical-assignment-operators': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-member-expression-literals': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-modules-amd': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-modules-commonjs': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-modules-systemjs': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-modules-umd': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-named-capturing-groups-regex': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-new-target': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-nullish-coalescing-operator': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-numeric-separator': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-object-rest-spread': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-object-super': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-optional-catch-binding': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-optional-chaining': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-parameters': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-private-methods': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-private-property-in-object': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-property-literals': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-regenerator': 8.0.2(@babel/core@8.0.1) + '@babel/plugin-transform-regexp-modifiers': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-reserved-words': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-shorthand-properties': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-spread': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-sticky-regex': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-template-literals': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-typeof-symbol': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-unicode-escapes': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-unicode-property-regex': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-unicode-regex': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-unicode-sets-regex': 8.0.1(@babel/core@8.0.1) + '@babel/preset-modules': 0.2.0(@babel/core@8.0.1) + babel-plugin-polyfill-corejs3: 1.0.0(@babel/core@8.0.1) + core-js-compat: 3.49.0 + semver: 7.7.3 - '@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.28.5)': + '@babel/preset-modules@0.2.0(@babel/core@8.0.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/types': 7.28.5 + '@babel/core': 8.0.1 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-dotall-regex': 8.0.1(@babel/core@8.0.1) + '@babel/plugin-transform-unicode-property-regex': 8.0.1(@babel/core@8.0.1) + '@babel/types': 8.0.4 esutils: 2.0.3 - '@babel/template@7.27.2': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/parser': 7.28.5 - '@babel/types': 7.28.5 - '@babel/template@7.28.6': dependencies: '@babel/code-frame': 7.29.0 '@babel/parser': 7.29.3 '@babel/types': 7.29.0 - '@babel/traverse@7.28.5': + '@babel/template@8.0.0': dependencies: - '@babel/code-frame': 7.27.1 - '@babel/generator': 7.28.5 - '@babel/helper-globals': 7.28.0 - '@babel/parser': 7.28.5 - '@babel/template': 7.27.2 - '@babel/types': 7.28.5 - debug: 4.4.3(supports-color@8.1.1) - transitivePeerDependencies: - - supports-color + '@babel/code-frame': 8.0.0 + '@babel/parser': 8.0.4 + '@babel/types': 8.0.4 - '@babel/traverse@7.29.0': + '@babel/traverse@7.29.0(supports-color@8.1.1)': dependencies: '@babel/code-frame': 7.29.0 '@babel/generator': 7.29.1 @@ -4992,23 +5219,40 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/types@7.28.5': + '@babel/traverse@8.0.4': dependencies: - '@babel/helper-string-parser': 7.27.1 - '@babel/helper-validator-identifier': 7.28.5 + '@babel/code-frame': 8.0.0 + '@babel/generator': 8.0.0 + '@babel/helper-globals': 8.0.0 + '@babel/parser': 8.0.4 + '@babel/template': 8.0.0 + '@babel/types': 8.0.4 + obug: 2.1.4 '@babel/types@7.29.0': dependencies: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.28.5 + '@babel/types@8.0.4': + dependencies: + '@babel/helper-string-parser': 8.0.0 + '@babel/helper-validator-identifier': 8.0.4 + '@bcoe/v8-coverage@1.0.2': {} '@blueoak/list@15.0.0': {} - '@brettz9/eslint-plugin@3.0.0(eslint@9.39.1)': + '@borewit/text-codec@0.2.2': {} + + '@braidai/lang@1.1.2': {} + + '@brettz9/eslint-plugin@3.0.0(eslint@10.8.0(supports-color@8.1.1))': dependencies: - eslint: 9.39.1 + eslint: 10.8.0(supports-color@8.1.1) + + '@colors/colors@1.5.0': + optional: true '@emnapi/core@1.7.1': dependencies: @@ -5026,92 +5270,92 @@ snapshots: tslib: 2.8.1 optional: true - '@es-joy/jsdoccomment@0.76.0': + '@es-joy/jsdoccomment@0.90.0': dependencies: '@types/estree': 1.0.9 - '@typescript-eslint/types': 8.47.0 - comment-parser: 1.4.1 - esquery: 1.6.0 - jsdoc-type-pratt-parser: 6.10.0 + '@typescript-eslint/types': 8.65.0 + comment-parser: 1.4.7 + esquery: 1.7.0 + jsdoc-type-pratt-parser: 7.3.0 '@es-joy/resolve.exports@1.2.0': {} - '@eslint-community/eslint-plugin-eslint-comments@4.5.0(eslint@9.39.1)': + '@eslint-community/eslint-plugin-eslint-comments@4.7.2(eslint@10.8.0(supports-color@8.1.1))': dependencies: escape-string-regexp: 4.0.0 - eslint: 9.39.1 - ignore: 5.3.2 + eslint: 10.8.0(supports-color@8.1.1) + ignore: 7.0.5 - '@eslint-community/eslint-utils@4.9.0(eslint@9.39.1)': + '@eslint-community/eslint-utils@4.10.1(eslint@10.8.0(supports-color@8.1.1))': dependencies: - eslint: 9.39.1 + eslint: 10.8.0(supports-color@8.1.1) eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.12.1': {} + '@eslint-community/eslint-utils@4.9.0(eslint@10.8.0(supports-color@8.1.1))': + dependencies: + eslint: 10.8.0(supports-color@8.1.1) + eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.2': {} - '@eslint/config-array@0.21.1': + '@eslint/config-array@0.23.5(supports-color@8.1.1)': dependencies: - '@eslint/object-schema': 2.1.7 + '@eslint/object-schema': 3.0.5 debug: 4.4.3(supports-color@8.1.1) - minimatch: 3.1.5 + minimatch: 10.2.5 transitivePeerDependencies: - supports-color - '@eslint/config-helpers@0.4.2': + '@eslint/config-helpers@0.7.0': dependencies: - '@eslint/core': 0.17.0 + '@eslint/core': 1.2.1 - '@eslint/core@0.17.0': + '@eslint/core@1.2.1': dependencies: '@types/json-schema': 7.0.15 - '@eslint/eslintrc@3.3.1': + '@eslint/css-tree@4.0.5': dependencies: - ajv: 6.15.0 - debug: 4.4.3(supports-color@8.1.1) - espree: 10.4.0 - globals: 14.0.0 - ignore: 5.3.2 - import-fresh: 3.3.1 - js-yaml: 4.1.1 - minimatch: 3.1.5 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color + mdn-data: 2.29.0 + source-map-js: 1.2.1 - '@eslint/js@9.39.1': {} + '@eslint/js@10.0.1(eslint@10.8.0(supports-color@8.1.1))': + optionalDependencies: + eslint: 10.8.0(supports-color@8.1.1) - '@eslint/markdown@7.5.1': + '@eslint/markdown@8.0.3(supports-color@8.1.1)': dependencies: - '@eslint/core': 0.17.0 - '@eslint/plugin-kit': 0.4.1 + '@eslint/core': 1.2.1 + '@eslint/plugin-kit': 0.7.2 github-slugger: 2.0.0 - mdast-util-from-markdown: 2.0.2 - mdast-util-frontmatter: 2.0.1 - mdast-util-gfm: 3.1.0 + mdast-util-from-markdown: 2.0.2(supports-color@8.1.1) + mdast-util-frontmatter: 2.0.1(supports-color@8.1.1) + mdast-util-gfm: 3.1.0(supports-color@8.1.1) + mdast-util-math: 3.0.0(supports-color@8.1.1) micromark-extension-frontmatter: 2.0.0 micromark-extension-gfm: 3.0.0 + micromark-extension-math: 3.1.0 micromark-util-normalize-identifier: 2.0.1 transitivePeerDependencies: - supports-color - '@eslint/object-schema@2.1.7': {} + '@eslint/object-schema@3.0.5': {} - '@eslint/plugin-kit@0.4.1': + '@eslint/plugin-kit@0.7.2': dependencies: - '@eslint/core': 0.17.0 + '@eslint/core': 1.2.1 levn: 0.4.1 '@fintechstudios/eslint-plugin-chai-as-promised@3.1.0': {} - '@gerrit0/mini-shiki@3.15.0': + '@gar/promise-retry@1.0.3': {} + + '@gerrit0/mini-shiki@3.23.0': dependencies: - '@shikijs/engine-oniguruma': 3.15.0 - '@shikijs/langs': 3.15.0 - '@shikijs/themes': 3.15.0 - '@shikijs/types': 3.15.0 + '@shikijs/engine-oniguruma': 3.23.0 + '@shikijs/langs': 3.23.0 + '@shikijs/themes': 3.23.0 + '@shikijs/types': 3.23.0 '@shikijs/vscode-textmate': 10.0.2 '@humanfs/core@0.19.1': {} @@ -5134,6 +5378,10 @@ snapshots: wrap-ansi: 8.1.0 wrap-ansi-cjs: wrap-ansi@7.0.0 + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + '@isaacs/string-locale-compare@1.1.0': {} '@istanbuljs/load-nyc-config@1.1.0': @@ -5151,11 +5399,6 @@ snapshots: '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping': 0.3.31 - '@jridgewell/remapping@2.3.5': - dependencies: - '@jridgewell/gen-mapping': 0.3.13 - '@jridgewell/trace-mapping': 0.3.31 - '@jridgewell/resolve-uri@3.1.2': {} '@jridgewell/source-map@0.3.11': @@ -5178,8 +5421,14 @@ snapshots: dependencies: jsep: 1.4.0 + '@loaderkit/resolve@1.0.6': + dependencies: + '@braidai/lang': 1.1.2 + '@mdn/browser-compat-data@5.7.6': {} + '@mdn/browser-compat-data@6.1.5': {} + '@napi-rs/wasm-runtime@0.2.12': dependencies: '@emnapi/core': 1.7.1 @@ -5187,10 +5436,6 @@ snapshots: '@tybys/wasm-util': 0.10.1 optional: true - '@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1': - dependencies: - eslint-scope: 5.1.1 - '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -5203,137 +5448,123 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.19.1 - '@nolyfill/is-core-module@1.0.39': {} - - '@npmcli/agent@2.2.2': + '@npmcli/agent@4.0.2(supports-color@8.1.1)': dependencies: agent-base: 7.1.4 - http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6 - lru-cache: 10.4.3 - socks-proxy-agent: 8.0.5 + http-proxy-agent: 7.0.2(supports-color@8.1.1) + https-proxy-agent: 7.0.6(supports-color@8.1.1) + lru-cache: 11.5.2 + socks-proxy-agent: 8.0.5(supports-color@8.1.1) transitivePeerDependencies: - supports-color - '@npmcli/arborist@7.5.4': + '@npmcli/arborist@9.9.0(supports-color@8.1.1)': dependencies: + '@gar/promise-retry': 1.0.3 '@isaacs/string-locale-compare': 1.1.0 - '@npmcli/fs': 3.1.1 - '@npmcli/installed-package-contents': 2.1.0 - '@npmcli/map-workspaces': 3.0.6 - '@npmcli/metavuln-calculator': 7.1.1 - '@npmcli/name-from-folder': 2.0.0 - '@npmcli/node-gyp': 3.0.0 - '@npmcli/package-json': 5.2.1 - '@npmcli/query': 3.1.0 - '@npmcli/redact': 2.0.1 - '@npmcli/run-script': 8.1.0 - bin-links: 4.0.4 - cacache: 18.0.4 - common-ancestor-path: 1.0.1 - hosted-git-info: 7.0.2 - json-parse-even-better-errors: 3.0.2 + '@npmcli/fs': 5.0.0 + '@npmcli/installed-package-contents': 4.0.0 + '@npmcli/map-workspaces': 5.0.3 + '@npmcli/metavuln-calculator': 9.0.3(supports-color@8.1.1) + '@npmcli/name-from-folder': 4.0.0 + '@npmcli/node-gyp': 5.0.0 + '@npmcli/package-json': 7.0.5 + '@npmcli/query': 5.0.0 + '@npmcli/redact': 4.0.0 + '@npmcli/run-script': 10.0.4 + bin-links: 6.0.2 + cacache: 20.0.4 + common-ancestor-path: 2.0.0 + hosted-git-info: 9.0.3 json-stringify-nice: 1.1.4 - lru-cache: 10.4.3 - minimatch: 9.0.9 - nopt: 7.2.1 - npm-install-checks: 6.3.0 - npm-package-arg: 11.0.3 - npm-pick-manifest: 9.1.0 - npm-registry-fetch: 17.1.0 - pacote: 18.0.6 - parse-conflict-json: 3.0.1 - proc-log: 4.2.0 - proggy: 2.0.0 + lru-cache: 11.5.2 + minimatch: 10.2.5 + nopt: 9.0.0 + npm-install-checks: 8.0.0 + npm-package-arg: 13.0.2 + npm-pick-manifest: 11.0.3 + npm-registry-fetch: 19.1.1(supports-color@8.1.1) + pacote: 21.5.1(supports-color@8.1.1) + parse-conflict-json: 5.0.1 + proc-log: 6.1.0 + proggy: 4.0.0 promise-all-reject-late: 1.0.1 promise-call-limit: 3.0.2 - read-package-json-fast: 3.0.2 - semver: 7.7.3 - ssri: 10.0.6 + semver: 7.8.5 + ssri: 13.0.1 treeverse: 3.0.0 - walk-up-path: 3.0.1 + walk-up-path: 4.0.0 transitivePeerDependencies: - - bluebird - supports-color - '@npmcli/fs@3.1.1': + '@npmcli/fs@5.0.0': dependencies: - semver: 7.7.3 + semver: 7.8.5 - '@npmcli/git@5.0.8': + '@npmcli/git@7.0.2': dependencies: - '@npmcli/promise-spawn': 7.0.2 - ini: 4.1.3 - lru-cache: 10.4.3 - npm-pick-manifest: 9.1.0 - proc-log: 4.2.0 - promise-inflight: 1.0.1 - promise-retry: 2.0.1 - semver: 7.7.3 - which: 4.0.0 - transitivePeerDependencies: - - bluebird + '@gar/promise-retry': 1.0.3 + '@npmcli/promise-spawn': 9.0.1 + ini: 6.0.0 + lru-cache: 11.5.2 + npm-pick-manifest: 11.0.3 + proc-log: 6.1.0 + semver: 7.8.5 + which: 6.0.1 - '@npmcli/installed-package-contents@2.1.0': + '@npmcli/installed-package-contents@4.0.0': dependencies: - npm-bundled: 3.0.1 - npm-normalize-package-bin: 3.0.1 + npm-bundled: 5.0.0 + npm-normalize-package-bin: 5.0.0 - '@npmcli/map-workspaces@3.0.6': + '@npmcli/map-workspaces@5.0.3': dependencies: - '@npmcli/name-from-folder': 2.0.0 - glob: 10.5.0 - minimatch: 9.0.9 - read-package-json-fast: 3.0.2 + '@npmcli/name-from-folder': 4.0.0 + '@npmcli/package-json': 7.0.5 + glob: 13.0.6 + minimatch: 10.2.5 - '@npmcli/metavuln-calculator@7.1.1': + '@npmcli/metavuln-calculator@9.0.3(supports-color@8.1.1)': dependencies: - cacache: 18.0.4 - json-parse-even-better-errors: 3.0.2 - pacote: 18.0.6 - proc-log: 4.2.0 - semver: 7.7.3 + cacache: 20.0.4 + json-parse-even-better-errors: 5.0.0 + pacote: 21.5.1(supports-color@8.1.1) + proc-log: 6.1.0 + semver: 7.8.5 transitivePeerDependencies: - - bluebird - supports-color - '@npmcli/name-from-folder@2.0.0': {} + '@npmcli/name-from-folder@4.0.0': {} - '@npmcli/node-gyp@3.0.0': {} + '@npmcli/node-gyp@5.0.0': {} - '@npmcli/package-json@5.2.1': + '@npmcli/package-json@7.0.5': dependencies: - '@npmcli/git': 5.0.8 - glob: 10.5.0 - hosted-git-info: 7.0.2 - json-parse-even-better-errors: 3.0.2 - normalize-package-data: 6.0.2 - proc-log: 4.2.0 - semver: 7.7.3 - transitivePeerDependencies: - - bluebird + '@npmcli/git': 7.0.2 + glob: 13.0.6 + hosted-git-info: 9.0.3 + json-parse-even-better-errors: 5.0.0 + proc-log: 6.1.0 + semver: 7.8.5 + spdx-expression-parse: 4.0.0 - '@npmcli/promise-spawn@7.0.2': + '@npmcli/promise-spawn@9.0.1': dependencies: - which: 4.0.0 + which: 6.0.1 - '@npmcli/query@3.1.0': + '@npmcli/query@5.0.0': dependencies: - postcss-selector-parser: 6.1.2 + postcss-selector-parser: 7.1.4 - '@npmcli/redact@2.0.1': {} + '@npmcli/redact@4.0.0': {} - '@npmcli/run-script@8.1.0': + '@npmcli/run-script@10.0.4': dependencies: - '@npmcli/node-gyp': 3.0.0 - '@npmcli/package-json': 5.2.1 - '@npmcli/promise-spawn': 7.0.2 - node-gyp: 10.3.1 - proc-log: 4.2.0 - which: 4.0.0 - transitivePeerDependencies: - - bluebird - - supports-color + '@npmcli/node-gyp': 5.0.0 + '@npmcli/package-json': 7.0.5 + '@npmcli/promise-spawn': 9.0.1 + node-gyp: 12.4.0 + proc-log: 6.1.0 '@pkgjs/parseargs@0.11.0': optional: true @@ -5350,115 +5581,116 @@ snapshots: '@pnpm/network.ca-file': 1.0.2 config-chain: 1.1.13 - '@rollup/plugin-babel@6.1.0(@babel/core@7.28.5)(rollup@4.59.0)': + '@rollup/plugin-babel@7.1.0(@babel/core@8.0.1)(rollup@4.62.3)(supports-color@8.1.1)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-module-imports': 7.27.1 - '@rollup/pluginutils': 5.3.0(rollup@4.59.0) + '@babel/core': 8.0.1 + '@babel/helper-module-imports': 7.28.6(supports-color@8.1.1) + '@rollup/pluginutils': 5.3.0(rollup@4.62.3) + workerpool: 9.3.4 optionalDependencies: - rollup: 4.59.0 + rollup: 4.62.3 transitivePeerDependencies: - supports-color - '@rollup/plugin-node-resolve@16.0.3(rollup@4.59.0)': + '@rollup/plugin-node-resolve@16.0.3(rollup@4.62.3)': dependencies: - '@rollup/pluginutils': 5.3.0(rollup@4.59.0) + '@rollup/pluginutils': 5.3.0(rollup@4.62.3) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-module: 1.0.0 resolve: 1.22.11 optionalDependencies: - rollup: 4.59.0 + rollup: 4.62.3 - '@rollup/plugin-terser@0.4.4(rollup@4.59.0)': + '@rollup/plugin-terser@1.0.0(rollup@4.62.3)': dependencies: - serialize-javascript: 6.0.2 + serialize-javascript: 7.0.7 smob: 1.5.0 terser: 5.44.1 optionalDependencies: - rollup: 4.59.0 + rollup: 4.62.3 - '@rollup/pluginutils@5.3.0(rollup@4.59.0)': + '@rollup/pluginutils@5.3.0(rollup@4.62.3)': dependencies: - '@types/estree': 1.0.8 + '@types/estree': 1.0.9 estree-walker: 2.0.2 picomatch: 4.0.4 optionalDependencies: - rollup: 4.59.0 + rollup: 4.62.3 - '@rollup/rollup-android-arm-eabi@4.59.0': + '@rollup/rollup-android-arm-eabi@4.62.3': optional: true - '@rollup/rollup-android-arm64@4.59.0': + '@rollup/rollup-android-arm64@4.62.3': optional: true - '@rollup/rollup-darwin-arm64@4.59.0': + '@rollup/rollup-darwin-arm64@4.62.3': optional: true - '@rollup/rollup-darwin-x64@4.59.0': + '@rollup/rollup-darwin-x64@4.62.3': optional: true - '@rollup/rollup-freebsd-arm64@4.59.0': + '@rollup/rollup-freebsd-arm64@4.62.3': optional: true - '@rollup/rollup-freebsd-x64@4.59.0': + '@rollup/rollup-freebsd-x64@4.62.3': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.59.0': + '@rollup/rollup-linux-arm-gnueabihf@4.62.3': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.59.0': + '@rollup/rollup-linux-arm-musleabihf@4.62.3': optional: true - '@rollup/rollup-linux-arm64-gnu@4.59.0': + '@rollup/rollup-linux-arm64-gnu@4.62.3': optional: true - '@rollup/rollup-linux-arm64-musl@4.59.0': + '@rollup/rollup-linux-arm64-musl@4.62.3': optional: true - '@rollup/rollup-linux-loong64-gnu@4.59.0': + '@rollup/rollup-linux-loong64-gnu@4.62.3': optional: true - '@rollup/rollup-linux-loong64-musl@4.59.0': + '@rollup/rollup-linux-loong64-musl@4.62.3': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.59.0': + '@rollup/rollup-linux-ppc64-gnu@4.62.3': optional: true - '@rollup/rollup-linux-ppc64-musl@4.59.0': + '@rollup/rollup-linux-ppc64-musl@4.62.3': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.59.0': + '@rollup/rollup-linux-riscv64-gnu@4.62.3': optional: true - '@rollup/rollup-linux-riscv64-musl@4.59.0': + '@rollup/rollup-linux-riscv64-musl@4.62.3': optional: true - '@rollup/rollup-linux-s390x-gnu@4.59.0': + '@rollup/rollup-linux-s390x-gnu@4.62.3': optional: true - '@rollup/rollup-linux-x64-gnu@4.59.0': + '@rollup/rollup-linux-x64-gnu@4.62.3': optional: true - '@rollup/rollup-linux-x64-musl@4.59.0': + '@rollup/rollup-linux-x64-musl@4.62.3': optional: true - '@rollup/rollup-openbsd-x64@4.59.0': + '@rollup/rollup-openbsd-x64@4.62.3': optional: true - '@rollup/rollup-openharmony-arm64@4.59.0': + '@rollup/rollup-openharmony-arm64@4.62.3': optional: true - '@rollup/rollup-win32-arm64-msvc@4.59.0': + '@rollup/rollup-win32-arm64-msvc@4.62.3': optional: true - '@rollup/rollup-win32-ia32-msvc@4.59.0': + '@rollup/rollup-win32-ia32-msvc@4.62.3': optional: true - '@rollup/rollup-win32-x64-gnu@4.59.0': + '@rollup/rollup-win32-x64-gnu@4.62.3': optional: true - '@rollup/rollup-win32-x64-msvc@4.59.0': + '@rollup/rollup-win32-x64-msvc@4.62.3': optional: true '@rpl/badge-up@3.0.0': @@ -5467,71 +5699,74 @@ snapshots: dot: 1.1.3 svgo: 2.6.0 - '@rtsao/scc@1.1.0': {} + '@rtsao/scc@1.1.0': + optional: true - '@shikijs/engine-oniguruma@3.15.0': + '@shikijs/engine-oniguruma@3.23.0': dependencies: - '@shikijs/types': 3.15.0 + '@shikijs/types': 3.23.0 '@shikijs/vscode-textmate': 10.0.2 - '@shikijs/langs@3.15.0': + '@shikijs/langs@3.23.0': dependencies: - '@shikijs/types': 3.15.0 + '@shikijs/types': 3.23.0 - '@shikijs/themes@3.15.0': + '@shikijs/themes@3.23.0': dependencies: - '@shikijs/types': 3.15.0 + '@shikijs/types': 3.23.0 - '@shikijs/types@3.15.0': + '@shikijs/types@3.23.0': dependencies: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 '@shikijs/vscode-textmate@10.0.2': {} - '@sigstore/bundle@2.3.2': + '@sigstore/bundle@4.0.0': dependencies: - '@sigstore/protobuf-specs': 0.3.3 + '@sigstore/protobuf-specs': 0.5.1 - '@sigstore/core@1.1.0': {} + '@sigstore/core@3.2.1': {} - '@sigstore/protobuf-specs@0.3.3': {} + '@sigstore/protobuf-specs@0.5.1': {} - '@sigstore/sign@2.3.2': + '@sigstore/sign@4.1.1(supports-color@8.1.1)': dependencies: - '@sigstore/bundle': 2.3.2 - '@sigstore/core': 1.1.0 - '@sigstore/protobuf-specs': 0.3.3 - make-fetch-happen: 13.0.1 - proc-log: 4.2.0 - promise-retry: 2.0.1 + '@gar/promise-retry': 1.0.3 + '@sigstore/bundle': 4.0.0 + '@sigstore/core': 3.2.1 + '@sigstore/protobuf-specs': 0.5.1 + make-fetch-happen: 15.0.6(supports-color@8.1.1) + proc-log: 6.1.0 transitivePeerDependencies: - supports-color - '@sigstore/tuf@2.3.4': + '@sigstore/tuf@4.0.2(supports-color@8.1.1)': dependencies: - '@sigstore/protobuf-specs': 0.3.3 - tuf-js: 2.2.1 + '@sigstore/protobuf-specs': 0.5.1 + tuf-js: 4.1.0(supports-color@8.1.1) transitivePeerDependencies: - supports-color - '@sigstore/verify@1.2.1': + '@sigstore/verify@3.1.1': dependencies: - '@sigstore/bundle': 2.3.2 - '@sigstore/core': 1.1.0 - '@sigstore/protobuf-specs': 0.3.3 + '@sigstore/bundle': 4.0.0 + '@sigstore/core': 3.2.1 + '@sigstore/protobuf-specs': 0.5.1 '@sindresorhus/base62@1.0.0': {} + '@sindresorhus/is@4.6.0': {} + '@sindresorhus/is@5.6.0': {} - '@sindresorhus/merge-streams@2.3.0': {} + '@sindresorhus/merge-streams@4.0.0': {} - '@stylistic/eslint-plugin@5.6.0(eslint@9.39.1)': + '@stylistic/eslint-plugin@5.10.0(eslint@10.8.0(supports-color@8.1.1))': dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.1) - '@typescript-eslint/types': 8.47.0 - eslint: 9.39.1 + '@eslint-community/eslint-utils': 4.10.1(eslint@10.8.0(supports-color@8.1.1)) + '@typescript-eslint/types': 8.65.0 + eslint: 10.8.0(supports-color@8.1.1) eslint-visitor-keys: 4.2.1 espree: 10.4.0 estraverse: 5.3.0 @@ -5541,30 +5776,46 @@ snapshots: dependencies: defer-to-connect: 2.0.1 + '@tokenizer/inflate@0.4.1(supports-color@8.1.1)': + dependencies: + debug: 4.4.3(supports-color@8.1.1) + token-types: 6.1.2 + transitivePeerDependencies: + - supports-color + '@tokenizer/token@0.3.0': {} '@trysound/sax@0.2.0': {} '@tufjs/canonical-json@2.0.0': {} - '@tufjs/models@2.0.1': + '@tufjs/models@4.1.0': dependencies: '@tufjs/canonical-json': 2.0.0 - minimatch: 9.0.9 + minimatch: 10.2.5 '@tybys/wasm-util@0.10.1': dependencies: tslib: 2.8.1 optional: true + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + '@types/debug@4.1.12': dependencies: '@types/ms': 2.1.0 - '@types/estree@1.0.8': {} + '@types/deep-eql@4.0.2': {} + + '@types/esrecurse@4.3.1': {} '@types/estree@1.0.9': {} + '@types/gensync@1.0.5': {} + '@types/hast@3.0.4': dependencies: '@types/unist': 3.0.3 @@ -5573,21 +5824,32 @@ snapshots: '@types/istanbul-lib-coverage@2.0.6': {} + '@types/jsesc@2.5.1': {} + '@types/json-schema@7.0.15': {} - '@types/json5@0.0.29': {} + '@types/json5@0.0.29': + optional: true + + '@types/katex@0.16.8': {} '@types/mdast@4.0.4': dependencies: '@types/unist': 3.0.3 + '@types/mocha@10.0.10': {} + '@types/ms@2.1.0': {} + '@types/node@26.1.2': + dependencies: + undici-types: 8.3.0 + '@types/resolve@1.20.2': {} '@types/unist@3.0.3': {} - '@typescript-eslint/types@8.47.0': {} + '@typescript-eslint/types@8.65.0': {} '@unrs/resolver-binding-android-arm-eabi@1.11.1': optional: true @@ -5648,7 +5910,7 @@ snapshots: '@unrs/resolver-binding-win32-x64-msvc@1.11.1': optional: true - abbrev@2.0.0: {} + abbrev@4.0.0: {} abort-controller@3.0.0: dependencies: @@ -5658,14 +5920,15 @@ snapshots: dependencies: acorn: 8.15.0 + acorn-jsx@5.3.2(acorn@8.17.0): + dependencies: + acorn: 8.17.0 + acorn@8.15.0: {} - agent-base@7.1.4: {} + acorn@8.17.0: {} - aggregate-error@3.1.0: - dependencies: - clean-stack: 2.2.0 - indent-string: 4.0.0 + agent-base@7.1.4: {} ajv@6.15.0: dependencies: @@ -5678,6 +5941,10 @@ snapshots: dependencies: string-width: 4.2.3 + ansi-escapes@7.3.0: + dependencies: + environment: 1.1.0 + ansi-regex@5.0.1: {} ansi-regex@6.2.2: {} @@ -5692,6 +5959,8 @@ snapshots: ansi-styles@6.2.3: {} + any-promise@1.3.0: {} + are-docs-informative@0.0.2: {} argparse@1.0.10: @@ -5710,6 +5979,7 @@ snapshots: dependencies: call-bound: 1.0.4 is-array-buffer: 3.0.5 + optional: true array-find-index@1.0.2: {} @@ -5725,6 +5995,7 @@ snapshots: get-intrinsic: 1.3.0 is-string: 1.1.1 math-intrinsics: 1.1.0 + optional: true array.prototype.findlastindex@1.2.6: dependencies: @@ -5735,6 +6006,7 @@ snapshots: es-errors: 1.3.0 es-object-atoms: 1.1.1 es-shim-unscopables: 1.1.0 + optional: true array.prototype.flat@1.3.3: dependencies: @@ -5742,6 +6014,7 @@ snapshots: define-properties: 1.2.1 es-abstract: 1.24.0 es-shim-unscopables: 1.1.0 + optional: true array.prototype.flatmap@1.3.3: dependencies: @@ -5749,6 +6022,7 @@ snapshots: define-properties: 1.2.1 es-abstract: 1.24.0 es-shim-unscopables: 1.1.0 + optional: true arraybuffer.prototype.slice@1.0.4: dependencies: @@ -5759,12 +6033,16 @@ snapshots: es-errors: 1.3.0 get-intrinsic: 1.3.0 is-array-buffer: 3.0.5 + optional: true + + assertion-error@2.0.1: {} ast-metadata-inferer@0.8.1: dependencies: '@mdn/browser-compat-data': 5.7.6 - async-function@1.0.0: {} + async-function@1.0.0: + optional: true async@3.2.6: {} @@ -5776,47 +6054,35 @@ snapshots: available-typed-arrays@1.0.7: dependencies: possible-typed-array-names: 1.1.0 + optional: true - babel-plugin-polyfill-corejs2@0.4.14(@babel/core@7.28.5): - dependencies: - '@babel/compat-data': 7.28.5 - '@babel/core': 7.28.5 - '@babel/helper-define-polyfill-provider': 0.6.5(@babel/core@7.28.5) - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - babel-plugin-polyfill-corejs3@0.13.0(@babel/core@7.28.5): - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-define-polyfill-provider': 0.6.5(@babel/core@7.28.5) - core-js-compat: 3.47.0 - transitivePeerDependencies: - - supports-color - - babel-plugin-polyfill-regenerator@0.6.5(@babel/core@7.28.5): + babel-plugin-polyfill-corejs3@1.0.0(@babel/core@8.0.1): dependencies: - '@babel/core': 7.28.5 - '@babel/helper-define-polyfill-provider': 0.6.5(@babel/core@7.28.5) - transitivePeerDependencies: - - supports-color + '@babel/core': 8.0.1 + '@babel/helper-define-polyfill-provider': 1.0.0(@babel/core@8.0.1) + core-js-compat: 3.49.0 balanced-match@1.0.2: {} + balanced-match@4.0.4: {} + base64-js@1.5.1: {} baseline-browser-mapping@2.10.31: {} + baseline-browser-mapping@2.11.4: {} + basic-auth@2.0.1: dependencies: safe-buffer: 5.1.2 - bin-links@4.0.4: + bin-links@6.0.2: dependencies: - cmd-shim: 6.0.3 - npm-normalize-package-bin: 3.0.1 - read-cmd-shim: 4.0.0 - write-file-atomic: 5.0.1 + cmd-shim: 8.0.0 + npm-normalize-package-bin: 5.0.0 + proc-log: 6.1.0 + read-cmd-shim: 6.0.0 + write-file-atomic: 7.0.1 boolbase@1.0.0: {} @@ -5846,11 +6112,16 @@ snapshots: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 + optional: true brace-expansion@2.1.0: dependencies: balanced-match: 1.0.2 + brace-expansion@5.0.8: + dependencies: + balanced-match: 4.0.4 + braces@3.0.3: dependencies: fill-range: 7.1.1 @@ -5865,6 +6136,14 @@ snapshots: node-releases: 2.0.27 update-browserslist-db: 1.1.4(browserslist@4.28.0) + browserslist@4.28.7: + dependencies: + baseline-browser-mapping: 2.11.4 + caniuse-lite: 1.0.30001806 + electron-to-chromium: 1.5.396 + node-releases: 2.0.51 + update-browserslist-db: 1.2.3(browserslist@4.28.7) + buffer-from@1.1.2: {} buffer@6.0.3: @@ -5882,7 +6161,7 @@ snapshots: bytes@3.1.2: {} - c8@10.1.3: + c8@12.0.0: dependencies: '@bcoe/v8-coverage': 1.0.2 '@istanbuljs/schema': 0.1.3 @@ -5891,25 +6170,23 @@ snapshots: istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 istanbul-reports: 3.2.0 - test-exclude: 7.0.1 + test-exclude: 8.0.0 v8-to-istanbul: 9.3.0 - yargs: 17.7.2 + yargs: 18.1.0 yargs-parser: 21.1.1 - cacache@18.0.4: + cacache@20.0.4: dependencies: - '@npmcli/fs': 3.1.1 + '@npmcli/fs': 5.0.0 fs-minipass: 3.0.3 - glob: 10.5.0 - lru-cache: 10.4.3 - minipass: 7.1.2 + glob: 13.0.6 + lru-cache: 11.5.2 + minipass: 7.1.3 minipass-collect: 2.0.1 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 - p-map: 4.0.0 - ssri: 10.0.6 - tar: 6.2.1 - unique-filename: 3.0.0 + p-map: 7.0.6 + ssri: 13.0.1 cacheable-lookup@7.0.0: {} @@ -5934,14 +6211,13 @@ snapshots: es-define-property: 1.0.1 get-intrinsic: 1.3.0 set-function-length: 1.2.2 + optional: true call-bound@1.0.4: dependencies: call-bind-apply-helpers: 1.0.2 get-intrinsic: 1.3.0 - callsites@3.1.0: {} - camelcase@5.3.1: {} camelcase@6.3.0: {} @@ -5952,9 +6228,11 @@ snapshots: caniuse-lite@1.0.30001793: {} + caniuse-lite@1.0.30001806: {} + ccount@2.0.1: {} - chai@6.2.1: {} + chai@6.2.2: {} chalk-template@0.4.0: dependencies: @@ -5975,25 +6253,44 @@ snapshots: change-case@5.4.4: {} + char-regex@1.0.2: {} + character-entities@2.0.2: {} chokidar@4.0.3: dependencies: readdirp: 4.1.2 - chownr@2.0.0: {} + chownr@3.0.0: {} ci-info@3.9.0: {} - ci-info@4.3.1: {} + ci-info@4.4.0: {} + + cjs-module-lexer@1.4.3: {} + + cli-boxes@3.0.0: {} - clean-regexp@1.0.0: + cli-highlight@2.1.11: dependencies: - escape-string-regexp: 1.0.5 + chalk: 4.1.2 + highlight.js: 10.7.3 + mz: 2.7.0 + parse5: 5.1.1 + parse5-htmlparser2-tree-adapter: 6.0.1 + yargs: 16.2.2 - clean-stack@2.2.0: {} + cli-table3@0.6.5: + dependencies: + string-width: 4.2.3 + optionalDependencies: + '@colors/colors': 1.5.0 - cli-boxes@3.0.0: {} + cliui@7.0.4: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 cliui@8.0.1: dependencies: @@ -6001,7 +6298,13 @@ snapshots: strip-ansi: 6.0.1 wrap-ansi: 7.0.0 - cmd-shim@6.0.3: {} + cliui@9.0.1: + dependencies: + string-width: 7.2.0 + strip-ansi: 7.1.2 + wrap-ansi: 9.0.2 + + cmd-shim@8.0.0: {} color-convert@1.9.3: dependencies: @@ -6065,15 +6368,22 @@ snapshots: table-layout: 4.1.1 typical: 7.3.0 + commander@10.0.1: {} + commander@2.20.3: {} commander@7.2.0: {} + commander@8.3.0: {} + comment-parser@1.4.1: {} - common-ancestor-path@1.0.1: {} + comment-parser@1.4.7: {} + + common-ancestor-path@2.0.0: {} - concat-map@0.0.1: {} + concat-map@0.0.1: + optional: true config-chain@1.1.13: dependencies: @@ -6095,11 +6405,13 @@ snapshots: graceful-fs: 4.2.11 xdg-basedir: 5.1.0 + convert-hrtime@5.0.0: {} + convert-source-map@2.0.0: {} - core-js-compat@3.47.0: + core-js-compat@3.49.0: dependencies: - browserslist: 4.28.0 + browserslist: 4.28.7 correct-license-metadata@1.4.0: dependencies: @@ -6159,22 +6471,28 @@ snapshots: call-bound: 1.0.4 es-errors: 1.3.0 is-data-view: 1.0.2 + optional: true data-view-byte-length@1.0.2: dependencies: call-bound: 1.0.4 es-errors: 1.3.0 is-data-view: 1.0.2 + optional: true data-view-byte-offset@1.0.1: dependencies: call-bound: 1.0.4 es-errors: 1.3.0 is-data-view: 1.0.2 + optional: true - debug@3.2.7: + debug@3.2.7(supports-color@8.1.1): dependencies: ms: 2.1.3 + optionalDependencies: + supports-color: 8.1.1 + optional: true debug@4.4.3(supports-color@8.1.1): dependencies: @@ -6212,6 +6530,7 @@ snapshots: es-define-property: 1.0.1 es-errors: 1.3.0 gopd: 1.2.0 + optional: true define-lazy-prop@3.0.0: {} @@ -6220,9 +6539,12 @@ snapshots: define-data-property: 1.1.4 has-property-descriptors: 1.0.2 object-keys: 1.1.1 + optional: true dequal@2.0.3: {} + detect-indent@7.0.2: {} + devlop@1.1.0: dependencies: dequal: 2.0.3 @@ -6234,6 +6556,7 @@ snapshots: doctrine@2.1.0: dependencies: esutils: 2.0.3 + optional: true dom-serializer@1.4.1: dependencies: @@ -6289,16 +6612,17 @@ snapshots: electron-to-chromium@1.5.255: {} + electron-to-chromium@1.5.396: {} + emoji-regex@10.6.0: {} emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} - encoding@0.1.13: - dependencies: - iconv-lite: 0.6.3 - optional: true + emojilib@2.4.0: {} + + empathic@2.0.1: {} enhanced-resolve@5.18.3: dependencies: @@ -6311,9 +6635,11 @@ snapshots: entities@6.0.1: {} + entities@7.0.1: {} + env-paths@2.2.1: {} - err-code@2.0.3: {} + environment@1.1.0: {} es-abstract@1.24.0: dependencies: @@ -6371,27 +6697,28 @@ snapshots: typed-array-length: 1.0.7 unbox-primitive: 1.1.0 which-typed-array: 1.1.19 + optional: true es-define-property@1.0.1: {} es-errors@1.3.0: {} - es-file-traverse@2.0.1(@babel/core@7.28.5)(eslint-plugin-import@2.32.0(eslint@9.39.1))(eslint@9.39.1): + es-file-traverse@3.0.0(eslint-plugin-import-x@4.17.1(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1))(eslint-plugin-import@2.32.0)(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1): dependencies: - '@babel/eslint-parser': 7.28.5(@babel/core@7.28.5)(eslint@9.39.1) + '@babel/core': 8.0.1 + '@babel/eslint-parser': 8.0.1(@babel/core@8.0.1)(eslint@10.8.0(supports-color@8.1.1)) command-line-basics: 3.0.0 - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(eslint@9.39.1))(eslint@9.39.1) - esquery: 1.6.0 + eslint-import-resolver-typescript: 4.4.5(eslint-plugin-import-x@4.17.1(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1))(eslint-plugin-import@2.32.0)(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1) + esquery: 1.7.0 file-fetch: 2.0.1 find-package-json: 1.2.0 - globby: 14.1.0 - htmlparser2: 10.0.0 + globby: 16.2.2 + htmlparser2: 10.1.0 is-builtin-module: 5.0.0 resolve: 1.22.11 resolve.exports: 2.0.3 transitivePeerDependencies: - '@75lb/nature' - - '@babel/core' - eslint - eslint-plugin-import - eslint-plugin-import-x @@ -6407,16 +6734,19 @@ snapshots: get-intrinsic: 1.3.0 has-tostringtag: 1.0.2 hasown: 2.0.2 + optional: true es-shim-unscopables@1.1.0: dependencies: hasown: 2.0.2 + optional: true es-to-primitive@1.3.0: dependencies: is-callable: 1.2.7 is-date-object: 1.1.0 is-symbol: 1.1.1 + optional: true es5-ext@0.10.64: dependencies: @@ -6451,150 +6781,177 @@ snapshots: escape-string-regexp@5.0.0: {} - eslint-compat-utils@0.5.1(eslint@9.39.1): + eslint-compat-utils@0.5.1(eslint@10.8.0(supports-color@8.1.1)): dependencies: - eslint: 9.39.1 - semver: 7.7.3 + eslint: 10.8.0(supports-color@8.1.1) + semver: 7.8.5 - eslint-config-ash-nazg@39.8.0(@babel/core@7.28.5)(eslint@9.39.1)(typescript@5.9.3): - dependencies: - '@babel/eslint-parser': 7.28.5(@babel/core@7.28.5)(eslint@9.39.1) - '@babel/eslint-plugin': 7.27.1(@babel/eslint-parser@7.28.5(@babel/core@7.28.5)(eslint@9.39.1))(eslint@9.39.1) - '@babel/plugin-syntax-import-attributes': 7.27.1(@babel/core@7.28.5) - '@brettz9/eslint-plugin': 3.0.0(eslint@9.39.1) - '@eslint-community/eslint-plugin-eslint-comments': 4.5.0(eslint@9.39.1) - '@eslint/core': 0.17.0 - '@eslint/eslintrc': 3.3.1 - '@eslint/js': 9.39.1 - '@eslint/markdown': 7.5.1 + eslint-config-ash-nazg@41.0.0(@babel/core@8.0.1)(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint-plugin-import@2.32.0)(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1)(ts-declaration-location@1.0.7(typescript@6.0.3))(typescript@6.0.3): + dependencies: + '@babel/eslint-parser': 8.0.1(@babel/core@8.0.1)(eslint@10.8.0(supports-color@8.1.1)) + '@babel/eslint-plugin': 8.0.1(@babel/core@8.0.1)(@babel/eslint-parser@8.0.1(@babel/core@8.0.1)(eslint@10.8.0(supports-color@8.1.1)))(eslint@10.8.0(supports-color@8.1.1)) + '@babel/plugin-syntax-import-attributes': 8.0.0-rc.1(@babel/core@8.0.1) + '@brettz9/eslint-plugin': 3.0.0(eslint@10.8.0(supports-color@8.1.1)) + '@eslint-community/eslint-plugin-eslint-comments': 4.7.2(eslint@10.8.0(supports-color@8.1.1)) + '@eslint/core': 1.2.1 + '@eslint/js': 10.0.1(eslint@10.8.0(supports-color@8.1.1)) + '@eslint/markdown': 8.0.3(supports-color@8.1.1) '@fintechstudios/eslint-plugin-chai-as-promised': 3.1.0 - '@stylistic/eslint-plugin': 5.6.0(eslint@9.39.1) - browserslist: 4.28.0 - es-file-traverse: 2.0.1(@babel/core@7.28.5)(eslint-plugin-import@2.32.0(eslint@9.39.1))(eslint@9.39.1) - eslint: 9.39.1 - eslint-plugin-array-func: 5.1.0(eslint@9.39.1) - eslint-plugin-chai-expect: 3.1.0(eslint@9.39.1) + '@stylistic/eslint-plugin': 5.10.0(eslint@10.8.0(supports-color@8.1.1)) + browserslist: 4.28.7 + es-file-traverse: 3.0.0(eslint-plugin-import-x@4.17.1(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1))(eslint-plugin-import@2.32.0)(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1) + eslint: 10.8.0(supports-color@8.1.1) + eslint-plugin-array-func: 5.1.1(eslint@10.8.0(supports-color@8.1.1)) + eslint-plugin-chai-expect: 4.1.0(eslint@10.8.0(supports-color@8.1.1)) eslint-plugin-chai-expect-keywords: 3.1.0 - eslint-plugin-chai-friendly: 1.1.0(eslint@9.39.1) - eslint-plugin-compat: 6.0.2(eslint@9.39.1) - eslint-plugin-cypress: 5.2.0(eslint@9.39.1) - eslint-plugin-escompat: 3.11.4(eslint@9.39.1) - eslint-plugin-html: 8.1.3 - eslint-plugin-import: 2.32.0(eslint@9.39.1) - eslint-plugin-jsdoc: 61.2.1(eslint@9.39.1) - eslint-plugin-mocha: 11.2.0(eslint@9.39.1) - eslint-plugin-mocha-cleanup: 1.11.3(eslint@9.39.1) - eslint-plugin-n: 17.23.1(eslint@9.39.1)(typescript@5.9.3) - eslint-plugin-no-unsanitized: 4.1.4(eslint@9.39.1) - eslint-plugin-no-use-extend-native: 0.7.2(eslint@9.39.1) - eslint-plugin-promise: 7.2.1(eslint@9.39.1) - eslint-plugin-sonarjs: 3.0.5(eslint@9.39.1) - eslint-plugin-unicorn: 62.0.0(eslint@9.39.1) - globals: 16.5.0 - semver: 7.7.3 + eslint-plugin-chai-friendly: 1.2.1(eslint@10.8.0(supports-color@8.1.1)) + eslint-plugin-compat: 7.0.2(eslint@10.8.0(supports-color@8.1.1)) + eslint-plugin-cypress: 6.4.3(eslint@10.8.0(supports-color@8.1.1)) + eslint-plugin-escompat: 3.11.4(eslint@10.8.0(supports-color@8.1.1)) + eslint-plugin-html: 8.1.4 + eslint-plugin-import-x: 4.17.1(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1) + eslint-plugin-jsdoc: 63.3.1(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1) + eslint-plugin-mocha: 12.0.0(eslint@10.8.0(supports-color@8.1.1)) + eslint-plugin-mocha-cleanup: 1.11.3(eslint@10.8.0(supports-color@8.1.1)) + eslint-plugin-n: 18.2.2(eslint@10.8.0(supports-color@8.1.1))(ts-declaration-location@1.0.7(typescript@6.0.3))(typescript@6.0.3) + eslint-plugin-no-unsanitized: 4.1.5(eslint@10.8.0(supports-color@8.1.1)) + eslint-plugin-no-use-extend-native: 0.7.3(eslint@10.8.0(supports-color@8.1.1)) + eslint-plugin-promise: 7.3.0(eslint@10.8.0(supports-color@8.1.1)) + eslint-plugin-sonarjs: 4.2.0(eslint@10.8.0(supports-color@8.1.1)) + eslint-plugin-unicorn: 72.0.0(eslint@10.8.0(supports-color@8.1.1)) + globals: 17.8.0 + semver: 7.8.5 transitivePeerDependencies: - '@75lb/nature' - '@babel/core' - '@typescript-eslint/parser' - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - eslint-plugin-import-x + - '@typescript-eslint/utils' + - eslint-import-resolver-node + - eslint-plugin-import - supports-color + - ts-declaration-location - typescript - eslint-import-resolver-node@0.3.9: + eslint-import-context@0.1.9(unrs-resolver@1.11.1): + dependencies: + get-tsconfig: 4.13.0 + stable-hash-x: 0.2.0 + optionalDependencies: + unrs-resolver: 1.11.1 + + eslint-import-resolver-node@0.3.9(supports-color@8.1.1): dependencies: - debug: 3.2.7 + debug: 3.2.7(supports-color@8.1.1) is-core-module: 2.16.1 resolve: 1.22.11 transitivePeerDependencies: - supports-color + optional: true - eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(eslint@9.39.1))(eslint@9.39.1): + eslint-import-resolver-typescript@4.4.5(eslint-plugin-import-x@4.17.1(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1))(eslint-plugin-import@2.32.0)(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1): dependencies: - '@nolyfill/is-core-module': 1.0.39 debug: 4.4.3(supports-color@8.1.1) - eslint: 9.39.1 + eslint: 10.8.0(supports-color@8.1.1) + eslint-import-context: 0.1.9(unrs-resolver@1.11.1) get-tsconfig: 4.13.0 is-bun-module: 2.0.0 - stable-hash: 0.0.5 + stable-hash-x: 0.2.0 tinyglobby: 0.2.15 unrs-resolver: 1.11.1 optionalDependencies: - eslint-plugin-import: 2.32.0(eslint@9.39.1) + eslint-plugin-import: 2.32.0(eslint-import-resolver-typescript@4.4.5)(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1) + eslint-plugin-import-x: 4.17.1(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1) transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.1(eslint-import-resolver-node@0.3.9)(eslint@9.39.1): + eslint-module-utils@2.12.1(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint-import-resolver-typescript@4.4.5)(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1): dependencies: - debug: 3.2.7 + debug: 3.2.7(supports-color@8.1.1) optionalDependencies: - eslint: 9.39.1 - eslint-import-resolver-node: 0.3.9 + eslint: 10.8.0(supports-color@8.1.1) + eslint-import-resolver-node: 0.3.9(supports-color@8.1.1) + eslint-import-resolver-typescript: 4.4.5(eslint-plugin-import-x@4.17.1(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1))(eslint-plugin-import@2.32.0)(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1) transitivePeerDependencies: - supports-color + optional: true - eslint-plugin-array-func@5.1.0(eslint@9.39.1): + eslint-plugin-array-func@5.1.1(eslint@10.8.0(supports-color@8.1.1)): dependencies: - eslint: 9.39.1 + eslint: 10.8.0(supports-color@8.1.1) eslint-plugin-chai-expect-keywords@3.1.0: dependencies: globals: 15.15.0 - eslint-plugin-chai-expect@3.1.0(eslint@9.39.1): + eslint-plugin-chai-expect@4.1.0(eslint@10.8.0(supports-color@8.1.1)): dependencies: - eslint: 9.39.1 + eslint: 10.8.0(supports-color@8.1.1) - eslint-plugin-chai-friendly@1.1.0(eslint@9.39.1): + eslint-plugin-chai-friendly@1.2.1(eslint@10.8.0(supports-color@8.1.1)): dependencies: - eslint: 9.39.1 + eslint: 10.8.0(supports-color@8.1.1) - eslint-plugin-compat@6.0.2(eslint@9.39.1): + eslint-plugin-compat@7.0.2(eslint@10.8.0(supports-color@8.1.1)): dependencies: - '@mdn/browser-compat-data': 5.7.6 + '@mdn/browser-compat-data': 6.1.5 ast-metadata-inferer: 0.8.1 browserslist: 4.28.0 - caniuse-lite: 1.0.30001793 - eslint: 9.39.1 + eslint: 10.8.0(supports-color@8.1.1) find-up: 5.0.0 globals: 15.15.0 lodash.memoize: 4.1.2 semver: 7.7.3 - eslint-plugin-cypress@5.2.0(eslint@9.39.1): + eslint-plugin-cypress@6.4.3(eslint@10.8.0(supports-color@8.1.1)): dependencies: - eslint: 9.39.1 - globals: 16.5.0 + eslint: 10.8.0(supports-color@8.1.1) + globals: 17.8.0 - eslint-plugin-es-x@7.8.0(eslint@9.39.1): + eslint-plugin-es-x@7.8.0(eslint@10.8.0(supports-color@8.1.1)): dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.1) + '@eslint-community/eslint-utils': 4.9.0(eslint@10.8.0(supports-color@8.1.1)) '@eslint-community/regexpp': 4.12.2 - eslint: 9.39.1 - eslint-compat-utils: 0.5.1(eslint@9.39.1) + eslint: 10.8.0(supports-color@8.1.1) + eslint-compat-utils: 0.5.1(eslint@10.8.0(supports-color@8.1.1)) - eslint-plugin-escompat@3.11.4(eslint@9.39.1): + eslint-plugin-escompat@3.11.4(eslint@10.8.0(supports-color@8.1.1)): dependencies: browserslist: 4.28.0 - eslint: 9.39.1 + eslint: 10.8.0(supports-color@8.1.1) - eslint-plugin-html@8.1.3: + eslint-plugin-html@8.1.4: dependencies: htmlparser2: 10.0.0 - eslint-plugin-import@2.32.0(eslint@9.39.1): + eslint-plugin-import-x@4.17.1(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1): + dependencies: + '@typescript-eslint/types': 8.65.0 + comment-parser: 1.4.1 + debug: 4.4.3(supports-color@8.1.1) + eslint: 10.8.0(supports-color@8.1.1) + eslint-import-context: 0.1.9(unrs-resolver@1.11.1) + is-glob: 4.0.3 + minimatch: 10.2.5 + semver: 7.7.3 + stable-hash-x: 0.2.0 + unrs-resolver: 1.11.1 + optionalDependencies: + eslint-import-resolver-node: 0.3.9(supports-color@8.1.1) + transitivePeerDependencies: + - supports-color + + eslint-plugin-import@2.32.0(eslint-import-resolver-typescript@4.4.5)(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 array.prototype.findlastindex: 1.2.6 array.prototype.flat: 1.3.3 array.prototype.flatmap: 1.3.3 - debug: 3.2.7 + debug: 3.2.7(supports-color@8.1.1) doctrine: 2.1.0 - eslint: 9.39.1 - eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.1(eslint-import-resolver-node@0.3.9)(eslint@9.39.1) + eslint: 10.8.0(supports-color@8.1.1) + eslint-import-resolver-node: 0.3.9(supports-color@8.1.1) + eslint-module-utils: 2.12.1(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint-import-resolver-typescript@4.4.5)(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -6609,147 +6966,146 @@ snapshots: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color + optional: true - eslint-plugin-jsdoc@61.2.1(eslint@9.39.1): + eslint-plugin-jsdoc@63.3.1(eslint@10.8.0(supports-color@8.1.1))(supports-color@8.1.1): dependencies: - '@es-joy/jsdoccomment': 0.76.0 + '@es-joy/jsdoccomment': 0.90.0 '@es-joy/resolve.exports': 1.2.0 are-docs-informative: 0.0.2 - comment-parser: 1.4.1 + comment-parser: 1.4.7 debug: 4.4.3(supports-color@8.1.1) escape-string-regexp: 4.0.0 - eslint: 9.39.1 - espree: 10.4.0 - esquery: 1.6.0 + eslint: 10.8.0(supports-color@8.1.1) + espree: 11.2.0 + esquery: 1.7.0 html-entities: 2.6.0 - object-deep-merge: 2.0.0 + object-deep-merge: 2.0.1 parse-imports-exports: 0.2.4 - semver: 7.7.3 - spdx-expression-parse: 4.0.0 + semver: 7.8.5 + spdx-expression-parse: 5.0.0 to-valid-identifier: 1.0.0 transitivePeerDependencies: - supports-color - eslint-plugin-mocha-cleanup@1.11.3(eslint@9.39.1): + eslint-plugin-mocha-cleanup@1.11.3(eslint@10.8.0(supports-color@8.1.1)): dependencies: - eslint: 9.39.1 + eslint: 10.8.0(supports-color@8.1.1) requireindex: 1.2.0 - eslint-plugin-mocha@11.2.0(eslint@9.39.1): + eslint-plugin-mocha@12.0.0(eslint@10.8.0(supports-color@8.1.1)): dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.1) - eslint: 9.39.1 - globals: 15.15.0 + '@eslint-community/eslint-utils': 4.10.1(eslint@10.8.0(supports-color@8.1.1)) + '@eslint/core': 1.2.1 + eslint: 10.8.0(supports-color@8.1.1) + globals: 17.7.0 - eslint-plugin-n@17.23.1(eslint@9.39.1)(typescript@5.9.3): + eslint-plugin-n@18.2.2(eslint@10.8.0(supports-color@8.1.1))(ts-declaration-location@1.0.7(typescript@6.0.3))(typescript@6.0.3): dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.1) + '@eslint-community/eslint-utils': 4.9.0(eslint@10.8.0(supports-color@8.1.1)) enhanced-resolve: 5.18.3 - eslint: 9.39.1 - eslint-plugin-es-x: 7.8.0(eslint@9.39.1) + eslint: 10.8.0(supports-color@8.1.1) + eslint-plugin-es-x: 7.8.0(eslint@10.8.0(supports-color@8.1.1)) get-tsconfig: 4.13.0 globals: 15.15.0 globrex: 0.1.2 ignore: 5.3.2 semver: 7.7.3 - ts-declaration-location: 1.0.7(typescript@5.9.3) - transitivePeerDependencies: - - typescript + optionalDependencies: + ts-declaration-location: 1.0.7(typescript@6.0.3) + typescript: 6.0.3 - eslint-plugin-no-unsanitized@4.1.4(eslint@9.39.1): + eslint-plugin-no-unsanitized@4.1.5(eslint@10.8.0(supports-color@8.1.1)): dependencies: - eslint: 9.39.1 + eslint: 10.8.0(supports-color@8.1.1) - eslint-plugin-no-use-extend-native@0.7.2(eslint@9.39.1): + eslint-plugin-no-use-extend-native@0.7.3(eslint@10.8.0(supports-color@8.1.1)): dependencies: - eslint: 9.39.1 + eslint: 10.8.0(supports-color@8.1.1) is-get-set-prop: 2.0.0 is-js-type: 3.0.0 is-obj-prop: 2.0.0 is-proto-prop: 3.0.1 - eslint-plugin-promise@7.2.1(eslint@9.39.1): + eslint-plugin-promise@7.3.0(eslint@10.8.0(supports-color@8.1.1)): dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.1) - eslint: 9.39.1 + '@eslint-community/eslint-utils': 4.9.0(eslint@10.8.0(supports-color@8.1.1)) + eslint: 10.8.0(supports-color@8.1.1) - eslint-plugin-sonarjs@3.0.5(eslint@9.39.1): + eslint-plugin-sonarjs@4.2.0(eslint@10.8.0(supports-color@8.1.1)): dependencies: - '@eslint-community/regexpp': 4.12.1 + '@eslint-community/regexpp': 4.12.2 builtin-modules: 3.3.0 bytes: 3.1.2 - eslint: 9.39.1 + eslint: 10.8.0(supports-color@8.1.1) functional-red-black-tree: 1.0.1 + globals: 17.8.0 jsx-ast-utils-x: 0.1.0 lodash.merge: 4.6.2 - minimatch: 9.0.5 + minimatch: 10.2.5 scslre: 0.3.0 - semver: 7.7.2 - typescript: 5.9.3 + semver: 7.8.5 + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 + yaml: 2.9.0 - eslint-plugin-unicorn@62.0.0(eslint@9.39.1): + eslint-plugin-unicorn@72.0.0(eslint@10.8.0(supports-color@8.1.1)): dependencies: - '@babel/helper-validator-identifier': 7.28.5 - '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.1) - '@eslint/plugin-kit': 0.4.1 + '@eslint-community/eslint-utils': 4.10.1(eslint@10.8.0(supports-color@8.1.1)) + '@eslint/css-tree': 4.0.5 + browserslist: 4.28.7 change-case: 5.4.4 - ci-info: 4.3.1 - clean-regexp: 1.0.0 - core-js-compat: 3.47.0 - eslint: 9.39.1 - esquery: 1.6.0 + ci-info: 4.4.0 + core-js-compat: 3.49.0 + detect-indent: 7.0.2 + entities: 4.5.0 + eslint: 10.8.0(supports-color@8.1.1) find-up-simple: 1.0.1 - globals: 16.5.0 + globals: 17.8.0 indent-string: 5.0.0 is-builtin-module: 5.0.0 - jsesc: 3.1.0 + is-identifier: 1.1.0 pluralize: 8.0.0 - regexp-tree: 0.1.27 - regjsparser: 0.13.0 - semver: 7.7.3 + quote-js-string: 0.1.0 + regjsparser: 0.13.2 + reserved-identifiers: 1.2.0 + semver: 7.8.5 strip-indent: 4.1.1 + yaml: 2.9.0 - eslint-rule-composer@0.3.0: {} - - eslint-scope@5.1.1: - dependencies: - esrecurse: 4.3.0 - estraverse: 4.3.0 - - eslint-scope@8.4.0: + eslint-scope@9.1.2: dependencies: + '@types/esrecurse': 4.3.1 + '@types/estree': 1.0.9 esrecurse: 4.3.0 estraverse: 5.3.0 - eslint-visitor-keys@2.1.0: {} - eslint-visitor-keys@3.4.3: {} eslint-visitor-keys@4.2.1: {} - eslint@9.39.1: + eslint-visitor-keys@5.0.1: {} + + eslint@10.8.0(supports-color@8.1.1): dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.1) + '@eslint-community/eslint-utils': 4.9.0(eslint@10.8.0(supports-color@8.1.1)) '@eslint-community/regexpp': 4.12.2 - '@eslint/config-array': 0.21.1 - '@eslint/config-helpers': 0.4.2 - '@eslint/core': 0.17.0 - '@eslint/eslintrc': 3.3.1 - '@eslint/js': 9.39.1 - '@eslint/plugin-kit': 0.4.1 + '@eslint/config-array': 0.23.5(supports-color@8.1.1) + '@eslint/config-helpers': 0.7.0 + '@eslint/core': 1.2.1 + '@eslint/plugin-kit': 0.7.2 '@humanfs/node': 0.16.7 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.4.3 - '@types/estree': 1.0.8 + '@types/estree': 1.0.9 ajv: 6.15.0 - chalk: 4.1.2 cross-spawn: 7.0.6 debug: 4.4.3(supports-color@8.1.1) escape-string-regexp: 4.0.0 - eslint-scope: 8.4.0 - eslint-visitor-keys: 4.2.1 - espree: 10.4.0 - esquery: 1.6.0 + eslint-scope: 9.1.2 + eslint-visitor-keys: 5.0.1 + espree: 11.2.0 + esquery: 1.7.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 file-entry-cache: 8.0.0 @@ -6759,8 +7115,7 @@ snapshots: imurmurhash: 0.1.4 is-glob: 4.0.3 json-stable-stringify-without-jsonify: 1.0.1 - lodash.merge: 4.6.2 - minimatch: 3.1.5 + minimatch: 10.2.5 natural-compare: 1.4.0 optionator: 0.9.4 transitivePeerDependencies: @@ -6784,9 +7139,15 @@ snapshots: acorn-jsx: 5.3.2(acorn@8.15.0) eslint-visitor-keys: 4.2.1 + espree@11.2.0: + dependencies: + acorn: 8.17.0 + acorn-jsx: 5.3.2(acorn@8.17.0) + eslint-visitor-keys: 5.0.1 + esprima@4.0.1: {} - esquery@1.6.0: + esquery@1.7.0: dependencies: estraverse: 5.3.0 @@ -6794,8 +7155,6 @@ snapshots: dependencies: estraverse: 5.3.0 - estraverse@4.3.0: {} - estraverse@5.3.0: {} estree-walker@2.0.2: {} @@ -6845,6 +7204,8 @@ snapshots: optionalDependencies: picomatch: 4.0.4 + fflate@0.8.3: {} + file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 @@ -6855,11 +7216,14 @@ snapshots: readable-stream: 4.7.0 stream-chunks: 1.0.0 - file-type@18.7.0: + file-type@21.3.4(supports-color@8.1.1): dependencies: - readable-web-to-node-stream: 3.0.4 - strtok3: 7.1.1 - token-types: 5.0.1 + '@tokenizer/inflate': 0.4.1(supports-color@8.1.1) + strtok3: 10.3.5 + token-types: 6.1.2 + uint8array-extras: 1.5.0 + transitivePeerDependencies: + - supports-color fill-range@7.1.1: dependencies: @@ -6894,11 +7258,14 @@ snapshots: flatted@3.4.2: {} - follow-redirects@1.16.0: {} + follow-redirects@1.16.0(debug@4.4.3(supports-color@8.1.1)): + optionalDependencies: + debug: 4.4.3(supports-color@8.1.1) for-each@0.3.5: dependencies: is-callable: 1.2.7 + optional: true foreground-child@3.3.1: dependencies: @@ -6909,19 +7276,17 @@ snapshots: format@0.2.2: {} - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - fs-minipass@3.0.3: dependencies: - minipass: 7.1.2 + minipass: 7.1.3 fsevents@2.3.3: optional: true function-bind@1.1.2: {} + function-timeout@1.0.2: {} + function.prototype.name@1.1.8: dependencies: call-bind: 1.0.8 @@ -6930,12 +7295,15 @@ snapshots: functions-have-names: 1.2.3 hasown: 2.0.2 is-callable: 1.2.7 + optional: true functional-red-black-tree@1.0.1: {} - functions-have-names@1.2.3: {} + functions-have-names@1.2.3: + optional: true - generator-function@2.0.1: {} + generator-function@2.0.1: + optional: true gensync@1.0.0-beta.2: {} @@ -6943,6 +7311,8 @@ snapshots: get-east-asian-width@1.4.0: {} + get-east-asian-width@1.6.0: {} + get-intrinsic@1.3.0: dependencies: call-bind-apply-helpers: 1.0.2 @@ -6965,8 +7335,6 @@ snapshots: get-set-props@0.2.0: {} - get-stdin@9.0.0: {} - get-stream@6.0.1: {} get-symbol-description@1.1.0: @@ -6974,6 +7342,7 @@ snapshots: call-bound: 1.0.4 es-errors: 1.3.0 get-intrinsic: 1.3.0 + optional: true get-tsconfig@4.13.0: dependencies: @@ -6998,6 +7367,12 @@ snapshots: package-json-from-dist: 1.0.1 path-scurry: 1.11.1 + glob@13.0.6: + dependencies: + minimatch: 10.2.5 + minipass: 7.1.3 + path-scurry: 2.0.2 + global-directory@4.0.1: dependencies: ini: 4.1.1 @@ -7006,25 +7381,26 @@ snapshots: dependencies: ini: 2.0.0 - globals@14.0.0: {} - globals@15.15.0: {} - globals@16.5.0: {} + globals@17.7.0: {} + + globals@17.8.0: {} globalthis@1.0.4: dependencies: define-properties: 1.2.1 gopd: 1.2.0 + optional: true - globby@14.1.0: + globby@16.2.2: dependencies: - '@sindresorhus/merge-streams': 2.3.0 + '@sindresorhus/merge-streams': 4.0.0 fast-glob: 3.3.3 ignore: 7.0.5 - path-type: 6.0.0 + is-path-inside: 4.0.0 slash: 5.1.0 - unicorn-magic: 0.3.0 + unicorn-magic: 0.4.0 globrex@0.1.2: {} @@ -7048,7 +7424,8 @@ snapshots: graceful-fs@4.2.11: {} - has-bigints@1.1.0: {} + has-bigints@1.1.0: + optional: true has-flag@3.0.0: {} @@ -7057,16 +7434,19 @@ snapshots: has-property-descriptors@1.0.2: dependencies: es-define-property: 1.0.1 + optional: true has-proto@1.2.0: dependencies: dunder-proto: 1.0.1 + optional: true has-symbols@1.1.0: {} has-tostringtag@1.0.2: dependencies: has-symbols: 1.1.0 + optional: true has-yarn@3.0.0: {} @@ -7076,9 +7456,11 @@ snapshots: he@1.2.0: {} - hosted-git-info@7.0.2: + highlight.js@10.7.3: {} + + hosted-git-info@9.0.3: dependencies: - lru-cache: 10.4.3 + lru-cache: 11.5.2 html-encoding-sniffer@3.0.0: dependencies: @@ -7095,35 +7477,42 @@ snapshots: domutils: 3.2.2 entities: 6.0.1 + htmlparser2@10.1.0: + dependencies: + domelementtype: 2.3.0 + domhandler: 5.0.3 + domutils: 3.2.2 + entities: 7.0.1 + http-cache-semantics@4.2.0: {} - http-proxy-agent@7.0.2: + http-proxy-agent@7.0.2(supports-color@8.1.1): dependencies: agent-base: 7.1.4 debug: 4.4.3(supports-color@8.1.1) transitivePeerDependencies: - supports-color - http-proxy@1.18.1: + http-proxy@1.18.1(debug@4.4.3(supports-color@8.1.1)): dependencies: eventemitter3: 4.0.7 - follow-redirects: 1.16.0 + follow-redirects: 1.16.0(debug@4.4.3(supports-color@8.1.1)) requires-port: 1.0.0 transitivePeerDependencies: - debug - http-server@14.1.1: + http-server@14.1.1(debug@4.4.3(supports-color@8.1.1))(supports-color@8.1.1): dependencies: basic-auth: 2.0.1 chalk: 4.1.2 corser: 2.0.1 he: 1.2.0 html-encoding-sniffer: 3.0.0 - http-proxy: 1.18.1 + http-proxy: 1.18.1(debug@4.4.3(supports-color@8.1.1)) mime: 1.6.0 minimist: 1.2.8 opener: 1.5.2 - portfinder: 1.0.38 + portfinder: 1.0.38(supports-color@8.1.1) secure-compare: 3.0.1 union: 0.5.0 url-join: 4.0.1 @@ -7136,7 +7525,7 @@ snapshots: quick-lru: 5.1.1 resolve-alpn: 1.2.1 - https-proxy-agent@7.0.6: + https-proxy-agent@7.0.6(supports-color@8.1.1): dependencies: agent-base: 7.1.4 debug: 4.4.3(supports-color@8.1.1) @@ -7147,26 +7536,30 @@ snapshots: dependencies: safer-buffer: 2.1.2 + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + optional: true + + identifier-regex@1.1.0: + dependencies: + reserved-identifiers: 1.2.0 + ieee754@1.2.1: {} - ignore-walk@6.0.5: + ignore-walk@8.0.0: dependencies: - minimatch: 9.0.9 + minimatch: 10.2.5 ignore@5.3.2: {} ignore@7.0.5: {} - import-fresh@3.3.1: - dependencies: - parent-module: 1.0.1 - resolve-from: 4.0.0 - import-lazy@4.0.0: {} - imurmurhash@0.1.4: {} + import-meta-resolve@4.2.0: {} - indent-string@4.0.0: {} + imurmurhash@0.1.4: {} indent-string@5.0.0: {} @@ -7176,13 +7569,14 @@ snapshots: ini@4.1.1: {} - ini@4.1.3: {} + ini@6.0.0: {} internal-slot@1.1.0: dependencies: es-errors: 1.3.0 hasown: 2.0.2 side-channel: 1.1.0 + optional: true ip-address@10.2.0: {} @@ -7191,6 +7585,7 @@ snapshots: call-bind: 1.0.8 call-bound: 1.0.4 get-intrinsic: 1.3.0 + optional: true is-async-function@2.1.1: dependencies: @@ -7199,15 +7594,18 @@ snapshots: get-proto: 1.0.1 has-tostringtag: 1.0.2 safe-regex-test: 1.1.0 + optional: true is-bigint@1.1.0: dependencies: has-bigints: 1.1.0 + optional: true is-boolean-object@1.2.2: dependencies: call-bound: 1.0.4 has-tostringtag: 1.0.2 + optional: true is-builtin-module@5.0.0: dependencies: @@ -7215,9 +7613,10 @@ snapshots: is-bun-module@2.0.0: dependencies: - semver: 7.7.3 + semver: 7.8.5 - is-callable@1.2.7: {} + is-callable@1.2.7: + optional: true is-ci@3.0.1: dependencies: @@ -7232,11 +7631,13 @@ snapshots: call-bound: 1.0.4 get-intrinsic: 1.3.0 is-typed-array: 1.1.15 + optional: true is-date-object@1.1.0: dependencies: call-bound: 1.0.4 has-tostringtag: 1.0.2 + optional: true is-docker@3.0.0: {} @@ -7245,6 +7646,7 @@ snapshots: is-finalizationregistry@1.1.1: dependencies: call-bound: 1.0.4 + optional: true is-fullwidth-code-point@3.0.0: {} @@ -7255,6 +7657,7 @@ snapshots: get-proto: 1.0.1 has-tostringtag: 1.0.2 safe-regex-test: 1.1.0 + optional: true is-get-set-prop@2.0.0: dependencies: @@ -7265,8 +7668,15 @@ snapshots: dependencies: is-extglob: 2.1.1 + is-identifier@1.1.0: + dependencies: + identifier-regex: 1.1.0 + super-regex: 1.1.0 + is-in-ci@1.0.0: {} + is-in-ssh@1.0.0: {} + is-inside-container@1.0.0: dependencies: is-docker: 3.0.0 @@ -7285,13 +7695,13 @@ snapshots: dependencies: js-types: 4.0.0 - is-lambda@1.0.1: {} - - is-map@2.0.3: {} + is-map@2.0.3: + optional: true is-module@1.0.0: {} - is-negative-zero@2.0.3: {} + is-negative-zero@2.0.3: + optional: true is-npm@6.1.0: {} @@ -7299,6 +7709,7 @@ snapshots: dependencies: call-bound: 1.0.4 has-tostringtag: 1.0.2 + optional: true is-number@7.0.0: {} @@ -7326,12 +7737,15 @@ snapshots: gopd: 1.2.0 has-tostringtag: 1.0.2 hasown: 2.0.2 + optional: true - is-set@2.0.3: {} + is-set@2.0.3: + optional: true is-shared-array-buffer@1.0.4: dependencies: call-bound: 1.0.4 + optional: true is-stream@3.0.0: {} @@ -7339,31 +7753,37 @@ snapshots: dependencies: call-bound: 1.0.4 has-tostringtag: 1.0.2 + optional: true is-symbol@1.1.1: dependencies: call-bound: 1.0.4 has-symbols: 1.1.0 safe-regex-test: 1.1.0 + optional: true is-typed-array@1.1.15: dependencies: which-typed-array: 1.1.19 + optional: true is-typedarray@1.0.0: {} is-unicode-supported@0.1.0: {} - is-weakmap@2.0.2: {} + is-weakmap@2.0.2: + optional: true is-weakref@1.1.1: dependencies: call-bound: 1.0.4 + optional: true is-weakset@2.0.4: dependencies: call-bound: 1.0.4 get-intrinsic: 1.3.0 + optional: true is-wsl@3.1.0: dependencies: @@ -7371,11 +7791,12 @@ snapshots: is-yarn-global@0.4.1: {} - isarray@2.0.5: {} + isarray@2.0.5: + optional: true isexe@2.0.0: {} - isexe@3.1.1: {} + isexe@4.0.0: {} istanbul-lib-coverage@3.2.2: {} @@ -7396,6 +7817,8 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + js-tokens@10.0.0: {} + js-tokens@4.0.0: {} js-types@4.0.0: {} @@ -7409,7 +7832,11 @@ snapshots: dependencies: argparse: 2.0.1 - jsdoc-type-pratt-parser@6.10.0: {} + js-yaml@5.2.2: + dependencies: + argparse: 2.0.1 + + jsdoc-type-pratt-parser@7.3.0: {} jsep@1.4.0: {} @@ -7417,7 +7844,7 @@ snapshots: json-buffer@3.0.1: {} - json-parse-even-better-errors@3.0.2: {} + json-parse-even-better-errors@5.0.0: {} json-schema-traverse@0.4.1: {} @@ -7428,6 +7855,7 @@ snapshots: json5@1.0.2: dependencies: minimist: 1.2.8 + optional: true json5@2.2.3: {} @@ -7439,6 +7867,10 @@ snapshots: just-diff@6.0.2: {} + katex@0.16.47: + dependencies: + commander: 8.3.0 + keyv@4.5.4: dependencies: json-buffer: 3.0.1 @@ -7458,42 +7890,40 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 - license-badger@0.22.1: + license-badger@0.23.0(supports-color@8.1.1): dependencies: '@rpl/badge-up': 3.0.0 command-line-basics: 3.0.0 es6-template-strings: 2.0.1 - js-yaml: 4.1.1 - license-types: 3.1.0 - licensee: 11.1.1 + js-yaml: 5.2.2 + license-types: 3.2.0 + licensee: 12.0.1(supports-color@8.1.1) spdx-correct: 3.2.0 - spdx-expression-parse: 4.0.0 - spdx-satisfies: 5.0.1 + spdx-expression-parse: 5.0.0 + spdx-satisfies: 6.0.0 transitivePeerDependencies: - '@75lb/nature' - - bluebird - supports-color - license-types@3.1.0: {} + license-types@3.2.0: {} - licensee@11.1.1: + licensee@12.0.1(supports-color@8.1.1): dependencies: '@blueoak/list': 15.0.0 - '@npmcli/arborist': 7.5.4 + '@npmcli/arborist': 9.9.0(supports-color@8.1.1) correct-license-metadata: 1.4.0 docopt: 0.6.2 hasown: 2.0.2 npm-license-corrections: 1.9.0 - semver: 7.7.3 + semver: 7.8.5 spdx-expression-parse: 4.0.0 spdx-expression-validate: 2.0.0 spdx-osi: 3.0.0 spdx-whitelisted: 1.0.0 transitivePeerDependencies: - - bluebird - supports-color - linkify-it@5.0.0: + linkify-it@5.0.2: dependencies: uc.micro: 2.1.0 @@ -7526,44 +7956,61 @@ snapshots: lru-cache@10.4.3: {} - lru-cache@5.1.1: - dependencies: - yallist: 3.1.1 + lru-cache@11.5.2: {} lunr@2.3.9: {} + make-asynchronous@1.1.0: + dependencies: + p-event: 6.0.1 + type-fest: 4.41.0 + web-worker: 1.5.0 + make-dir@4.0.0: dependencies: - semver: 7.7.3 + semver: 7.8.5 - make-fetch-happen@13.0.1: + make-fetch-happen@15.0.6(supports-color@8.1.1): dependencies: - '@npmcli/agent': 2.2.2 - cacache: 18.0.4 + '@gar/promise-retry': 1.0.3 + '@npmcli/agent': 4.0.2(supports-color@8.1.1) + '@npmcli/redact': 4.0.0 + cacache: 20.0.4 http-cache-semantics: 4.2.0 - is-lambda: 1.0.1 - minipass: 7.1.2 - minipass-fetch: 3.0.5 + minipass: 7.1.3 + minipass-fetch: 5.0.2 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 - negotiator: 0.6.4 - proc-log: 4.2.0 - promise-retry: 2.0.1 - ssri: 10.0.6 + negotiator: 1.0.0 + proc-log: 6.1.0 + ssri: 13.0.1 transitivePeerDependencies: - supports-color - markdown-it@14.1.1: + markdown-it@14.3.0: dependencies: argparse: 2.0.1 entities: 4.5.0 - linkify-it: 5.0.0 + linkify-it: 5.0.2 mdurl: 2.0.0 punycode.js: 2.3.1 uc.micro: 2.1.0 markdown-table@3.0.4: {} + marked-terminal@7.3.0(marked@9.1.6): + dependencies: + ansi-escapes: 7.3.0 + ansi-regex: 6.2.2 + chalk: 5.6.2 + cli-highlight: 2.1.11 + cli-table3: 0.6.5 + marked: 9.1.6 + node-emoji: 2.2.0 + supports-hyperlinks: 3.2.0 + + marked@9.1.6: {} + math-intrinsics@1.1.0: {} mdast-util-find-and-replace@3.0.2: @@ -7573,14 +8020,14 @@ snapshots: unist-util-is: 6.0.1 unist-util-visit-parents: 6.0.2 - mdast-util-from-markdown@2.0.2: + mdast-util-from-markdown@2.0.2(supports-color@8.1.1): dependencies: '@types/mdast': 4.0.4 '@types/unist': 3.0.3 decode-named-character-reference: 1.2.0 devlop: 1.1.0 mdast-util-to-string: 4.0.0 - micromark: 4.0.2 + micromark: 4.0.2(supports-color@8.1.1) micromark-util-decode-numeric-character-reference: 2.0.2 micromark-util-decode-string: 2.0.1 micromark-util-normalize-identifier: 2.0.1 @@ -7590,12 +8037,12 @@ snapshots: transitivePeerDependencies: - supports-color - mdast-util-frontmatter@2.0.1: + mdast-util-frontmatter@2.0.1(supports-color@8.1.1): dependencies: '@types/mdast': 4.0.4 devlop: 1.1.0 escape-string-regexp: 5.0.0 - mdast-util-from-markdown: 2.0.2 + mdast-util-from-markdown: 2.0.2(supports-color@8.1.1) mdast-util-to-markdown: 2.1.2 micromark-extension-frontmatter: 2.0.0 transitivePeerDependencies: @@ -7609,52 +8056,64 @@ snapshots: mdast-util-find-and-replace: 3.0.2 micromark-util-character: 2.1.1 - mdast-util-gfm-footnote@2.1.0: + mdast-util-gfm-footnote@2.1.0(supports-color@8.1.1): dependencies: '@types/mdast': 4.0.4 devlop: 1.1.0 - mdast-util-from-markdown: 2.0.2 + mdast-util-from-markdown: 2.0.2(supports-color@8.1.1) mdast-util-to-markdown: 2.1.2 micromark-util-normalize-identifier: 2.0.1 transitivePeerDependencies: - supports-color - mdast-util-gfm-strikethrough@2.0.0: + mdast-util-gfm-strikethrough@2.0.0(supports-color@8.1.1): dependencies: '@types/mdast': 4.0.4 - mdast-util-from-markdown: 2.0.2 + mdast-util-from-markdown: 2.0.2(supports-color@8.1.1) mdast-util-to-markdown: 2.1.2 transitivePeerDependencies: - supports-color - mdast-util-gfm-table@2.0.0: + mdast-util-gfm-table@2.0.0(supports-color@8.1.1): dependencies: '@types/mdast': 4.0.4 devlop: 1.1.0 markdown-table: 3.0.4 - mdast-util-from-markdown: 2.0.2 + mdast-util-from-markdown: 2.0.2(supports-color@8.1.1) mdast-util-to-markdown: 2.1.2 transitivePeerDependencies: - supports-color - mdast-util-gfm-task-list-item@2.0.0: + mdast-util-gfm-task-list-item@2.0.0(supports-color@8.1.1): dependencies: '@types/mdast': 4.0.4 devlop: 1.1.0 - mdast-util-from-markdown: 2.0.2 + mdast-util-from-markdown: 2.0.2(supports-color@8.1.1) mdast-util-to-markdown: 2.1.2 transitivePeerDependencies: - supports-color - mdast-util-gfm@3.1.0: + mdast-util-gfm@3.1.0(supports-color@8.1.1): dependencies: - mdast-util-from-markdown: 2.0.2 + mdast-util-from-markdown: 2.0.2(supports-color@8.1.1) mdast-util-gfm-autolink-literal: 2.0.1 - mdast-util-gfm-footnote: 2.1.0 - mdast-util-gfm-strikethrough: 2.0.0 - mdast-util-gfm-table: 2.0.0 - mdast-util-gfm-task-list-item: 2.0.0 + mdast-util-gfm-footnote: 2.1.0(supports-color@8.1.1) + mdast-util-gfm-strikethrough: 2.0.0(supports-color@8.1.1) + mdast-util-gfm-table: 2.0.0(supports-color@8.1.1) + mdast-util-gfm-task-list-item: 2.0.0(supports-color@8.1.1) + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-math@3.0.0(supports-color@8.1.1): + dependencies: + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + devlop: 1.1.0 + longest-streak: 3.1.0 + mdast-util-from-markdown: 2.0.2(supports-color@8.1.1) mdast-util-to-markdown: 2.1.2 + unist-util-remove-position: 5.0.0 transitivePeerDependencies: - supports-color @@ -7681,9 +8140,11 @@ snapshots: mdn-data@2.0.14: {} + mdn-data@2.29.0: {} + mdurl@2.0.0: {} - meow@12.1.1: {} + meow@14.1.0: {} merge2@1.4.1: {} @@ -7771,6 +8232,16 @@ snapshots: micromark-util-combine-extensions: 2.0.1 micromark-util-types: 2.0.2 + micromark-extension-math@3.1.0: + dependencies: + '@types/katex': 0.16.8 + devlop: 1.1.0 + katex: 0.16.47 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + micromark-factory-destination@2.0.1: dependencies: micromark-util-character: 2.1.1 @@ -7863,7 +8334,7 @@ snapshots: micromark-util-types@2.0.2: {} - micromark@4.0.2: + micromark@4.0.2(supports-color@8.1.1): dependencies: '@types/debug': 4.1.12 debug: 4.4.3(supports-color@8.1.1) @@ -7902,13 +8373,14 @@ snapshots: mimic-response@4.0.0: {} - minimatch@3.1.5: + minimatch@10.2.5: dependencies: - brace-expansion: 1.1.14 + brace-expansion: 5.0.8 - minimatch@9.0.5: + minimatch@3.1.5: dependencies: - brace-expansion: 2.1.0 + brace-expansion: 1.1.14 + optional: true minimatch@9.0.9: dependencies: @@ -7918,15 +8390,15 @@ snapshots: minipass-collect@2.0.1: dependencies: - minipass: 7.1.2 + minipass: 7.1.3 - minipass-fetch@3.0.5: + minipass-fetch@5.0.2: dependencies: - minipass: 7.1.2 - minipass-sized: 1.0.3 - minizlib: 2.1.2 + minipass: 7.1.3 + minipass-sized: 2.0.0 + minizlib: 3.1.0 optionalDependencies: - encoding: 0.1.13 + iconv-lite: 0.7.3 minipass-flush@1.0.5: dependencies: @@ -7936,24 +8408,21 @@ snapshots: dependencies: minipass: 3.3.6 - minipass-sized@1.0.3: + minipass-sized@2.0.0: dependencies: - minipass: 3.3.6 + minipass: 7.1.3 minipass@3.3.6: dependencies: yallist: 4.0.0 - minipass@5.0.0: {} - minipass@7.1.2: {} - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 + minipass@7.1.3: {} - mkdirp@1.0.4: {} + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 mocha-badge-generator@0.11.0: dependencies: @@ -7962,15 +8431,15 @@ snapshots: es6-template-strings: 2.0.1 fast-glob: 3.3.3 - mocha-multi-reporters@1.5.1(mocha@11.7.5): + mocha-multi-reporters@1.5.1(mocha@11.7.6)(supports-color@8.1.1): dependencies: debug: 4.4.3(supports-color@8.1.1) lodash: 4.18.1 - mocha: 11.7.5 + mocha: 11.7.6 transitivePeerDependencies: - supports-color - mocha@11.7.5: + mocha@11.7.6: dependencies: browser-stdout: 1.3.1 chokidar: 4.0.3 @@ -7996,83 +8465,91 @@ snapshots: ms@2.1.3: {} + mz@2.7.0: + dependencies: + any-promise: 1.3.0 + object-assign: 4.1.1 + thenify-all: 1.6.0 + napi-postinstall@0.3.4: {} natural-compare@1.4.0: {} - negotiator@0.6.4: {} + negotiator@1.0.0: {} next-tick@1.1.0: {} - node-gyp@10.3.1: + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + node-gyp@12.4.0: dependencies: env-paths: 2.2.1 exponential-backoff: 3.1.3 - glob: 10.5.0 graceful-fs: 4.2.11 - make-fetch-happen: 13.0.1 - nopt: 7.2.1 - proc-log: 4.2.0 - semver: 7.7.3 - tar: 6.2.1 - which: 4.0.0 - transitivePeerDependencies: - - supports-color + nopt: 9.0.0 + proc-log: 6.1.0 + semver: 7.8.5 + tar: 7.5.22 + tinyglobby: 0.2.15 + undici: 6.28.0 + which: 6.0.1 node-releases@2.0.27: {} - nopt@7.2.1: - dependencies: - abbrev: 2.0.0 + node-releases@2.0.51: {} - normalize-package-data@6.0.2: + nopt@9.0.0: dependencies: - hosted-git-info: 7.0.2 - semver: 7.7.3 - validate-npm-package-license: 3.0.4 + abbrev: 4.0.0 normalize-url@8.1.0: {} - npm-bundled@3.0.1: + npm-bundled@5.0.0: dependencies: - npm-normalize-package-bin: 3.0.1 + npm-normalize-package-bin: 5.0.0 - npm-install-checks@6.3.0: + npm-install-checks@8.0.0: dependencies: - semver: 7.7.3 + semver: 7.8.5 npm-license-corrections@1.9.0: {} - npm-normalize-package-bin@3.0.1: {} + npm-normalize-package-bin@5.0.0: {} - npm-package-arg@11.0.3: + npm-package-arg@13.0.2: dependencies: - hosted-git-info: 7.0.2 - proc-log: 4.2.0 - semver: 7.7.3 - validate-npm-package-name: 5.0.1 + hosted-git-info: 9.0.3 + proc-log: 6.1.0 + semver: 7.8.5 + validate-npm-package-name: 7.0.2 - npm-packlist@8.0.2: + npm-packlist@10.0.4: dependencies: - ignore-walk: 6.0.5 + ignore-walk: 8.0.0 + proc-log: 6.1.0 - npm-pick-manifest@9.1.0: + npm-pick-manifest@11.0.3: dependencies: - npm-install-checks: 6.3.0 - npm-normalize-package-bin: 3.0.1 - npm-package-arg: 11.0.3 - semver: 7.7.3 + npm-install-checks: 8.0.0 + npm-normalize-package-bin: 5.0.0 + npm-package-arg: 13.0.2 + semver: 7.8.5 - npm-registry-fetch@17.1.0: + npm-registry-fetch@19.1.1(supports-color@8.1.1): dependencies: - '@npmcli/redact': 2.0.1 + '@npmcli/redact': 4.0.0 jsonparse: 1.3.1 - make-fetch-happen: 13.0.1 - minipass: 7.1.2 - minipass-fetch: 3.0.5 - minizlib: 2.1.2 - npm-package-arg: 11.0.3 - proc-log: 4.2.0 + make-fetch-happen: 15.0.6(supports-color@8.1.1) + minipass: 7.1.3 + minipass-fetch: 5.0.2 + minizlib: 3.1.0 + npm-package-arg: 13.0.2 + proc-log: 6.1.0 transitivePeerDependencies: - supports-color @@ -8082,11 +8559,14 @@ snapshots: obj-props@2.0.0: {} - object-deep-merge@2.0.0: {} + object-assign@4.1.1: {} + + object-deep-merge@2.0.1: {} object-inspect@1.13.4: {} - object-keys@1.1.1: {} + object-keys@1.1.1: + optional: true object.assign@4.1.7: dependencies: @@ -8096,6 +8576,7 @@ snapshots: es-object-atoms: 1.1.1 has-symbols: 1.1.0 object-keys: 1.1.1 + optional: true object.fromentries@2.0.8: dependencies: @@ -8103,12 +8584,14 @@ snapshots: define-properties: 1.2.1 es-abstract: 1.24.0 es-object-atoms: 1.1.1 + optional: true object.groupby@1.0.3: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 es-abstract: 1.24.0 + optional: true object.values@1.2.1: dependencies: @@ -8116,21 +8599,27 @@ snapshots: call-bound: 1.0.4 define-properties: 1.2.1 es-object-atoms: 1.1.1 + optional: true + + obug@2.1.4: {} - open-cli@8.0.0: + open-cli@9.0.0(supports-color@8.1.1): dependencies: - file-type: 18.7.0 - get-stdin: 9.0.0 - meow: 12.1.1 - open: 10.2.0 - tempy: 3.1.0 + file-type: 21.3.4(supports-color@8.1.1) + meow: 14.1.0 + open: 11.0.0 + tempy: 3.2.0 + transitivePeerDependencies: + - supports-color - open@10.2.0: + open@11.0.0: dependencies: default-browser: 5.4.0 define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 is-inside-container: 1.0.0 - wsl-utils: 0.1.0 + powershell-utils: 0.1.0 + wsl-utils: 0.3.1 opener@1.5.2: {} @@ -8148,9 +8637,14 @@ snapshots: get-intrinsic: 1.3.0 object-keys: 1.1.1 safe-push-apply: 1.0.0 + optional: true p-cancelable@3.0.0: {} + p-event@6.0.1: + dependencies: + p-timeout: 6.1.4 + p-limit@2.3.0: dependencies: p-try: 2.2.0 @@ -8167,9 +8661,9 @@ snapshots: dependencies: p-limit: 3.1.0 - p-map@4.0.0: - dependencies: - aggregate-error: 3.1.0 + p-map@7.0.6: {} + + p-timeout@6.1.4: {} p-try@2.2.0: {} @@ -8180,45 +8674,40 @@ snapshots: ky: 1.14.0 registry-auth-token: 5.1.0 registry-url: 6.0.1 - semver: 7.7.3 + semver: 7.8.5 package-json@8.1.1: dependencies: got: 12.6.1 registry-auth-token: 5.1.0 registry-url: 6.0.1 - semver: 7.7.3 + semver: 7.8.5 - pacote@18.0.6: + pacote@21.5.1(supports-color@8.1.1): dependencies: - '@npmcli/git': 5.0.8 - '@npmcli/installed-package-contents': 2.1.0 - '@npmcli/package-json': 5.2.1 - '@npmcli/promise-spawn': 7.0.2 - '@npmcli/run-script': 8.1.0 - cacache: 18.0.4 + '@gar/promise-retry': 1.0.3 + '@npmcli/git': 7.0.2 + '@npmcli/installed-package-contents': 4.0.0 + '@npmcli/package-json': 7.0.5 + '@npmcli/promise-spawn': 9.0.1 + '@npmcli/run-script': 10.0.4 + cacache: 20.0.4 fs-minipass: 3.0.3 - minipass: 7.1.2 - npm-package-arg: 11.0.3 - npm-packlist: 8.0.2 - npm-pick-manifest: 9.1.0 - npm-registry-fetch: 17.1.0 - proc-log: 4.2.0 - promise-retry: 2.0.1 - sigstore: 2.3.1 - ssri: 10.0.6 - tar: 6.2.1 + minipass: 7.1.3 + npm-package-arg: 13.0.2 + npm-packlist: 10.0.4 + npm-pick-manifest: 11.0.3 + npm-registry-fetch: 19.1.1(supports-color@8.1.1) + proc-log: 6.1.0 + sigstore: 4.1.1(supports-color@8.1.1) + ssri: 13.0.1 + tar: 7.5.22 transitivePeerDependencies: - - bluebird - supports-color - parent-module@1.0.1: + parse-conflict-json@5.0.1: dependencies: - callsites: 3.1.0 - - parse-conflict-json@3.0.1: - dependencies: - json-parse-even-better-errors: 3.0.2 + json-parse-even-better-errors: 5.0.0 just-diff: 6.0.2 just-diff-apply: 5.5.0 @@ -8228,6 +8717,14 @@ snapshots: parse-statements@1.0.11: {} + parse5-htmlparser2-tree-adapter@6.0.1: + dependencies: + parse5: 6.0.1 + + parse5@5.1.1: {} + + parse5@6.0.1: {} + path-exists@4.0.0: {} path-key@3.1.1: {} @@ -8239,9 +8736,10 @@ snapshots: lru-cache: 10.4.3 minipass: 7.1.2 - path-type@6.0.0: {} - - peek-readable@5.4.2: {} + path-scurry@2.0.2: + dependencies: + lru-cache: 11.5.2 + minipass: 7.1.2 picocolors@1.1.1: {} @@ -8251,39 +8749,35 @@ snapshots: pluralize@8.0.0: {} - portfinder@1.0.38: + portfinder@1.0.38(supports-color@8.1.1): dependencies: async: 3.2.6 debug: 4.4.3(supports-color@8.1.1) transitivePeerDependencies: - supports-color - possible-typed-array-names@1.1.0: {} + possible-typed-array-names@1.1.0: + optional: true - postcss-selector-parser@6.1.2: + postcss-selector-parser@7.1.4: dependencies: cssesc: 3.0.0 util-deprecate: 1.0.2 + powershell-utils@0.1.0: {} + prelude-ls@1.2.1: {} - proc-log@4.2.0: {} + proc-log@6.1.0: {} process@0.11.10: {} - proggy@2.0.0: {} + proggy@4.0.0: {} promise-all-reject-late@1.0.1: {} promise-call-limit@3.0.2: {} - promise-inflight@1.0.1: {} - - promise-retry@2.0.1: - dependencies: - err-code: 2.0.3 - retry: 0.12.0 - proto-list@1.2.4: {} prototype-properties@5.0.0: {} @@ -8304,6 +8798,8 @@ snapshots: quick-lru@5.1.1: {} + quote-js-string@0.1.0: {} + randombytes@2.1.0: dependencies: safe-buffer: 5.2.1 @@ -8315,12 +8811,7 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 - read-cmd-shim@4.0.0: {} - - read-package-json-fast@3.0.2: - dependencies: - json-parse-even-better-errors: 3.0.2 - npm-normalize-package-bin: 3.0.1 + read-cmd-shim@6.0.0: {} readable-stream@4.7.0: dependencies: @@ -8330,17 +8821,13 @@ snapshots: process: 0.11.10 string_decoder: 1.3.0 - readable-web-to-node-stream@3.0.4: - dependencies: - readable-stream: 4.7.0 - readdirp@4.1.2: {} reduce-flatten@2.0.0: {} refa@0.12.1: dependencies: - '@eslint-community/regexpp': 4.12.1 + '@eslint-community/regexpp': 4.12.2 reflect.getprototypeof@1.0.10: dependencies: @@ -8352,6 +8839,7 @@ snapshots: get-intrinsic: 1.3.0 get-proto: 1.0.1 which-builtin-type: 1.2.1 + optional: true regenerate-unicode-properties@10.2.2: dependencies: @@ -8361,11 +8849,9 @@ snapshots: regexp-ast-analysis@0.7.1: dependencies: - '@eslint-community/regexpp': 4.12.1 + '@eslint-community/regexpp': 4.12.2 refa: 0.12.1 - regexp-tree@0.1.27: {} - regexp.prototype.flags@1.5.4: dependencies: call-bind: 1.0.8 @@ -8374,6 +8860,7 @@ snapshots: get-proto: 1.0.1 gopd: 1.2.0 set-function-name: 2.0.2 + optional: true regexpu-core@6.4.0: dependencies: @@ -8398,6 +8885,10 @@ snapshots: dependencies: jsesc: 3.1.0 + regjsparser@0.13.2: + dependencies: + jsesc: 3.1.0 + require-directory@2.1.1: {} requireindex@1.2.0: {} @@ -8408,8 +8899,6 @@ snapshots: resolve-alpn@1.2.1: {} - resolve-from@4.0.0: {} - resolve-from@5.0.0: {} resolve-pkg-maps@1.0.0: {} @@ -8426,39 +8915,37 @@ snapshots: dependencies: lowercase-keys: 3.0.0 - retry@0.12.0: {} - reusify@1.1.0: {} - rollup@4.59.0: + rollup@4.62.3: dependencies: - '@types/estree': 1.0.8 + '@types/estree': 1.0.9 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.59.0 - '@rollup/rollup-android-arm64': 4.59.0 - '@rollup/rollup-darwin-arm64': 4.59.0 - '@rollup/rollup-darwin-x64': 4.59.0 - '@rollup/rollup-freebsd-arm64': 4.59.0 - '@rollup/rollup-freebsd-x64': 4.59.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.59.0 - '@rollup/rollup-linux-arm-musleabihf': 4.59.0 - '@rollup/rollup-linux-arm64-gnu': 4.59.0 - '@rollup/rollup-linux-arm64-musl': 4.59.0 - '@rollup/rollup-linux-loong64-gnu': 4.59.0 - '@rollup/rollup-linux-loong64-musl': 4.59.0 - '@rollup/rollup-linux-ppc64-gnu': 4.59.0 - '@rollup/rollup-linux-ppc64-musl': 4.59.0 - '@rollup/rollup-linux-riscv64-gnu': 4.59.0 - '@rollup/rollup-linux-riscv64-musl': 4.59.0 - '@rollup/rollup-linux-s390x-gnu': 4.59.0 - '@rollup/rollup-linux-x64-gnu': 4.59.0 - '@rollup/rollup-linux-x64-musl': 4.59.0 - '@rollup/rollup-openbsd-x64': 4.59.0 - '@rollup/rollup-openharmony-arm64': 4.59.0 - '@rollup/rollup-win32-arm64-msvc': 4.59.0 - '@rollup/rollup-win32-ia32-msvc': 4.59.0 - '@rollup/rollup-win32-x64-gnu': 4.59.0 - '@rollup/rollup-win32-x64-msvc': 4.59.0 + '@rollup/rollup-android-arm-eabi': 4.62.3 + '@rollup/rollup-android-arm64': 4.62.3 + '@rollup/rollup-darwin-arm64': 4.62.3 + '@rollup/rollup-darwin-x64': 4.62.3 + '@rollup/rollup-freebsd-arm64': 4.62.3 + '@rollup/rollup-freebsd-x64': 4.62.3 + '@rollup/rollup-linux-arm-gnueabihf': 4.62.3 + '@rollup/rollup-linux-arm-musleabihf': 4.62.3 + '@rollup/rollup-linux-arm64-gnu': 4.62.3 + '@rollup/rollup-linux-arm64-musl': 4.62.3 + '@rollup/rollup-linux-loong64-gnu': 4.62.3 + '@rollup/rollup-linux-loong64-musl': 4.62.3 + '@rollup/rollup-linux-ppc64-gnu': 4.62.3 + '@rollup/rollup-linux-ppc64-musl': 4.62.3 + '@rollup/rollup-linux-riscv64-gnu': 4.62.3 + '@rollup/rollup-linux-riscv64-musl': 4.62.3 + '@rollup/rollup-linux-s390x-gnu': 4.62.3 + '@rollup/rollup-linux-x64-gnu': 4.62.3 + '@rollup/rollup-linux-x64-musl': 4.62.3 + '@rollup/rollup-openbsd-x64': 4.62.3 + '@rollup/rollup-openharmony-arm64': 4.62.3 + '@rollup/rollup-win32-arm64-msvc': 4.62.3 + '@rollup/rollup-win32-ia32-msvc': 4.62.3 + '@rollup/rollup-win32-x64-gnu': 4.62.3 + '@rollup/rollup-win32-x64-msvc': 4.62.3 fsevents: 2.3.3 run-applescript@7.1.0: {} @@ -8474,6 +8961,7 @@ snapshots: get-intrinsic: 1.3.0 has-symbols: 1.1.0 isarray: 2.0.5 + optional: true safe-buffer@5.1.2: {} @@ -8483,18 +8971,20 @@ snapshots: dependencies: es-errors: 1.3.0 isarray: 2.0.5 + optional: true safe-regex-test@1.1.0: dependencies: call-bound: 1.0.4 es-errors: 1.3.0 is-regex: 1.2.1 + optional: true safer-buffer@2.1.2: {} scslre@0.3.0: dependencies: - '@eslint-community/regexpp': 4.12.1 + '@eslint-community/regexpp': 4.12.2 refa: 0.12.1 regexp-ast-analysis: 0.7.1 @@ -8502,18 +8992,21 @@ snapshots: semver-diff@4.0.0: dependencies: - semver: 7.7.3 + semver: 7.8.5 - semver@6.3.1: {} - - semver@7.7.2: {} + semver@6.3.1: + optional: true semver@7.7.3: {} + semver@7.8.5: {} + serialize-javascript@6.0.2: dependencies: randombytes: 2.1.0 + serialize-javascript@7.0.7: {} + set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 @@ -8522,6 +9015,7 @@ snapshots: get-intrinsic: 1.3.0 gopd: 1.2.0 has-property-descriptors: 1.0.2 + optional: true set-function-name@2.0.2: dependencies: @@ -8529,12 +9023,14 @@ snapshots: es-errors: 1.3.0 functions-have-names: 1.2.3 has-property-descriptors: 1.0.2 + optional: true set-proto@1.0.0: dependencies: dunder-proto: 1.0.1 es-errors: 1.3.0 es-object-atoms: 1.1.1 + optional: true shebang-command@2.0.0: dependencies: @@ -8574,24 +9070,28 @@ snapshots: signal-exit@4.1.0: {} - sigstore@2.3.1: + sigstore@4.1.1(supports-color@8.1.1): dependencies: - '@sigstore/bundle': 2.3.2 - '@sigstore/core': 1.1.0 - '@sigstore/protobuf-specs': 0.3.3 - '@sigstore/sign': 2.3.2 - '@sigstore/tuf': 2.3.4 - '@sigstore/verify': 1.2.1 + '@sigstore/bundle': 4.0.0 + '@sigstore/core': 3.2.1 + '@sigstore/protobuf-specs': 0.5.1 + '@sigstore/sign': 4.1.1(supports-color@8.1.1) + '@sigstore/tuf': 4.0.2(supports-color@8.1.1) + '@sigstore/verify': 3.1.1 transitivePeerDependencies: - supports-color + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + slash@5.1.0: {} smart-buffer@4.2.0: {} smob@1.5.0: {} - socks-proxy-agent@8.0.5: + socks-proxy-agent@8.0.5(supports-color@8.1.1): dependencies: agent-base: 7.1.4 debug: 4.4.3(supports-color@8.1.1) @@ -8604,6 +9104,8 @@ snapshots: ip-address: 10.2.0 smart-buffer: 4.2.0 + source-map-js@1.2.1: {} + source-map-support@0.5.21: dependencies: buffer-from: 1.1.2 @@ -8634,6 +9136,11 @@ snapshots: spdx-exceptions: 2.5.0 spdx-license-ids: 3.0.22 + spdx-expression-parse@5.0.0: + dependencies: + spdx-exceptions: 2.5.0 + spdx-license-ids: 3.0.22 + spdx-expression-validate@2.0.0: dependencies: spdx-expression-parse: 3.0.1 @@ -8644,7 +9151,7 @@ snapshots: spdx-ranges@2.1.1: {} - spdx-satisfies@5.0.1: + spdx-satisfies@6.0.0: dependencies: spdx-compare: 1.0.0 spdx-expression-parse: 3.0.1 @@ -8657,11 +9164,11 @@ snapshots: sprintf-js@1.0.3: {} - ssri@10.0.6: + ssri@13.0.1: dependencies: - minipass: 7.1.2 + minipass: 7.1.3 - stable-hash@0.0.5: {} + stable-hash-x@0.2.0: {} stable@0.1.8: {} @@ -8669,6 +9176,7 @@ snapshots: dependencies: es-errors: 1.3.0 internal-slot: 1.1.0 + optional: true stream-chunks@1.0.0: dependencies: @@ -8693,6 +9201,11 @@ snapshots: get-east-asian-width: 1.4.0 strip-ansi: 7.1.2 + string-width@8.2.2: + dependencies: + get-east-asian-width: 1.6.0 + strip-ansi: 7.1.2 + string.prototype.trim@1.2.10: dependencies: call-bind: 1.0.8 @@ -8702,6 +9215,7 @@ snapshots: es-abstract: 1.24.0 es-object-atoms: 1.1.1 has-property-descriptors: 1.0.2 + optional: true string.prototype.trimend@1.0.9: dependencies: @@ -8709,12 +9223,14 @@ snapshots: call-bound: 1.0.4 define-properties: 1.2.1 es-object-atoms: 1.1.1 + optional: true string.prototype.trimstart@1.0.8: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 es-object-atoms: 1.1.1 + optional: true string_decoder@1.3.0: dependencies: @@ -8728,7 +9244,8 @@ snapshots: dependencies: ansi-regex: 6.2.2 - strip-bom@3.0.0: {} + strip-bom@3.0.0: + optional: true strip-indent@4.1.1: {} @@ -8736,10 +9253,9 @@ snapshots: strip-json-comments@3.1.1: {} - strtok3@7.1.1: + strtok3@10.3.5: dependencies: '@tokenizer/token': 0.3.0 - peek-readable: 5.4.2 stubborn-fs@2.0.0: dependencies: @@ -8747,6 +9263,12 @@ snapshots: stubborn-utils@1.0.2: {} + super-regex@1.1.0: + dependencies: + function-timeout: 1.0.2 + make-asynchronous: 1.1.0 + time-span: 5.1.0 + supports-color@5.5.0: dependencies: has-flag: 3.0.0 @@ -8759,6 +9281,11 @@ snapshots: dependencies: has-flag: 4.0.0 + supports-hyperlinks@3.2.0: + dependencies: + has-flag: 4.0.0 + supports-color: 7.2.0 + supports-preserve-symlinks-flag@1.0.0: {} svgo@2.6.0: @@ -8785,18 +9312,17 @@ snapshots: tapable@2.3.0: {} - tar@6.2.1: + tar@7.5.22: dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 temp-dir@3.0.0: {} - tempy@3.1.0: + tempy@3.2.0: dependencies: is-stream: 3.0.0 temp-dir: 3.0.0 @@ -8810,11 +9336,23 @@ snapshots: commander: 2.20.3 source-map-support: 0.5.21 - test-exclude@7.0.1: + test-exclude@8.0.0: dependencies: '@istanbuljs/schema': 0.1.3 - glob: 10.5.0 - minimatch: 9.0.9 + glob: 13.0.6 + minimatch: 10.2.5 + + thenify-all@1.6.0: + dependencies: + thenify: 3.3.1 + + thenify@3.3.1: + dependencies: + any-promise: 1.3.0 + + time-span@5.1.0: + dependencies: + convert-hrtime: 5.0.0 tinyglobby@0.2.15: dependencies: @@ -8830,17 +9368,23 @@ snapshots: '@sindresorhus/base62': 1.0.0 reserved-identifiers: 1.2.0 - token-types@5.0.1: + token-types@6.1.2: dependencies: + '@borewit/text-codec': 0.2.2 '@tokenizer/token': 0.3.0 ieee754: 1.2.1 treeverse@3.0.0: {} - ts-declaration-location@1.0.7(typescript@5.9.3): + ts-api-utils@2.5.0(typescript@6.0.3): + dependencies: + typescript: 6.0.3 + + ts-declaration-location@1.0.7(typescript@6.0.3): dependencies: picomatch: 4.0.4 - typescript: 5.9.3 + typescript: 6.0.3 + optional: true tsconfig-paths@3.15.0: dependencies: @@ -8848,15 +9392,16 @@ snapshots: json5: 1.0.2 minimist: 1.2.8 strip-bom: 3.0.0 + optional: true tslib@2.8.1: optional: true - tuf-js@2.2.1: + tuf-js@4.1.0(supports-color@8.1.1): dependencies: - '@tufjs/models': 2.0.1 + '@tufjs/models': 4.1.0 debug: 4.4.3(supports-color@8.1.1) - make-fetch-happen: 13.0.1 + make-fetch-happen: 15.0.6(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -8877,6 +9422,7 @@ snapshots: call-bound: 1.0.4 es-errors: 1.3.0 is-typed-array: 1.1.15 + optional: true typed-array-byte-length@1.0.3: dependencies: @@ -8885,6 +9431,7 @@ snapshots: gopd: 1.2.0 has-proto: 1.2.0 is-typed-array: 1.1.15 + optional: true typed-array-byte-offset@1.0.4: dependencies: @@ -8895,6 +9442,7 @@ snapshots: has-proto: 1.2.0 is-typed-array: 1.1.15 reflect.getprototypeof: 1.0.10 + optional: true typed-array-length@1.0.7: dependencies: @@ -8904,21 +9452,24 @@ snapshots: is-typed-array: 1.1.15 possible-typed-array-names: 1.1.0 reflect.getprototypeof: 1.0.10 + optional: true typedarray-to-buffer@3.1.5: dependencies: is-typedarray: 1.0.0 - typedoc@0.28.14(typescript@5.9.3): + typedoc@0.28.20(typescript@6.0.3): dependencies: - '@gerrit0/mini-shiki': 3.15.0 + '@gerrit0/mini-shiki': 3.23.0 lunr: 2.3.9 - markdown-it: 14.1.1 - minimatch: 9.0.9 - typescript: 5.9.3 + markdown-it: 14.3.0 + minimatch: 10.2.5 + typescript: 6.0.3 yaml: 2.9.0 - typescript@5.9.3: {} + typescript@5.6.1-rc: {} + + typescript@6.0.3: {} typical@4.0.0: {} @@ -8928,15 +9479,24 @@ snapshots: uc.micro@2.1.0: {} + uint8array-extras@1.5.0: {} + unbox-primitive@1.1.0: dependencies: call-bound: 1.0.4 has-bigints: 1.1.0 has-symbols: 1.1.0 which-boxed-primitive: 1.1.1 + optional: true + + undici-types@8.3.0: {} + + undici@6.28.0: {} unicode-canonical-property-names-ecmascript@2.0.1: {} + unicode-emoji-modifier-base@1.0.0: {} + unicode-match-property-ecmascript@2.0.0: dependencies: unicode-canonical-property-names-ecmascript: 2.0.1 @@ -8946,20 +9506,12 @@ snapshots: unicode-property-aliases-ecmascript@2.2.0: {} - unicorn-magic@0.3.0: {} + unicorn-magic@0.4.0: {} union@0.5.0: dependencies: qs: 6.15.2 - unique-filename@3.0.0: - dependencies: - unique-slug: 4.0.0 - - unique-slug@4.0.0: - dependencies: - imurmurhash: 0.1.4 - unique-string@3.0.0: dependencies: crypto-random-string: 4.0.0 @@ -8968,6 +9520,11 @@ snapshots: dependencies: '@types/unist': 3.0.3 + unist-util-remove-position@5.0.0: + dependencies: + '@types/unist': 3.0.3 + unist-util-visit: 5.0.0 + unist-util-stringify-position@4.0.0: dependencies: '@types/unist': 3.0.3 @@ -9013,6 +9570,12 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 + update-browserslist-db@1.2.3(browserslist@4.28.7): + dependencies: + browserslist: 4.28.7 + escalade: 3.2.0 + picocolors: 1.1.1 + update-notifier@6.0.2: dependencies: boxen: 7.1.1 @@ -9026,7 +9589,7 @@ snapshots: is-yarn-global: 0.4.1 latest-version: 7.0.0 pupa: 3.3.0 - semver: 7.7.3 + semver: 7.8.5 semver-diff: 4.0.0 xdg-basedir: 5.1.0 @@ -9040,7 +9603,7 @@ snapshots: is-npm: 6.1.0 latest-version: 9.0.0 pupa: 3.3.0 - semver: 7.7.3 + semver: 7.8.5 xdg-basedir: 5.1.0 uri-js@4.4.1: @@ -9057,14 +9620,13 @@ snapshots: '@types/istanbul-lib-coverage': 2.0.6 convert-source-map: 2.0.0 - validate-npm-package-license@3.0.4: - dependencies: - spdx-correct: 3.2.0 - spdx-expression-parse: 3.0.1 - validate-npm-package-name@5.0.1: {} - walk-up-path@3.0.1: {} + validate-npm-package-name@7.0.2: {} + + walk-up-path@4.0.0: {} + + web-worker@1.5.0: {} whatwg-encoding@2.0.0: dependencies: @@ -9079,6 +9641,7 @@ snapshots: is-number-object: 1.1.1 is-string: 1.1.1 is-symbol: 1.1.1 + optional: true which-builtin-type@1.2.1: dependencies: @@ -9095,6 +9658,7 @@ snapshots: which-boxed-primitive: 1.1.1 which-collection: 1.0.2 which-typed-array: 1.1.19 + optional: true which-collection@1.0.2: dependencies: @@ -9102,6 +9666,7 @@ snapshots: is-set: 2.0.3 is-weakmap: 2.0.2 is-weakset: 2.0.4 + optional: true which-typed-array@1.1.19: dependencies: @@ -9112,14 +9677,15 @@ snapshots: get-proto: 1.0.1 gopd: 1.2.0 has-tostringtag: 1.0.2 + optional: true which@2.0.2: dependencies: isexe: 2.0.0 - which@4.0.0: + which@6.0.1: dependencies: - isexe: 3.1.1 + isexe: 4.0.0 widest-line@4.0.1: dependencies: @@ -9165,27 +9731,31 @@ snapshots: signal-exit: 3.0.7 typedarray-to-buffer: 3.1.5 - write-file-atomic@5.0.1: + write-file-atomic@7.0.1: dependencies: - imurmurhash: 0.1.4 signal-exit: 4.1.0 - wsl-utils@0.1.0: + wsl-utils@0.3.1: dependencies: is-wsl: 3.1.0 + powershell-utils: 0.1.0 xdg-basedir@5.1.0: {} y18n@5.0.8: {} - yallist@3.1.1: {} - yallist@4.0.0: {} + yallist@5.0.0: {} + yaml@2.9.0: {} + yargs-parser@20.2.9: {} + yargs-parser@21.1.1: {} + yargs-parser@22.0.0: {} + yargs-unparser@2.0.0: dependencies: camelcase: 6.3.0 @@ -9193,6 +9763,16 @@ snapshots: flat: 5.0.2 is-plain-obj: 2.1.0 + yargs@16.2.2: + dependencies: + cliui: 7.0.4 + escalade: 3.2.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.9 + yargs@17.7.2: dependencies: cliui: 8.0.1 @@ -9203,6 +9783,15 @@ snapshots: y18n: 5.0.8 yargs-parser: 21.1.1 + yargs@18.1.0: + dependencies: + cliui: 9.0.1 + escalade: 3.2.0 + get-caller-file: 2.0.5 + string-width: 8.2.2 + y18n: 5.0.8 + yargs-parser: 22.0.0 + yocto-queue@0.1.0: {} zwitch@2.0.4: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 9d793392..30123318 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,3 +3,10 @@ allowBuilds: unrs-resolver: false ignoredBuiltDependencies: - unrs-resolver +minimumReleaseAgeExclude: + - '@types/node@26.1.2' + - eslint-config-ash-nazg@41.0.0 + - eslint-plugin-jsdoc@63.3.1 + - eslint-plugin-mocha@12.0.0 + - license-badger@0.23.0 + - license-types@3.2.0 diff --git a/rollup.config.js b/rollup.config.js index f7da6ff4..45282e3e 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,10 +3,10 @@ import {babel} from '@rollup/plugin-babel'; import {nodeResolve} from '@rollup/plugin-node-resolve'; import terser from '@rollup/plugin-terser'; +// @ts-expect-error Ok const pkg = JSON.parse(await readFile('./package.json')); /** - * @external RollupConfig * @type {object} * @see {@link https://rollupjs.org/guide/en#big-list-of-options} */ @@ -15,10 +15,10 @@ const pkg = JSON.parse(await readFile('./package.json')); * @param {object} config * @param {string} config.input * @param {boolean} config.minifying - * @param {string[]} [config."external"] + * @param {string[]} [config.external] * @param {string} [config.environment] - * @param {string} [config.format] - * @returns {RollupConfig} + * @param {"esm"|"umd"|"cjs"} [config.format] + * @returns {import('rollup').RollupOptions} */ function getRollupObject ({ input, minifying, environment, @@ -64,10 +64,10 @@ function getRollupObject ({ } /** - * @param {PlainObject} config + * @param {object} config * @param {boolean} config.minifying - * @param {"node"|"environment"} [config.environment] - * @returns {RollupConfig[]} + * @param {"node"|"environment"|"browser"} [config.environment] + * @returns {import('rollup').RollupOptions[]} */ function getRollupObjectByEnv ({minifying, environment}) { const input = `src/jsonpath-${environment}.js`; diff --git a/src/Safe-Script.js b/src/Safe-Script.js index 4b8e6cd6..365189ef 100644 --- a/src/Safe-Script.js +++ b/src/Safe-Script.js @@ -1,8 +1,30 @@ +/* eslint-disable unicorn/no-top-level-side-effects -- Temporary? */ /* eslint-disable no-bitwise -- Convenient */ import jsep from 'jsep'; import jsepRegex from '@jsep-plugin/regex'; import jsepAssignment from '@jsep-plugin/assignment'; +/** + * @import {EvaluatedResult, UnknownResult} from './jsonpath.js'; + */ + +/** + * @typedef {import('@jsep-plugin/assignment'). + * AssignmentExpression} AssignmentExpression + */ + +/** + * @typedef {any} Substitution + */ + +/** + * @typedef {any} AnyParameter + */ + +/** + * @typedef {Record} Substitutions + */ + // register plugins jsep.plugins.register(jsepRegex, jsepAssignment); jsep.addUnaryOp('typeof'); @@ -22,37 +44,78 @@ const BLOCKED_PROTO_PROPERTIES = new Set([ const SafeEval = { /** * @param {jsep.Expression} ast - * @param {Record} subs + * @param {Substitutions} subs + * @returns {UnknownResult} */ evalAst (ast, subs) { switch (ast.type) { case 'BinaryExpression': case 'LogicalExpression': - return SafeEval.evalBinaryExpression(ast, subs); + return SafeEval.evalBinaryExpression( + /** @type {jsep.BinaryExpression} */ (ast), + subs + ); case 'Compound': - return SafeEval.evalCompound(ast, subs); + return SafeEval.evalCompound( + /** @type {jsep.Compound} */ (ast), + subs + ); case 'ConditionalExpression': - return SafeEval.evalConditionalExpression(ast, subs); + return SafeEval.evalConditionalExpression( + /** @type {jsep.ConditionalExpression} */ (ast), + subs + ); case 'Identifier': - return SafeEval.evalIdentifier(ast, subs); + return SafeEval.evalIdentifier( + /** @type {jsep.Identifier} */ (ast), + subs + ); case 'Literal': - return SafeEval.evalLiteral(ast, subs); + return SafeEval.evalLiteral(/** @type {jsep.Literal} */ (ast)); case 'MemberExpression': - return SafeEval.evalMemberExpression(ast, subs); + return SafeEval.evalMemberExpression( + /** @type {jsep.MemberExpression} */ (ast), + subs + ); case 'UnaryExpression': - return SafeEval.evalUnaryExpression(ast, subs); + return SafeEval.evalUnaryExpression( + /** @type {jsep.UnaryExpression} */ (ast), + subs + ); case 'ArrayExpression': - return SafeEval.evalArrayExpression(ast, subs); + return SafeEval.evalArrayExpression( + /** @type {jsep.ArrayExpression} */ (ast), + subs + ); case 'CallExpression': - return SafeEval.evalCallExpression(ast, subs); + return SafeEval.evalCallExpression( + /** @type {jsep.CallExpression} */ (ast), + subs + ); case 'AssignmentExpression': - return SafeEval.evalAssignmentExpression(ast, subs); + return SafeEval.evalAssignmentExpression( + /** @type {AssignmentExpression} */ (ast), + subs + ); default: - throw SyntaxError('Unexpected expression', ast); + throw new SyntaxError('Unexpected expression', { + cause: ast + }); } }, + + /** + * @param {jsep.BinaryExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalBinaryExpression (ast, subs) { - const result = { + /** + * @typedef {{ + * [key: string]: (a: AnyParameter, b: AnyParameter) => UnknownResult + * }} OperatorTable + */ + const result = /** @type {OperatorTable} */ ({ '||': (a, b) => a || b(), '&&': (a, b) => a && b(), '|': (a, b) => a | b(), @@ -76,25 +139,32 @@ const SafeEval = { '*': (a, b) => a * b(), '/': (a, b) => a / b(), '%': (a, b) => a % b() - }[ast.operator]( + })[ast.operator]( SafeEval.evalAst(ast.left, subs), () => SafeEval.evalAst(ast.right, subs) ); return result; }, + + /** + * @param {jsep.Compound} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalCompound (ast, subs) { let last; for (let i = 0; i < ast.body.length; i++) { if ( ast.body[i].type === 'Identifier' && - ['var', 'let', 'const'].includes(ast.body[i].name) && - ast.body[i + 1] && + ['var', 'let', 'const'].includes( + /** @type {jsep.Identifier} */ + (ast.body[i]).name + ) && + Object.hasOwn(ast.body, i + 1) && ast.body[i + 1].type === 'AssignmentExpression' ) { // var x=2; is detected as // [{Identifier var}, {AssignmentExpression x=2}] - // eslint-disable-next-line @stylistic/max-len -- Long - // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient i += 1; } const expr = ast.body[i]; @@ -102,76 +172,142 @@ const SafeEval = { } return last; }, + + /** + * @param {jsep.ConditionalExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalConditionalExpression (ast, subs) { if (SafeEval.evalAst(ast.test, subs)) { return SafeEval.evalAst(ast.consequent, subs); } return SafeEval.evalAst(ast.alternate, subs); }, + + /** + * @param {jsep.Identifier} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalIdentifier (ast, subs) { if (Object.hasOwn(subs, ast.name)) { return subs[ast.name]; } - throw ReferenceError(`${ast.name} is not defined`); + throw new ReferenceError(`${ast.name} is not defined`); }, + + /** + * @param {jsep.Literal} ast + * @returns {UnknownResult} + */ evalLiteral (ast) { return ast.value; }, + + /** + * @param {jsep.MemberExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalMemberExpression (ast, subs) { const prop = String( // NOTE: `String(value)` throws error when // value has overwritten the toString method to return non-string // i.e. `value = {toString: () => []}` ast.computed - ? SafeEval.evalAst(ast.property) // `object[property]` + ? SafeEval.evalAst(ast.property, {}) // `object[property]` : ast.property.name // `object.property` property is Identifier ); const obj = SafeEval.evalAst(ast.object, subs); if (obj === undefined || obj === null) { - throw TypeError( + throw new TypeError( `Cannot read properties of ${obj} (reading '${prop}')` ); } if (!Object.hasOwn(obj, prop) && BLOCKED_PROTO_PROPERTIES.has(prop)) { - throw TypeError( + throw new TypeError( `Cannot read properties of ${obj} (reading '${prop}')` ); } - const result = obj[prop]; + const result = /** @type {Record} */ (obj)[prop]; if (typeof result === 'function' && result !== Function) { return result.bind(obj); // arrow functions aren't affected by bind. } return result; }, + + /** + * @param {jsep.UnaryExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalUnaryExpression (ast, subs) { - const result = { - '-': (a) => -SafeEval.evalAst(a, subs), + /** + * @typedef {{ + * [key: string]: (a: AnyParameter) => UnknownResult + * }} UnaryOperatorTable + */ + const result = /** @type {UnaryOperatorTable} */ ({ + '-': (a) => -(/** @type {EvaluatedResult} */ ( + SafeEval.evalAst(a, subs)) + ), '!': (a) => !SafeEval.evalAst(a, subs), - '~': (a) => ~SafeEval.evalAst(a, subs), + '~': (a) => ~(/** @type {EvaluatedResult} */ ( + SafeEval.evalAst(a, subs)) + ), // eslint-disable-next-line no-implicit-coercion -- API - '+': (a) => +SafeEval.evalAst(a, subs), + '+': (a) => +(/** @type {EvaluatedResult} */ ( + SafeEval.evalAst(a, subs)) + ), typeof: (a) => typeof SafeEval.evalAst(a, subs), - // eslint-disable-next-line no-void, sonarjs/void-use -- feature + // eslint-disable-next-line no-void -- Ok void: (a) => void SafeEval.evalAst(a, subs) - }[ast.operator](ast.argument); + })[ast.operator](ast.argument); return result; }, + + /** + * @param {jsep.ArrayExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalArrayExpression (ast, subs) { - return ast.elements.map((el) => SafeEval.evalAst(el, subs)); + return ast.elements.map((el) => SafeEval.evalAst( + /** @type {jsep.Expression} */ + (el), + subs + )); }, + + /** + * @param {jsep.CallExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalCallExpression (ast, subs) { const args = ast.arguments.map((arg) => SafeEval.evalAst(arg, subs)); const func = SafeEval.evalAst(ast.callee, subs); if (func === Function) { throw new Error('Function constructor is disabled'); } - return func(...args); + return (/** @type {(...args: AnyParameter[]) => UnknownResult} */ ( + func + ))(...args); }, + + /** + * @param {AssignmentExpression} ast + * @param {Substitutions} subs + * @returns {UnknownResult} + */ evalAssignmentExpression (ast, subs) { if (ast.left.type !== 'Identifier') { - throw SyntaxError('Invalid left-hand side in assignment'); + throw new SyntaxError('Invalid left-hand side in assignment'); } - const id = ast.left.name; + const id = /** @type {jsep.Identifier} */ ( + ast.left + ).name; const value = SafeEval.evalAst(ast.right, subs); subs[id] = value; return subs[id]; diff --git a/src/jsonpath-browser.js b/src/jsonpath-browser.js index 47f7b65d..eb85ffed 100644 --- a/src/jsonpath-browser.js +++ b/src/jsonpath-browser.js @@ -1,24 +1,88 @@ -import {JSONPath} from './jsonpath.js'; +import {JSONPath, JSONPathClass} from './jsonpath.js'; /** - * @typedef {any} ContextItem + * @typedef {import('./jsonpath.js').AnyInput} AnyInput + */ +/** + * @typedef {import('./jsonpath.js').SandboxCallback} SandboxCallback + */ +/** + * @typedef {import('./jsonpath.js').SandboxPropertyValue} SandboxPropertyValue + */ +/** + * @typedef {import('./jsonpath.js').ExpressionArray} ExpressionArray + */ +/** + * @typedef {import('./jsonpath.js').ValueType} ValueType + */ +/** + * @typedef {import('./jsonpath.js').ParentValue} ParentValue + */ +/** + * @typedef {import('./jsonpath.js').UnknownResult} UnknownResult + */ +/** + * @typedef {import('./jsonpath.js').ParentProperty} ParentProperty + */ +/** + * @typedef {import('./jsonpath.js').PreferredOutput} PreferredOutput + */ +/** + * @typedef {import('./jsonpath.js').ReturnObject} ReturnObject + */ +/** + * @typedef {import('./jsonpath.js').JSONPathCallback} JSONPathCallback + */ +/** + * @typedef {import('./jsonpath.js').OtherTypeCallback} OtherTypeCallback + */ +/** + * @typedef {import('./jsonpath.js').ContextItem} ContextItem + */ +/** + * @typedef {import('./jsonpath.js').EvaluatedResult} EvaluatedResult + */ +/** + * @typedef {import('./jsonpath.js').EvalCallback} EvalCallback + */ +/** + * @typedef {import('./jsonpath.js').EvalClass} EvalClass + */ +/** + * @typedef {import('./jsonpath.js').ResultType} ResultType + */ +/** + * @typedef {import('./jsonpath.js').EvalValue} EvalValue + */ +/** + * @typedef {import('./jsonpath.js').PathType} PathType + */ +/** + * @typedef {import('./jsonpath.js').SafeScriptType} SafeScriptType + */ +/** + * @typedef {import('./jsonpath.js').ScriptType} ScriptType + */ +/** + * @typedef {import('./jsonpath.js').SandboxType} SandboxType */ - /** - * @typedef {any} EvaluatedResult + * @typedef {import('./jsonpath.js').JSONPathOptions} JSONPathOptions */ /** + * @template T * @callback ConditionCallback - * @param {ContextItem} item + * @param {T} item * @returns {boolean} */ /** * Copy items out of one array into another. - * @param {GenericArray} source Array with items to copy - * @param {GenericArray} target Array to which to copy - * @param {ConditionCallback} conditionCb Callback passed the current item; + * @template T + * @param {T[]} source Array with items to copy + * @param {T[]} target Array to which to copy + * @param {ConditionCallback} conditionCb Callback passed the current item; * will move item if evaluates to `true` * @returns {void} */ @@ -27,8 +91,6 @@ const moveToAnotherArray = function (source, target, conditionCb) { for (let i = 0; i < il; i++) { const item = source[i]; if (conditionCb(item)) { - // eslint-disable-next-line @stylistic/max-len -- Long - // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient target.push(source.splice(i--, 1)[0]); } } @@ -46,14 +108,14 @@ class Script { } /** - * @param {object} context Object whose items will be added + * @param {SandboxType} context Object whose items will be added * to evaluation * @returns {EvaluatedResult} Result of evaluated code */ runInNewContext (context) { let expr = this.code; const keys = Object.keys(context); - const funcs = []; + const funcs = /** @type {string[]} */ ([]); moveToAnotherArray(keys, funcs, (key) => { return typeof context[key] === 'function'; }); @@ -71,7 +133,7 @@ class Script { expr = funcString + expr; - // Mitigate http://perfectionkills.com/global-eval-what-are-the-options/#new_function + // Mitigate https://perfectionkills.com/global-eval-what-are-the-options/#new_function if (!(/(['"])use strict\1/u).test(expr) && !keys.includes('arguments')) { expr = 'var arguments = undefined;' + expr; } @@ -95,8 +157,8 @@ class Script { } } -JSONPath.prototype.vm = { +JSONPathClass.prototype.vm = { Script }; -export {JSONPath}; +export {JSONPath, JSONPathClass, Script}; diff --git a/src/jsonpath-node.cts b/src/jsonpath-node.cts new file mode 100644 index 00000000..881f83ec --- /dev/null +++ b/src/jsonpath-node.cts @@ -0,0 +1,2 @@ +import * as jsonpath from './jsonpath-node.js'; +export = jsonpath; diff --git a/src/jsonpath-node.js b/src/jsonpath-node.js index 75dcfa40..923f6044 100644 --- a/src/jsonpath-node.js +++ b/src/jsonpath-node.js @@ -1,8 +1,78 @@ import vm from 'vm'; -import {JSONPath} from './jsonpath.js'; +import {JSONPath, JSONPathClass} from './jsonpath.js'; -JSONPath.prototype.vm = vm; +/** + * @typedef {import('./jsonpath.js').AnyInput} AnyInput + */ +/** + * @typedef {import('./jsonpath.js').SandboxCallback} SandboxCallback + */ +/** + * @typedef {import('./jsonpath.js').SandboxPropertyValue} SandboxPropertyValue + */ +/** + * @typedef {import('./jsonpath.js').ExpressionArray} ExpressionArray + */ +/** + * @typedef {import('./jsonpath.js').ValueType} ValueType + */ +/** + * @typedef {import('./jsonpath.js').ParentValue} ParentValue + */ +/** + * @typedef {import('./jsonpath.js').UnknownResult} UnknownResult + */ +/** + * @typedef {import('./jsonpath.js').ParentProperty} ParentProperty + */ +/** + * @typedef {import('./jsonpath.js').PreferredOutput} PreferredOutput + */ +/** + * @typedef {import('./jsonpath.js').ReturnObject} ReturnObject + */ +/** + * @typedef {import('./jsonpath.js').JSONPathCallback} JSONPathCallback + */ +/** + * @typedef {import('./jsonpath.js').OtherTypeCallback} OtherTypeCallback + */ +/** + * @typedef {import('./jsonpath.js').ContextItem} ContextItem + */ +/** + * @typedef {import('./jsonpath.js').EvaluatedResult} EvaluatedResult + */ +/** + * @typedef {import('./jsonpath.js').EvalCallback} EvalCallback + */ +/** + * @typedef {import('./jsonpath.js').EvalClass} EvalClass + */ +/** + * @typedef {import('./jsonpath.js').ResultType} ResultType + */ +/** + * @typedef {import('./jsonpath.js').EvalValue} EvalValue + */ +/** + * @typedef {import('./jsonpath.js').PathType} PathType + */ +/** + * @typedef {import('./jsonpath.js').SafeScriptType} SafeScriptType + */ +/** + * @typedef {import('./jsonpath.js').ScriptType} ScriptType + */ +/** + * @typedef {import('./jsonpath.js').SandboxType} SandboxType + */ +/** + * @typedef {import('./jsonpath.js').JSONPathOptions} JSONPathOptions + */ + +JSONPathClass.prototype.vm = vm; export { - JSONPath + JSONPath, JSONPathClass }; diff --git a/src/jsonpath.d.ts b/src/jsonpath.d.ts deleted file mode 100644 index 6c3ab7b4..00000000 --- a/src/jsonpath.d.ts +++ /dev/null @@ -1,226 +0,0 @@ -/** - * Declaration for https://github.com/s3u/JSONPath - */ -declare module 'jsonpath-plus' { - type JSONPathCallback = ( - payload: any, payloadType: any, fullPayload: any - ) => any - - type JSONPathOtherTypeCallback = (...args: any[]) => void - - class EvalClass { - constructor(code: string); - runInNewContext(context: object): any; - } - - interface JSONPathOptions { - /** - * The JSONPath expression as a (normalized or unnormalized) string or - * array. - */ - path: string | any[] - /** - * The JSON object to evaluate (whether of null, boolean, number, - * string, object, or array type). - */ - json: null | boolean | number | string | object | any[] - /** - * If this is supplied as false, one may call the evaluate method - * manually. - * - * @default true - */ - autostart?: true | boolean - /** - * Whether the returned array of results will be flattened to a - * single dimension array. - * - * @default false - */ - flatten?: false | boolean - /** - * Can be case-insensitive form of "value", "path", "pointer", "parent", - * or "parentProperty" to determine respectively whether to return - * results as the values of the found items, as their absolute paths, - * as JSON Pointers to the absolute paths, as their parent objects, - * or as their parent's property name. - * - * If set to "all", all of these types will be returned on an object with - * the type as key name. - * - * @default 'value' - */ - resultType?: - 'value' | 'path' | 'pointer' | 'parent' | 'parentProperty' | 'all' - - /** - * Key-value map of variables to be available to code evaluations such - * as filtering expressions. - * (Note that the current path and value will also be available to those - * expressions; see the Syntax section for details.) - */ - sandbox?: Map - /** - * Whether or not to wrap the results in an array. - * - * If wrap is set to false, and no results are found, undefined will be - * returned (as opposed to an empty array when wrap is set to true). - * - * If wrap is set to false and a single non-array result is found, that - * result will be the only item returned (not within an array). - * - * An array will still be returned if multiple results are found, however. - * To avoid ambiguities (in the case where it is necessary to distinguish - * between a result which is a failure and one which is an empty array), - * it is recommended to switch the default to false. - * - * @default true - */ - wrap?: true | boolean - /** - * Script evaluation method. - * - * `safe`: In browser, it will use a minimal scripting engine which doesn't - * use `eval` or `Function` and satisfies Content Security Policy. In NodeJS, - * it has no effect and is equivalent to native as scripting is safe there. - * - * `native`: uses the native scripting capabilities. i.e. unsafe `eval` or - * `Function` in browser and `vm.Script` in nodejs. - * - * `true`: Same as 'safe' - * - * `false`: Disable Javascript executions in path string. Same as `preventEval: true` in previous versions. - * - * `callback [ (code, context) => value]`: A custom implementation which is called - * with `code` and `context` as arguments to return the evaluated value. - * - * `class`: A class similar to nodejs vm.Script. It will be created with `code` as constructor argument and the code - * is evaluated by calling `runInNewContext` with `context`. - * - * @default 'safe' - */ - eval?: 'safe' | 'native' | boolean | ((code: string, context: object) => any) | typeof EvalClass - /** - * Ignore errors while evaluating JSONPath expression. - * - * `true`: Don't break entire search if an error occurs while evaluating JSONPath expression on one key/value pair. - * - * `false`: Break entire search if an error occurs while evaluating JSONPath expression on one key/value pair. - * - * @default false - * - */ - ignoreEvalErrors?: boolean - /** - * In the event that a query could be made to return the root node, - * this allows the parent of that root node to be returned within results. - * - * @default null - */ - parent?: null | any - /** - * In the event that a query could be made to return the root node, - * this allows the parentProperty of that root node to be returned within - * results. - * - * @default null - */ - parentProperty?: null | any - /** - * If supplied, a callback will be called immediately upon retrieval of - * an end point value. - * - * The three arguments supplied will be the value of the payload - * (according to `resultType`), the type of the payload (whether it is - * a normal "value" or a "property" name), and a full payload object - * (with all `resultType`s). - * - * @default undefined - */ - callback?: undefined | JSONPathCallback - /** - * In the current absence of JSON Schema support, - * one can determine types beyond the built-in types by adding the - * perator `@other()` at the end of one's query. - * - * If such a path is encountered, the `otherTypeCallback` will be invoked - * with the value of the item, its path, its parent, and its parent's - * property name, and it should return a boolean indicating whether the - * supplied value belongs to the "other" type or not (or it may handle - * transformations and return false). - * - * @default undefined - * - */ - otherTypeCallback?: undefined | JSONPathOtherTypeCallback - } - - interface JSONPathOptionsAutoStart extends JSONPathOptions { - autostart: false - } - - interface JSONPathCallable { - (options: JSONPathOptionsAutoStart): JSONPathClass - (options: JSONPathOptions): T - - ( - path: JSONPathOptions['path'], - json: JSONPathOptions['json'], - callback: JSONPathOptions['callback'], - otherTypeCallback: JSONPathOptions['otherTypeCallback'] - ): T - } - - class JSONPathClass { - /** - * Exposes the cache object for those who wish to preserve and reuse - * it for optimization purposes. - */ - cache: any - - /** - * Accepts a normalized or unnormalized path as string and - * converts to an array: for example, - * `['$', 'aProperty', 'anotherProperty']`. - */ - toPathArray(path: string): string[] - - /** - * Accepts a path array and converts to a normalized path string. - * The string will be in a form like: - * `$['aProperty']['anotherProperty][0]`. - * The JSONPath terminal constructions `~` and `^` and type operators - * like `@string()` are silently stripped. - */ - toPathString(path: string[]): string - - /** - * Accepts a path array and converts to a JSON Pointer. - * - * The string will be in a form like: `/aProperty/anotherProperty/0` - * (with any `~` and `/` internal characters escaped as per the JSON - * Pointer spec). - * - * The JSONPath terminal constructions `~` and `^` and type operators - * like `@string()` are silently stripped. - */ - toPointer(path: string[]): any - - evaluate( - path: JSONPathOptions['path'], - json: JSONPathOptions['json'], - callback: JSONPathOptions['callback'], - otherTypeCallback: JSONPathOptions['otherTypeCallback'] - ): any - evaluate(options: { - path: JSONPathOptions['path'], - json: JSONPathOptions['json'], - callback: JSONPathOptions['callback'], - otherTypeCallback: JSONPathOptions['otherTypeCallback'] - }): any - } - - type JSONPathType = JSONPathCallable & JSONPathClass - - export const JSONPath: JSONPathType -} diff --git a/src/jsonpath.js b/src/jsonpath.js index e2bdbb57..2429c87a 100644 --- a/src/jsonpath.js +++ b/src/jsonpath.js @@ -1,24 +1,56 @@ /* eslint-disable camelcase -- Convenient for escaping */ - +/* eslint-disable class-methods-use-this -- Consistent monkey-patching */ +/* eslint-disable unicorn/prefer-private-class-fields -- Allow + monkey-patching */ import {SafeScript} from './Safe-Script.js'; /** - * @typedef {null|boolean|number|string|object|GenericArray} JSONObject + * @import {Script} from './jsonpath-browser.js'; + */ + +/** + * @typedef {any} AnyInput + */ + +/** + * @typedef {((...args: any[]) => any)} SandboxCallback + */ + +/** + * @typedef {any|SandboxCallback} SandboxPropertyValue + */ + +/** + * @typedef {(string|number)[]} ExpressionArray + */ + +/** + * @typedef {"scalar"|"boolean"|"string"|"undefined"| + * "function"|"integer"|"number"|"nonFinite"|"object"| + * "array"|"other"|"null"} ValueType + */ + +/** + * @typedef {unknown} ParentValue + */ + +/** + * @typedef {unknown} UnknownResult */ /** - * @typedef {any} AnyItem + * @typedef {string|number|null} ParentProperty */ /** - * @typedef {any} AnyResult + * @typedef {unknown|ParentValue|string|ReturnObject} PreferredOutput */ /** * Copies array and then pushes item into it. - * @param {GenericArray} arr Array to copy and into which to push - * @param {AnyItem} item Array item to add (to end) - * @returns {GenericArray} Copy of the original array + * @param {ExpressionArray} arr Array to copy and into which to push + * @param {string|number} item Array item to add (to end) + * @returns {ExpressionArray} Copy of the original array */ function push (arr, item) { arr = arr.slice(); @@ -27,9 +59,9 @@ function push (arr, item) { } /** * Copies array and then unshifts item into it. - * @param {AnyItem} item Array item to add (to beginning) - * @param {GenericArray} arr Array to copy and into which to unshift - * @returns {GenericArray} Copy of the original array + * @param {string|number} item Array item to add (to beginning) + * @param {ExpressionArray} arr Array to copy and into which to unshift + * @returns {ExpressionArray} Copy of the original array */ function unshift (item, arr) { arr = arr.slice(); @@ -43,14 +75,15 @@ function unshift (item, arr) { */ class NewError extends Error { /** - * @param {AnyResult} value The evaluated scalar value + * @param {UnknownResult} value The evaluated scalar value + * @param {ErrorOptions} [options] */ - constructor (value) { + constructor (value, options) { super( 'JSONPath should not be called with "new" (it prevents return ' + - 'of (unwrapped) scalar values)' + 'of (unwrapped) scalar values)', + options ); - this.avoidNew = true; this.value = value; this.name = 'NewError'; } @@ -58,15 +91,20 @@ class NewError extends Error { /** * @typedef {object} ReturnObject -* @property {string} path -* @property {JSONObject} value -* @property {object|GenericArray} parent -* @property {string} parentProperty +* @property {ExpressionArray|string} path +* @property {unknown} value +* @property {ParentValue} parent +* @property {ParentProperty} parentProperty +* @property {boolean} [isParentSelector] +* @property {boolean} [hasArrExpr] +* @property {ExpressionArray} [expr] +* @property {string} [pointer] */ /** * @callback JSONPathCallback -* @param {string|object} preferredOutput +* @param {any} preferredOutput Using `any` type instead of `PreferredOutput` so +* that user can supply flexible type * @param {"value"|"property"} type * @param {ReturnObject} fullRetObj * @returns {void} @@ -74,10 +112,10 @@ class NewError extends Error { /** * @callback OtherTypeCallback -* @param {JSONObject} val -* @param {string} path -* @param {object|GenericArray} parent -* @param {string} parentPropName +* @param {unknown} val +* @param {ExpressionArray} path +* @param {ParentValue} parent +* @param {string|null} parentPropName * @returns {boolean} */ @@ -100,596 +138,961 @@ class NewError extends Error { * @typedef {typeof SafeScript} EvalClass */ +/** + * @typedef {"value"|"path"|"pointer"|"parent"|"parentProperty"| + * "all"} ResultType + */ + +/** + * @typedef {EvalCallback|EvalClass|'safe'|'native'|boolean} EvalValue + */ + +/** + * @typedef {string|string[]} PathType + */ + +/** + * @typedef {{Script: typeof SafeScript}} SafeScriptType + */ + +/** + * @typedef {import('node:vm')|{Script: typeof Script}} ScriptType + */ + +/** + * @typedef {{ + * _$_path?: string, + * _$_parentProperty?: ParentProperty, + * _$_parent?: ParentValue, + * _$_property?: string|number, + * _$_root?: AnyInput, + * _$_v?: unknown, + * [key: string]: SandboxPropertyValue + * }} SandboxType + */ + /** * @typedef {object} JSONPathOptions - * @property {JSON} json - * @property {string|string[]} path - * @property {"value"|"path"|"pointer"|"parent"|"parentProperty"| - * "all"} [resultType="value"] + * @property {AnyInput} [json] + * @property {PathType} [path] + * @property {ResultType} [resultType="value"] * @property {boolean} [flatten=false] * @property {boolean} [wrap=true] - * @property {object} [sandbox={}] - * @property {EvalCallback|EvalClass|'safe'|'native'| - * boolean} [eval = 'safe'] - * @property {object|GenericArray|null} [parent=null] + * @property {SandboxType} [sandbox={}] + * @property {EvalValue} [eval='safe'] + * @property {any|null} [parent=null] * @property {string|null} [parentProperty=null] * @property {JSONPathCallback} [callback] * @property {OtherTypeCallback} [otherTypeCallback] Defaults to * function which throws on encountering `@other` * @property {boolean} [autostart=true] + * @property {boolean} [ignoreEvalErrors=false] */ + +/** + * @overload + * @param {string} opts JSON path to evaluate + * @param {AnyInput} [expr] JSON object to evaluate against + * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired + * payload per `resultType`, 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [callback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + * @param {undefined} [otherTypeCallback] + * @returns {unknown|JSONPathClass} + */ /** - * @param {string|JSONPathOptions} opts If a string, will be treated as `expr` - * @param {string} [expr] JSON path to evaluate - * @param {JSON} [obj] JSON object to evaluate against - * @param {JSONPathCallback} [callback] Passed 3 arguments: 1) desired payload - * per `resultType`, 2) `"value"|"property"`, 3) Full returned object with + * @overload + * @param {JSONPathOptions} opts If a string, will be treated as + * `expr` + * @returns {unknown|JSONPathClass} + */ +/** + * @param {JSONPathOptions|string} opts If a string, will be treated as `expr` + * @param {string|AnyInput} [expr] JSON path to evaluate + * @param {AnyInput|JSONPathCallback} [obj] JSON object to evaluate against + * @param {JSONPathCallback|OtherTypeCallback} [callback] Passed 3 + * arguments: 1) desired payload per `resultType`, + * 2) `"value"|"property"`, 3) Full returned object with * all payloads * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the end * of one's query, this will be invoked with the value of the item, its * path, its parent, and its parent's property name, and it should return * a boolean indicating whether the supplied value belongs to the "other" * type or not (or it may handle transformations and return `false`). - * @returns {JSONPath} - * @class + * @throws {Error} + * @returns {unknown|JSONPathClass} */ function JSONPath (opts, expr, obj, callback, otherTypeCallback) { - // eslint-disable-next-line no-restricted-syntax -- Allow for pseudo-class - if (!(this instanceof JSONPath)) { - try { - return new JSONPath(opts, expr, obj, callback, otherTypeCallback); - } catch (e) { - if (!e.avoidNew) { - throw e; - } - return e.value; + try { + if (opts && typeof opts === 'object') { + return new JSONPathClass(opts); } + return new JSONPathClass( + opts, + expr, + /** @type {JSONPathCallback|undefined} */ (obj), + /** @type {OtherTypeCallback|undefined} */ (callback), + /** @type {undefined} */ (otherTypeCallback) + ); + } catch (e) { + // eslint-disable-next-line no-restricted-syntax -- Within the file + if (!(e instanceof NewError)) { + throw e; + } + return e.value; } +} - if (typeof opts === 'string') { - otherTypeCallback = callback; - callback = obj; - obj = expr; - expr = opts; - opts = null; - } - const optObj = opts && typeof opts === 'object'; - opts = opts || {}; - this.json = opts.json || obj; - this.path = opts.path || expr; - this.resultType = opts.resultType || 'value'; - this.flatten = opts.flatten || false; - this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true; - this.sandbox = opts.sandbox || {}; - this.eval = opts.eval === undefined ? 'safe' : opts.eval; - this.ignoreEvalErrors = (typeof opts.ignoreEvalErrors === 'undefined') - ? false - : opts.ignoreEvalErrors; - this.parent = opts.parent || null; - this.parentProperty = opts.parentProperty || null; - this.callback = opts.callback || callback || null; - this.otherTypeCallback = opts.otherTypeCallback || - otherTypeCallback || - function () { - throw new TypeError( - 'You must supply an otherTypeCallback callback option ' + - 'with the @other() operator.' +/** + * + */ +class JSONPathClass { + /** + * @overload + * @param {string} opts JSON path to evaluate + * @param {AnyInput} [expr] JSON object to evaluate against + * @param {JSONPathCallback} [obj] Passed 3 arguments: 1) desired + * payload per `resultType`, 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [callback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + * @param {undefined} [otherTypeCallback] + * @returns {JSONPath|JSONPathClass} + */ + /** + * @overload + * @param {JSONPathOptions} opts If a string, will be treated as + * `expr` + */ + /** + * @param {null|string|JSONPathOptions} opts If a string, will be treated as + * `expr` + * @param {string|AnyInput} [expr] JSON path to evaluate + * @param {AnyInput|JSONPathCallback} [obj] JSON object to evaluate against + * @param {JSONPathCallback|OtherTypeCallback} [callback] Passed 3 + * arguments: 1) desired payload per `resultType`, + * 2) `"value"|"property"`, 3) Full returned + * object with all payloads + * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the + * end of one's query, this will be invoked with the value of the item, + * its path, its parent, and its parent's property name, and it should + * return a boolean indicating whether the supplied value belongs to the + * "other" type or not (or it may handle transformations and return + * `false`). + */ + constructor (opts, expr, obj, callback, otherTypeCallback) { + if (typeof opts === 'string') { + otherTypeCallback = /** @type {OtherTypeCallback} */ ( + callback ); - }; - - if (opts.autostart !== false) { - const args = { - path: (optObj ? opts.path : expr) - }; - if (!optObj) { - args.json = obj; - } else if ('json' in opts) { - args.json = opts.json; + callback = /** @type {JSONPathCallback} */ ( + obj + ); + obj = expr; + expr = opts; + opts = null; } - const ret = this.evaluate(args); - if (!ret || typeof ret !== 'object') { - throw new NewError(ret); + const optObj = opts && typeof opts === 'object'; + opts ||= /** @type {JSONPathOptions} */ ({}); + /** @type {ResultType|undefined} */ + this.currResultType = undefined; + + /** @type {EvalValue|undefined} */ + this.currEval = undefined; + + /** @type {OtherTypeCallback|undefined} */ + this.currOtherTypeCallback = undefined; + + /** @type {SafeScriptType} */ + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members, no-unused-expressions -- On prototype + this.safeVm; + + /** @type {ScriptType} */ + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members, no-unused-expressions -- On prototype + this.vm; + + /** @type {SandboxType|undefined} */ + this.currSandbox = undefined; + + this._hasParentSelector = false; + + this.json = opts.json || obj; + this.path = opts.path || expr; + this.resultType = opts.resultType || 'value'; + this.flatten = opts.flatten || false; + this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true; + this.sandbox = opts.sandbox || {}; + this.eval = opts.eval === undefined ? 'safe' : opts.eval; + this.ignoreEvalErrors = (typeof opts.ignoreEvalErrors === 'undefined') + ? false + : opts.ignoreEvalErrors; + this.parent = opts.parent || null; + this.parentProperty = opts.parentProperty || null; + this.callback = opts.callback || + /** @type {JSONPathCallback} */ + (callback) || + null; + this.otherTypeCallback = opts.otherTypeCallback || + otherTypeCallback || + function () { + throw new TypeError( + 'You must supply an otherTypeCallback callback option ' + + 'with the @other() operator.' + ); + }; + + if (opts.autostart !== false) { + const args = /** @type {JSONPathOptions} */ ({ + path: (optObj ? opts.path : expr) + }); + if (!optObj && obj !== undefined) { + args.json = obj; + } else if ('json' in opts) { + args.json = opts.json; + } + const ret = this.evaluate(args); + if (!ret || typeof ret !== 'object') { + throw new NewError(ret); + } + + // eslint-disable-next-line @stylistic/max-len -- Long + // @ts-expect-error - Constructor returns evaluate result for legacy API + // eslint-disable-next-line no-constructor-return -- Legacy API + return ret; } - return ret; } -} -// PUBLIC METHODS -JSONPath.prototype.evaluate = function ( - expr, json, callback, otherTypeCallback -) { - let currParent = this.parent, - currParentProperty = this.parentProperty; - let {flatten, wrap} = this; - - this.currResultType = this.resultType; - this.currEval = this.eval; - this.currSandbox = this.sandbox; - callback = callback || this.callback; - this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; - - json = json || this.json; - expr = expr || this.path; - if (expr && typeof expr === 'object' && !Array.isArray(expr)) { - if (!expr.path && expr.path !== '') { - throw new TypeError( - 'You must supply a "path" property when providing an object ' + - 'argument to JSONPath.evaluate().' - ); + // PUBLIC METHODS + + /** + * @overload + * @param {JSONPathOptions} [expr] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + + /** + * @overload + * @param {PathType|undefined} [expr] + * @param {AnyInput} [json] + * @param {JSONPathCallback|null} [callback] + * @param {OtherTypeCallback} [otherTypeCallback] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + + /** + * @param {PathType|JSONPathOptions|undefined} [expr] + * @param {AnyInput} [json] + * @param {JSONPathCallback|null} [callback] + * @param {OtherTypeCallback} [otherTypeCallback] + * @returns {ReturnObject|ReturnObject[]|undefined|unknown} + */ + evaluate ( + expr, json, callback, otherTypeCallback + ) { + let currParent = this.parent, + currParentProperty = this.parentProperty; + let {flatten, wrap} = this; + + this.currResultType = this.resultType; + this.currEval = this.eval; + this.currSandbox = this.sandbox; + callback ||= this.callback; + this.currOtherTypeCallback = otherTypeCallback || + this.otherTypeCallback; + + if (expr && typeof expr === 'object' && !Array.isArray(expr)) { + const exprObj = expr; + if (!exprObj.path && exprObj.path !== '') { + throw new TypeError( + 'You must supply a "path" property when providing an ' + + 'object argument to JSONPath.evaluate().' + ); + } + if (!(Object.hasOwn(exprObj, 'json'))) { + throw new TypeError( + 'You must supply a "json" property when providing an ' + + 'object argument to JSONPath.evaluate().' + ); + } + ({json} = exprObj); + flatten = Object.hasOwn(exprObj, 'flatten') + ? exprObj.flatten ?? flatten + : flatten; + this.currResultType = Object.hasOwn(exprObj, 'resultType') + ? exprObj.resultType + : this.currResultType; + this.currSandbox = Object.hasOwn(exprObj, 'sandbox') + ? exprObj.sandbox + : this.currSandbox; + wrap = Object.hasOwn(exprObj, 'wrap') ? exprObj.wrap : wrap; + this.currEval = Object.hasOwn(exprObj, 'eval') + ? exprObj.eval + : this.currEval; + callback = Object.hasOwn(exprObj, 'callback') + ? exprObj.callback + : callback; + this.currOtherTypeCallback = Object.hasOwn( + exprObj, 'otherTypeCallback' + ) + ? exprObj.otherTypeCallback + : this.currOtherTypeCallback; + currParent = Object.hasOwn(exprObj, 'parent') + ? exprObj.parent ?? currParent + : currParent; + currParentProperty = Object.hasOwn(exprObj, 'parentProperty') + ? exprObj.parentProperty ?? currParentProperty + : currParentProperty; + expr = exprObj.path; + } else { + json ||= this.json; + expr ||= this.path; } - if (!(Object.hasOwn(expr, 'json'))) { - throw new TypeError( - 'You must supply a "json" property when providing an object ' + - 'argument to JSONPath.evaluate().' - ); + currParent ||= null; + currParentProperty ||= null; + + if (Array.isArray(expr)) { + expr = JSONPath.toPathString(expr); + } + if (!json || (!expr && expr !== '')) { + return undefined; } - ({json} = expr); - flatten = Object.hasOwn(expr, 'flatten') ? expr.flatten : flatten; - this.currResultType = Object.hasOwn(expr, 'resultType') - ? expr.resultType - : this.currResultType; - this.currSandbox = Object.hasOwn(expr, 'sandbox') - ? expr.sandbox - : this.currSandbox; - wrap = Object.hasOwn(expr, 'wrap') ? expr.wrap : wrap; - this.currEval = Object.hasOwn(expr, 'eval') - ? expr.eval - : this.currEval; - callback = Object.hasOwn(expr, 'callback') ? expr.callback : callback; - this.currOtherTypeCallback = Object.hasOwn(expr, 'otherTypeCallback') - ? expr.otherTypeCallback - : this.currOtherTypeCallback; - currParent = Object.hasOwn(expr, 'parent') ? expr.parent : currParent; - currParentProperty = Object.hasOwn(expr, 'parentProperty') - ? expr.parentProperty - : currParentProperty; - expr = expr.path; - } - currParent = currParent || null; - currParentProperty = currParentProperty || null; - if (Array.isArray(expr)) { - expr = JSONPath.toPathString(expr); - } - if ((!expr && expr !== '') || !json) { - return undefined; - } + const exprList = JSONPath.toPathArray( + /** @type {string} */ + (expr) + ); + if (exprList[0] === '$' && exprList.length > 1) { + exprList.shift(); + } + this._hasParentSelector = false; + const traceResult = this._trace( + exprList, json, ['$'], currParent, + currParentProperty, + callback ?? undefined, + undefined + ); - const exprList = JSONPath.toPathArray(expr); - if (exprList[0] === '$' && exprList.length > 1) { - exprList.shift(); - } - this._hasParentSelector = null; - const result = this - ._trace( - exprList, json, ['$'], currParent, currParentProperty, callback - ) - .filter(function (ea) { + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next 2 -- Unreachable: _trace returns array when hasArrExpr set */ + const result = ( + Array.isArray(traceResult) ? traceResult : [traceResult] + ).filter((ea) => { return ea && !ea.isParentSelector; }); - if (!result.length) { - return wrap ? [] : undefined; - } - if (!wrap && result.length === 1 && !result[0].hasArrExpr) { - return this._getPreferredOutput(result[0]); - } - return result.reduce((rslt, ea) => { - const valOrPath = this._getPreferredOutput(ea); - if (flatten && Array.isArray(valOrPath)) { - rslt = rslt.concat(valOrPath); - } else { - rslt.push(valOrPath); + if (!result.length) { + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: valid queries always produce results */ + return wrap ? [] : undefined; } - return rslt; - }, []); -}; + if (!wrap && result.length === 1 && !result[0].hasArrExpr) { + const preferredOutput = this._getPreferredOutput(result[0]); + return preferredOutput; + } + const reduced = result.reduce( + (rslt, ea) => { + const valOrPath = this._getPreferredOutput(ea); + if (flatten && Array.isArray(valOrPath)) { + rslt = rslt.concat(valOrPath); + } else { + rslt.push(valOrPath); + } + return rslt; + }, + /** @type {UnknownResult[]} */ + ([]) + ); -// PRIVATE METHODS - -JSONPath.prototype._getPreferredOutput = function (ea) { - const resultType = this.currResultType; - switch (resultType) { - case 'all': { - const path = Array.isArray(ea.path) - ? ea.path - : JSONPath.toPathArray(ea.path); - ea.pointer = JSONPath.toPointer(path); - ea.path = typeof ea.path === 'string' - ? ea.path - : JSONPath.toPathString(ea.path); - return ea; - } case 'value': case 'parent': case 'parentProperty': - return ea[resultType]; - case 'path': - return JSONPath.toPathString(ea[resultType]); - case 'pointer': - return JSONPath.toPointer(ea.path); - default: - throw new TypeError('Unknown result type'); + return reduced; } -}; -JSONPath.prototype._handleCallback = function (fullRetObj, callback, type) { - if (callback) { - const preferredOutput = this._getPreferredOutput(fullRetObj); - fullRetObj.path = typeof fullRetObj.path === 'string' - ? fullRetObj.path - : JSONPath.toPathString(fullRetObj.path); - // eslint-disable-next-line n/callback-return -- No need to return - callback(preferredOutput, type, fullRetObj); - } -}; + // PRIVATE METHODS -/** - * - * @param {string} expr - * @param {JSONObject} val - * @param {string} path - * @param {object|GenericArray} parent - * @param {string} parentPropName - * @param {JSONPathCallback} callback - * @param {boolean} hasArrExpr - * @param {boolean} literalPriority - * @returns {ReturnObject|ReturnObject[]} - */ -JSONPath.prototype._trace = function ( - expr, val, path, parent, parentPropName, callback, hasArrExpr, - literalPriority -) { - // No expr to follow? return path and value as the result of - // this trace branch - let retObj; - if (!expr.length) { - retObj = { - path, - value: val, - parent, - parentProperty: parentPropName, - hasArrExpr - }; - this._handleCallback(retObj, callback, 'value'); - return retObj; + /** + * @param {ReturnObject} ea + * @returns {PreferredOutput} + */ + _getPreferredOutput (ea) { + const resultType = this.currResultType; + switch (resultType) { + case 'all': { + const path = Array.isArray(ea.path) + ? ea.path + : JSONPath.toPathArray(ea.path); + ea.pointer = JSONPath.toPointer(/** @type {string[]} */ (path)); + ea.path = typeof ea.path === 'string' + ? ea.path + : JSONPath.toPathString(/** @type {string[]} */ (ea.path)); + return ea; + } case 'value': case 'parent': case 'parentProperty': + return ea[resultType]; + case 'path': + if (typeof ea.path === 'string') { + return ea.path; + } + return JSONPath.toPathString(/** @type {string[]} */ (ea.path)); + case 'pointer': { + const pathArray = Array.isArray(ea.path) + ? ea.path + : JSONPath.toPathArray(ea.path); + return JSONPath.toPointer(/** @type {string[]} */ (pathArray)); + } + default: + throw new TypeError('Unknown result type'); + } } - const loc = expr[0], x = expr.slice(1); - - // We need to gather the return value of recursive trace calls in order to - // do the parent sel computation. - const ret = []; /** - * - * @param {ReturnObject|ReturnObject[]} elems + * @param {ReturnObject} fullRetObj + * @param {JSONPathCallback|undefined} callback + * @param {"value"|"property"} type * @returns {void} */ - function addRet (elems) { - if (Array.isArray(elems)) { - // This was causing excessive stack size in Node (with or - // without Babel) against our performance test: - // `ret.push(...elems);` - elems.forEach((t) => { - ret.push(t); - }); - } else { - ret.push(elems); + _handleCallback (fullRetObj, callback, type) { + // Early return if no callback provided (defensive + // check for internal calls) + if (!callback) { + return; } + const preferredOutput = this._getPreferredOutput(fullRetObj); + if (Array.isArray(fullRetObj.path)) { + fullRetObj.path = JSONPath.toPathString( + /** @type {string[]} */ (fullRetObj.path) + ); + } + callback(preferredOutput, type, fullRetObj); } - if ((typeof loc !== 'string' || literalPriority) && val && - Object.hasOwn(val, loc) - ) { // simple case--directly follow property - addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, - hasArrExpr)); - // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if` - } else if (loc === '*') { // all child properties - this._walk(val, (m) => { + + /** + * + * @param {ExpressionArray} expr + * @param {unknown} val + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @param {JSONPathCallback|undefined} callback + * @param {boolean|undefined} hasArrExpr + * @param {boolean} [literalPriority] + * @returns {ReturnObject|ReturnObject[]} + */ + _trace ( + expr, val, path, parent, parentPropName, callback, hasArrExpr, + literalPriority + ) { + // No expr to follow? return path and value as the result of + // this trace branch + let retObj; + if (!expr.length) { + retObj = { + path, + value: val, + parent, + parentProperty: parentPropName, + hasArrExpr + }; + this._handleCallback(retObj, callback, 'value'); + return retObj; + } + + const loc = /** @type {string} */ (expr[0]), x = expr.slice(1); + + // We need to gather the return value of recursive trace calls in order + // to do the parent sel computation. + /** @type {ReturnObject[]} */ + const ret = []; + /** + * + * @param {ReturnObject|ReturnObject[]} elems + * @returns {void} + */ + function addRet (elems) { + if (Array.isArray(elems)) { + // This was causing excessive stack size in Node (with or + // without Babel) against our performance test: + // `ret.push(...elems);` + elems.forEach((t) => { + ret.push(t); + }); + } else { + ret.push(elems); + } + } + if (val && (typeof loc !== 'string' || literalPriority) && + Object.hasOwn(val, /** @type {PropertyKey} */ (loc)) + ) { // simple case--directly follow property + const valObj = /** @type {Record} */ (val); addRet(this._trace( - x, val[m], push(path, m), val, m, callback, true, true + x, valObj[/** @type {string} */ (loc)], + push(path, loc), + val, /** @type {string|number} */ (loc), callback, + hasArrExpr )); - }); - } else if (loc === '..') { // all descendent parent properties - // Check remaining expression with val's immediate children - addRet( - this._trace(x, val, path, parent, parentPropName, callback, - hasArrExpr) - ); - this._walk(val, (m) => { - // We don't join m and x here because we only want parents, - // not scalar values - if (typeof val[m] === 'object') { - // Keep going with recursive descent on val's - // object children + // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if` + } else if (loc === '*') { // all child properties + this._walk(val, (m) => { + const valObj = /** @type {Record} */ (val); addRet(this._trace( - expr.slice(), val[m], push(path, m), val, m, callback, true + x, valObj[m], push(path, m), val, m, callback, true, true )); - } - }); - // The parent sel computation is handled in the frame above using the - // ancestor object of val - } else if (loc === '^') { - // This is not a final endpoint, so we do not invoke the callback here - this._hasParentSelector = true; - return { - path: path.slice(0, -1), - expr: x, - isParentSelector: true - }; - } else if (loc === '~') { // property name - retObj = { - path: push(path, loc), - value: parentPropName, - parent, - parentProperty: null - }; - this._handleCallback(retObj, callback, 'property'); - return retObj; - } else if (loc === '$') { // root only - addRet(this._trace(x, val, path, null, null, callback, hasArrExpr)); - } else if ((/^(-?\d*):(-?\d*):?(\d*)$/u).test(loc)) { // [start:end:step] Python slice syntax - addRet( - this._slice(loc, x, val, path, parent, parentPropName, callback) - ); - } else if (loc.indexOf('?(') === 0) { // [?(expr)] (filtering) - if (this.currEval === false) { - throw new Error('Eval [?(expr)] prevented in JSONPath expression.'); - } - const safeLoc = loc.replace(/^\?\((.*?)\)$/u, '$1'); - // check for a nested filter expression - const nested = (/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu).exec(safeLoc); - if (nested) { - // find if there are matches in the nested expression - // add them to the result set if there is at least one match - this._walk(val, (m) => { - const npath = [nested[2]]; - const nvalue = nested[1] - ? val[m][nested[1]] - : val[m]; - const filterResults = this._trace(npath, nvalue, path, - parent, parentPropName, callback, true); - if (filterResults.length > 0) { - addRet(this._trace(x, val[m], push(path, m), val, - m, callback, true)); - } }); - } else { + } else if (loc === '..') { // all descendent parent properties + // Check remaining expression with val's immediate children + addRet( + this._trace(x, val, path, parent, parentPropName, callback, + hasArrExpr) + ); this._walk(val, (m) => { - if (this._eval(safeLoc, val[m], m, path, parent, - parentPropName)) { - addRet(this._trace(x, val[m], push(path, m), val, m, - callback, true)); + // We don't join m and x here because we only want parents, + // not scalar values + const valObj = /** @type {Record} */ (val); + if (typeof valObj[m] === 'object') { + // Keep going with recursive descent on val's + // object children + addRet(this._trace( + expr.slice(), + valObj[m], + push(path, m), + val, + m, + callback, + true + )); } }); - } - } else if (loc[0] === '(') { // [(expr)] (dynamic property/index) - if (this.currEval === false) { - throw new Error('Eval [(expr)] prevented in JSONPath expression.'); - } - // As this will resolve to a property name (but we don't know it - // yet), property and parent information is relative to the - // parent of the property to which this expression will resolve - addRet(this._trace(unshift( - this._eval( - loc, val, path.at(-1), - path.slice(0, -1), parent, parentPropName - ), - x - ), val, path, parent, parentPropName, callback, hasArrExpr)); - } else if (loc[0] === '@') { // value type: @boolean(), etc. - let addType = false; - const valueType = loc.slice(1, -2); - switch (valueType) { - case 'scalar': - if (!val || !(['object', 'function'].includes(typeof val))) { - addType = true; - } - break; - case 'boolean': case 'string': case 'undefined': case 'function': - if (typeof val === valueType) { - addType = true; - } - break; - case 'integer': - if (Number.isFinite(val) && !(val % 1)) { - addType = true; - } - break; - case 'number': - if (Number.isFinite(val)) { - addType = true; + // The parent sel computation is handled in the frame above using the + // ancestor object of val + } else if (loc === '^') { + // This is not a final endpoint, so we do not invoke the + // callback here + this._hasParentSelector = true; + return /** @type {ReturnObject} */ ({ + path: path.slice(0, -1), + expr: x, + isParentSelector: true, + value: undefined, + parent: undefined, + parentProperty: null + }); + } else if (loc === '~') { // property name + retObj = { + path: push(path, loc), + value: parentPropName, + parent, + parentProperty: null + }; + this._handleCallback(retObj, callback, 'property'); + return retObj; + } else if (loc === '$') { // root only + addRet(this._trace(x, val, path, null, null, callback, hasArrExpr)); + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient + } else if ((/^(-?\d*):(-?\d*):?(\d*)$/u).test(loc)) { // [start:end:step] Python slice syntax + const sliceResult = this._slice( + loc, x, val, path, parent, parentPropName, callback + ); + if (sliceResult) { + addRet(sliceResult); } - break; - case 'nonFinite': - if (typeof val === 'number' && !Number.isFinite(val)) { - addType = true; + } else if (loc.indexOf('?(') === 0) { // [?(expr)] (filtering) + if (this.currEval === false) { + throw new Error( + 'Eval [?(expr)] prevented in JSONPath expression.' + ); } - break; - case 'object': - if (val && typeof val === valueType) { - addType = true; + const safeLoc = loc.replace(/^\?\((.*?)\)$/u, '$1'); + // check for a nested filter expression + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient + const nested = (/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu).exec(safeLoc); + if (nested) { + // find if there are matches in the nested expression + // add them to the result set if there is at least one match + this._walk(val, (m) => { + const npath = [nested[2]]; + const valObj2 = /** @type {Record} */ ( + val + ); + const nvalue = /** @type {ValueType} */ (nested[1] + ? /** @type {Record} */ ( + valObj2[m] + )[nested[1]] + : valObj2[m]); + const filterResults = this._trace(npath, nvalue, path, + parent, parentPropName, callback, true); + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next 3 -- Unreachable: _trace always returns array for nested filters */ + const filterArray = Array.isArray(filterResults) + ? filterResults + : [filterResults]; + if (filterArray.length > 0) { + addRet(this._trace(x, valObj2[m], push(path, m), val, + m, callback, true)); + } + }); + } else { + const valObj3 = /** @type {Record} */ (val); + this._walk(val, (m) => { + if (this._eval(safeLoc, valObj3[m], m, path, parent, + parentPropName)) { + addRet(this._trace(x, valObj3[m], push(path, m), val, m, + callback, true)); + } + }); } - break; - case 'array': - if (Array.isArray(val)) { - addType = true; + } else if (loc[0] === '(') { // [(expr)] (dynamic property/index) + if (this.currEval === false) { + throw new Error( + 'Eval [(expr)] prevented in JSONPath expression.' + ); } - break; - case 'other': - addType = this.currOtherTypeCallback( - val, path, parent, parentPropName + // As this will resolve to a property name (but we don't know it + // yet), property and parent information is relative to the + const evalResult = this._eval( + /** @type {string} */ (loc), + val, /** @type {string|number} */ (path.at(-1)), + path.slice(0, -1), parent, parentPropName + ); + const exprToUse = /** @type {string|number} */ ( + evalResult !== undefined ? evalResult : '' ); - break; - case 'null': - if (val === null) { - addType = true; + addRet(this._trace(unshift( + exprToUse, + x + ), val, path, parent, parentPropName, callback, hasArrExpr)); + } else if (loc[0] === '@') { // value type: @boolean(), etc. + let addType = false; + const valueType = /** @type {ValueType} */ (loc).slice(1, -2); + switch (valueType) { + case 'scalar': + if (!val || !(['object', 'function'].includes(typeof val))) { + addType = true; + } + break; + case 'boolean': case 'string': case 'undefined': case 'function': + if (typeof val === valueType) { + addType = true; + } + break; + case 'integer': + if (Number.isFinite(val) && + !(/** @type {number} */ (val) % 1)) { + addType = true; + } + break; + case 'number': + if (Number.isFinite(val)) { + addType = true; + } + break; + case 'nonFinite': + if (typeof val === 'number' && !Number.isFinite(val)) { + addType = true; + } + break; + case 'object': + if (val && typeof val === valueType) { + addType = true; + } + break; + case 'array': + if (Array.isArray(val)) { + addType = true; + } + break; + case 'other': + addType = this.currOtherTypeCallback?.( + val, path, parent, + /** @type {string|null} */ (parentPropName) + ) ?? false; + break; + case 'null': + if (val === null) { + addType = true; + } + break; + /* c8 ignore next 2 */ + default: + throw new TypeError('Unknown value type ' + valueType); } - break; - /* c8 ignore next 2 */ - default: - throw new TypeError('Unknown value type ' + valueType); - } - if (addType) { - retObj = {path, value: val, parent, parentProperty: parentPropName}; - this._handleCallback(retObj, callback, 'value'); - return retObj; - } - // `-escaped property - } else if (loc[0] === '`' && val && Object.hasOwn(val, loc.slice(1))) { - const locProp = loc.slice(1); - addRet(this._trace( - x, val[locProp], push(path, locProp), val, locProp, callback, - hasArrExpr, true - )); - } else if (loc.includes(',')) { // [name1,name2,...] - const parts = loc.split(','); - for (const part of parts) { + if (addType) { + retObj = { + path, value: val, parent, parentProperty: parentPropName, + hasArrExpr + }; + this._handleCallback(retObj, callback, 'value'); + return retObj; + } + // `-escaped property + } else if (val && loc[0] === '`' && + Object.hasOwn(val, loc.slice(1)) + ) { + const locProp = loc.slice(1); + const valObj = /** @type {Record} */ (val); addRet(this._trace( - unshift(part, x), val, path, parent, parentPropName, callback, - true + x, valObj[locProp], push(path, locProp), val, locProp, callback, + hasArrExpr, true )); + } else if (loc.includes(',')) { // [name1,name2,...] + const parts = loc.split(','); + for (const part of parts) { + addRet(this._trace( + unshift(part, x), + val, + path, + parent, + parentPropName, + callback, + true + )); + } + // simple case--directly follow property + } else if ( + !literalPriority && val && Object.hasOwn(val, loc) + ) { + const valObj = /** @type {Record} */ (val); + addRet( + this._trace(x, valObj[loc], push(path, loc), val, loc, callback, + hasArrExpr, true) + ); } - // simple case--directly follow property - } else if ( - !literalPriority && val && Object.hasOwn(val, loc) - ) { - addRet( - this._trace(x, val[loc], push(path, loc), val, loc, callback, - hasArrExpr, true) - ); - } - // We check the resulting values for parent selections. For parent - // selections we discard the value object and continue the trace with the - // current val object - if (this._hasParentSelector) { - for (let t = 0; t < ret.length; t++) { - const rett = ret[t]; - if (rett && rett.isParentSelector) { - const tmp = this._trace( - rett.expr, val, rett.path, parent, parentPropName, callback, - hasArrExpr - ); - if (Array.isArray(tmp)) { - ret[t] = tmp[0]; - const tl = tmp.length; - for (let tt = 1; tt < tl; tt++) { - // eslint-disable-next-line @stylistic/max-len -- Long - // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient - t++; - ret.splice(t, 0, tmp[tt]); + // We check the resulting values for parent selections. For parent + // selections we discard the value object and continue the trace with + // the current val object + if (this._hasParentSelector) { + for (let t = 0; t < ret.length; t++) { + const rett = ret[t]; + if (rett && rett.isParentSelector) { + const exprToUse = /** @type {ExpressionArray} */ ( + rett.expr + ); + const pathToUse = /** @type {ExpressionArray} */ ( + rett.path + ); + const tmp = this._trace( + exprToUse, + val, + pathToUse, + parent, + parentPropName, + callback, + hasArrExpr + ); + if (Array.isArray(tmp)) { + ret[t] = tmp[0]; + const tl = tmp.length; + for (let tt = 1; tt < tl; tt++) { + t++; + ret.splice(t, 0, tmp[tt]); + } + } else { + ret[t] = tmp; } - } else { - ret[t] = tmp; } } } + return ret; } - return ret; -}; -JSONPath.prototype._walk = function (val, f) { - if (Array.isArray(val)) { - const n = val.length; - for (let i = 0; i < n; i++) { - f(i); + /** + * @param {unknown} val + * @param {(prop: string|number) => void} f + * @returns {void} + */ + _walk (val, f) { + if (Array.isArray(val)) { + const n = val.length; + for (let i = 0; i < n; i++) { + f(i); + } + } else if (val && typeof val === 'object') { + Object.keys(val).forEach((m) => { + f(m); + }); } - } else if (val && typeof val === 'object') { - Object.keys(val).forEach((m) => { - f(m); - }); } -}; -JSONPath.prototype._slice = function ( - loc, expr, val, path, parent, parentPropName, callback -) { - if (!Array.isArray(val)) { - return undefined; - } - const len = val.length, parts = loc.split(':'), - step = (parts[2] && Number.parseInt(parts[2])) || 1; - let start = (parts[0] && Number.parseInt(parts[0])) || 0, - end = parts[1] ? Number.parseInt(parts[1]) : len; - start = (start < 0) ? Math.max(0, start + len) : Math.min(len, start); - end = (end < 0) ? Math.max(0, end + len) : Math.min(len, end); - const ret = []; - for (let i = start; i < end; i += step) { - const tmp = this._trace( - unshift(i, expr), val, path, parent, parentPropName, callback, true - ); - // Should only be possible to be an array here since first part of - // ``unshift(i, expr)` passed in above would not be empty, nor `~`, - // nor begin with `@` (as could return objects) - // This was causing excessive stack size in Node (with or - // without Babel) against our performance test: `ret.push(...tmp);` - tmp.forEach((t) => { - ret.push(t); - }); + /** + * @param {string} loc + * @param {ExpressionArray} expr + * @param {unknown} val + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @param {JSONPathCallback|undefined} callback + * @returns {ReturnObject[]|undefined} + */ + _slice ( + loc, expr, val, path, parent, parentPropName, callback + ) { + if (!Array.isArray(val)) { + return undefined; + } + const len = val.length, parts = loc.split(':'), + step = (parts[2] && Number(parts[2])) || 1; + let start = (parts[0] && Number(parts[0])) || 0, + end = parts[1] ? Number(parts[1]) : len; + start = (start < 0) ? Math.max(0, start + len) : Math.min(len, start); + end = (end < 0) ? Math.max(0, end + len) : Math.min(len, end); + /** @type {ReturnObject[]} */ + const ret = []; + for (let i = start; i < end; i += step) { + const tmp = this._trace( + unshift(i, expr), + val, + path, + parent, + parentPropName, + callback, + true + ); + // Should only be possible to be an array here since first part of + // ``unshift(i, expr)` passed in above would not be empty, + // nor `~`, nor begin with `@` (as could return objects) + // This was causing excessive stack size in Node (with or + // without Babel) against our performance test: `ret.push(...tmp);` + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: _trace returns array when expr non-empty */ + const tmpArray = Array.isArray(tmp) ? tmp : [tmp]; + tmpArray.forEach((t) => { + ret.push(t); + }); + } + return ret; } - return ret; -}; -JSONPath.prototype._eval = function ( - code, _v, _vname, path, parent, parentPropName -) { - this.currSandbox._$_parentProperty = parentPropName; - this.currSandbox._$_parent = parent; - this.currSandbox._$_property = _vname; - this.currSandbox._$_root = this.json; - this.currSandbox._$_v = _v; - - const containsPath = code.includes('@path'); - if (containsPath) { - this.currSandbox._$_path = JSONPath.toPathString(path.concat([_vname])); - } + /** + * @param {string} code + * @param {unknown} _v + * @param {string|number} _vname + * @param {ExpressionArray} path + * @param {ParentValue} parent + * @param {ParentProperty} parentPropName + * @returns {UnknownResult} + */ + _eval ( + code, _v, _vname, path, parent, parentPropName + ) { + if (this.currSandbox) { + this.currSandbox._$_parentProperty = parentPropName; + this.currSandbox._$_parent = parent; + this.currSandbox._$_property = _vname; + this.currSandbox._$_root = this.json; + this.currSandbox._$_v = _v; + } - const scriptCacheKey = this.currEval + 'Script:' + code; - if (!JSONPath.cache[scriptCacheKey]) { - let script = code - .replaceAll('@parentProperty', '_$_parentProperty') - .replaceAll('@parent', '_$_parent') - .replaceAll('@property', '_$_property') - .replaceAll('@root', '_$_root') - .replaceAll(/@([.\s)[])/gu, '_$_v$1'); + const containsPath = code.includes('@path'); if (containsPath) { - script = script.replaceAll('@path', '_$_path'); + // eslint-disable-next-line @stylistic/max-len -- Long + /* c8 ignore next -- Unreachable: currSandbox set in evaluate() before _eval */ + const currSandbox = this.currSandbox ?? {}; + currSandbox._$_path = JSONPath.toPathString( + /** @type {string[]} */ (path.concat([_vname])) + ); } - if ( - this.currEval === 'safe' || - this.currEval === true || - this.currEval === undefined - ) { - JSONPath.cache[scriptCacheKey] = new this.safeVm.Script(script); - } else if (this.currEval === 'native') { - JSONPath.cache[scriptCacheKey] = new this.vm.Script(script); - } else if ( - typeof this.currEval === 'function' && - this.currEval.prototype && - Object.hasOwn(this.currEval.prototype, 'runInNewContext') - ) { - const CurrEval = this.currEval; - JSONPath.cache[scriptCacheKey] = new CurrEval(script); - } else if (typeof this.currEval === 'function') { - JSONPath.cache[scriptCacheKey] = { - runInNewContext: (context) => this.currEval(script, context) - }; - } else { - throw new TypeError(`Unknown "eval" property "${this.currEval}"`); + + const scriptCacheKey = this.currEval + 'Script:' + code; + if (!Object.hasOwn(JSONPath.cache, scriptCacheKey)) { + let script = code + .replaceAll('@parentProperty', '_$_parentProperty') + .replaceAll('@parent', '_$_parent') + .replaceAll('@property', '_$_property') + .replaceAll('@root', '_$_root') + .replaceAll(/@([.\s)[])/gu, '_$_v$1'); + if (containsPath) { + script = script.replaceAll('@path', '_$_path'); + } + const evalType = /** @type {string|boolean|undefined} */ ( + this.currEval + ); + if (['safe', true, undefined].includes(evalType)) { + const {cache} = JSONPath; + cache[scriptCacheKey] = new ( + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members -- Prototype + this.safeVm + ).Script(script); + } else if (this.currEval === 'native') { + const {cache} = JSONPath; + cache[scriptCacheKey] = new ( + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-undeclared-class-members -- Prototype + this.vm + ).Script(script); + } else if ( + typeof this.currEval === 'function' && + this.currEval.prototype && + Object.hasOwn(this.currEval.prototype, 'runInNewContext') + ) { + const CurrEval = this.currEval; + const {cache} = JSONPath; + // eslint-disable-next-line @stylistic/max-len -- Long + // @ts-expect-error - Type checked above to have proper constructor + cache[scriptCacheKey] = new CurrEval(script); + } else if (typeof this.currEval === 'function') { + const {cache} = JSONPath; + // Type narrowing: at this point currEval is a function + // but not a constructor + const evalFunc = /** @type {EvalCallback} */ (this.currEval); + cache[scriptCacheKey] = { + runInNewContext: ( + /** @type {ContextItem} */ context + ) => evalFunc(script, context) + }; + } else { + throw new TypeError( + `Unknown "eval" property "${this.currEval}"` + ); + } } - } - try { - return JSONPath.cache[scriptCacheKey].runInNewContext(this.currSandbox); - } catch (e) { - if (this.ignoreEvalErrors) { - return false; + try { + const {cache} = JSONPath; + + /** + * @typedef {{ + * runInNewContext: ( + * ctx: SandboxType|undefined + * ) => EvaluatedResult + * }} RunInNewContext + */ + + return /** @type {RunInNewContext} */ ( + cache[scriptCacheKey] + ).runInNewContext( + this.currSandbox + ); + } catch (e) { + if (this.ignoreEvalErrors) { + return false; + } + const error = /** @type {Error} */ (e); + throw new Error('jsonPath: ' + error.message + ': ' + code, { + cause: e + }); } - throw new Error('jsonPath: ' + e.message + ': ' + code); } +} + +JSONPathClass.prototype.safeVm = { + Script: SafeScript }; // PUBLIC CLASS PROPERTIES AND METHODS // Could store the cache object itself + +/** @type {Record} */ JSONPath.cache = {}; /** @@ -708,7 +1111,7 @@ JSONPath.toPathString = function (pathArr) { }; /** - * @param {string} pointer JSON Path + * @param {string[]} pointer JSON Path array * @returns {string} JSON Pointer */ JSONPath.toPointer = function (pointer) { @@ -730,9 +1133,10 @@ JSONPath.toPointer = function (pointer) { */ JSONPath.toPathArray = function (expr) { const {cache} = JSONPath; - if (cache[expr]) { - return cache[expr].concat(); + if (Object.hasOwn(cache, expr)) { + return /** @type {string[]} */ (cache[expr]).concat(); } + /** @type {string[]} */ const subx = []; const normalized = expr // Properties @@ -743,7 +1147,11 @@ JSONPath.toPathArray = function (expr) { // Parenthetical evaluations (filtering and otherwise), directly // within brackets or single quotes .replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function ($0, $1) { - return '[#' + (subx.push($1) - 1) + ']'; + return '[#' + + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-return-array-push -- Optimization + (subx.push($1) - 1) + + ']'; }) // Escape periods and tildes within properties .replaceAll(/\[['"]([^'\]]*)['"]\]/gu, function ($0, prop) { @@ -755,6 +1163,7 @@ JSONPath.toPathArray = function (expr) { // Properties operator .replaceAll('~', ';~;') // Split by property boundaries + // eslint-disable-next-line sonarjs/super-linear-regex -- Convenient .replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu, ';') // Reinsert periods within properties .replaceAll('%@%', '.') @@ -771,14 +1180,10 @@ JSONPath.toPathArray = function (expr) { const exprList = normalized.split(';').map(function (exp) { const match = exp.match(/#(\d+)/u); - return !match || !match[1] ? exp : subx[match[1]]; + return !match || !match[1] ? exp : subx[Number(match[1])]; }); cache[expr] = exprList; - return cache[expr].concat(); -}; - -JSONPath.prototype.safeVm = { - Script: SafeScript + return /** @type {string[]} */ (cache[expr]).concat(); }; -export {JSONPath}; +export {JSONPath, JSONPathClass}; diff --git a/test-helpers/checkVM.js b/test-helpers/checkVM.js index 361bad31..ef3d603a 100644 --- a/test-helpers/checkVM.js +++ b/test-helpers/checkVM.js @@ -3,9 +3,13 @@ * @returns {void} */ +/** + * @typedef {"Node vm"|"JSONPath vm"} VmType + */ + /** * @callback VMTestIterator -* @param {"Node vm"|"JSONPath vm"} vmType +* @param {VmType} vmType * @param {BeforeChecker} beforeChecker * @returns {void} */ @@ -22,18 +26,23 @@ function checkBuiltInVMAndNodeVM (cb) { }); return; } - [ + /** @type {VmType[]} */ + ([ 'Node vm', 'JSONPath vm' - ].forEach((vmType) => { + ]).forEach((vmType) => { const checkingBrowserVM = vmType === 'JSONPath vm'; cb( vmType, checkingBrowserVM ? () => { + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-global-object-property-assignment -- Test env globalThis.jsonpath = globalThis.jsonpathBrowser; } : () => { + // eslint-disable-next-line @stylistic/max-len -- Long + // eslint-disable-next-line unicorn/no-global-object-property-assignment -- Test env globalThis.jsonpath = globalThis.jsonpathNodeVM; } ); diff --git a/test-helpers/node-env.js b/test-helpers/node-env.js index d7ac504e..34bcf4ed 100644 --- a/test-helpers/node-env.js +++ b/test-helpers/node-env.js @@ -1,12 +1,15 @@ import {assert, expect} from 'chai'; -import {JSONPath} from '../src/jsonpath-node.js'; +import {JSONPath, JSONPathClass} from '../src/jsonpath-node.js'; import { JSONPath as JSONPathBrowser } from '../src/jsonpath-browser.js'; +/* eslint-disable unicorn/no-global-object-property-assignment -- Test env */ globalThis.assert = assert; globalThis.expect = expect; globalThis.jsonpathNodeVM = JSONPath; globalThis.jsonpath = JSONPath; globalThis.jsonpathBrowser = JSONPathBrowser; +globalThis.JSONPathClass = JSONPathClass; +/* eslint-enable unicorn/no-global-object-property-assignment -- Test env */ diff --git a/test/test.all.js b/test/test.all.js index 75257adb..b2faf5eb 100644 --- a/test/test.all.js +++ b/test/test.all.js @@ -33,7 +33,14 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { }); it('select sibling via parent, return both path and value', () => { - const expected = [{path: "$['children'][2]['children'][1]", value: {name: 'child3_2'}, parent: json.children[2].children, parentProperty: 1, pointer: '/children/2/children/1', hasArrExpr: true}]; + const expected = [{ + path: "$['children'][2]['children'][1]", + value: {name: 'child3_2'}, + parent: json.children[2].children, + parentProperty: 1, + pointer: '/children/2/children/1', + hasArrExpr: true + }]; const result = jsonpath({json, path: '$..[?(@.name && @.name.match(/3_1$/))]^[?(@.name.match(/_2$/))]', resultType: 'all'}); assert.deepEqual(result, expected); }); diff --git a/test/test.api.js b/test/test.api.js index 8913772e..662ad54f 100644 --- a/test/test.api.js +++ b/test/test.api.js @@ -1,5 +1,9 @@ +/** + * @import {JSONPathClass} from '../src/jsonpath.js'; + */ + describe('JSONPath - API', function () { - // tests based on examples at http://goessner.net/articles/jsonpath/ + // tests based on examples at https://goessner.net/articles/jsonpath/ const json = { "store": { "book": [{ @@ -56,18 +60,18 @@ describe('JSONPath - API', function () { it('should test defaults on manual `evaluate` with `autostart: false`', () => { const books = json.store.book; const expected = [books[0].author, books[1].author, books[2].author, books[3].author]; - let jp = jsonpath({ + let jp = /** @type {JSONPathClass} */ (jsonpath({ path: '$.store.book[*].author', json, autostart: false - }); + })); let result = jp.evaluate(); assert.deepEqual(result, expected); - jp = jsonpath({ + jp = /** @type {JSONPathClass} */ (jsonpath({ json, path: 'store.book[*].author', autostart: false - }); + })); result = jp.evaluate(); assert.deepEqual(result, expected); }); @@ -75,9 +79,9 @@ describe('JSONPath - API', function () { it('should test defaults with `evaluate` object and `autostart: false`', () => { const books = json.store.book; const expected = [books[0].author, books[1].author, books[2].author, books[3].author]; - const jp = jsonpath({ + const jp = /** @type {JSONPathClass} */ (jsonpath({ autostart: false - }); + })); const result = jp.evaluate({ json, path: '$.store.book[*].author', @@ -89,8 +93,198 @@ describe('JSONPath - API', function () { callback () { /* */ }, parent: null, parentProperty: null, - otherTypeCallback () { /* */ } + otherTypeCallback () { + return true; + } + }); + assert.deepEqual(result, expected); + }); + + it('should handle _handleCallback with undefined callback', () => { + const jp = /** @type {JSONPathClass} */ (jsonpath({ + autostart: false + })); + // Test the defensive check in _handleCallback when callback is undefined + const retObj = { + path: "$['store']['book'][0]", + value: json.store.book[0], + parent: json.store.book, + parentProperty: 0 + }; + // This should not throw and should return early + assert.doesNotThrow(() => { + jp._handleCallback(retObj, undefined, 'value'); }); + }); + + it('should handle _getPreferredOutput with string path and all resultType', () => { + const jp = /** @type {JSONPathClass} */ (jsonpath({ + autostart: false + })); + jp.currResultType = 'all'; + const retObj = { + path: "$['store']['book'][0]", + value: json.store.book[0], + parent: json.store.book, + parentProperty: 0 + }; + + const result = /** @type {{path: string, pointer: string}} */ ( + jp._getPreferredOutput(retObj) + ); + assert.deepEqual(result.path, "$['store']['book'][0]"); + assert.deepEqual(result.pointer, '/store/book/0'); + }); + + it('should return string path directly in _getPreferredOutput for path resultType', () => { + const jp = /** @type {JSONPathClass} */ (jsonpath({ + autostart: false + })); + jp.currResultType = 'path'; + const retObj = { + path: "$['store']['book'][0]", + value: json.store.book[0], + parent: json.store.book, + parentProperty: 0 + }; + + const result = /** @type {string} */ (jp._getPreferredOutput(retObj)); + assert.deepEqual(result, "$['store']['book'][0]"); + }); + + it('should convert string path to array for pointer resultType', () => { + const jp = /** @type {JSONPathClass} */ (jsonpath({ + autostart: false + })); + jp.currResultType = 'pointer'; + const retObj = { + path: "$['store']['book'][0]", + value: json.store.book[0], + parent: json.store.book, + parentProperty: 0 + }; + + const result = /** @type {string} */ (jp._getPreferredOutput(retObj)); + assert.deepEqual(result, '/store/book/0'); + }); + + it('should handle flatten: null in evaluate options', () => { + const jp = /** @type {JSONPathClass} */ (jsonpath({ + autostart: false + })); + const result = jp.evaluate({ + json, + path: '$.store.book[*].author', + flatten: undefined + }); + const books = json.store.book; + const expected = [books[0].author, books[1].author, books[2].author, books[3].author]; assert.deepEqual(result, expected); }); + + it('should handle nested filter with single result', () => { + const testJson = { + items: [ + {id: 1, nested: {value: 'a'}}, + {id: 2, nested: {value: 'b'}} + ] + }; + const result = jsonpath({ + json: testJson, + path: '$.items[?(@.nested)]' + }); + assert.deepEqual(result, [testJson.items[0], testJson.items[1]]); + }); + + it('should handle slice with single element', () => { + const testJson = {items: [1]}; + const result = jsonpath({ + json: testJson, + path: '$.items[0:1]' + }); + assert.deepEqual(result, [1]); + }); + + it('should handle simple root path returning single object', () => { + const testJson = {value: 42}; + const result = jsonpath({ + json: testJson, + path: '$', + wrap: false, + resultType: 'all' + }); + assert.deepEqual(result, { + path: '$', + value: testJson, + parent: null, + parentProperty: null, + hasArrExpr: undefined, + pointer: '' + }); + }); + + it('should handle otherTypeCallback returning null for @other()', () => { + const testJson = { + values: [1, 'text', true, null, {obj: 'value'}] + }; + + // @ts-expect-error Testing + const result = jsonpath({ + json: testJson, + path: '$.values[*]@other()', + otherTypeCallback (val) { + // Return null for objects to test the ?? false fallback + if (typeof val === 'object' && val !== null) { + return null; + } + return false; + } + }); + assert.deepEqual(result, []); + }); + + it('should handle nested filter with property access', () => { + const testJson = { + items: [ + {id: 1, subs: [{val: 1}, {val: 2}]}, + {id: 2, subs: [{val: 3}]}, + {id: 3, subs: []} + ] + }; + // Nested filter: select items that have subs with val > 1 + const result = jsonpath({ + json: testJson, + path: '$.items[?(@.subs[?(@.val > 1)])]' + }); + // Items 0 and 1 both have subs with val > 1 + assert.deepEqual(result, [testJson.items[0], testJson.items[1]]); + }); + + it('should handle slice operation with multiple elements', () => { + const testJson = {items: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}; + const result = jsonpath({ + json: testJson, + path: '$.items[2:8:2]' + }); + assert.deepEqual(result, [3, 5, 7]); + }); + + it('should handle parenthesis expression with undefined result', () => { + const testJson = {a: {x: 1}, b: {y: 2}, c: {z: undefined}}; + const result = jsonpath({ + json: testJson, + path: '$[(undefined)]' + }); + assert.deepEqual(result, []); + }); + + it('should handle @path expression without predefined sandbox', () => { + const testJson = {a: 1, b: 2}; + // Don't provide sandbox, let it be created on demand + const result = jsonpath({ + json: testJson, + path: '$[?(@path == "$[\'a\']")]' + }); + assert.deepEqual(result, [1]); + }); }); diff --git a/test/test.at_and_dollar.js b/test/test.at_and_dollar.js index c69d8715..5cd6b636 100644 --- a/test/test.at_and_dollar.js +++ b/test/test.at_and_dollar.js @@ -1,4 +1,16 @@ +/** + * @type {{ + * assert: Chai.AssertStatic, + * jsonpath: (opts: any) => any + * }} + */ +const testGlobals = globalThis; +/** @type {Chai.AssertStatic} */ +const assertChai = testGlobals.assert; + +const jsonpathFn = testGlobals.jsonpath; + describe('JSONPath - At and Dollar sign', function () { const t1 = { simpleString: "simpleString", @@ -15,20 +27,20 @@ describe('JSONPath - At and Dollar sign', function () { }; it('test undefined, null', () => { - assert.strictEqual(jsonpath({json: {a: null}, path: '$.a', wrap: false}), null); - assert.strictEqual(jsonpath({json: undefined, path: 'foo'}), undefined); - assert.strictEqual(jsonpath({json: null, path: 'foo'}), undefined); - assert.strictEqual(jsonpath({json: {}, path: 'foo'})[0], undefined); - assert.strictEqual(jsonpath({json: {a: 'b'}, path: 'foo'})[0], undefined); - assert.strictEqual(jsonpath({json: {a: 'b'}, path: 'foo'})[100], undefined); + assertChai.isNull(jsonpathFn({json: {a: null}, path: '$.a', wrap: false})); + assertChai.isUndefined(jsonpathFn({json: undefined, path: 'foo'})); + assertChai.isUndefined(jsonpathFn({json: null, path: 'foo'})); + assertChai.isUndefined(jsonpathFn({json: {}, path: 'foo'})[0]); + assertChai.isUndefined(jsonpathFn({json: {a: 'b'}, path: 'foo'})[0]); + assertChai.isUndefined(jsonpathFn({json: {a: 'b'}, path: 'foo'})[100]); }); it('test $ and @', () => { - assert.strictEqual(jsonpath({json: t1, path: '`$'})[0], t1.$); - assert.strictEqual(jsonpath({json: t1, path: 'a$a'})[0], t1.a$a); - assert.strictEqual(jsonpath({json: t1, path: '`@'})[0], t1['@']); - assert.strictEqual(jsonpath({json: t1, path: '$.`$.`@'})[0], t1.$['@']); - assert.strictEqual(jsonpath({json: t1, path: String.raw`\@`})[1], undefined); + assertChai.strictEqual(jsonpathFn({json: t1, path: '`$'})[0], t1.$); + assertChai.strictEqual(jsonpathFn({json: t1, path: 'a$a'})[0], t1.a$a); + assertChai.strictEqual(jsonpathFn({json: t1, path: '`@'})[0], t1['@']); + assertChai.strictEqual(jsonpathFn({json: t1, path: '$.`$.`@'})[0], t1.$['@']); + assertChai.isUndefined(jsonpathFn({json: t1, path: String.raw`\@`})[1]); }); it('@ as false', () => { @@ -38,8 +50,8 @@ describe('JSONPath - At and Dollar sign', function () { } }; const expected = [false]; - const result = jsonpath({json, path: "$..*[?(@ === false)]", wrap: false}); - assert.deepEqual(result, expected); + const result = jsonpathFn({json, path: "$..*[?(@ === false)]", wrap: false}); + assertChai.deepEqual(result, expected); }); it('@ as 0', function () { @@ -49,7 +61,7 @@ describe('JSONPath - At and Dollar sign', function () { } }; const expected = [0]; - const result = jsonpath({json, path: "$.a[?(@property === 'b' && @ < 1)]", wrap: false}); - assert.deepEqual(result, expected); + const result = jsonpathFn({json, path: "$.a[?(@property === 'b' && @ < 1)]", wrap: false}); + assertChai.deepEqual(result, expected); }); }); diff --git a/test/test.callback.js b/test/test.callback.js index 79d034d6..40b95abf 100644 --- a/test/test.callback.js +++ b/test/test.callback.js @@ -37,12 +37,16 @@ describe('JSONPath - Callback', function () { it('Callback', () => { const expected = ['value', json.store.bicycle, {path: "$['store']['bicycle']", value: json.store.bicycle, parent: json.store, parentProperty: 'bicycle', hasArrExpr: undefined}]; + + /** + * @type {undefined|(string|object)[]} + */ let result; /** * - * @param {PlainObject} data + * @param {object} data * @param {string} type - * @param {PlainObject} fullData + * @param {object} fullData * @returns {void} */ function callback (data, type, fullData) { @@ -75,12 +79,16 @@ describe('JSONPath - Callback', function () { hasArrExpr: undefined } ]; + + /** + * @type {undefined|(string|object)[]} + */ let result; /** * - * @param {PlainObject} data + * @param {object} data * @param {string} type - * @param {PlainObject} fullData + * @param {object} fullData * @returns {void} */ function callback (data, type, fullData) { @@ -90,7 +98,7 @@ describe('JSONPath - Callback', function () { result.push(type, data, fullData); } jsonpath({json, path: '$.store.bicycle', resultType: 'all', wrap: false, callback}); - assert.deepEqual(result[0], expected[0]); + assert.deepEqual(result?.[0], expected[0]); assert.deepEqual(result, expected); }); diff --git a/test/test.cli.js b/test/test.cli.js index 3bbb22cb..3ee8e77c 100644 --- a/test/test.cli.js +++ b/test/test.cli.js @@ -20,6 +20,9 @@ describe("JSONPath - cli", () => { } expect(out).to.have.property("code", 1); expect(out).to.have.property("stderr"); - expect(out.stderr).to.include(`usage: ${binPath} \n\n`); + expect( + /** @type {{stderr: string}} */ + (out).stderr + ).to.include(`usage: ${binPath} \n\n`); }); }); diff --git a/test/test.errors.js b/test/test.errors.js index 4bc27f07..06b1aff2 100644 --- a/test/test.errors.js +++ b/test/test.errors.js @@ -25,6 +25,7 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { it('should throw with a bad result type', () => { expect(() => { + // @ts-expect-error Bad argument jsonpath({ json: {children: [5]}, path: '$..children', diff --git a/test/test.eval.js b/test/test.eval.js index 4fd1fb27..53bc89a8 100644 --- a/test/test.eval.js +++ b/test/test.eval.js @@ -1,5 +1,9 @@ import {checkBuiltInVMAndNodeVM} from '../test-helpers/checkVM.js'; +/** + * @import {SandboxCallback, EvalValue} from '../src/jsonpath.js'; + */ + checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { describe(`JSONPath - Eval (${vmType} - native)`, function () { before(setBuiltInState); @@ -28,6 +32,7 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { it('fail if eval is unsupported', () => { expect(() => { + // @ts-expect-error Bad argument jsonpath({json, path: "$..[?(@.category === category)]", eval: 'wrong-eval'}); }).to.throw( TypeError, @@ -124,11 +129,11 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { const expected = [json.store.book]; const result = jsonpath({ json, - sandbox: { + sandbox: /** @type {{filter: SandboxCallback}} */ ({ filter (arg) { return arg.category === 'reference'; } - }, + }), path: "$..[?(filter(@))]", wrap: false, eval: 'native' }); @@ -138,6 +143,10 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { describe('cyclic object', () => { // This is not an eval test, but we put it here for parity with item below it('cyclic object without a sandbox', () => { + /** + * @typedef {{a: {b: {c: number}, x?: CircularObj}}} CircularObj + */ + /** @type {CircularObj} */ const circular = {a: {b: {c: 5}}}; circular.a.x = circular; const expected = circular.a.b; @@ -150,6 +159,12 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { assert.deepEqual(result, expected); }); it('cyclic object in a sandbox', () => { + /** + * @typedef {{ + * category: string, recurse?: CircularObjWithRecurse + * }} CircularObjWithRecurse + */ + /** @type {CircularObjWithRecurse} */ const circular = {category: 'fiction'}; circular.recurse = circular; const expected = json.store.books; @@ -191,8 +206,9 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { } }; it('eval as callback function', () => { + /** @type {EvalValue} */ const evalCb = (code, ctxt) => { - const script = new jsonpath.prototype.safeVm.Script(code); + const script = new JSONPathClass.prototype.safeVm.Script(code); return script.runInNewContext(ctxt); }; const expected = [json.store.book]; @@ -208,7 +224,7 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { const result = jsonpath({ json, path: '$..[?(@.category === "reference")]', - eval: jsonpath.prototype.safeVm.Script + eval: JSONPathClass.prototype.safeVm.Script }); assert.deepEqual(result, expected); }); @@ -218,7 +234,7 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { const result = jsonpath({ json, path: '$..[?(@.category.toLowerCase() === "reference")]', - eval: jsonpath.prototype.safeVm.Script, + eval: JSONPathClass.prototype.safeVm.Script, ignoreEvalErrors: true }); assert.deepEqual(result, expected); diff --git a/test/test.examples.js b/test/test.examples.js index 0d06190a..22dc6cf7 100644 --- a/test/test.examples.js +++ b/test/test.examples.js @@ -3,7 +3,7 @@ import {checkBuiltInVMAndNodeVM} from '../test-helpers/checkVM.js'; checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { describe(`JSONPath - Examples (${vmType})`, function () { before(setBuiltInState); - // tests based on examples at http://goessner.net/articles/jsonpath/ + // tests based on examples at https://goessner.net/articles/jsonpath/ const json = { "store": { "book": [{ @@ -143,17 +143,17 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { }); it('all properties of a JSON structure (beneath the root)', () => { - const expected = [ + const expected = /** @type {any[]} */ ([ json.store, json.store.book, json.store.bicycle - ]; + ]); json.store.book.forEach((book) => { expected.push(book); }); json.store.book.forEach(function (book) { - Object.keys(book).forEach(function (p) { - expected.push(book[p]); + Object.values(book).forEach(function (v) { + expected.push(v); }); }); expected.push( @@ -166,11 +166,11 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { }); it('all parent components of a JSON structure', () => { - const expected = [ + const expected = /** @type {any[]} */ ([ json, json.store, json.store.book - ]; + ]); json.store.book.forEach((book) => { expected.push(book); }); @@ -207,34 +207,46 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { assert.deepEqual(result, expected); }); it('Custom property: @property', () => { - let expected = json.store.book.reduce(function (arr, book) { + const expected = json.store.book.reduce(function (arr, book) { arr.push(book.author, book.title); if (book.isbn) { arr.push(book.isbn); } arr.push(book.price); return arr; - }, []); + }, /** @type {(string|number)[]} */ ([])); let result = jsonpath({json, path: '$..book.*[?(@property !== "category")]'}); assert.deepEqual(result, expected); - expected = json.store.book.slice(1); + const expected2 = json.store.book.slice(1); result = jsonpath({json, path: '$..book[?(@property !== 0)]'}); - assert.deepEqual(result, expected); + assert.deepEqual(result, expected2); }); it('Custom property: @parentProperty', () => { - let expected = [json.store.bicycle.color, json.store.bicycle.price]; + const expected = [json.store.bicycle.color, json.store.bicycle.price]; let result = jsonpath({json, path: '$.store.*[?(@parentProperty !== "book")]'}); assert.deepEqual(result, expected); - expected = json.store.book.slice(1).reduce(function (rslt, book) { - return [...rslt, ...Object.keys(book).reduce((reslt, prop) => { - reslt.push(book[prop]); - return reslt; - }, [])]; - }, []); + const expected2 = json.store.book.slice(1).reduce( + (rslt, book) => { + return [...rslt, ...Object.values(book).reduce((reslt, v) => { + reslt.push(v); + return reslt; + }, [])]; + }, + /** + * @type {{ + * category: string; + * author: string; + * title: string; + * isbn: string; + * price: number; + * }[]} + */ + ([]) + ); result = jsonpath({json, path: '$..book.*[?(@parentProperty !== 0)]'}); - assert.deepEqual(result, expected); + assert.deepEqual(result, expected2); }); it('Custom property: @root', () => { diff --git a/test/test.intermixed.arr.js b/test/test.intermixed.arr.js index 75d908e9..0700e219 100644 --- a/test/test.intermixed.arr.js +++ b/test/test.intermixed.arr.js @@ -1,6 +1,6 @@ describe('JSONPath - Intermixed Array', function () { - // tests based on examples at http://goessner.net/articles/jsonpath/ + // tests based on examples at https://goessner.net/articles/jsonpath/ const json = { "store": { "book": [ @@ -41,7 +41,7 @@ describe('JSONPath - Intermixed Array', function () { it('all sub properties, entire tree', () => { const books = json.store.book; let expected = [books[1].price, books[2].price, books[3].price, json.store.bicycle.price]; - expected = [...books[0].price, ...expected]; + expected = [...(/** @type {number[]} */ (books[0].price)), ...expected]; const result = jsonpath({json, path: '$.store..price', flatten: true}); assert.deepEqual(result, expected); }); diff --git a/test/test.path_expressions.js b/test/test.path_expressions.js index d42b5e73..f25b86f0 100644 --- a/test/test.path_expressions.js +++ b/test/test.path_expressions.js @@ -1,6 +1,6 @@ describe('JSONPath - Path expressions', function () { - // tests based on examples at http://goessner.net/articles/JsonPath/ + // tests based on examples at https://goessner.net/articles/JsonPath/ const json = {"store": { "book": [ diff --git a/test/test.performance.js b/test/test.performance.js index d241f42d..c19ef933 100644 --- a/test/test.performance.js +++ b/test/test.performance.js @@ -6,27 +6,31 @@ describe('JSONPath - Performance', function () { itemCount = 150, groupCount = 245; + /** + * @typedef {{a: {b: 0, c: 0}, s: {b: {c: number[]}}}[]} Items + */ + const json = { - results: [] + results: + /** @type {{groups: {items: Items, a: string}[], v?: {v: number[]}}[]} */ ( + [] + ) }; - let i, j; - - const bigArray = []; - for (i = 0; i < arraySize; i++) { + const bigArray = /** @type {number[]} */ ([]); + for (let i = 0; i < arraySize; i++) { bigArray[i] = 1; } - const items = []; - for (i = 0; i < itemCount; i++) { - // eslint-disable-next-line unicorn/prefer-structured-clone -- Want JSON - items[i] = JSON.parse(JSON.stringify({a: {b: 0, c: 0}, s: {b: {c: bigArray}}})); + const items = /** @type {Items} */ ([]); + for (let i = 0; i < itemCount; i++) { + items[i] = {a: {b: 0, c: 0}, s: {b: {c: bigArray}}}; } - for (i = 0; i < resultCount; i++) { + for (let i = 0; i < resultCount; i++) { json.results[i] = {groups: [], v: {v: [1, 2, 3, 4, 5, 6, 7, 8]}}; json.results[i].groups = []; - for (j = 0; j < groupCount; j++) { + for (let j = 0; j < groupCount; j++) { json.results[i].groups[j] = {items, a: "121212"}; } } diff --git a/test/test.safe-eval.js b/test/test.safe-eval.js index 6b079a3b..e18f618f 100644 --- a/test/test.safe-eval.js +++ b/test/test.safe-eval.js @@ -1,5 +1,9 @@ import {checkBuiltInVMAndNodeVM} from '../test-helpers/checkVM.js'; +/** + * @import {SandboxCallback} from '../src/jsonpath.js'; + */ + checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { describe(`JSONPath - Eval (${vmType} - safe)`, function () { before(setBuiltInState); @@ -110,11 +114,11 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { const expected = [json.store.book]; const result = jsonpath({ json, - sandbox: { + sandbox: /** @type {{filter: SandboxCallback}} */ ({ filter (arg) { return arg.category === 'reference'; } - }, + }), path: "$..[?(filter(@))]", wrap: false, eval: 'safe' }); @@ -124,6 +128,11 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { describe('cyclic object', () => { // This is not an eval test, but we put it here for parity with item below it('cyclic object without a sandbox', () => { + /** + * @typedef {{a: {b: {c: number}, x?: CircularObj}}} CircularObj + */ + + /** @type {CircularObj} */ const circular = {a: {b: {c: 5}}}; circular.a.x = circular; const expected = circular.a.b; @@ -136,6 +145,12 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { assert.deepEqual(result, expected); }); it('cyclic object in a sandbox', () => { + /** + * @typedef {{ + * category: string, recurse?: CircularObjWithRecurse + * }} CircularObjWithRecurse + */ + /** @type {CircularObjWithRecurse} */ const circular = {category: 'fiction'}; circular.recurse = circular; const expected = json.store.books; @@ -211,7 +226,7 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { }] } }; - const opPathExpecteds = [ + const opPathExpecteds = /** @type {[string, string, unknown[]][]} */ ([ ['|| , ===', '$..[?(@property === "book" || @property === "books")]', [json.store.book, json.store.books]], ['| , &&', '$..[?(@ && (@.shelf === (1 | 2)))]', [json.store.books[1]]], ['^', '$..[?(@ && (@.shelf === (1 ^ 2)))]', [json.store.books[1]]], @@ -233,7 +248,7 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { ['+ (unary)', '$..[?(@ && +@.meta === 12)]', [json.store.book]], ['typeof', '$..[?(@ && typeof @.meta === "number")]', [json.store.books[0]]], ['void', '$..books[?(@.meta === void 0)]', [json.store.books[1]]] - ]; + ]); for (const [operator, path, expected] of opPathExpecteds) { it(`${operator} operator`, () => { const result = jsonpath({ @@ -280,6 +295,7 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { path: pathDoS }); + // @ts-expect-error Won't get here result.toString(); // DoS }, 'constructor is not defined'); }); @@ -302,6 +318,8 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) { }); it("10.4.1 RCE", () => { assert.throws(() => { + // @ts-expect-error VM testing + // eslint-disable-next-line unicorn/no-global-object-property-assignment -- Exploit test globalThis.TEST_10_4_1_RCE = 'not exploited'; const path = "$..[?(@.constructor[( @.getPrototypeOf(@).constructor('globalThis.TEST_10_4_1_RCE=\"RCE\";0')() )])]"; diff --git a/test/test.toPath.js b/test/test.toPath.js index 6541f3dd..000993f9 100644 --- a/test/test.toPath.js +++ b/test/test.toPath.js @@ -31,7 +31,7 @@ describe('JSONPath - toPath*', function () { const json = {foo: {bar: 'baz'}}; const pathArr = jsonpath.toPathArray(originalPath); - assert.strictEqual(pathArr.length, 3); + assert.lengthOf(pathArr, 3); // Shouldn't manipulate pathArr values jsonpath({ @@ -41,7 +41,7 @@ describe('JSONPath - toPath*', function () { resultType: 'value' }); - assert.strictEqual(pathArr.length, 3); + assert.lengthOf(pathArr, 3); const path = jsonpath.toPathString(pathArr); assert.strictEqual(path, originalPath); diff --git a/test/test.type-operators.js b/test/test.type-operators.js index 51a08e78..87746a85 100644 --- a/test/test.type-operators.js +++ b/test/test.type-operators.js @@ -1,6 +1,8 @@ - +/** + * @import {OtherTypeCallback} from '../src/jsonpath.js'; + */ describe('JSONPath - Type Operators', function () { - // tests based on examples at http://goessner.net/articles/jsonpath/ + // tests based on examples at https://goessner.net/articles/jsonpath/ const json = {"store": { "book": [ @@ -68,16 +70,12 @@ describe('JSONPath - Type Operators', function () { it('@other()', () => { const expected = [12.99, 8.99, 22.99]; - /** - * @typedef {any} Value - */ /** * - * @param {Value} val - * @returns {boolean} + * @type {OtherTypeCallback} */ - function endsIn99 (val /* , path, parent, parentPropName */) { - return Boolean((/\.99/u).test(val.toString())); + function endsIn99 (/** @type {number} */ val /* , path, parent, parentPropName */) { + return (/\.99/u).test(val.toString()); } const result = jsonpath({json, path: '$.store.book..*@other()', flatten: true, otherTypeCallback: endsIn99}); assert.deepEqual(result, expected); @@ -136,9 +134,9 @@ describe('JSONPath - Type Operators', function () { nested: { a: true, b: null, - c: [ + c: /** @type {[number, unknown[]]} */ ([ 7, [false, 9] - ] + ]) } }; const expected = [jsonMixed.nested.a, jsonMixed.nested.c[1][0]]; @@ -153,9 +151,9 @@ describe('JSONPath - Type Operators', function () { nested: { a: 50.7, b: null, - c: [ + c: /** @type {[number, unknown[]]} */ ([ 42, [false, 73] - ] + ]) } }; const expected = [jsonMixed.nested.c[0], jsonMixed.nested.c[1][1]]; @@ -169,10 +167,10 @@ describe('JSONPath - Type Operators', function () { const jsonMixed = { nested: { a: 50.7, - b: Number.NEGATIVE_INFINITY, - c: [ - 42, [Number.POSITIVE_INFINITY, 73, Number.NaN] - ] + b: -Infinity, + c: /** @type {[number, unknown[]]} */ ([ + 42, [Infinity, 73, NaN] + ]) } }; const expected = [ diff --git a/tsconfig-prod.json b/tsconfig-prod.json new file mode 100644 index 00000000..5bd19d6b --- /dev/null +++ b/tsconfig-prod.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "emitDeclarationOnly": true, + "noEmit": false, + "rootDir": "src" + }, + "include": [ + "src" + ] +} diff --git a/tsconfig.json b/tsconfig.json index 1c9167a1..ce829ab7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,9 +1,20 @@ { "compilerOptions": { - "lib": ["es2015"] + "lib": ["es2024"], + "types": ["node", "mocha"], + "target": "es2017", + "module": "nodenext", + "allowJs": true, + "checkJs": true, + "declaration": true, + "noEmit": true, + "outDir": "dist", + "skipLibCheck": true }, "include": [ - "src" + "src", "bin", "test-helpers", "test" + // TS bug exporting eslint-config-ash-nazg typedef type with asterisks + // "eslint.config.js", "rollup.config.js" ], "exclude": ["node_modules"] }