diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml
index 32d6451..69b6235 100644
--- a/.github/workflows/nodejs.yml
+++ b/.github/workflows/nodejs.yml
@@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
- node-version: [18.x, 20.x, 22.x, 23.x]
+ node-version: [20.x, 22.x, 23.x, 24.x]
steps:
- name: ๐ checkout
diff --git a/README.md b/README.md
index 79e1af2..b6e63d5 100644
--- a/README.md
+++ b/README.md
@@ -8,24 +8,70 @@ JMESPath is a query language for JSON. It will take a JSON document
as input and transform it into another JSON document
given a JMESPath expression.
-## INSTALLATION
-
-```
+## Table of Contents
+
+- [Installation](#installation)
+- [Usage](#usage)
+ - [ESM (Node.js)](#esm-nodejs)
+ - [CommonJS (Node.js)](#commonjs-nodejs)
+ - [Browser (UMD)](#browser-umd)
+- [API](#api)
+ - [`search(data, expression)`](#searchdata-jsonvalue-expression-string-jsonvalue)
+ - [`compile(expression)`](#compileexpression-string-expressionnodetree)
+- [Extensions](#extensions-to-original-spec)
+- [More Resources](#more-resources)
+- [Experimental Features](#experimental-features)
+
+## Installation
+
+```bash
npm install @jmespath-community/jmespath
```
-## USAGE
+## Usage
-### `search(data: JSONValue, expression: string): JSONValue`
+### ESM (Node.js)
```javascript
import { search } from "@jmespath-community/jmespath";
-search({ foo: { bar: { baz: [0, 1, 2, 3, 4] } } }, "foo.bar.baz[2]");
+const data = { foo: { bar: { baz: [0, 1, 2, 3, 4] } } };
+const result = search(data, "foo.bar.baz[2]");
+
+console.log(result);
+// Outputs: 2
+```
+
+### CommonJS (Node.js)
+
+```javascript
+const { search } = require("@jmespath-community/jmespath");
+
+const data = { foo: { bar: { baz: [0, 1, 2, 3, 4] } } };
+const result = search(data, "foo.bar.baz[2]");
+
+console.log(result);
+// Outputs: 2
+```
+
+### Browser (UMD)
-// OUTPUTS: 2
+You can include the UMD build directly in your HTML file. The library will be available under the `jmespath` global variable.
+
+```html
+
+
```
+## API
+
+### `search(data: JSONValue, expression: string): JSONValue`
+
In the example we gave the `search` function input data of
`{foo: {bar: {baz: [0, 1, 2, 3, 4]}}}` as well as the JMESPath
expression `foo.bar.baz[2]`, and the `search` function evaluated
@@ -83,7 +129,7 @@ import { compile, TreeInterpreter } from "@jmespath-community/jmespath";
const ast = compile("foo.bar");
-TreeInterpreter.search(ast, { foo: { bar: "BAZ" } });
+const result = TreeInterpreter.search(ast, { foo: { bar: "BAZ" } });
// RETURNS: "BAZ"
```
diff --git a/biome.json b/biome.json
index 647ac11..131a5c9 100644
--- a/biome.json
+++ b/biome.json
@@ -1,5 +1,5 @@
{
- "$schema": "https://biomejs.dev/schemas/2.0.6/schema.json",
+ "$schema": "https://biomejs.dev/schemas/2.3.2/schema.json",
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
"files": { "ignoreUnknown": false, "includes": ["**", "!**/dist", "!**/coverage", "!**/test/compliance"] },
"formatter": {
diff --git a/package-lock.json b/package-lock.json
index 3b7d006..380dc25 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,103 +13,23 @@
},
"devDependencies": {
"@biomejs/biome": "2.3.2",
- "@vitest/coverage-v8": "^3.2.4",
- "clean-publish": "^3.4.5",
- "coveralls-next": "^4.2.0",
- "husky": "^6.0.0",
- "lint-staged": "^11.0.0",
- "rimraf": "^3.0.2",
- "shelljs": "^0.8.4",
- "tinybench": "^2.5.1",
+ "@vitest/coverage-v8": "^4.0.6",
+ "clean-publish": "^6.0.1",
+ "coveralls-next": "^5.0.0",
+ "husky": "^9.1.7",
+ "lint-staged": "^16.2.6",
+ "rimraf": "^6.1.0",
+ "shelljs": "^0.10.0",
+ "tinybench": "^5.1.0",
"ts-node": "^10.9.2",
"tsup": "^8.5.0",
"typescript": "^5.9.3",
- "vitest": "^3.2.4"
+ "vitest": "^4.0.6"
},
"engines": {
"node": ">=20.19.0"
}
},
- "node_modules/@ampproject/remapping": {
- "version": "2.3.0",
- "dev": true,
- "license": "Apache-2.0",
- "dependencies": {
- "@jridgewell/gen-mapping": "^0.3.5",
- "@jridgewell/trace-mapping": "^0.3.24"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/@babel/code-frame": {
- "version": "7.22.13",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@babel/highlight": "^7.22.13",
- "chalk": "^2.4.2"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/code-frame/node_modules/ansi-styles": {
- "version": "3.2.1",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "color-convert": "^1.9.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/code-frame/node_modules/chalk": {
- "version": "2.4.2",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "ansi-styles": "^3.2.1",
- "escape-string-regexp": "^1.0.5",
- "supports-color": "^5.3.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/code-frame/node_modules/color-convert": {
- "version": "1.9.3",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "color-name": "1.1.3"
- }
- },
- "node_modules/@babel/code-frame/node_modules/color-name": {
- "version": "1.1.3",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/@babel/code-frame/node_modules/has-flag": {
- "version": "3.0.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/code-frame/node_modules/supports-color": {
- "version": "5.5.0",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "has-flag": "^3.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/@babel/helper-string-parser": {
"version": "7.25.9",
"dev": true,
@@ -126,75 +46,6 @@
"node": ">=6.9.0"
}
},
- "node_modules/@babel/highlight": {
- "version": "7.22.20",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@babel/helper-validator-identifier": "^7.22.20",
- "chalk": "^2.4.2",
- "js-tokens": "^4.0.0"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/highlight/node_modules/ansi-styles": {
- "version": "3.2.1",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "color-convert": "^1.9.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/highlight/node_modules/chalk": {
- "version": "2.4.2",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "ansi-styles": "^3.2.1",
- "escape-string-regexp": "^1.0.5",
- "supports-color": "^5.3.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/highlight/node_modules/color-convert": {
- "version": "1.9.3",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "color-name": "1.1.3"
- }
- },
- "node_modules/@babel/highlight/node_modules/color-name": {
- "version": "1.1.3",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/@babel/highlight/node_modules/has-flag": {
- "version": "3.0.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/highlight/node_modules/supports-color": {
- "version": "5.5.0",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "has-flag": "^3.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/@babel/parser": {
"version": "7.26.3",
"dev": true,
@@ -854,6 +705,29 @@
"node": ">=18"
}
},
+ "node_modules/@isaacs/balanced-match": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz",
+ "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "20 || >=22"
+ }
+ },
+ "node_modules/@isaacs/brace-expansion": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz",
+ "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@isaacs/balanced-match": "^4.0.1"
+ },
+ "engines": {
+ "node": "20 || >=22"
+ }
+ },
"node_modules/@isaacs/cliui": {
"version": "8.0.2",
"dev": true,
@@ -943,14 +817,6 @@
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
- "node_modules/@istanbuljs/schema": {
- "version": "0.1.3",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.8",
"dev": true,
@@ -981,12 +847,16 @@
}
},
"node_modules/@jridgewell/sourcemap-codec": {
- "version": "1.5.0",
+ "version": "1.5.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
"dev": true,
"license": "MIT"
},
"node_modules/@jridgewell/trace-mapping": {
- "version": "0.3.25",
+ "version": "0.3.31",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -996,6 +866,8 @@
},
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
+ "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1008,6 +880,8 @@
},
"node_modules/@nodelib/fs.stat": {
"version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
+ "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
"dev": true,
"license": "MIT",
"engines": {
@@ -1016,6 +890,8 @@
},
"node_modules/@nodelib/fs.walk": {
"version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
+ "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1315,6 +1191,13 @@
"win32"
]
},
+ "node_modules/@standard-schema/spec": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz",
+ "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@tsconfig/node10": {
"version": "1.0.9",
"dev": true,
@@ -1336,13 +1219,14 @@
"license": "MIT"
},
"node_modules/@types/chai": {
- "version": "5.2.2",
- "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.2.tgz",
- "integrity": "sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==",
+ "version": "5.2.3",
+ "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz",
+ "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@types/deep-eql": "*"
+ "@types/deep-eql": "*",
+ "assertion-error": "^2.0.1"
}
},
"node_modules/@types/deep-eql": {
@@ -1370,38 +1254,31 @@
"undici-types": "~7.10.0"
}
},
- "node_modules/@types/parse-json": {
- "version": "4.0.0",
- "dev": true,
- "license": "MIT"
- },
"node_modules/@vitest/coverage-v8": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-3.2.4.tgz",
- "integrity": "sha512-EyF9SXU6kS5Ku/U82E259WSnvg6c8KTjppUncuNdm5QHpe17mwREHnjDzozC8x9MZ0xfBUFSaLkRv4TMA75ALQ==",
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.0.6.tgz",
+ "integrity": "sha512-cv6pFXj9/Otk7q1Ocoj8k3BUVVwnFr3jqcqpwYrU5LkKClU9DpaMEdX+zptx/RyIJS+/VpoxMWmfISXchmVDPQ==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@ampproject/remapping": "^2.3.0",
"@bcoe/v8-coverage": "^1.0.2",
- "ast-v8-to-istanbul": "^0.3.3",
- "debug": "^4.4.1",
+ "@vitest/utils": "4.0.6",
+ "ast-v8-to-istanbul": "^0.3.5",
+ "debug": "^4.4.3",
"istanbul-lib-coverage": "^3.2.2",
"istanbul-lib-report": "^3.0.1",
"istanbul-lib-source-maps": "^5.0.6",
- "istanbul-reports": "^3.1.7",
- "magic-string": "^0.30.17",
+ "istanbul-reports": "^3.2.0",
"magicast": "^0.3.5",
"std-env": "^3.9.0",
- "test-exclude": "^7.0.1",
- "tinyrainbow": "^2.0.0"
+ "tinyrainbow": "^3.0.3"
},
"funding": {
"url": "https://opencollective.com/vitest"
},
"peerDependencies": {
- "@vitest/browser": "3.2.4",
- "vitest": "3.2.4"
+ "@vitest/browser": "4.0.6",
+ "vitest": "4.0.6"
},
"peerDependenciesMeta": {
"@vitest/browser": {
@@ -1410,59 +1287,86 @@
}
},
"node_modules/@vitest/expect": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz",
- "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==",
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.0.6.tgz",
+ "integrity": "sha512-5j8UUlBVhOjhj4lR2Nt9sEV8b4WtbcYh8vnfhTNA2Kn5+smtevzjNq+xlBuVhnFGXiyPPNzGrOVvmyHWkS5QGg==",
"dev": true,
"license": "MIT",
"dependencies": {
+ "@standard-schema/spec": "^1.0.0",
"@types/chai": "^5.2.2",
- "@vitest/spy": "3.2.4",
- "@vitest/utils": "3.2.4",
- "chai": "^5.2.0",
- "tinyrainbow": "^2.0.0"
+ "@vitest/spy": "4.0.6",
+ "@vitest/utils": "4.0.6",
+ "chai": "^6.0.1",
+ "tinyrainbow": "^3.0.3"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/mocker": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.0.6.tgz",
+ "integrity": "sha512-3COEIew5HqdzBFEYN9+u0dT3i/NCwppLnO1HkjGfAP1Vs3vti1Hxm/MvcbC4DAn3Szo1M7M3otiAaT83jvqIjA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/spy": "4.0.6",
+ "estree-walker": "^3.0.3",
+ "magic-string": "^0.30.19"
},
"funding": {
"url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "msw": "^2.4.9",
+ "vite": "^6.0.0 || ^7.0.0-0"
+ },
+ "peerDependenciesMeta": {
+ "msw": {
+ "optional": true
+ },
+ "vite": {
+ "optional": true
+ }
}
},
"node_modules/@vitest/pretty-format": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz",
- "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==",
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.0.6.tgz",
+ "integrity": "sha512-4vptgNkLIA1W1Nn5X4x8rLJBzPiJwnPc+awKtfBE5hNMVsoAl/JCCPPzNrbf+L4NKgklsis5Yp2gYa+XAS442g==",
"dev": true,
"license": "MIT",
"dependencies": {
- "tinyrainbow": "^2.0.0"
+ "tinyrainbow": "^3.0.3"
},
"funding": {
"url": "https://opencollective.com/vitest"
}
},
"node_modules/@vitest/runner": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.4.tgz",
- "integrity": "sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==",
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.0.6.tgz",
+ "integrity": "sha512-trPk5qpd7Jj+AiLZbV/e+KiiaGXZ8ECsRxtnPnCrJr9OW2mLB72Cb824IXgxVz/mVU3Aj4VebY+tDTPn++j1Og==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@vitest/utils": "3.2.4",
- "pathe": "^2.0.3",
- "strip-literal": "^3.0.0"
+ "@vitest/utils": "4.0.6",
+ "pathe": "^2.0.3"
},
"funding": {
"url": "https://opencollective.com/vitest"
}
},
"node_modules/@vitest/snapshot": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.4.tgz",
- "integrity": "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==",
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.0.6.tgz",
+ "integrity": "sha512-PaYLt7n2YzuvxhulDDu6c9EosiRuIE+FI2ECKs6yvHyhoga+2TBWI8dwBjs+IeuQaMtZTfioa9tj3uZb7nev1g==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@vitest/pretty-format": "3.2.4",
- "magic-string": "^0.30.17",
+ "@vitest/pretty-format": "4.0.6",
+ "magic-string": "^0.30.19",
"pathe": "^2.0.3"
},
"funding": {
@@ -1470,28 +1374,24 @@
}
},
"node_modules/@vitest/spy": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz",
- "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==",
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.0.6.tgz",
+ "integrity": "sha512-g9jTUYPV1LtRPRCQfhbMintW7BTQz1n6WXYQYRQ25qkyffA4bjVXjkROokZnv7t07OqfaFKw1lPzqKGk1hmNuQ==",
"dev": true,
"license": "MIT",
- "dependencies": {
- "tinyspy": "^4.0.3"
- },
"funding": {
"url": "https://opencollective.com/vitest"
}
},
"node_modules/@vitest/utils": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz",
- "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==",
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.0.6.tgz",
+ "integrity": "sha512-bG43VS3iYKrMIZXBo+y8Pti0O7uNju3KvNn6DrQWhQQKcLavMB+0NZfO1/QBAEbq0MaQ3QjNsnnXlGQvsh0Z6A==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@vitest/pretty-format": "3.2.4",
- "loupe": "^3.1.4",
- "tinyrainbow": "^2.0.0"
+ "@vitest/pretty-format": "4.0.6",
+ "tinyrainbow": "^3.0.3"
},
"funding": {
"url": "https://opencollective.com/vitest"
@@ -1518,46 +1418,17 @@
"node": ">=0.4.0"
}
},
- "node_modules/aggregate-error": {
- "version": "3.1.0",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "clean-stack": "^2.0.0",
- "indent-string": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/ansi-colors": {
- "version": "4.1.3",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/ansi-escapes": {
- "version": "4.3.2",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.1.1.tgz",
+ "integrity": "sha512-Zhl0ErHcSRUaVfGUeUdDuLgpkEo8KIFjB4Y9uAc46ScOpdDiU1Dbyplh7qWJeJ/ZHpbyMSM26+X3BySgnIz40Q==",
"dev": true,
"license": "MIT",
"dependencies": {
- "type-fest": "^0.21.3"
- },
- "engines": {
- "node": ">=8"
+ "environment": "^1.0.0"
},
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/ansi-escapes/node_modules/type-fest": {
- "version": "0.21.3",
- "dev": true,
- "license": "(MIT OR CC0-1.0)",
"engines": {
- "node": ">=10"
+ "node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@@ -1613,65 +1484,22 @@
}
},
"node_modules/ast-v8-to-istanbul": {
- "version": "0.3.3",
- "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-0.3.3.tgz",
- "integrity": "sha512-MuXMrSLVVoA6sYN/6Hke18vMzrT4TZNbZIj/hvh0fnYFpO+/kFXcLIaiPwXXWaQUPg4yJD8fj+lfJ7/1EBconw==",
+ "version": "0.3.8",
+ "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-0.3.8.tgz",
+ "integrity": "sha512-szgSZqUxI5T8mLKvS7WTjF9is+MVbOeLADU73IseOcrqhxr/VAvy6wfoVE39KnKzA7JRhjF5eUagNlHwvZPlKQ==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@jridgewell/trace-mapping": "^0.3.25",
+ "@jridgewell/trace-mapping": "^0.3.31",
"estree-walker": "^3.0.3",
"js-tokens": "^9.0.1"
}
},
- "node_modules/ast-v8-to-istanbul/node_modules/estree-walker": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
- "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/estree": "^1.0.0"
- }
- },
- "node_modules/ast-v8-to-istanbul/node_modules/js-tokens": {
- "version": "9.0.1",
- "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz",
- "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/astral-regex": {
- "version": "2.0.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/asynckit": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
- "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/balanced-match": {
"version": "1.0.2",
"dev": true,
"license": "MIT"
},
- "node_modules/brace-expansion": {
- "version": "1.1.12",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
- "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
"node_modules/braces": {
"version": "3.0.3",
"dev": true,
@@ -1709,55 +1537,16 @@
"node": ">=8"
}
},
- "node_modules/call-bind-apply-helpers": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
- "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "es-errors": "^1.3.0",
- "function-bind": "^1.1.2"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/callsites": {
- "version": "3.1.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/chai": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/chai/-/chai-5.2.1.tgz",
- "integrity": "sha512-5nFxhUrX0PqtyogoYOA8IPswy5sZFTOsBFl/9bNsmDLgsxYTzSZQJDPppDnZPTQbzSEm0hqGjWPzRemQCYbD6A==",
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.0.tgz",
+ "integrity": "sha512-aUTnJc/JipRzJrNADXVvpVqi6CO0dn3nx4EVPxijri+fj3LUUDyZQOgVeW54Ob3Y1Xh9Iz8f+CgaCl8v0mn9bA==",
"dev": true,
"license": "MIT",
- "dependencies": {
- "assertion-error": "^2.0.1",
- "check-error": "^2.1.1",
- "deep-eql": "^5.0.1",
- "loupe": "^3.1.0",
- "pathval": "^2.0.0"
- },
"engines": {
"node": ">=18"
}
},
- "node_modules/check-error": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz",
- "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 16"
- }
- },
"node_modules/chokidar": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
@@ -1775,69 +1564,122 @@
}
},
"node_modules/clean-publish": {
- "version": "3.4.5",
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/clean-publish/-/clean-publish-6.0.1.tgz",
+ "integrity": "sha512-fDHKQgcGRb/KmmwobfRtLdGm/cWJY3OBGzwZHxTcotb2+AhK0LXMK4oOxqB8lUV5Km6DbciuUwsKdI/qY9uwjw==",
"dev": true,
"license": "MIT",
"dependencies": {
- "cross-spawn": "^7.0.3",
- "fast-glob": "^3.2.7",
- "fs-extra": "^10.0.0",
- "hosted-git-info": "^4.0.2",
- "lilconfig": "^2.0.4"
+ "lilconfig": "^3.1.3",
+ "picomatch": "^4.0.3",
+ "tinyexec": "^1.0.1",
+ "tinyglobby": "^0.2.15"
},
"bin": {
"clean-publish": "clean-publish.js",
"clear-package-json": "clear-package-json.js"
},
"engines": {
- "node": "^12.0.0 || ^14.0.0 || >= 16.0.0"
+ "node": ">= 20.0.0"
}
},
- "node_modules/clean-stack": {
- "version": "2.2.0",
+ "node_modules/clean-publish/node_modules/picomatch": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
+ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"license": "MIT",
"engines": {
- "node": ">=6"
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
}
},
+ "node_modules/clean-publish/node_modules/tinyexec": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.1.tgz",
+ "integrity": "sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/cli-cursor": {
- "version": "3.1.0",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
+ "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
"dev": true,
"license": "MIT",
"dependencies": {
- "restore-cursor": "^3.1.0"
+ "restore-cursor": "^5.0.0"
},
"engines": {
- "node": ">=8"
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/cli-truncate": {
- "version": "2.1.0",
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.1.1.tgz",
+ "integrity": "sha512-SroPvNHxUnk+vIW/dOSfNqdy1sPEFkrTk6TUtqLCnBlo3N7TNYYkzzN7uSD6+jVjrdO4+p8nH7JzH6cIvUem6A==",
"dev": true,
"license": "MIT",
"dependencies": {
- "slice-ansi": "^3.0.0",
- "string-width": "^4.2.0"
+ "slice-ansi": "^7.1.0",
+ "string-width": "^8.0.0"
},
"engines": {
- "node": ">=8"
+ "node": ">=20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/cli-truncate/node_modules/slice-ansi": {
- "version": "3.0.0",
+ "node_modules/cli-truncate/node_modules/ansi-regex": {
+ "version": "6.2.2",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
+ "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/cli-truncate/node_modules/string-width": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.1.0.tgz",
+ "integrity": "sha512-Kxl3KJGb/gxkaUMOjRsQ8IrXiGW75O4E3RPjFIINOVH8AMl2SQ/yWdTzWwF3FevIX9LcMAjJW+GRwAlAbTSXdg==",
"dev": true,
"license": "MIT",
"dependencies": {
- "ansi-styles": "^4.0.0",
- "astral-regex": "^2.0.0",
- "is-fullwidth-code-point": "^3.0.0"
+ "get-east-asian-width": "^1.3.0",
+ "strip-ansi": "^7.1.0"
},
"engines": {
- "node": ">=8"
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/cli-truncate/node_modules/strip-ansi": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",
+ "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
"node_modules/color-convert": {
@@ -1857,28 +1699,22 @@
"license": "MIT"
},
"node_modules/colorette": {
- "version": "1.4.0",
+ "version": "2.0.20",
+ "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz",
+ "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==",
"dev": true,
"license": "MIT"
},
- "node_modules/combined-stream": {
- "version": "1.0.8",
- "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
- "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "node_modules/commander": {
+ "version": "14.0.2",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.2.tgz",
+ "integrity": "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==",
"dev": true,
"license": "MIT",
- "dependencies": {
- "delayed-stream": "~1.0.0"
- },
"engines": {
- "node": ">= 0.8"
+ "node": ">=20"
}
},
- "node_modules/concat-map": {
- "version": "0.0.1",
- "dev": true,
- "license": "MIT"
- },
"node_modules/confbox": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz",
@@ -1896,29 +1732,13 @@
"node": "^14.18.0 || >=16.10.0"
}
},
- "node_modules/cosmiconfig": {
- "version": "7.1.0",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/parse-json": "^4.0.0",
- "import-fresh": "^3.2.1",
- "parse-json": "^5.0.0",
- "path-type": "^4.0.0",
- "yaml": "^1.10.0"
- },
- "engines": {
- "node": ">=10"
- }
- },
"node_modules/coveralls-next": {
- "version": "4.2.2",
- "resolved": "https://registry.npmjs.org/coveralls-next/-/coveralls-next-4.2.2.tgz",
- "integrity": "sha512-Tw1TKXV0+aEfOgRYBN97RtEZlrLxBiZKFkngsupONkJwy0uYQNbB6VfAEnGnOUa5WkW5sBhjGB2tWha6ULrYkw==",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/coveralls-next/-/coveralls-next-5.0.0.tgz",
+ "integrity": "sha512-RCj6Oflf6iQtN3Q5b0SSemEbQBzeBjQlLUrc3bfNECTy83hMJA9krdNZ5GTRm7Jpbyo92yKUbQDP5FYlWcL5sA==",
"dev": true,
"license": "BSD-2-Clause",
"dependencies": {
- "form-data": "4.0.4",
"js-yaml": "4.1.0",
"lcov-parse": "1.0.0",
"log-driver": "1.2.7",
@@ -1950,9 +1770,9 @@
}
},
"node_modules/debug": {
- "version": "4.4.1",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
- "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1967,26 +1787,6 @@
}
}
},
- "node_modules/deep-eql": {
- "version": "5.0.2",
- "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz",
- "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/delayed-stream": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
- "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=0.4.0"
- }
- },
"node_modules/diff": {
"version": "4.0.2",
"dev": true,
@@ -1995,21 +1795,6 @@
"node": ">=0.3.1"
}
},
- "node_modules/dunder-proto": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
- "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "call-bind-apply-helpers": "^1.0.1",
- "es-errors": "^1.3.0",
- "gopd": "^1.2.0"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
"node_modules/eastasianwidth": {
"version": "0.2.0",
"dev": true,
@@ -2020,43 +1805,17 @@
"dev": true,
"license": "MIT"
},
- "node_modules/enquirer": {
- "version": "2.3.6",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "ansi-colors": "^4.1.1"
- },
- "engines": {
- "node": ">=8.6"
- }
- },
- "node_modules/error-ex": {
- "version": "1.3.2",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "is-arrayish": "^0.2.1"
- }
- },
- "node_modules/es-define-property": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
- "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/es-errors": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
- "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "node_modules/environment": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz",
+ "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==",
"dev": true,
"license": "MIT",
"engines": {
- "node": ">= 0.4"
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/es-module-lexer": {
@@ -2066,35 +1825,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/es-object-atoms": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
- "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "es-errors": "^1.3.0"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/es-set-tostringtag": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
- "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "es-errors": "^1.3.0",
- "get-intrinsic": "^1.2.6",
- "has-tostringtag": "^1.0.2",
- "hasown": "^2.0.2"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
"node_modules/esbuild": {
"version": "0.25.6",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.6.tgz",
@@ -2137,16 +1867,27 @@
"@esbuild/win32-x64": "0.25.6"
}
},
- "node_modules/escape-string-regexp": {
- "version": "1.0.5",
+ "node_modules/estree-walker": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
+ "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
"dev": true,
"license": "MIT",
- "engines": {
- "node": ">=0.8.0"
+ "dependencies": {
+ "@types/estree": "^1.0.0"
}
},
+ "node_modules/eventemitter3": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
+ "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/execa": {
"version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2167,6 +1908,29 @@
"url": "https://github.com/sindresorhus/execa?sponsor=1"
}
},
+ "node_modules/execa/node_modules/onetime": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mimic-fn": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/execa/node_modules/signal-exit": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
+ "dev": true,
+ "license": "ISC"
+ },
"node_modules/expect-type": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.2.2.tgz",
@@ -2178,7 +1942,9 @@
}
},
"node_modules/fast-glob": {
- "version": "3.2.12",
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
+ "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2186,14 +1952,16 @@
"@nodelib/fs.walk": "^1.2.3",
"glob-parent": "^5.1.2",
"merge2": "^1.3.0",
- "micromatch": "^4.0.4"
+ "micromatch": "^4.0.8"
},
"engines": {
"node": ">=8.6.0"
}
},
"node_modules/fastq": {
- "version": "1.15.0",
+ "version": "1.19.1",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",
+ "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==",
"dev": true,
"license": "ISC",
"dependencies": {
@@ -2224,11 +1992,13 @@
}
},
"node_modules/foreground-child": {
- "version": "3.3.0",
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz",
+ "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==",
"dev": true,
"license": "ISC",
"dependencies": {
- "cross-spawn": "^7.0.0",
+ "cross-spawn": "^7.0.6",
"signal-exit": "^4.0.1"
},
"engines": {
@@ -2238,52 +2008,6 @@
"url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/foreground-child/node_modules/signal-exit": {
- "version": "4.1.0",
- "dev": true,
- "license": "ISC",
- "engines": {
- "node": ">=14"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/form-data": {
- "version": "4.0.4",
- "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz",
- "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "asynckit": "^0.4.0",
- "combined-stream": "^1.0.8",
- "es-set-tostringtag": "^2.1.0",
- "hasown": "^2.0.2",
- "mime-types": "^2.1.12"
- },
- "engines": {
- "node": ">= 6"
- }
- },
- "node_modules/fs-extra": {
- "version": "10.1.0",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "graceful-fs": "^4.2.0",
- "jsonfile": "^6.0.1",
- "universalify": "^2.0.0"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/fs.realpath": {
- "version": "1.0.0",
- "dev": true,
- "license": "ISC"
- },
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
@@ -2299,62 +2023,23 @@
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
- "node_modules/function-bind": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
- "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
- "dev": true,
- "license": "MIT",
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/get-intrinsic": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
- "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
+ "node_modules/get-east-asian-width": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz",
+ "integrity": "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==",
"dev": true,
"license": "MIT",
- "dependencies": {
- "call-bind-apply-helpers": "^1.0.2",
- "es-define-property": "^1.0.1",
- "es-errors": "^1.3.0",
- "es-object-atoms": "^1.1.1",
- "function-bind": "^1.1.2",
- "get-proto": "^1.0.1",
- "gopd": "^1.2.0",
- "has-symbols": "^1.1.0",
- "hasown": "^2.0.2",
- "math-intrinsics": "^1.1.0"
- },
"engines": {
- "node": ">= 0.4"
+ "node": ">=18"
},
"funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/get-own-enumerable-property-symbols": {
- "version": "3.0.2",
- "dev": true,
- "license": "ISC"
- },
- "node_modules/get-proto": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
- "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "dunder-proto": "^1.0.1",
- "es-object-atoms": "^1.0.0"
- },
- "engines": {
- "node": ">= 0.4"
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/get-stream": {
"version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
"dev": true,
"license": "MIT",
"engines": {
@@ -2365,19 +2050,24 @@
}
},
"node_modules/glob": {
- "version": "7.2.3",
+ "version": "11.0.3",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz",
+ "integrity": "sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==",
"dev": true,
"license": "ISC",
"dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.1.1",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
+ "foreground-child": "^3.3.1",
+ "jackspeak": "^4.1.1",
+ "minimatch": "^10.0.3",
+ "minipass": "^7.1.2",
+ "package-json-from-dist": "^1.0.0",
+ "path-scurry": "^2.0.0"
+ },
+ "bin": {
+ "glob": "dist/esm/bin.mjs"
},
"engines": {
- "node": "*"
+ "node": "20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
@@ -2385,6 +2075,8 @@
},
"node_modules/glob-parent": {
"version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true,
"license": "ISC",
"dependencies": {
@@ -2394,103 +2086,60 @@
"node": ">= 6"
}
},
- "node_modules/gopd": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
- "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/graceful-fs": {
- "version": "4.2.10",
- "dev": true,
- "license": "ISC"
- },
- "node_modules/has": {
- "version": "1.0.3",
+ "node_modules/glob/node_modules/jackspeak": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz",
+ "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==",
"dev": true,
- "license": "MIT",
+ "license": "BlueOak-1.0.0",
"dependencies": {
- "function-bind": "^1.1.1"
+ "@isaacs/cliui": "^8.0.2"
},
"engines": {
- "node": ">= 0.4.0"
- }
- },
- "node_modules/has-flag": {
- "version": "4.0.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/has-symbols": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
- "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 0.4"
+ "node": "20 || >=22"
},
"funding": {
- "url": "https://github.com/sponsors/ljharb"
+ "url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/has-tostringtag": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
- "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
+ "node_modules/glob/node_modules/path-scurry": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz",
+ "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==",
"dev": true,
- "license": "MIT",
+ "license": "BlueOak-1.0.0",
"dependencies": {
- "has-symbols": "^1.0.3"
+ "lru-cache": "^11.0.0",
+ "minipass": "^7.1.2"
},
"engines": {
- "node": ">= 0.4"
+ "node": "20 || >=22"
},
"funding": {
- "url": "https://github.com/sponsors/ljharb"
+ "url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/hasown": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
- "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
+ "node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"license": "MIT",
- "dependencies": {
- "function-bind": "^1.1.2"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/hosted-git-info": {
- "version": "4.1.0",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "lru-cache": "^6.0.0"
- },
"engines": {
- "node": ">=10"
+ "node": ">=8"
}
},
"node_modules/html-escaper": {
"version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
+ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
"dev": true,
"license": "MIT"
},
"node_modules/human-signals": {
"version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
+ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
"dev": true,
"license": "Apache-2.0",
"engines": {
@@ -2498,79 +2147,25 @@
}
},
"node_modules/husky": {
- "version": "6.0.0",
+ "version": "9.1.7",
+ "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz",
+ "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==",
"dev": true,
"license": "MIT",
"bin": {
- "husky": "lib/bin.js"
+ "husky": "bin.js"
+ },
+ "engines": {
+ "node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/typicode"
}
},
- "node_modules/import-fresh": {
- "version": "3.3.0",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "parent-module": "^1.0.0",
- "resolve-from": "^4.0.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/indent-string": {
- "version": "4.0.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/inflight": {
- "version": "1.0.6",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "node_modules/inherits": {
- "version": "2.0.4",
- "dev": true,
- "license": "ISC"
- },
- "node_modules/interpret": {
- "version": "1.4.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 0.10"
- }
- },
- "node_modules/is-arrayish": {
- "version": "0.2.1",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/is-core-module": {
- "version": "2.11.0",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "has": "^1.0.3"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-extglob": {
- "version": "2.1.1",
+ "node_modules/is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"dev": true,
"license": "MIT",
"engines": {
@@ -2587,6 +2182,8 @@
},
"node_modules/is-glob": {
"version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2604,24 +2201,10 @@
"node": ">=0.12.0"
}
},
- "node_modules/is-obj": {
- "version": "1.0.1",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/is-regexp": {
- "version": "1.0.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/is-stream": {
"version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
+ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
"dev": true,
"license": "MIT",
"engines": {
@@ -2646,6 +2229,8 @@
},
"node_modules/istanbul-lib-report": {
"version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz",
+ "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==",
"dev": true,
"license": "BSD-3-Clause",
"dependencies": {
@@ -2657,20 +2242,6 @@
"node": ">=10"
}
},
- "node_modules/istanbul-lib-report/node_modules/make-dir": {
- "version": "4.0.0",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "semver": "^7.5.3"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/istanbul-lib-source-maps": {
"version": "5.0.6",
"dev": true,
@@ -2685,7 +2256,9 @@
}
},
"node_modules/istanbul-reports": {
- "version": "3.1.7",
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz",
+ "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==",
"dev": true,
"license": "BSD-3-Clause",
"dependencies": {
@@ -2721,7 +2294,9 @@
}
},
"node_modules/js-tokens": {
- "version": "4.0.0",
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz",
+ "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==",
"dev": true,
"license": "MIT"
},
@@ -2736,22 +2311,6 @@
"js-yaml": "bin/js-yaml.js"
}
},
- "node_modules/json-parse-even-better-errors": {
- "version": "2.3.1",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/jsonfile": {
- "version": "6.1.0",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "universalify": "^2.0.0"
- },
- "optionalDependencies": {
- "graceful-fs": "^4.1.6"
- }
- },
"node_modules/lcov-parse": {
"version": "1.0.0",
"dev": true,
@@ -2761,11 +2320,16 @@
}
},
"node_modules/lilconfig": {
- "version": "2.1.0",
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz",
+ "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==",
"dev": true,
"license": "MIT",
"engines": {
- "node": ">=10"
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antonk52"
}
},
"node_modules/lines-and-columns": {
@@ -2774,85 +2338,48 @@
"license": "MIT"
},
"node_modules/lint-staged": {
- "version": "11.2.6",
+ "version": "16.2.6",
+ "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-16.2.6.tgz",
+ "integrity": "sha512-s1gphtDbV4bmW1eylXpVMk2u7is7YsrLl8hzrtvC70h4ByhcMLZFY01Fx05ZUDNuv1H8HO4E+e2zgejV1jVwNw==",
"dev": true,
"license": "MIT",
"dependencies": {
- "cli-truncate": "2.1.0",
- "colorette": "^1.4.0",
- "commander": "^8.2.0",
- "cosmiconfig": "^7.0.1",
- "debug": "^4.3.2",
- "enquirer": "^2.3.6",
- "execa": "^5.1.1",
- "listr2": "^3.12.2",
- "micromatch": "^4.0.4",
- "normalize-path": "^3.0.0",
- "please-upgrade-node": "^3.2.0",
- "string-argv": "0.3.1",
- "stringify-object": "3.3.0",
- "supports-color": "8.1.1"
+ "commander": "^14.0.1",
+ "listr2": "^9.0.5",
+ "micromatch": "^4.0.8",
+ "nano-spawn": "^2.0.0",
+ "pidtree": "^0.6.0",
+ "string-argv": "^0.3.2",
+ "yaml": "^2.8.1"
},
"bin": {
"lint-staged": "bin/lint-staged.js"
},
- "funding": {
- "url": "https://opencollective.com/lint-staged"
- }
- },
- "node_modules/lint-staged/node_modules/commander": {
- "version": "8.3.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 12"
- }
- },
- "node_modules/lint-staged/node_modules/supports-color": {
- "version": "8.1.1",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "has-flag": "^4.0.0"
- },
"engines": {
- "node": ">=10"
+ "node": ">=20.17"
},
"funding": {
- "url": "https://github.com/chalk/supports-color?sponsor=1"
+ "url": "https://opencollective.com/lint-staged"
}
},
"node_modules/listr2": {
- "version": "3.14.0",
+ "version": "9.0.5",
+ "resolved": "https://registry.npmjs.org/listr2/-/listr2-9.0.5.tgz",
+ "integrity": "sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==",
"dev": true,
"license": "MIT",
"dependencies": {
- "cli-truncate": "^2.1.0",
- "colorette": "^2.0.16",
- "log-update": "^4.0.0",
- "p-map": "^4.0.0",
- "rfdc": "^1.3.0",
- "rxjs": "^7.5.1",
- "through": "^2.3.8",
- "wrap-ansi": "^7.0.0"
+ "cli-truncate": "^5.0.0",
+ "colorette": "^2.0.20",
+ "eventemitter3": "^5.0.1",
+ "log-update": "^6.1.0",
+ "rfdc": "^1.4.1",
+ "wrap-ansi": "^9.0.0"
},
"engines": {
- "node": ">=10.0.0"
- },
- "peerDependencies": {
- "enquirer": ">= 2.3.0 < 3"
- },
- "peerDependenciesMeta": {
- "enquirer": {
- "optional": true
- }
+ "node": ">=20.0.0"
}
},
- "node_modules/listr2/node_modules/colorette": {
- "version": "2.0.19",
- "dev": true,
- "license": "MIT"
- },
"node_modules/load-tsconfig": {
"version": "0.2.5",
"resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz",
@@ -2879,59 +2406,72 @@
}
},
"node_modules/log-update": {
- "version": "4.0.0",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz",
+ "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==",
"dev": true,
"license": "MIT",
"dependencies": {
- "ansi-escapes": "^4.3.0",
- "cli-cursor": "^3.1.0",
- "slice-ansi": "^4.0.0",
- "wrap-ansi": "^6.2.0"
+ "ansi-escapes": "^7.0.0",
+ "cli-cursor": "^5.0.0",
+ "slice-ansi": "^7.1.0",
+ "strip-ansi": "^7.1.0",
+ "wrap-ansi": "^9.0.0"
},
"engines": {
- "node": ">=10"
+ "node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/log-update/node_modules/wrap-ansi": {
- "version": "6.2.0",
+ "node_modules/log-update/node_modules/ansi-regex": {
+ "version": "6.2.2",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
+ "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
"dev": true,
"license": "MIT",
- "dependencies": {
- "ansi-styles": "^4.0.0",
- "string-width": "^4.1.0",
- "strip-ansi": "^6.0.0"
- },
"engines": {
- "node": ">=8"
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
}
},
- "node_modules/loupe": {
- "version": "3.1.4",
- "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.4.tgz",
- "integrity": "sha512-wJzkKwJrheKtknCOKNEtDK4iqg/MxmZheEMtSTYvnzRdEYaZzmgH976nenp8WdJRdx5Vc1X/9MO0Oszl6ezeXg==",
+ "node_modules/log-update/node_modules/strip-ansi": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",
+ "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
},
"node_modules/lru-cache": {
- "version": "6.0.0",
+ "version": "11.2.2",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.2.tgz",
+ "integrity": "sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==",
"dev": true,
"license": "ISC",
- "dependencies": {
- "yallist": "^4.0.0"
- },
"engines": {
- "node": ">=10"
+ "node": "20 || >=22"
}
},
"node_modules/magic-string": {
- "version": "0.30.17",
+ "version": "0.30.21",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
+ "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@jridgewell/sourcemap-codec": "^1.5.0"
+ "@jridgewell/sourcemap-codec": "^1.5.5"
}
},
"node_modules/magicast": {
@@ -2944,28 +2484,38 @@
"source-map-js": "^1.2.0"
}
},
- "node_modules/make-error": {
- "version": "1.3.6",
- "dev": true,
- "license": "ISC"
- },
- "node_modules/math-intrinsics": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
- "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
+ "node_modules/make-dir": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz",
+ "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==",
"dev": true,
"license": "MIT",
+ "dependencies": {
+ "semver": "^7.5.3"
+ },
"engines": {
- "node": ">= 0.4"
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/make-error": {
+ "version": "1.3.6",
+ "dev": true,
+ "license": "ISC"
+ },
"node_modules/merge-stream": {
"version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
+ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
"dev": true,
"license": "MIT"
},
"node_modules/merge2": {
"version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
+ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
"dev": true,
"license": "MIT",
"engines": {
@@ -2984,46 +2534,43 @@
"node": ">=8.6"
}
},
- "node_modules/mime-db": {
- "version": "1.52.0",
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
- "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/mime-types": {
- "version": "2.1.35",
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
- "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "node_modules/mimic-fn": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
"dev": true,
"license": "MIT",
- "dependencies": {
- "mime-db": "1.52.0"
- },
"engines": {
- "node": ">= 0.6"
+ "node": ">=6"
}
},
- "node_modules/mimic-fn": {
- "version": "2.1.0",
+ "node_modules/mimic-function": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz",
+ "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==",
"dev": true,
"license": "MIT",
"engines": {
- "node": ">=6"
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/minimatch": {
- "version": "3.1.2",
+ "version": "10.1.1",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz",
+ "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==",
"dev": true,
- "license": "ISC",
+ "license": "BlueOak-1.0.0",
"dependencies": {
- "brace-expansion": "^1.1.7"
+ "@isaacs/brace-expansion": "^5.0.0"
},
"engines": {
- "node": "*"
+ "node": "20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/minimist": {
@@ -3074,6 +2621,19 @@
"thenify-all": "^1.0.0"
}
},
+ "node_modules/nano-spawn": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/nano-spawn/-/nano-spawn-2.0.0.tgz",
+ "integrity": "sha512-tacvGzUY5o2D8CBh2rrwxyNojUsZNU2zjNTzKQrkgGJQTbGAfArVWXSKMBokBeeg6C7OLRGUEyoFlYbfeWQIqw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.17"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/nano-spawn?sponsor=1"
+ }
+ },
"node_modules/nanoid": {
"version": "3.3.11",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
@@ -3093,16 +2653,10 @@
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
- "node_modules/normalize-path": {
- "version": "3.0.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/npm-run-path": {
"version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
+ "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -3122,37 +2676,17 @@
"node": ">=0.10.0"
}
},
- "node_modules/once": {
- "version": "1.4.0",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "wrappy": "1"
- }
- },
"node_modules/onetime": {
- "version": "5.1.2",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "mimic-fn": "^2.1.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/p-map": {
- "version": "4.0.0",
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
+ "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
"dev": true,
"license": "MIT",
"dependencies": {
- "aggregate-error": "^3.0.0"
+ "mimic-function": "^5.0.0"
},
"engines": {
- "node": ">=10"
+ "node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@@ -3163,83 +2697,34 @@
"dev": true,
"license": "BlueOak-1.0.0"
},
- "node_modules/parent-module": {
- "version": "1.0.1",
+ "node_modules/path-key": {
+ "version": "3.1.1",
"dev": true,
"license": "MIT",
- "dependencies": {
- "callsites": "^3.0.0"
- },
"engines": {
- "node": ">=6"
+ "node": ">=8"
}
},
- "node_modules/parse-json": {
- "version": "5.2.0",
+ "node_modules/path-scurry": {
+ "version": "1.11.1",
"dev": true,
- "license": "MIT",
+ "license": "BlueOak-1.0.0",
"dependencies": {
- "@babel/code-frame": "^7.0.0",
- "error-ex": "^1.3.1",
- "json-parse-even-better-errors": "^2.3.0",
- "lines-and-columns": "^1.1.6"
+ "lru-cache": "^10.2.0",
+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
},
"engines": {
- "node": ">=8"
+ "node": ">=16 || 14 >=14.18"
},
"funding": {
- "url": "https://github.com/sponsors/sindresorhus"
+ "url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/path-is-absolute": {
- "version": "1.0.1",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/path-key": {
- "version": "3.1.1",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/path-parse": {
- "version": "1.0.7",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/path-scurry": {
- "version": "1.11.1",
- "dev": true,
- "license": "BlueOak-1.0.0",
- "dependencies": {
- "lru-cache": "^10.2.0",
- "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
- },
- "engines": {
- "node": ">=16 || 14 >=14.18"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/path-scurry/node_modules/lru-cache": {
- "version": "10.4.3",
+ "node_modules/path-scurry/node_modules/lru-cache": {
+ "version": "10.4.3",
"dev": true,
"license": "ISC"
},
- "node_modules/path-type": {
- "version": "4.0.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/pathe": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
@@ -3247,16 +2732,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/pathval": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz",
- "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 14.16"
- }
- },
"node_modules/picocolors": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
@@ -3275,6 +2750,19 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
+ "node_modules/pidtree": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz",
+ "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "pidtree": "bin/pidtree.js"
+ },
+ "engines": {
+ "node": ">=0.10"
+ }
+ },
"node_modules/pirates": {
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz",
@@ -3297,14 +2785,6 @@
"pathe": "^2.0.1"
}
},
- "node_modules/please-upgrade-node": {
- "version": "3.2.0",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "semver-compare": "^1.0.0"
- }
- },
"node_modules/postcss": {
"version": "8.5.6",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz",
@@ -3346,6 +2826,8 @@
},
"node_modules/queue-microtask": {
"version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
+ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
"dev": true,
"funding": [
{
@@ -3377,54 +2859,27 @@
"url": "https://paulmillr.com/funding/"
}
},
- "node_modules/rechoir": {
- "version": "0.6.2",
- "dev": true,
- "dependencies": {
- "resolve": "^1.1.6"
- },
- "engines": {
- "node": ">= 0.10"
- }
- },
- "node_modules/resolve": {
- "version": "1.22.1",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "is-core-module": "^2.9.0",
- "path-parse": "^1.0.7",
- "supports-preserve-symlinks-flag": "^1.0.0"
- },
- "bin": {
- "resolve": "bin/resolve"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/resolve-from": {
- "version": "4.0.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/restore-cursor": {
- "version": "3.1.0",
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
+ "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "onetime": "^5.1.0",
- "signal-exit": "^3.0.2"
+ "onetime": "^7.0.0",
+ "signal-exit": "^4.1.0"
},
"engines": {
- "node": ">=8"
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/reusify": {
- "version": "1.0.4",
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
+ "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
"dev": true,
"license": "MIT",
"engines": {
@@ -3433,19 +2888,27 @@
}
},
"node_modules/rfdc": {
- "version": "1.3.0",
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz",
+ "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==",
"dev": true,
"license": "MIT"
},
"node_modules/rimraf": {
- "version": "3.0.2",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.0.tgz",
+ "integrity": "sha512-DxdlA1bdNzkZK7JiNWH+BAx1x4tEJWoTofIopFo6qWUU94jYrFZ0ubY05TqH3nWPJ1nKa1JWVFDINZ3fnrle/A==",
"dev": true,
- "license": "ISC",
+ "license": "BlueOak-1.0.0",
"dependencies": {
- "glob": "^7.1.3"
+ "glob": "^11.0.3",
+ "package-json-from-dist": "^1.0.1"
},
"bin": {
- "rimraf": "bin.js"
+ "rimraf": "dist/esm/bin.mjs"
+ },
+ "engines": {
+ "node": "20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
@@ -3493,6 +2956,8 @@
},
"node_modules/run-parallel": {
"version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
+ "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
"dev": true,
"funding": [
{
@@ -3513,16 +2978,10 @@
"queue-microtask": "^1.2.2"
}
},
- "node_modules/rxjs": {
- "version": "7.8.0",
- "dev": true,
- "license": "Apache-2.0",
- "dependencies": {
- "tslib": "^2.1.0"
- }
- },
"node_modules/semver": {
- "version": "7.6.3",
+ "version": "7.7.3",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz",
+ "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==",
"dev": true,
"license": "ISC",
"bin": {
@@ -3532,11 +2991,6 @@
"node": ">=10"
}
},
- "node_modules/semver-compare": {
- "version": "1.0.0",
- "dev": true,
- "license": "MIT"
- },
"node_modules/shebang-command": {
"version": "2.0.0",
"dev": true,
@@ -3557,47 +3011,85 @@
}
},
"node_modules/shelljs": {
- "version": "0.8.5",
+ "version": "0.10.0",
+ "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.10.0.tgz",
+ "integrity": "sha512-Jex+xw5Mg2qMZL3qnzXIfaxEtBaC4n7xifqaqtrZDdlheR70OGkydrPJWT0V1cA1k3nanC86x9FwAmQl6w3Klw==",
"dev": true,
"license": "BSD-3-Clause",
"dependencies": {
- "glob": "^7.0.0",
- "interpret": "^1.0.0",
- "rechoir": "^0.6.2"
- },
- "bin": {
- "shjs": "bin/shjs"
+ "execa": "^5.1.1",
+ "fast-glob": "^3.3.2"
},
"engines": {
- "node": ">=4"
+ "node": ">=18"
}
},
"node_modules/siginfo": {
"version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
+ "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
"dev": true,
"license": "ISC"
},
"node_modules/signal-exit": {
- "version": "3.0.7",
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
"dev": true,
- "license": "ISC"
+ "license": "ISC",
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
},
"node_modules/slice-ansi": {
- "version": "4.0.0",
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz",
+ "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==",
"dev": true,
"license": "MIT",
"dependencies": {
- "ansi-styles": "^4.0.0",
- "astral-regex": "^2.0.0",
- "is-fullwidth-code-point": "^3.0.0"
+ "ansi-styles": "^6.2.1",
+ "is-fullwidth-code-point": "^5.0.0"
},
"engines": {
- "node": ">=10"
+ "node": ">=18"
},
"funding": {
"url": "https://github.com/chalk/slice-ansi?sponsor=1"
}
},
+ "node_modules/slice-ansi/node_modules/ansi-styles": {
+ "version": "6.2.3",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
+ "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz",
+ "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "get-east-asian-width": "^1.3.1"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/source-map-js": {
"version": "1.2.1",
"dev": true,
@@ -3608,18 +3100,22 @@
},
"node_modules/stackback": {
"version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
+ "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",
"dev": true,
"license": "MIT"
},
"node_modules/std-env": {
- "version": "3.9.0",
- "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.9.0.tgz",
- "integrity": "sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==",
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz",
+ "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==",
"dev": true,
"license": "MIT"
},
"node_modules/string-argv": {
- "version": "0.3.1",
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz",
+ "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==",
"dev": true,
"license": "MIT",
"engines": {
@@ -3653,19 +3149,6 @@
"node": ">=8"
}
},
- "node_modules/stringify-object": {
- "version": "3.3.0",
- "dev": true,
- "license": "BSD-2-Clause",
- "dependencies": {
- "get-own-enumerable-property-symbols": "^3.0.0",
- "is-obj": "^1.0.1",
- "is-regexp": "^1.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/strip-ansi": {
"version": "6.0.1",
"dev": true,
@@ -3691,32 +3174,14 @@
},
"node_modules/strip-final-newline": {
"version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
+ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=6"
}
},
- "node_modules/strip-literal": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.0.0.tgz",
- "integrity": "sha512-TcccoMhJOM3OebGhSBEmp3UZ2SfDMZUEBdRA/9ynfLi8yYajyWX3JiXArcJt4Umh4vISpspkQIY8ZZoCqjbviA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "js-tokens": "^9.0.1"
- },
- "funding": {
- "url": "https://github.com/sponsors/antfu"
- }
- },
- "node_modules/strip-literal/node_modules/js-tokens": {
- "version": "9.0.1",
- "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz",
- "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/sucrase": {
"version": "3.35.0",
"resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz",
@@ -3799,6 +3264,8 @@
},
"node_modules/supports-color": {
"version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -3808,73 +3275,6 @@
"node": ">=8"
}
},
- "node_modules/supports-preserve-symlinks-flag": {
- "version": "1.0.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/test-exclude": {
- "version": "7.0.1",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "@istanbuljs/schema": "^0.1.2",
- "glob": "^10.4.1",
- "minimatch": "^9.0.4"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/test-exclude/node_modules/brace-expansion": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
- "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "balanced-match": "^1.0.0"
- }
- },
- "node_modules/test-exclude/node_modules/glob": {
- "version": "10.4.5",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "foreground-child": "^3.1.0",
- "jackspeak": "^3.1.2",
- "minimatch": "^9.0.4",
- "minipass": "^7.1.2",
- "package-json-from-dist": "^1.0.0",
- "path-scurry": "^1.11.1"
- },
- "bin": {
- "glob": "dist/esm/bin.mjs"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/test-exclude/node_modules/minimatch": {
- "version": "9.0.5",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "brace-expansion": "^2.0.1"
- },
- "engines": {
- "node": ">=16 || 14 >=14.17"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
"node_modules/thenify": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz",
@@ -3898,15 +3298,15 @@
"node": ">=0.8"
}
},
- "node_modules/through": {
- "version": "2.3.8",
- "dev": true,
- "license": "MIT"
- },
"node_modules/tinybench": {
- "version": "2.9.0",
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-5.1.0.tgz",
+ "integrity": "sha512-LXKNtFualiKOm6gADe1UXPtf8+Nfn1CtPMEHAT33Fd2YjQatrujkDcK0+4wRC1X6t7fxUDXUs6BsvuIgfkDgDg==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.0.0"
+ }
},
"node_modules/tinyexec": {
"version": "0.3.2",
@@ -3961,28 +3361,10 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
- "node_modules/tinypool": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz",
- "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": "^18.0.0 || >=20.0.0"
- }
- },
"node_modules/tinyrainbow": {
- "version": "2.0.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=14.0.0"
- }
- },
- "node_modules/tinyspy": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.3.tgz",
- "integrity": "sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==",
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.0.3.tgz",
+ "integrity": "sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q==",
"dev": true,
"license": "MIT",
"engines": {
@@ -4071,13 +3453,6 @@
}
}
},
- "node_modules/tslib": {
- "version": "2.8.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
- "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
- "dev": true,
- "license": "0BSD"
- },
"node_modules/tsup": {
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.0.tgz",
@@ -4131,19 +3506,6 @@
}
}
},
- "node_modules/tsup/node_modules/lilconfig": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz",
- "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=14"
- },
- "funding": {
- "url": "https://github.com/sponsors/antonk52"
- }
- },
"node_modules/tsup/node_modules/postcss-load-config": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz",
@@ -4210,21 +3572,6 @@
"node": ">= 8"
}
},
- "node_modules/tsup/node_modules/yaml": {
- "version": "2.8.1",
- "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz",
- "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==",
- "dev": true,
- "license": "ISC",
- "optional": true,
- "peer": true,
- "bin": {
- "yaml": "bin.mjs"
- },
- "engines": {
- "node": ">= 14.6"
- }
- },
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
@@ -4254,77 +3601,15 @@
"license": "MIT",
"peer": true
},
- "node_modules/universalify": {
- "version": "2.0.0",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 10.0.0"
- }
- },
"node_modules/v8-compile-cache-lib": {
"version": "3.0.1",
"dev": true,
"license": "MIT"
},
- "node_modules/vite-node": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz",
- "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "cac": "^6.7.14",
- "debug": "^4.4.1",
- "es-module-lexer": "^1.7.0",
- "pathe": "^2.0.3",
- "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0"
- },
- "bin": {
- "vite-node": "vite-node.mjs"
- },
- "engines": {
- "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
- },
- "node_modules/vite-node/node_modules/fdir": {
- "version": "6.5.0",
- "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
- "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=12.0.0"
- },
- "peerDependencies": {
- "picomatch": "^3 || ^4"
- },
- "peerDependenciesMeta": {
- "picomatch": {
- "optional": true
- }
- }
- },
- "node_modules/vite-node/node_modules/picomatch": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
- "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/sponsors/jonschlinkert"
- }
- },
- "node_modules/vite-node/node_modules/vite": {
- "version": "7.1.11",
- "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz",
- "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==",
+ "node_modules/vite": {
+ "version": "7.1.12",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.12.tgz",
+ "integrity": "sha512-ZWyE8YXEXqJrrSLvYgrRP7p62OziLW7xI5HYGWFzOvupfAlrLvURSzv/FyGyy0eidogEM3ujU+kUG1zuHgb6Ug==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -4396,132 +3681,7 @@
}
}
},
- "node_modules/vite-node/node_modules/yaml": {
- "version": "2.8.1",
- "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz",
- "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==",
- "dev": true,
- "license": "ISC",
- "optional": true,
- "peer": true,
- "bin": {
- "yaml": "bin.mjs"
- },
- "engines": {
- "node": ">= 14.6"
- }
- },
- "node_modules/vitest": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.4.tgz",
- "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/chai": "^5.2.2",
- "@vitest/expect": "3.2.4",
- "@vitest/mocker": "3.2.4",
- "@vitest/pretty-format": "^3.2.4",
- "@vitest/runner": "3.2.4",
- "@vitest/snapshot": "3.2.4",
- "@vitest/spy": "3.2.4",
- "@vitest/utils": "3.2.4",
- "chai": "^5.2.0",
- "debug": "^4.4.1",
- "expect-type": "^1.2.1",
- "magic-string": "^0.30.17",
- "pathe": "^2.0.3",
- "picomatch": "^4.0.2",
- "std-env": "^3.9.0",
- "tinybench": "^2.9.0",
- "tinyexec": "^0.3.2",
- "tinyglobby": "^0.2.14",
- "tinypool": "^1.1.1",
- "tinyrainbow": "^2.0.0",
- "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0",
- "vite-node": "3.2.4",
- "why-is-node-running": "^2.3.0"
- },
- "bin": {
- "vitest": "vitest.mjs"
- },
- "engines": {
- "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- },
- "peerDependencies": {
- "@edge-runtime/vm": "*",
- "@types/debug": "^4.1.12",
- "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
- "@vitest/browser": "3.2.4",
- "@vitest/ui": "3.2.4",
- "happy-dom": "*",
- "jsdom": "*"
- },
- "peerDependenciesMeta": {
- "@edge-runtime/vm": {
- "optional": true
- },
- "@types/debug": {
- "optional": true
- },
- "@types/node": {
- "optional": true
- },
- "@vitest/browser": {
- "optional": true
- },
- "@vitest/ui": {
- "optional": true
- },
- "happy-dom": {
- "optional": true
- },
- "jsdom": {
- "optional": true
- }
- }
- },
- "node_modules/vitest/node_modules/@vitest/mocker": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.4.tgz",
- "integrity": "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@vitest/spy": "3.2.4",
- "estree-walker": "^3.0.3",
- "magic-string": "^0.30.17"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- },
- "peerDependencies": {
- "msw": "^2.4.9",
- "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0"
- },
- "peerDependenciesMeta": {
- "msw": {
- "optional": true
- },
- "vite": {
- "optional": true
- }
- }
- },
- "node_modules/vitest/node_modules/estree-walker": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
- "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/estree": "^1.0.0"
- }
- },
- "node_modules/vitest/node_modules/fdir": {
+ "node_modules/vite/node_modules/fdir": {
"version": "6.5.0",
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
"integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
@@ -4539,7 +3699,7 @@
}
}
},
- "node_modules/vitest/node_modules/picomatch": {
+ "node_modules/vite/node_modules/picomatch": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
@@ -4552,96 +3712,104 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
- "node_modules/vitest/node_modules/vite": {
- "version": "7.1.11",
- "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz",
- "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==",
+ "node_modules/vitest": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.0.6.tgz",
+ "integrity": "sha512-gR7INfiVRwnEOkCk47faros/9McCZMp5LM+OMNWGLaDBSvJxIzwjgNFufkuePBNaesGRnLmNfW+ddbUJRZn0nQ==",
"dev": true,
"license": "MIT",
"dependencies": {
- "esbuild": "^0.25.0",
- "fdir": "^6.5.0",
+ "@vitest/expect": "4.0.6",
+ "@vitest/mocker": "4.0.6",
+ "@vitest/pretty-format": "4.0.6",
+ "@vitest/runner": "4.0.6",
+ "@vitest/snapshot": "4.0.6",
+ "@vitest/spy": "4.0.6",
+ "@vitest/utils": "4.0.6",
+ "debug": "^4.4.3",
+ "es-module-lexer": "^1.7.0",
+ "expect-type": "^1.2.2",
+ "magic-string": "^0.30.19",
+ "pathe": "^2.0.3",
"picomatch": "^4.0.3",
- "postcss": "^8.5.6",
- "rollup": "^4.43.0",
- "tinyglobby": "^0.2.15"
+ "std-env": "^3.9.0",
+ "tinybench": "^2.9.0",
+ "tinyexec": "^0.3.2",
+ "tinyglobby": "^0.2.15",
+ "tinyrainbow": "^3.0.3",
+ "vite": "^6.0.0 || ^7.0.0",
+ "why-is-node-running": "^2.3.0"
},
"bin": {
- "vite": "bin/vite.js"
+ "vitest": "vitest.mjs"
},
"engines": {
- "node": "^20.19.0 || >=22.12.0"
+ "node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"funding": {
- "url": "https://github.com/vitejs/vite?sponsor=1"
- },
- "optionalDependencies": {
- "fsevents": "~2.3.3"
+ "url": "https://opencollective.com/vitest"
},
"peerDependencies": {
- "@types/node": "^20.19.0 || >=22.12.0",
- "jiti": ">=1.21.0",
- "less": "^4.0.0",
- "lightningcss": "^1.21.0",
- "sass": "^1.70.0",
- "sass-embedded": "^1.70.0",
- "stylus": ">=0.54.8",
- "sugarss": "^5.0.0",
- "terser": "^5.16.0",
- "tsx": "^4.8.1",
- "yaml": "^2.4.2"
+ "@edge-runtime/vm": "*",
+ "@types/debug": "^4.1.12",
+ "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
+ "@vitest/browser-playwright": "4.0.6",
+ "@vitest/browser-preview": "4.0.6",
+ "@vitest/browser-webdriverio": "4.0.6",
+ "@vitest/ui": "4.0.6",
+ "happy-dom": "*",
+ "jsdom": "*"
},
"peerDependenciesMeta": {
- "@types/node": {
- "optional": true
- },
- "jiti": {
- "optional": true
- },
- "less": {
+ "@edge-runtime/vm": {
"optional": true
},
- "lightningcss": {
+ "@types/debug": {
"optional": true
},
- "sass": {
+ "@types/node": {
"optional": true
},
- "sass-embedded": {
+ "@vitest/browser-playwright": {
"optional": true
},
- "stylus": {
+ "@vitest/browser-preview": {
"optional": true
},
- "sugarss": {
+ "@vitest/browser-webdriverio": {
"optional": true
},
- "terser": {
+ "@vitest/ui": {
"optional": true
},
- "tsx": {
+ "happy-dom": {
"optional": true
},
- "yaml": {
+ "jsdom": {
"optional": true
}
}
},
- "node_modules/vitest/node_modules/yaml": {
- "version": "2.8.1",
- "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz",
- "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==",
+ "node_modules/vitest/node_modules/picomatch": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
+ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
- "license": "ISC",
- "optional": true,
- "peer": true,
- "bin": {
- "yaml": "bin.mjs"
- },
+ "license": "MIT",
"engines": {
- "node": ">= 14.6"
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
}
},
+ "node_modules/vitest/node_modules/tinybench": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz",
+ "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/webidl-conversions": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
@@ -4677,6 +3845,8 @@
},
"node_modules/why-is-node-running": {
"version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz",
+ "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -4691,16 +3861,18 @@
}
},
"node_modules/wrap-ansi": {
- "version": "7.0.0",
+ "version": "9.0.2",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz",
+ "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==",
"dev": true,
"license": "MIT",
"dependencies": {
- "ansi-styles": "^4.0.0",
- "string-width": "^4.1.0",
- "strip-ansi": "^6.0.0"
+ "ansi-styles": "^6.2.1",
+ "string-width": "^7.0.0",
+ "strip-ansi": "^7.1.0"
},
"engines": {
- "node": ">=10"
+ "node": ">=18"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
@@ -4723,22 +3895,84 @@
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
- "node_modules/wrappy": {
- "version": "1.0.2",
+ "node_modules/wrap-ansi/node_modules/ansi-regex": {
+ "version": "6.2.2",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
+ "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
"dev": true,
- "license": "ISC"
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
},
- "node_modules/yallist": {
- "version": "4.0.0",
+ "node_modules/wrap-ansi/node_modules/ansi-styles": {
+ "version": "6.2.3",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
+ "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
"dev": true,
- "license": "ISC"
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/wrap-ansi/node_modules/emoji-regex": {
+ "version": "10.6.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",
+ "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/wrap-ansi/node_modules/string-width": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
+ "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "emoji-regex": "^10.3.0",
+ "get-east-asian-width": "^1.0.0",
+ "strip-ansi": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/wrap-ansi/node_modules/strip-ansi": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",
+ "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
},
"node_modules/yaml": {
- "version": "1.10.2",
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz",
+ "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==",
"dev": true,
"license": "ISC",
+ "bin": {
+ "yaml": "bin.mjs"
+ },
"engines": {
- "node": ">= 6"
+ "node": ">= 14.6"
}
},
"node_modules/yn": {
diff --git a/package.json b/package.json
index 85fb6d2..70d3296 100644
--- a/package.json
+++ b/package.json
@@ -63,7 +63,7 @@
"lint": "biome check",
"lint:fix": "biome check --write",
"lint:ci": "biome check --diagnostic-level=error",
- "prebuild": "npx rimraf dist",
+ "prebuild": "rimraf dist",
"build": "tsup",
"dev": "ts-node src/cli.ts",
"perf": "node --expose-gc scripts/perf.js",
@@ -75,21 +75,21 @@
"coverage": "vitest run --coverage",
"deploy-docs": "ts-node scripts/gh-pages-publish",
"report-coverage": "cat ./coverage/lcov.info | coveralls",
- "prepublishOnly": "npx clean-publish"
+ "prepublishOnly": "clean-publish"
},
"devDependencies": {
"@biomejs/biome": "2.3.2",
- "@vitest/coverage-v8": "^3.2.4",
- "clean-publish": "^3.4.5",
- "coveralls-next": "^4.2.0",
- "husky": "^6.0.0",
- "lint-staged": "^11.0.0",
- "rimraf": "^3.0.2",
- "shelljs": "^0.8.4",
- "tinybench": "^2.5.1",
+ "@vitest/coverage-v8": "^4.0.6",
+ "clean-publish": "^6.0.1",
+ "coveralls-next": "^5.0.0",
+ "husky": "^9.1.7",
+ "lint-staged": "^16.2.6",
+ "rimraf": "^6.1.0",
+ "shelljs": "^0.10.0",
+ "tinybench": "^5.1.0",
"ts-node": "^10.9.2",
"tsup": "^8.5.0",
"typescript": "^5.9.3",
- "vitest": "^3.2.4"
+ "vitest": "^4.0.6"
}
}
diff --git a/src/JSON.type.ts b/src/JSON.type.ts
index fece4c8..ee7cafb 100644
--- a/src/JSON.type.ts
+++ b/src/JSON.type.ts
@@ -2,8 +2,8 @@ export type ObjectDict = Record;
export type JSONPrimitive = string | number | boolean | null;
export type JSONValue = JSONPrimitive | JSONObject | JSONArray;
-export type JSONObject = { [member: string]: JSONValue };
-export type JSONArrayObject = JSONObject[];
-export type JSONArrayKeyValuePairs = [string, JSONValue][];
-export type JSONArrayArray = JSONArray[];
-export type JSONArray = JSONValue[];
+export type JSONObject = Readonly<{ [member: string]: JSONValue }>;
+export type JSONArrayObject = ReadonlyArray;
+export type JSONArrayKeyValuePairs = ReadonlyArray<[string, JSONValue]>;
+export type JSONArrayArray = ReadonlyArray;
+export type JSONArray = ReadonlyArray;
diff --git a/src/Runtime.ts b/src/Runtime.ts
index 8a6a263..f86a876 100644
--- a/src/Runtime.ts
+++ b/src/Runtime.ts
@@ -45,7 +45,7 @@ export interface InputSignature {
optional?: boolean;
}
-export type RuntimeFunction = (resolvedArgs: T) => U;
+export type RuntimeFunction, U> = (resolvedArgs: T) => U;
export interface FunctionSignature {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -688,12 +688,15 @@ export class Runtime implements FunctionRegistry {
private functionGroupBy: RuntimeFunction<[JSONArrayObject, ExpressionNode], JSONValue> = ([array, exprefNode]) => {
const keyFunction = this.createKeyFunction(exprefNode, [InputArgument.TYPE_STRING]);
- return array.reduce((acc, cur) => {
- const k = keyFunction(cur ?? {});
- const target = (acc[k] = acc[k] || []);
- target.push(cur);
- return acc;
- }, {});
+ const groups: Record = {};
+ for (const item of array) {
+ const key = keyFunction(item) as string;
+ if (!groups[key]) {
+ groups[key] = [];
+ }
+ groups[key].push(item);
+ }
+ return groups;
};
private functionItems: RuntimeFunction<[JSONObject], JSONArray> = ([inputValue]) => {
@@ -719,7 +722,7 @@ export class Runtime implements FunctionRegistry {
if (!this._interpreter) {
return [];
}
- const mapped = [];
+ const mapped: JSONValue[] = [];
const interpreter = this._interpreter;
for (let i = 0; i < elements.length; i += 1) {
mapped.push(interpreter.visit(exprefNode, elements[i]));
@@ -851,7 +854,7 @@ export class Runtime implements FunctionRegistry {
if (typeName === InputArgument.TYPE_STRING) {
return new Text(inputValue as string).reverse();
}
- const reversedArray = (inputValue as JSONArray).slice(0);
+ const reversedArray = [...(inputValue as JSONArray)];
reversedArray.reverse();
return reversedArray;
};
@@ -867,7 +870,7 @@ export class Runtime implements FunctionRegistry {
};
private functionSortBy: RuntimeFunction<[number[] | string[], ExpressionNode], JSONValue> = resolvedArgs => {
- const sortedArray = resolvedArgs[0].slice(0);
+ const sortedArray = [...resolvedArgs[0]];
if (sortedArray.length === 0) {
return sortedArray;
}
@@ -975,6 +978,6 @@ export class Runtime implements FunctionRegistry {
const result = Array(length)
.fill(null)
.map((_, index) => array.map(arr => arr[index]));
- return result;
+ return result as unknown as JSONArray;
};
}
diff --git a/src/TreeInterpreter.ts b/src/TreeInterpreter.ts
index 54a11e6..00eac63 100644
--- a/src/TreeInterpreter.ts
+++ b/src/TreeInterpreter.ts
@@ -131,7 +131,7 @@ export class TreeInterpreter {
if (!Array.isArray(base)) {
return null;
}
- const collected: JSONArray = [];
+ const collected: JSONValue[] = [];
for (const elem of base) {
const current = this.visit(right, elem) as JSONValue;
if (current !== null) {
@@ -147,7 +147,7 @@ export class TreeInterpreter {
if (base === null || typeof base !== 'object' || Array.isArray(base)) {
return null;
}
- const collected: JSONArray = [];
+ const collected: JSONValue[] = [];
const values = Object.values(base);
for (const elem of values) {
const current = this.visit(right, elem) as JSONValue;
@@ -165,7 +165,7 @@ export class TreeInterpreter {
return null;
}
- const results: JSONArray = [];
+ const results: JSONValue[] = [];
for (const elem of base) {
const matched = this.visit(condition, elem);
if (isFalse(matched)) {
@@ -257,14 +257,14 @@ export class TreeInterpreter {
case 'Root':
return this._rootValue;
case 'MultiSelectList': {
- const collected: JSONArray = [];
+ const collected: JSONValue[] = [];
for (const child of node.children) {
collected.push(this.visit(child, value) as JSONValue);
}
return collected;
}
case 'MultiSelectHash': {
- const collected: JSONObject = {};
+ const collected: Record = {};
for (const child of node.children) {
collected[child.name] = this.visit(child.value, value) as JSONValue;
}
@@ -291,7 +291,7 @@ export class TreeInterpreter {
case 'Pipe':
return this.visit(node.right, this.visit(node.left, value));
case 'Function': {
- const args: JSONArray = [];
+ const args: JSONValue[] = [];
for (const child of node.children) {
args.push(this.visit(child, value) as JSONValue);
}
diff --git a/src/cli.ts b/src/cli.ts
index c78a0c6..e1c60a5 100644
--- a/src/cli.ts
+++ b/src/cli.ts
@@ -1,7 +1,7 @@
'use strict';
+import * as fs from 'node:fs';
import { ParseArgsConfig, parseArgs } from 'node:util';
-import * as fs from 'fs';
import pkg from '../package.json';
import jmespath, { JSONValue } from './index';
diff --git a/src/index.ts b/src/index.ts
index 16ab5c2..29d6970 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -27,30 +27,30 @@ export type {
RuntimeFunction,
} from './Runtime';
-export const TYPE_ANY = InputArgument.TYPE_ANY;
-export const TYPE_ARRAY = InputArgument.TYPE_ARRAY;
-export const TYPE_ARRAY_ARRAY = InputArgument.TYPE_ARRAY_ARRAY;
-export const TYPE_ARRAY_NUMBER = InputArgument.TYPE_ARRAY_NUMBER;
-export const TYPE_ARRAY_OBJECT = InputArgument.TYPE_ARRAY_OBJECT;
-export const TYPE_ARRAY_STRING = InputArgument.TYPE_ARRAY_STRING;
-export const TYPE_BOOLEAN = InputArgument.TYPE_BOOLEAN;
-export const TYPE_EXPREF = InputArgument.TYPE_EXPREF;
-export const TYPE_NULL = InputArgument.TYPE_NULL;
-export const TYPE_NUMBER = InputArgument.TYPE_NUMBER;
-export const TYPE_OBJECT = InputArgument.TYPE_OBJECT;
-export const TYPE_STRING = InputArgument.TYPE_STRING;
-
-export function compile(expression: string, options?: Options): ExpressionNode {
+const TYPE_ANY = InputArgument.TYPE_ANY;
+const TYPE_ARRAY = InputArgument.TYPE_ARRAY;
+const TYPE_ARRAY_ARRAY = InputArgument.TYPE_ARRAY_ARRAY;
+const TYPE_ARRAY_NUMBER = InputArgument.TYPE_ARRAY_NUMBER;
+const TYPE_ARRAY_OBJECT = InputArgument.TYPE_ARRAY_OBJECT;
+const TYPE_ARRAY_STRING = InputArgument.TYPE_ARRAY_STRING;
+const TYPE_BOOLEAN = InputArgument.TYPE_BOOLEAN;
+const TYPE_EXPREF = InputArgument.TYPE_EXPREF;
+const TYPE_NULL = InputArgument.TYPE_NULL;
+const TYPE_NUMBER = InputArgument.TYPE_NUMBER;
+const TYPE_OBJECT = InputArgument.TYPE_OBJECT;
+const TYPE_STRING = InputArgument.TYPE_STRING;
+
+function compile(expression: string, options?: Options): ExpressionNode {
const nodeTree = Parser.parse(expression, options);
return nodeTree;
}
-export function tokenize(expression: string, options?: LexerOptions): LexerToken[] {
+function tokenize(expression: string, options?: LexerOptions): LexerToken[] {
return Lexer.tokenize(expression, options);
}
// Enhanced registerFunction with backward compatibility
-export const registerFunction = (
+const registerFunction = (
functionName: string,
customFunction: RuntimeFunction<(JSONValue | ExpressionNode)[], JSONValue>,
signature: InputSignature[],
@@ -60,7 +60,7 @@ export const registerFunction = (
};
// Enhanced registry functions with type safety
-export const register = (
+const register = (
name: T extends BuiltInFunctionNames ? never : T,
customFunction: RuntimeFunction<(JSONValue | ExpressionNode)[], JSONValue>,
signature: InputSignature[],
@@ -69,38 +69,38 @@ export const register = (
return TreeInterpreterInst.runtime.register(name, customFunction, signature, options);
};
-export const unregisterFunction = (name: T extends BuiltInFunctionNames ? never : T): boolean => {
+const unregisterFunction = (name: T extends BuiltInFunctionNames ? never : T): boolean => {
return TreeInterpreterInst.runtime.unregister(name);
};
-export const isRegistered = (name: string): boolean => {
+const isRegistered = (name: string): boolean => {
return TreeInterpreterInst.runtime.isRegistered(name);
};
-export const getRegisteredFunctions = (): string[] => {
+const getRegisteredFunctions = (): string[] => {
return TreeInterpreterInst.runtime.getRegistered();
};
-export const getCustomFunctions = (): string[] => {
+const getCustomFunctions = (): string[] => {
return TreeInterpreterInst.runtime.getCustomFunctions();
};
-export const clearCustomFunctions = (): void => {
+const clearCustomFunctions = (): void => {
TreeInterpreterInst.runtime.clearCustomFunctions();
};
-export function search(data: JSONValue, expression: string, options?: Options): JSONValue {
+function search(data: JSONValue, expression: string, options?: Options): JSONValue {
const nodeTree = Parser.parse(expression, options);
return TreeInterpreterInst.search(nodeTree, data);
}
-export function Scope(): ScopeChain {
+function Scope(): ScopeChain {
return new ScopeChain();
}
-export const TreeInterpreter = TreeInterpreterInst;
+const TreeInterpreter = TreeInterpreterInst;
-export const jmespath = {
+const jmespath = {
compile,
registerFunction,
register,
@@ -122,8 +122,11 @@ export const jmespath = {
TYPE_NUMBER,
TYPE_OBJECT,
TYPE_STRING,
+ TYPE_ARRAY_ARRAY,
+ TYPE_ARRAY_OBJECT,
+ Scope,
};
// Export as default for backward compatibility
// Supports both: import jmespath from '...' and import { jmespath } from '...'
-export { jmespath as default };
+export default jmespath;
diff --git a/test/build-artifacts.spec.ts b/test/build-artifacts.spec.ts
index 6208a62..c56946e 100644
--- a/test/build-artifacts.spec.ts
+++ b/test/build-artifacts.spec.ts
@@ -14,7 +14,7 @@ describe('Build Artifacts', () => {
const content = readFileSync(indexDtsPath, 'utf-8');
expect(content).toContain('declare function search');
expect(content).toContain('declare function compile');
- expect(content).toContain('declare const registerFunction');
+ expect(content).toContain('registerFunction: (');
});
it('should generate CLI type declarations', () => {
@@ -38,9 +38,9 @@ describe('Build Artifacts', () => {
expect(content).toContain('type JSONValue');
// Check for constant exports
- expect(content).toContain('declare const TYPE_ANY');
- expect(content).toContain('declare const TYPE_STRING');
- expect(content).toContain('declare const TYPE_NUMBER');
+ expect(content).toContain('TYPE_ANY: InputArgument;');
+ expect(content).toContain('TYPE_STRING: InputArgument;');
+ expect(content).toContain('TYPE_NUMBER: InputArgument;');
});
});
@@ -77,7 +77,7 @@ describe('Build Artifacts', () => {
const content = readFileSync(umdPath, 'utf-8');
// tsup generates IIFE format with global variable
- expect(content).toContain('var jmespath = (function (exports)');
+ expect(content).toContain('var jmespath = (function ()');
});
it('should generate minified UMD bundle', () => {
diff --git a/test/compliance.spec.ts b/test/compliance.spec.ts
index 4d0542f..16b3f1f 100644
--- a/test/compliance.spec.ts
+++ b/test/compliance.spec.ts
@@ -1,7 +1,7 @@
import { readdirSync, readFileSync } from 'fs';
import { basename } from 'path';
import { describe, expect, test } from 'vitest';
-import { Options, search } from '../src';
+import jmespath, { Options } from '../src';
import { JSONValue } from '../src/JSON.type';
import { expectError } from './error.utils';
@@ -37,12 +37,12 @@ export function addTestSuitesFromFile(filename: string, options?: Options): void
if (error !== undefined) {
expectError(
() => {
- return search(given, expression, options);
+ return jmespath.search(given, expression, options);
},
error,
);
} else {
- expect(search(given, expression, options)).toEqual(result);
+ expect(jmespath.search(given, expression, options)).toEqual(result);
}
});
});
diff --git a/test/environments.spec.ts b/test/environments.spec.ts
new file mode 100644
index 0000000..4f5639e
--- /dev/null
+++ b/test/environments.spec.ts
@@ -0,0 +1,49 @@
+import { readFileSync } from 'fs';
+import { createRequire } from 'module';
+import { join } from 'path';
+import { describe, expect, it } from 'vitest';
+import { Script } from 'vm';
+import jmespathEsm from '../dist/index.mjs';
+
+const require = createRequire(import.meta.url);
+const { search: searchCjs } = require('../dist/index.cjs');
+
+const data = { foo: { bar: { baz: [0, 1, 2, 3, 4] } } };
+const expression = 'foo.bar.baz[2]';
+const expected = 2;
+
+describe('Environment Bundles', () => {
+ it('should work in an ESM environment', () => {
+ const result = jmespathEsm.search(data, expression);
+ expect(result).toBe(expected);
+ });
+
+ it('should work in a CJS environment', () => {
+ const result = searchCjs(data, expression);
+ expect(result).toBe(expected);
+ });
+
+ it('should work in a UMD (browser) environment', () => {
+ const umdPath = join(process.cwd(), 'dist', 'index.umd.js');
+ const umdContent = readFileSync(umdPath, 'utf-8');
+
+ const context = {
+ window: {},
+ self: {},
+ };
+ context.self = context;
+ context.window = context;
+
+ const script = new Script(umdContent);
+ script.runInNewContext(context);
+
+ // @ts-ignore
+ const jmespath = context.jmespath;
+
+ expect(jmespath).toBeDefined();
+ expect(typeof jmespath.search).toBe('function');
+
+ const result = jmespath.search(data, expression);
+ expect(result).toBe(expected);
+ });
+});
diff --git a/test/jmespath-extensions.spec.ts b/test/jmespath-extensions.spec.ts
index fda2023..f6e4cbd 100644
--- a/test/jmespath-extensions.spec.ts
+++ b/test/jmespath-extensions.spec.ts
@@ -1,21 +1,12 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import type { RegistrationResult } from '../src';
-import jmespath, {
- clearCustomFunctions,
- getCustomFunctions,
- getRegisteredFunctions,
- isRegistered,
- register,
- registerFunction,
- search,
- unregisterFunction,
-} from '../src';
+import jmespath from '../src';
import { JSONObject } from '../src/JSON.type';
describe('registerFunction', () => {
it('register a customFunction', () => {
expect(() =>
- search(
+ jmespath.search(
{
foo: 60,
bar: 10,
@@ -32,7 +23,7 @@ describe('registerFunction', () => {
[{ types: [jmespath.TYPE_NUMBER] }, { types: [jmespath.TYPE_NUMBER] }],
);
expect(() =>
- search(
+ jmespath.search(
{
foo: 60,
bar: 10,
@@ -41,7 +32,7 @@ describe('registerFunction', () => {
),
).not.toThrow();
expect(
- search(
+ jmespath.search(
{
foo: 60,
bar: 10,
@@ -52,19 +43,19 @@ describe('registerFunction', () => {
});
it("won't register a customFunction if one already exists", () => {
expect(() =>
- registerFunction('sum', () => {
+ jmespath.registerFunction('sum', () => {
/* EMPTY FUNCTION */
return 'empty';
}, []),
).toThrow('Function already defined: sum()');
});
it('alerts too few arguments', () => {
- registerFunction('tooFewArgs', () => {
+ jmespath.registerFunction('tooFewArgs', () => {
/* EMPTY FUNCTION */
return 'empty';
}, [{ types: [jmespath.TYPE_ANY] }, { types: [jmespath.TYPE_NUMBER], optional: true }]);
expect(() =>
- search(
+ jmespath.search(
{
foo: 60,
bar: 10,
@@ -73,7 +64,7 @@ describe('registerFunction', () => {
),
).toThrow('Invalid arity: tooFewArgs() takes 1 arguments but received 0');
expect(() =>
- search(
+ jmespath.search(
{
foo: 60,
bar: 10,
@@ -82,7 +73,7 @@ describe('registerFunction', () => {
),
).toThrow('Invalid type: tooFewArgs() expected argument 2 to be type (number) but received type object instead.');
expect(() =>
- search(
+ jmespath.search(
{
foo: 60,
bar: 10,
@@ -92,12 +83,12 @@ describe('registerFunction', () => {
).toThrow('Invalid arity: tooFewArgs() takes 1 arguments but received 3');
});
it('alerts too many arguments', () => {
- registerFunction('tooManyArgs', () => {
+ jmespath.registerFunction('tooManyArgs', () => {
/* EMPTY FUNCTION */
return 'empty';
}, []);
expect(() =>
- search(
+ jmespath.search(
{
foo: 60,
bar: 10,
@@ -108,12 +99,12 @@ describe('registerFunction', () => {
});
it('alerts optional variadic arguments', () => {
- registerFunction('optionalVariadic', () => {
+ jmespath.registerFunction('optionalVariadic', () => {
/* EMPTY FUNCTION */
return 'empty';
}, [{ types: [jmespath.TYPE_ANY], optional: true, variadic: true }]);
expect(() =>
- search(
+ jmespath.search(
{
foo: 60,
bar: 10,
@@ -125,7 +116,7 @@ describe('registerFunction', () => {
it('alerts variadic is always last argument', () => {
expect(() =>
- registerFunction('variadicAlwaysLast', () => {
+ jmespath.registerFunction('variadicAlwaysLast', () => {
/* EMPTY FUNCTION */
return 'empty';
}, [
@@ -136,7 +127,7 @@ describe('registerFunction', () => {
});
it('accounts for optional arguments', () => {
- registerFunction(
+ jmespath.registerFunction(
'optionalArgs',
([first, second, third]) => {
return {
@@ -151,7 +142,7 @@ describe('registerFunction', () => {
[{ types: [jmespath.TYPE_ANY] }, { types: [jmespath.TYPE_ANY], optional: true }],
);
expect(
- search(
+ jmespath.search(
{
foo: 60,
bar: 10,
@@ -160,7 +151,7 @@ describe('registerFunction', () => {
),
).toEqual({ first: 60, second: 'default[2]', third: 'default[3]' });
expect(
- search(
+ jmespath.search(
{
foo: 60,
bar: 10,
@@ -169,7 +160,7 @@ describe('registerFunction', () => {
),
).toEqual({ first: 60, second: 10, third: 'default[3]' });
expect(() =>
- search(
+ jmespath.search(
{
foo: 60,
bar: 10,
@@ -182,23 +173,23 @@ describe('registerFunction', () => {
describe('root', () => {
it('$ should give access to the root value', () => {
- const value = search({ foo: { bar: 1 } }, 'foo.{ value: $.foo.bar }');
+ const value = jmespath.search({ foo: { bar: 1 } }, 'foo.{ value: $.foo.bar }');
expect(value).not.toBe(null);
expect(value?.['value']).toBe(1);
});
it('$ should give access to the root value after pipe', () => {
- const value = search({ foo: { bar: 1 } }, 'foo | $.foo.bar');
+ const value = jmespath.search({ foo: { bar: 1 } }, 'foo | $.foo.bar');
expect(value).toEqual(1);
});
it('$ should give access in expressions', () => {
- const value = search([{ foo: { bar: 1 } }, { foo: { bar: 99 } }], 'map(&foo.{boo: bar, root: $}, @)');
+ const value = jmespath.search([{ foo: { bar: 1 } }, { foo: { bar: 99 } }], 'map(&foo.{boo: bar, root: $}, @)');
expect(value).toEqual([
{ boo: 1, root: [{ foo: { bar: 1 } }, { foo: { bar: 99 } }] },
{ boo: 99, root: [{ foo: { bar: 1 } }, { foo: { bar: 99 } }] },
]);
});
it('$ can be used in parallel', () => {
- const value = search([{ foo: { bar: 1 } }, { foo: { bar: 99 } }], '[$[0].foo.bar, $[1].foo.bar]');
+ const value = jmespath.search([{ foo: { bar: 1 } }, { foo: { bar: 99 } }], '[$[0].foo.bar, $[1].foo.bar]');
expect(value).toEqual([1, 99]);
});
});
@@ -206,33 +197,33 @@ describe('root', () => {
describe('Enhanced Registry API', () => {
// Clean up custom functions before and after each test
beforeEach(() => {
- clearCustomFunctions();
+ jmespath.clearCustomFunctions();
});
afterEach(() => {
- clearCustomFunctions();
+ jmespath.clearCustomFunctions();
});
describe('register() function', () => {
it('should register a new function successfully', () => {
- const result = register('multiply', ([a, b]) => (a as number) * (b as number), [
+ const result = jmespath.register('multiply', ([a, b]) => (a as number) * (b as number), [
{ types: [jmespath.TYPE_NUMBER] },
{ types: [jmespath.TYPE_NUMBER] },
]);
expect(result.success).toBe(true);
expect(result.message).toContain('multiply() registered successfully');
- expect(isRegistered('multiply')).toBe(true);
+ expect(jmespath.isRegistered('multiply')).toBe(true);
});
it('should prevent registering built-in functions at compile time', () => {
// This test verifies TypeScript compile-time checking
// The following line should cause a TypeScript error if uncommented:
- // register('sum', ([a, b]) => a + b, [{ types: [jmespath.TYPE_NUMBER] }]);
+ // jmespath.register('sum', ([a, b]) => a + b, [{ types: [jmespath.TYPE_NUMBER] }]);
// We can test runtime behavior by bypassing TypeScript
// biome-ignore lint/suspicious/noExplicitAny: Testing runtime behavior
- const result = (register as (name: string, func: any, sig: any) => RegistrationResult)(
+ const result = (jmespath.register as (name: string, func: any, sig: any) => RegistrationResult)(
'sum',
// biome-ignore lint/suspicious/noExplicitAny: Testing runtime behavior
([a, b]: any[]) => (a as number) + (b as number),
@@ -245,8 +236,8 @@ describe('Enhanced Registry API', () => {
});
it('should return error when function already exists without override', () => {
- register('testFunc', () => 'first', []);
- const result = register('testFunc', () => 'second', []);
+ jmespath.register('testFunc', () => 'first', []);
+ const result = jmespath.register('testFunc', () => 'second', []);
expect(result.success).toBe(false);
if (!result.success) {
@@ -256,8 +247,8 @@ describe('Enhanced Registry API', () => {
});
it('should allow overriding with override option', () => {
- register('testFunc', () => 'first', []);
- const result = register('testFunc', () => 'second', [], { override: true });
+ jmespath.register('testFunc', () => 'first', []);
+ const result = jmespath.register('testFunc', () => 'second', [], { override: true });
expect(result.success).toBe(true);
if (result.success) {
@@ -268,15 +259,15 @@ describe('Enhanced Registry API', () => {
it('should emit warning when overriding with warn option', () => {
const consoleSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});
- register('testFunc', () => 'first', []);
- register('testFunc', () => 'second', [], { override: true, warn: true });
+ jmespath.register('testFunc', () => 'first', []);
+ jmespath.register('testFunc', () => 'second', [], { override: true, warn: true });
expect(consoleSpy).toHaveBeenCalledWith('Warning: Overriding existing function: testFunc()');
consoleSpy.mockRestore();
});
it('should validate function name', () => {
- const result = register('', () => 'test', []);
+ const result = jmespath.register('', () => 'test', []);
expect(result.success).toBe(false);
if (!result.success) {
expect(result.reason).toBe('invalid-name');
@@ -284,7 +275,7 @@ describe('Enhanced Registry API', () => {
});
it('should validate function signature', () => {
- const result = register('testFunc', () => 'test', [
+ const result = jmespath.register('testFunc', () => 'test', [
{ types: [jmespath.TYPE_ANY], variadic: true },
{ types: [jmespath.TYPE_ANY] }, // Invalid: variadic must be last
]);
@@ -298,40 +289,40 @@ describe('Enhanced Registry API', () => {
describe('registerFunction() backward compatibility', () => {
it('should maintain backward compatibility', () => {
expect(() => {
- registerFunction('oldStyle', ([a, b]) => (a as number) + (b as number), [
+ jmespath.registerFunction('oldStyle', ([a, b]) => (a as number) + (b as number), [
{ types: [jmespath.TYPE_NUMBER] },
{ types: [jmespath.TYPE_NUMBER] },
]);
}).not.toThrow();
- expect(search({ a: 5, b: 3 }, 'oldStyle(a, b)')).toBe(8);
+ expect(jmespath.search({ a: 5, b: 3 }, 'oldStyle(a, b)')).toBe(8);
});
it('should support new options in registerFunction', () => {
- registerFunction('testFunc', () => 'first', []);
+ jmespath.registerFunction('testFunc', () => 'first', []);
expect(() => {
- registerFunction('testFunc', () => 'second', [], { override: true });
+ jmespath.registerFunction('testFunc', () => 'second', [], { override: true });
}).not.toThrow();
});
it('should throw error for duplicate registration without override', () => {
- registerFunction('testFunc', () => 'first', []);
+ jmespath.registerFunction('testFunc', () => 'first', []);
expect(() => {
- registerFunction('testFunc', () => 'second', []);
+ jmespath.registerFunction('testFunc', () => 'second', []);
}).toThrow('Function already defined: testFunc()');
});
});
describe('unregisterFunction()', () => {
it('should unregister custom functions', () => {
- register('testFunc', () => 'test', []);
- expect(isRegistered('testFunc')).toBe(true);
+ jmespath.register('testFunc', () => 'test', []);
+ expect(jmespath.isRegistered('testFunc')).toBe(true);
- const result = unregisterFunction('testFunc');
+ const result = jmespath.unregisterFunction('testFunc');
expect(result).toBe(true);
- expect(isRegistered('testFunc')).toBe(false);
+ expect(jmespath.isRegistered('testFunc')).toBe(false);
});
it('should not unregister built-in functions', () => {
@@ -340,37 +331,37 @@ describe('Enhanced Registry API', () => {
// Test runtime behavior
// biome-ignore lint/suspicious/noExplicitAny: Testing runtime behavior
- const result = (unregisterFunction as any)('sum');
+ const result = (jmespath.unregisterFunction as any)('sum');
expect(result).toBe(false);
- expect(isRegistered('sum')).toBe(true);
+ expect(jmespath.isRegistered('sum')).toBe(true);
});
it('should return false for non-existent functions', () => {
- const result = unregisterFunction('nonExistent');
+ const result = jmespath.unregisterFunction('nonExistent');
expect(result).toBe(false);
});
});
describe('isRegistered()', () => {
it('should return true for built-in functions', () => {
- expect(isRegistered('sum')).toBe(true);
- expect(isRegistered('length')).toBe(true);
- expect(isRegistered('map')).toBe(true);
+ expect(jmespath.isRegistered('sum')).toBe(true);
+ expect(jmespath.isRegistered('length')).toBe(true);
+ expect(jmespath.isRegistered('map')).toBe(true);
});
it('should return true for custom functions', () => {
- register('customFunc', () => 'test', []);
- expect(isRegistered('customFunc')).toBe(true);
+ jmespath.register('customFunc', () => 'test', []);
+ expect(jmespath.isRegistered('customFunc')).toBe(true);
});
it('should return false for non-existent functions', () => {
- expect(isRegistered('nonExistent')).toBe(false);
+ expect(jmespath.isRegistered('nonExistent')).toBe(false);
});
});
describe('getRegisteredFunctions()', () => {
it('should return all registered functions including built-ins', () => {
- const functions = getRegisteredFunctions();
+ const functions = jmespath.getRegisteredFunctions();
// Should include built-in functions
expect(functions).toContain('sum');
@@ -382,10 +373,10 @@ describe('Enhanced Registry API', () => {
});
it('should include custom functions', () => {
- register('customFunc1', () => 'test1', []);
- register('customFunc2', () => 'test2', []);
+ jmespath.register('customFunc1', () => 'test1', []);
+ jmespath.register('customFunc2', () => 'test2', []);
- const functions = getRegisteredFunctions();
+ const functions = jmespath.getRegisteredFunctions();
expect(functions).toContain('customFunc1');
expect(functions).toContain('customFunc2');
});
@@ -393,13 +384,13 @@ describe('Enhanced Registry API', () => {
describe('getCustomFunctions()', () => {
it('should return only custom functions', () => {
- const customFunctions = getCustomFunctions();
+ const customFunctions = jmespath.getCustomFunctions();
expect(customFunctions).toEqual([]);
- register('customFunc1', () => 'test1', []);
- register('customFunc2', () => 'test2', []);
+ jmespath.register('customFunc1', () => 'test1', []);
+ jmespath.register('customFunc2', () => 'test2', []);
- const updatedCustomFunctions = getCustomFunctions();
+ const updatedCustomFunctions = jmespath.getCustomFunctions();
expect(updatedCustomFunctions).toEqual(['customFunc1', 'customFunc2']);
expect(updatedCustomFunctions).not.toContain('sum');
expect(updatedCustomFunctions).not.toContain('length');
@@ -408,18 +399,18 @@ describe('Enhanced Registry API', () => {
describe('clearCustomFunctions()', () => {
it('should remove all custom functions but keep built-ins', () => {
- register('customFunc1', () => 'test1', []);
- register('customFunc2', () => 'test2', []);
+ jmespath.register('customFunc1', () => 'test1', []);
+ jmespath.register('customFunc2', () => 'test2', []);
- expect(getCustomFunctions()).toHaveLength(2);
- expect(isRegistered('sum')).toBe(true);
+ expect(jmespath.getCustomFunctions()).toHaveLength(2);
+ expect(jmespath.isRegistered('sum')).toBe(true);
- clearCustomFunctions();
+ jmespath.clearCustomFunctions();
- expect(getCustomFunctions()).toHaveLength(0);
- expect(isRegistered('customFunc1')).toBe(false);
- expect(isRegistered('customFunc2')).toBe(false);
- expect(isRegistered('sum')).toBe(true); // Built-in should remain
+ expect(jmespath.getCustomFunctions()).toHaveLength(0);
+ expect(jmespath.isRegistered('customFunc1')).toBe(false);
+ expect(jmespath.isRegistered('customFunc2')).toBe(false);
+ expect(jmespath.isRegistered('sum')).toBe(true); // Built-in should remain
});
});
});
diff --git a/test/jmespath-functions.spec.ts b/test/jmespath-functions.spec.ts
index 0db6409..9598208 100644
--- a/test/jmespath-functions.spec.ts
+++ b/test/jmespath-functions.spec.ts
@@ -1,14 +1,14 @@
import { describe, expect, it } from 'vitest';
-import { registerFunction, search, TYPE_NUMBER } from '../src';
+import jmespath from '../src';
import { expectError } from './error.utils';
describe('Evaluates functions', () => {
it('from_items()', () => {
- expect(search([], 'from_items(@)')).toEqual({});
+ expect(jmespath.search([], 'from_items(@)')).toEqual({});
});
it('from_items()', () => {
expect(
- search(
+ jmespath.search(
[
['foo', 'bar'],
['baz', 'qux'],
@@ -18,7 +18,7 @@ describe('Evaluates functions', () => {
).toEqual({ foo: 'bar', baz: 'qux' });
});
it('group_by()', () => {
- expect(search([], 'group_by(@, &ignored)')).toEqual({});
+ expect(jmespath.search([], 'group_by(@, &ignored)')).toEqual({});
});
it('group_by()', () => {
const input = {
@@ -29,7 +29,7 @@ describe('Evaluates functions', () => {
{ spec: { nodeName: 'node_01', other: 'values_04' } },
],
};
- expect(search(input, 'group_by(items, &spec.nodeName)')).toEqual({
+ expect(jmespath.search(input, 'group_by(items, &spec.nodeName)')).toEqual({
node_01: [
{ spec: { nodeName: 'node_01', other: 'values_01' } },
{ spec: { nodeName: 'node_01', other: 'values_04' } },
@@ -39,28 +39,28 @@ describe('Evaluates functions', () => {
});
});
it('items()', () => {
- expect(search({ foo: 'bar', baz: 'qux' }, 'items(@)')).toEqual([
+ expect(jmespath.search({ foo: 'bar', baz: 'qux' }, 'items(@)')).toEqual([
['foo', 'bar'],
['baz', 'qux'],
]);
});
it('pad_left()', () => {
// this should be included in the compliance test suite
- expect(search('', 'pad_left(@, `10`)')).toEqual('');
+ expect(jmespath.search('', 'pad_left(@, `10`)')).toEqual('');
});
it('pad_right()', () => {
// this should be included in the compliance test suite
- expect(search('', 'pad_right(@, `10`)')).toEqual('');
+ expect(jmespath.search('', 'pad_right(@, `10`)')).toEqual('');
});
it('zip()', () => {
- expect(search([], 'zip(@)')).toEqual([]);
+ expect(jmespath.search([], 'zip(@)')).toEqual([]);
});
it('zip()', () => {
const input = {
people: ['Monika', 'Alice'],
country: ['Germany', 'USA', 'France'],
};
- expect(search(input, 'zip(people, country)')).toEqual([
+ expect(jmespath.search(input, 'zip(people, country)')).toEqual([
['Monika', 'Germany'],
['Alice', 'USA'],
]);
@@ -71,47 +71,47 @@ describe('Type-checks function arguments', () => {
it('find_last()', () => {
// this should be included in the compliance test suite
expectError(() => {
- return search('subject string', "find_last(@, 's', `1.3`)");
+ return jmespath.search('subject string', "find_last(@, 's', `1.3`)");
}, 'invalid-value');
});
it('from_items()', () => {
expectError(() => {
- return search(null, 'from_items(@)');
+ return jmespath.search(null, 'from_items(@)');
}, ['invalid-type', 'null']);
});
it('from_items()', () => {
expectError(() => {
- return search('foo', 'from_items(@)');
+ return jmespath.search('foo', 'from_items(@)');
}, ['invalid-type', 'string']);
});
it('from_items()', () => {
expectError(() => {
- return search([[]], 'from_items(@)');
+ return jmespath.search([[]], 'from_items(@)');
}, 'invalid-value');
});
it('from_items()', () => {
expectError(() => {
- return search([[1, 'one']], 'from_items(@)');
+ return jmespath.search([[1, 'one']], 'from_items(@)');
}, 'invalid-value');
});
it('group_by()', () => {
expectError(() => {
- return search({}, 'group_by(@, &`false`)');
+ return jmespath.search({}, 'group_by(@, &`false`)');
}, 'invalid-type');
});
it('group_by()', () => {
expectError(() => {
- return search([{}, {}], 'group_by(@, &`false`)');
+ return jmespath.search([{}, {}], 'group_by(@, &`false`)');
}, 'invalid-type');
});
it('group_by()', () => {
expectError(() => {
- return search([{ a: 42 }, { a: 42 }], 'group_by(@, &a)');
+ return jmespath.search([{ a: 42 }, { a: 42 }], 'group_by(@, &a)');
}, 'invalid-type');
});
it('length()', () => {
try {
- search([], 'length(`null`)');
+ jmespath.search([], 'length(`null`)');
} catch (e) {
if (e instanceof Error) {
expect(e.message).toContain('length() expected argument 1 to be type (string | array | object)');
@@ -122,22 +122,22 @@ describe('Type-checks function arguments', () => {
it('pad_right()', () => {
// this should be included in the compliance test suite
expectError(() => {
- return search('subject string', "pad_right(@, `1`, '--')");
+ return jmespath.search('subject string', "pad_right(@, `1`, '--')");
}, 'invalid-value');
});
});
describe('custom functions', () => {
it('must be in scope for let expression', () => {
- registerFunction(
+ jmespath.registerFunction(
'plusplus', // FUNCTION NAME
resolvedArgs => {
// CUSTOM FUNCTION
const [num] = resolvedArgs;
return num + 1;
},
- [{ types: [TYPE_NUMBER] }], //SIGNATURE
+ [{ types: [jmespath.TYPE_NUMBER] }], //SIGNATURE
);
- expect(search({ index: 0 }, 'let $n = index in plusplus($n)')).toEqual(1);
+ expect(jmespath.search({ index: 0 }, 'let $n = index in plusplus($n)')).toEqual(1);
});
});
diff --git a/test/jmespath-interpreter.spec.ts b/test/jmespath-interpreter.spec.ts
index a78647b..02ae7a9 100644
--- a/test/jmespath-interpreter.spec.ts
+++ b/test/jmespath-interpreter.spec.ts
@@ -1,8 +1,8 @@
import { describe, expect, it } from 'vitest';
-import { search } from '../src';
+import jmespath from '../src';
describe('Searches compiled ast', () => {
it('search a compiled expression', () => {
- expect(search({ foo: { bar: 'BAZ' } }, 'foo.bar')).toEqual('BAZ');
+ expect(jmespath.search({ foo: { bar: 'BAZ' } }, 'foo.bar')).toEqual('BAZ');
});
});
diff --git a/test/jmespath-lexer.spec.ts b/test/jmespath-lexer.spec.ts
index 000cfd7..498c7cd 100644
--- a/test/jmespath-lexer.spec.ts
+++ b/test/jmespath-lexer.spec.ts
@@ -1,58 +1,60 @@
import { describe, expect, it } from 'vitest';
-import { tokenize } from '../src';
+import jmespath from '../src';
describe('tokenize', () => {
it('should tokenize root node reference', () => {
- expect(tokenize('$')).toMatchObject([{ type: 'Root', value: '$', start: 0 }]);
+ expect(jmespath.tokenize('$')).toMatchObject([{ type: 'Root', value: '$', start: 0 }]);
});
it('should tokenize variable reference', () => {
- expect(tokenize('$foo')).toMatchObject([{ type: 'Variable', value: 'foo', start: 0 }]);
+ expect(jmespath.tokenize('$foo')).toMatchObject([{ type: 'Variable', value: 'foo', start: 0 }]);
});
it('should tokenize assign operator', () => {
- expect(tokenize('=')).toMatchObject([{ type: 'Assign', value: '=', start: 0 }]);
+ expect(jmespath.tokenize('=')).toMatchObject([{ type: 'Assign', value: '=', start: 0 }]);
});
it('should tokenize arithmetic + plus sign', () => {
- expect(tokenize('+')).toMatchObject([{ type: 'Plus', value: '+', start: 0 }]);
+ expect(jmespath.tokenize('+')).toMatchObject([{ type: 'Plus', value: '+', start: 0 }]);
});
it('should tokenize arithmetic - minus sign', () => {
- expect(tokenize('-')).toMatchObject([{ type: 'Minus', value: '-', start: 0 }]);
+ expect(jmespath.tokenize('-')).toMatchObject([{ type: 'Minus', value: '-', start: 0 }]);
});
it('should tokenize arithmetic โ (U+2212) minus sign', () => {
- expect(tokenize('โ')).toMatchObject([{ type: 'Minus', value: '\u2212', start: 0 }]);
+ expect(jmespath.tokenize('โ')).toMatchObject([{ type: 'Minus', value: '\u2212', start: 0 }]);
});
it('should tokenize arithmetic ร (U+00D7) multiplication sign', () => {
- expect(tokenize('ร')).toMatchObject([{ type: 'Multiply', value: '\u00d7', start: 0 }]);
+ expect(jmespath.tokenize('ร')).toMatchObject([{ type: 'Multiply', value: '\u00d7', start: 0 }]);
});
it('should tokenize arithmetic / division operator', () => {
- expect(tokenize('/')).toMatchObject([{ type: 'Divide', value: '/', start: 0 }]);
+ expect(jmespath.tokenize('/')).toMatchObject([{ type: 'Divide', value: '/', start: 0 }]);
});
it('should tokenize arithmetic รท (U+00F7) division sign', () => {
- expect(tokenize('รท')).toMatchObject([{ type: 'Divide', value: '\u00f7', start: 0 }]);
+ expect(jmespath.tokenize('รท')).toMatchObject([{ type: 'Divide', value: '\u00f7', start: 0 }]);
});
it('should tokenize arithmetic % modulo operator', () => {
- expect(tokenize('%')).toMatchObject([{ type: 'Modulo', value: '%', start: 0 }]);
+ expect(jmespath.tokenize('%')).toMatchObject([{ type: 'Modulo', value: '%', start: 0 }]);
});
it('should tokenize arithmetic // integer division operator', () => {
- expect(tokenize('//')).toMatchObject([{ type: 'Div', value: '//', start: 0 }]);
+ expect(jmespath.tokenize('//')).toMatchObject([{ type: 'Div', value: '//', start: 0 }]);
});
it('should tokenize unquoted identifier', () => {
- expect(tokenize('foo')).toMatchObject([{ type: 'UnquotedIdentifier', value: 'foo', start: 0 }]);
+ expect(jmespath.tokenize('foo')).toMatchObject([{ type: 'UnquotedIdentifier', value: 'foo', start: 0 }]);
});
it('should tokenize unquoted identifier with underscore', () => {
- expect(tokenize('_underscore')).toMatchObject([{ type: 'UnquotedIdentifier', value: '_underscore', start: 0 }]);
+ expect(jmespath.tokenize('_underscore')).toMatchObject([
+ { type: 'UnquotedIdentifier', value: '_underscore', start: 0 },
+ ]);
});
it('should tokenize unquoted identifier with numbers', () => {
- expect(tokenize('foo123')).toMatchObject([{ type: 'UnquotedIdentifier', value: 'foo123', start: 0 }]);
+ expect(jmespath.tokenize('foo123')).toMatchObject([{ type: 'UnquotedIdentifier', value: 'foo123', start: 0 }]);
});
it('should tokenize dotted lookups', () => {
- expect(tokenize('foo.bar')).toMatchObject([
+ expect(jmespath.tokenize('foo.bar')).toMatchObject([
{ type: 'UnquotedIdentifier', value: 'foo', start: 0 },
{ type: 'Dot', value: '.', start: 3 },
{ type: 'UnquotedIdentifier', value: 'bar', start: 4 },
]);
});
it('should tokenize numbers', () => {
- expect(tokenize('foo[0]')).toMatchObject([
+ expect(jmespath.tokenize('foo[0]')).toMatchObject([
{ type: 'UnquotedIdentifier', value: 'foo', start: 0 },
{ type: 'Lbracket', value: '[', start: 3 },
{ type: 'Number', value: 0, start: 4 },
@@ -60,51 +62,53 @@ describe('tokenize', () => {
]);
});
it('should tokenize numbers with multiple digits', () => {
- expect(tokenize('12345')).toMatchObject([{ type: 'Number', value: 12345, start: 0 }]);
+ expect(jmespath.tokenize('12345')).toMatchObject([{ type: 'Number', value: 12345, start: 0 }]);
});
it('should tokenize negative numbers', () => {
- expect(tokenize('-12345')).toMatchObject([{ type: 'Number', value: -12345, start: 0 }]);
+ expect(jmespath.tokenize('-12345')).toMatchObject([{ type: 'Number', value: -12345, start: 0 }]);
});
it('should tokenize quoted identifier', () => {
- expect(tokenize('"foo"')).toMatchObject([{ type: 'QuotedIdentifier', value: 'foo', start: 0 }]);
+ expect(jmespath.tokenize('"foo"')).toMatchObject([{ type: 'QuotedIdentifier', value: 'foo', start: 0 }]);
});
it('should tokenize quoted identifier with unicode escape', () => {
- expect(tokenize('"\\u2713"')).toMatchObject([{ type: 'QuotedIdentifier', value: 'โ', start: 0 }]);
+ expect(jmespath.tokenize('"\\u2713"')).toMatchObject([{ type: 'QuotedIdentifier', value: 'โ', start: 0 }]);
});
it('should tokenize literal lists', () => {
- expect(tokenize('`[0, 1]`')).toMatchObject([{ type: 'Literal', value: [0, 1], start: 0 }]);
+ expect(jmespath.tokenize('`[0, 1]`')).toMatchObject([{ type: 'Literal', value: [0, 1], start: 0 }]);
});
it('should tokenize literal dict', () => {
- expect(tokenize('`{"foo": "bar"}`')).toMatchObject([{ type: 'Literal', value: { foo: 'bar' }, start: 0 }]);
+ expect(jmespath.tokenize('`{"foo": "bar"}`')).toMatchObject([{ type: 'Literal', value: { foo: 'bar' }, start: 0 }]);
});
it('should tokenize literal strings', () => {
- expect(tokenize('`"foo"`')).toMatchObject([{ type: 'Literal', value: 'foo', start: 0 }]);
+ expect(jmespath.tokenize('`"foo"`')).toMatchObject([{ type: 'Literal', value: 'foo', start: 0 }]);
});
it('should tokenize json literals', () => {
- expect(tokenize('`true`')).toMatchObject([{ type: 'Literal', value: true, start: 0 }]);
+ expect(jmespath.tokenize('`true`')).toMatchObject([{ type: 'Literal', value: true, start: 0 }]);
});
it('should tokenize raw strings', () => {
- expect(tokenize("'raw-string'")).toMatchObject([{ type: 'Literal', value: 'raw-string', start: 0 }]);
+ expect(jmespath.tokenize("'raw-string'")).toMatchObject([{ type: 'Literal', value: 'raw-string', start: 0 }]);
});
it('should tokenize raw strings single quote', () => {
- expect(tokenize("'\\''")).toMatchObject([{ type: 'Literal', value: "'", start: 0 }]);
+ expect(jmespath.tokenize("'\\''")).toMatchObject([{ type: 'Literal', value: "'", start: 0 }]);
});
it('should tokenize raw strings surrounding quotes', () => {
- expect(tokenize("'\\'raw-string\\''")).toMatchObject([{ type: 'Literal', value: "'raw-string'", start: 0 }]);
+ expect(jmespath.tokenize("'\\'raw-string\\''")).toMatchObject([
+ { type: 'Literal', value: "'raw-string'", start: 0 },
+ ]);
});
it('should tokenize raw strings backslash characters', () => {
- expect(tokenize("'\\\\'")).toMatchObject([{ type: 'Literal', value: '\\', start: 0 }]);
+ expect(jmespath.tokenize("'\\\\'")).toMatchObject([{ type: 'Literal', value: '\\', start: 0 }]);
});
it('should not require surrounding quotes for strings', () => {
- expect(tokenize('`foo`', { enable_legacy_literals: true })).toMatchObject([
+ expect(jmespath.tokenize('`foo`', { enable_legacy_literals: true })).toMatchObject([
{ type: 'Literal', value: 'foo', start: 0 },
]);
});
it('should not require surrounding quotes for numbers', () => {
- expect(tokenize('`20`')).toMatchObject([{ type: 'Literal', value: 20, start: 0 }]);
+ expect(jmespath.tokenize('`20`')).toMatchObject([{ type: 'Literal', value: 20, start: 0 }]);
});
it('should tokenize literal lists with chars afterwards', () => {
- expect(tokenize('`[0, 1]`[0]')).toMatchObject([
+ expect(jmespath.tokenize('`[0, 1]`[0]')).toMatchObject([
{ type: 'Literal', value: [0, 1], start: 0 },
{ type: 'Lbracket', value: '[', start: 8 },
{ type: 'Number', value: 0, start: 9 },
@@ -112,33 +116,33 @@ describe('tokenize', () => {
]);
});
it('should tokenize two char tokens with shared prefix', () => {
- expect(tokenize('[?foo]')).toMatchObject([
+ expect(jmespath.tokenize('[?foo]')).toMatchObject([
{ type: 'Filter', value: '[?', start: 0 },
{ type: 'UnquotedIdentifier', value: 'foo', start: 2 },
{ type: 'Rbracket', value: ']', start: 5 },
]);
});
it('should tokenize flatten operator', () => {
- expect(tokenize('[]')).toMatchObject([{ type: 'Flatten', value: '[]', start: 0 }]);
+ expect(jmespath.tokenize('[]')).toMatchObject([{ type: 'Flatten', value: '[]', start: 0 }]);
});
it('should tokenize comparators', () => {
- expect(tokenize('<')).toMatchObject([{ type: 'LT', value: '<', start: 0 }]);
+ expect(jmespath.tokenize('<')).toMatchObject([{ type: 'LT', value: '<', start: 0 }]);
});
it('should tokenize two char tokens without shared prefix', () => {
- expect(tokenize('==')).toMatchObject([{ type: 'EQ', value: '==', start: 0 }]);
+ expect(jmespath.tokenize('==')).toMatchObject([{ type: 'EQ', value: '==', start: 0 }]);
});
it('should tokenize not equals', () => {
- expect(tokenize('!=')).toMatchObject([{ type: 'NE', value: '!=', start: 0 }]);
+ expect(jmespath.tokenize('!=')).toMatchObject([{ type: 'NE', value: '!=', start: 0 }]);
});
it('should tokenize the OR token', () => {
- expect(tokenize('a||b')).toMatchObject([
+ expect(jmespath.tokenize('a||b')).toMatchObject([
{ type: 'UnquotedIdentifier', value: 'a', start: 0 },
{ type: 'Or', value: '||', start: 1 },
{ type: 'UnquotedIdentifier', value: 'b', start: 3 },
]);
});
it('should tokenize function calls', () => {
- expect(tokenize('abs(@)')).toMatchObject([
+ expect(jmespath.tokenize('abs(@)')).toMatchObject([
{ type: 'UnquotedIdentifier', value: 'abs', start: 0 },
{ type: 'Lparen', value: '(', start: 3 },
{ type: 'Current', value: '@', start: 4 },
diff --git a/test/jmespath-parser.spec.ts b/test/jmespath-parser.spec.ts
index 983001b..8a42b07 100644
--- a/test/jmespath-parser.spec.ts
+++ b/test/jmespath-parser.spec.ts
@@ -1,19 +1,19 @@
import { describe, expect, it } from 'vitest';
-import { compile } from '../src';
+import jmespath from '../src';
import { expectError } from './error.utils';
describe('parsing', () => {
it('should parse field node', () => {
- expect(compile('foo')).toMatchObject({ type: 'Field', name: 'foo' });
+ expect(jmespath.compile('foo')).toMatchObject({ type: 'Field', name: 'foo' });
});
it('should fail to parse invalid slice expressions', () => {
expectError(() => {
- compile('[:::]');
+ jmespath.compile('[:::]');
return null;
}, ['syntax', 'too many colons in slice expression']);
});
it('should parse arithmetic addition', () => {
- expect(compile('foo + bar')).toMatchObject({
+ expect(jmespath.compile('foo + bar')).toMatchObject({
type: 'Arithmetic',
operator: 'Plus',
left: { type: 'Field', name: 'foo' },
@@ -27,8 +27,8 @@ describe('parsing', () => {
left: { type: 'Field', name: 'foo' },
right: { type: 'Field', name: 'bar' },
};
- expect(compile('foo - bar')).toMatchObject(expected);
- expect(compile('foo โ bar')).toMatchObject(expected);
+ expect(jmespath.compile('foo - bar')).toMatchObject(expected);
+ expect(jmespath.compile('foo โ bar')).toMatchObject(expected);
});
it('should parse arithmetic unary negation', () => {
const expected = {
@@ -36,8 +36,8 @@ describe('parsing', () => {
operator: 'Minus',
operand: { type: 'Field', name: 'bar' },
};
- expect(compile('-bar')).toMatchObject(expected);
- expect(compile('\u2212bar')).toMatchObject(expected);
+ expect(jmespath.compile('-bar')).toMatchObject(expected);
+ expect(jmespath.compile('\u2212bar')).toMatchObject(expected);
});
it('should parse let expression', () => {
const expected = {
@@ -56,11 +56,11 @@ describe('parsing', () => {
],
expression: { type: 'Current' },
};
- expect(compile('let $foo = bar, $baz = qux in @')).toMatchObject(expected);
+ expect(jmespath.compile('let $foo = bar, $baz = qux in @')).toMatchObject(expected);
});
it('should fail to parse invalid let expression', () => {
expectError(() => {
- compile('let $foo = bar = qux');
+ jmespath.compile('let $foo = bar = qux');
return null;
}, 'syntax');
});
@@ -71,7 +71,7 @@ describe('parsing', () => {
left: { type: 'Current' },
right: { type: 'Literal' },
};
- expect(compile(" @ && 'truthy' ")).toMatchObject(expected);
- expect(compile("( @ && 'truthy' )")).toMatchObject(expected);
+ expect(jmespath.compile(" @ && 'truthy' ")).toMatchObject(expected);
+ expect(jmespath.compile("( @ && 'truthy' )")).toMatchObject(expected);
});
});
diff --git a/test/jmespath-ternary.spec.ts b/test/jmespath-ternary.spec.ts
index f609349..120ce53 100644
--- a/test/jmespath-ternary.spec.ts
+++ b/test/jmespath-ternary.spec.ts
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
-import { search } from '../src';
+import jmespath from '../src';
describe('JMESPath Ternary Operations', () => {
const data = {
@@ -16,75 +16,75 @@ describe('JMESPath Ternary Operations', () => {
describe('Basic Ternary Operations', () => {
it('should return foo when condition is true', () => {
- expect(search(data, 'true ? foo : bar')).toBe('foo');
+ expect(jmespath.search(data, 'true ? foo : bar')).toBe('foo');
});
it('should return bar when condition is false', () => {
- expect(search(data, 'false ? foo : bar')).toBe('bar');
+ expect(jmespath.search(data, 'false ? foo : bar')).toBe('bar');
});
it('should return bar when condition is null', () => {
- expect(search(data, '`null` ? foo : bar')).toBe('bar');
+ expect(jmespath.search(data, '`null` ? foo : bar')).toBe('bar');
});
it('should return bar when condition is empty array', () => {
- expect(search(data, '`[]` ? foo : bar')).toBe('bar');
+ expect(jmespath.search(data, '`[]` ? foo : bar')).toBe('bar');
});
it('should return bar when condition is not an empty array', () => {
- expect(search(data, '`[1]` ? foo : bar')).toBe('foo');
+ expect(jmespath.search(data, '`[1]` ? foo : bar')).toBe('foo');
});
it('should return bar when condition is empty object', () => {
- expect(search(data, '`{}` ? foo : bar')).toBe('bar');
+ expect(jmespath.search(data, '`{}` ? foo : bar')).toBe('bar');
});
it('should return bar when condition is empty string', () => {
- expect(search(data, "'' ? foo : bar")).toBe('bar');
+ expect(jmespath.search(data, "'' ? foo : bar")).toBe('bar');
});
});
describe('Chained Ternary Operations', () => {
it('should handle chained ternary operations', () => {
- expect(search(data, 'foo ? bar ? baz : qux : quux')).toBe('baz');
+ expect(jmespath.search(data, 'foo ? bar ? baz : qux : quux')).toBe('baz');
});
});
describe('Ternary Operations with Precedence', () => {
it('should handle precedence with pipes', () => {
- expect(search(data, 'false ? foo | bar | @ : baz')).toBe('baz');
+ expect(jmespath.search(data, 'false ? foo | bar | @ : baz')).toBe('baz');
});
it('should handle precedence with arithmetic', () => {
- expect(search(data, 'foo ? fourty + two : `false`')).toBe(42);
+ expect(jmespath.search(data, 'foo ? fourty + two : `false`')).toBe(42);
});
});
describe('Nested Ternary Operations', () => {
it('should handle left-nested ternary operations', () => {
- expect(search(data, 'true ? (true ? foo : bar) : baz')).toBe('foo');
- expect(search(data, 'true ? (false ? foo : bar) : baz')).toBe('bar');
- expect(search(data, 'false ? (true ? foo : bar) : baz')).toBe('baz');
+ expect(jmespath.search(data, 'true ? (true ? foo : bar) : baz')).toBe('foo');
+ expect(jmespath.search(data, 'true ? (false ? foo : bar) : baz')).toBe('bar');
+ expect(jmespath.search(data, 'false ? (true ? foo : bar) : baz')).toBe('baz');
});
it('should handle right-nested ternary operations', () => {
- expect(search(data, 'true ? foo : (true ? bar : baz)')).toBe('foo');
- expect(search(data, 'false ? foo : (true ? bar : baz)')).toBe('bar');
- expect(search(data, 'false ? foo : (false ? bar : baz)')).toBe('baz');
+ expect(jmespath.search(data, 'true ? foo : (true ? bar : baz)')).toBe('foo');
+ expect(jmespath.search(data, 'false ? foo : (true ? bar : baz)')).toBe('bar');
+ expect(jmespath.search(data, 'false ? foo : (false ? bar : baz)')).toBe('baz');
});
it('should handle multiple nested ternary operations', () => {
- expect(search(data, 'true ? (true ? (true ? foo : bar) : baz) : quux')).toBe('foo');
- expect(search(data, 'true ? (true ? (false ? foo : bar) : baz) : quux')).toBe('bar');
- expect(search(data, 'true ? (false ? (true ? foo : bar) : baz) : quux')).toBe('baz');
- expect(search(data, 'false ? (true ? (true ? foo : bar) : baz) : quux')).toBe('quux');
+ expect(jmespath.search(data, 'true ? (true ? (true ? foo : bar) : baz) : quux')).toBe('foo');
+ expect(jmespath.search(data, 'true ? (true ? (false ? foo : bar) : baz) : quux')).toBe('bar');
+ expect(jmespath.search(data, 'true ? (false ? (true ? foo : bar) : baz) : quux')).toBe('baz');
+ expect(jmespath.search(data, 'false ? (true ? (true ? foo : bar) : baz) : quux')).toBe('quux');
});
it('should handle mixed nested ternary operations with literals', () => {
- expect(search(data, 'true ? (`null` ? foo : bar) : baz')).toBe('bar');
- expect(search(data, 'true ? (`[]` ? foo : bar) : baz')).toBe('bar');
- expect(search(data, 'true ? (`{}` ? foo : bar) : baz')).toBe('bar');
- expect(search(data, "true ? ('' ? foo : bar) : baz")).toBe('bar');
+ expect(jmespath.search(data, 'true ? (`null` ? foo : bar) : baz')).toBe('bar');
+ expect(jmespath.search(data, 'true ? (`[]` ? foo : bar) : baz')).toBe('bar');
+ expect(jmespath.search(data, 'true ? (`{}` ? foo : bar) : baz')).toBe('bar');
+ expect(jmespath.search(data, "true ? ('' ? foo : bar) : baz")).toBe('bar');
});
it('should handle nested ternary operations with arithmetic', () => {
@@ -92,8 +92,8 @@ describe('JMESPath Ternary Operations', () => {
...data,
threshold: 40,
};
- expect(search(testData, 'true ? (fourty + two > threshold ? foo : bar) : baz')).toBe('foo');
- expect(search(testData, 'true ? (fourty + two < threshold ? foo : bar) : baz')).toBe('bar');
+ expect(jmespath.search(testData, 'true ? (fourty + two > threshold ? foo : bar) : baz')).toBe('foo');
+ expect(jmespath.search(testData, 'true ? (fourty + two < threshold ? foo : bar) : baz')).toBe('bar');
});
});
});
diff --git a/test/scopes.spec.ts b/test/scopes.spec.ts
index a2b3e43..069aeb3 100644
--- a/test/scopes.spec.ts
+++ b/test/scopes.spec.ts
@@ -1,20 +1,20 @@
import { describe, expect, it } from 'vitest';
-import { Scope } from '../src';
+import jmespath from '../src';
describe('scopes', () => {
it('should return null on missing identifier', () => {
- const scope = Scope();
+ const scope = jmespath.Scope();
expect(scope.getValue('foo')).toEqual(null);
});
it('should return item from scope', () => {
- const scope = Scope();
+ const scope = jmespath.Scope();
{
const outer = scope.withScope({ foo: 'bar' });
expect(outer.getValue('foo')).toEqual('bar');
}
});
it('should return item from nested scope', () => {
- const scope = Scope();
+ const scope = jmespath.Scope();
{
const outer = scope.withScope({ foo: 'bar', qux: 'quux' });
{
@@ -26,7 +26,7 @@ describe('scopes', () => {
}
});
it('should not return value for non-existent identifiers', () => {
- const scope = Scope();
+ const scope = jmespath.Scope();
{
const scoped = scope.withScope({ foo: 'bar' });
expect(scoped.getValue('baz')).toEqual(null);
@@ -34,7 +34,7 @@ describe('scopes', () => {
}
});
it('should return null for identifiers even in nested scopes if absent', () => {
- const scope = Scope();
+ const scope = jmespath.Scope();
{
const outer = scope.withScope({ foo: 'bar' });
{
@@ -45,7 +45,7 @@ describe('scopes', () => {
}
});
it('should handle values in nested scopes differently from outer scopes', () => {
- const scope = Scope();
+ const scope = jmespath.Scope();
{
const outer = scope.withScope({ foo: 'bar' });
{
@@ -56,7 +56,7 @@ describe('scopes', () => {
}
});
it('should not fall through to outer scope when key is in current scope with null/undefined', () => {
- const scope = Scope();
+ const scope = jmespath.Scope();
{
const outer = scope.withScope({ foo: 'bar' });
{
@@ -66,7 +66,7 @@ describe('scopes', () => {
}
});
it('should properly differentiate between keys absent entirely and those in outer scopes', () => {
- const scope = Scope();
+ const scope = jmespath.Scope();
{
const outer = scope.withScope({ foo: 'bar' });
{
diff --git a/tsconfig.json b/tsconfig.json
index f558846..8b58593 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -11,6 +11,7 @@
"outDir": "./dist",
"rootDir": "./src",
"declaration": true,
+ "declarationMap": true,
"sourceMap": true,
"isolatedModules": true,
"resolveJsonModule": true,
@@ -20,7 +21,10 @@
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
- "strictNullChecks": true
+ "strictNullChecks": true,
+ "useDefineForClassFields": true,
+ "allowUnusedLabels": false,
+ "allowUnreachableCode": false
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "dist", "src/**/*.test.ts"]
diff --git a/tsup.config.ts b/tsup.config.ts
index 36bdabb..006f232 100644
--- a/tsup.config.ts
+++ b/tsup.config.ts
@@ -1,114 +1,86 @@
-import { defineConfig } from 'tsup';
+import { defineConfig, Options } from 'tsup';
+
+const baseConfig: Options = {
+ dts: true,
+ sourcemap: true,
+ clean: true,
+ treeshake: true,
+ splitting: false,
+};
+
+const nodeConfig: Options = {
+ ...baseConfig,
+ platform: 'node',
+ target: 'es2022',
+ format: ['cjs', 'esm'],
+ outDir: 'dist',
+ outExtension({ format }) {
+ return {
+ js: format === 'cjs' ? '.cjs' : '.mjs',
+ };
+ },
+};
+
+const browserConfig: Options = {
+ ...baseConfig,
+ platform: 'browser',
+ target: 'es2020',
+ globalName: 'jmespath',
+};
export default defineConfig([
- // Library build - Node.js
+ // Library builds
{
+ ...nodeConfig,
entry: ['src/index.ts'],
- format: ['cjs', 'esm'],
- dts: true,
- sourcemap: true,
- clean: true,
- outDir: 'dist',
- outExtension({ format }) {
- return {
- js: format === 'cjs' ? '.cjs' : '.mjs',
- };
- },
- target: 'es2022',
- platform: 'node',
- splitting: false,
- treeshake: true,
},
- // Library build - Browser UMD
{
+ ...browserConfig,
entry: ['src/index.ts'],
- format: ['iife'],
- dts: false, // Types already generated above
- sourcemap: true,
- outDir: 'dist',
+ format: ['esm'],
outExtension() {
return {
- js: '.umd.js',
+ js: '.esm.js',
};
},
- target: 'es2020', // Broader browser compatibility
- platform: 'browser',
- globalName: 'jmespath',
- splitting: false,
- treeshake: true,
- minify: false,
},
- // Library build - Browser UMD Minified
{
+ ...browserConfig,
entry: ['src/index.ts'],
- format: ['iife'],
- dts: false,
- sourcemap: true,
- outDir: 'dist',
+ format: ['esm'],
+ minify: true,
outExtension() {
return {
- js: '.umd.min.js',
+ js: '.esm.min.js',
};
},
- target: 'es2020',
- platform: 'browser',
- globalName: 'jmespath',
- splitting: false,
- treeshake: true,
- minify: true,
},
- // Library build - Browser ESM
{
+ ...browserConfig,
entry: ['src/index.ts'],
- format: ['esm'],
- dts: false,
- sourcemap: true,
- outDir: 'dist',
+ format: ['iife'],
outExtension() {
return {
- js: '.esm.js',
+ js: '.umd.js',
};
},
- target: 'es2020',
- platform: 'browser',
- splitting: false,
- treeshake: true,
- minify: false,
},
- // Library build - Browser ESM Minified
{
+ ...browserConfig,
entry: ['src/index.ts'],
- format: ['esm'],
- dts: false,
- sourcemap: true,
- outDir: 'dist',
+ format: ['iife'],
+ minify: true,
outExtension() {
return {
- js: '.esm.min.js',
+ js: '.umd.min.js',
};
},
- target: 'es2020',
- platform: 'browser',
- splitting: false,
- treeshake: true,
- minify: true,
},
- // CLI build - ESM only (since package.json points to .mjs)
+ // CLI build
{
+ ...nodeConfig,
entry: ['src/cli.ts'],
- format: ['esm'],
dts: true,
- sourcemap: true,
- outDir: 'dist',
- outExtension() {
- return {
- js: '.mjs',
- };
- },
- target: 'es2022',
- platform: 'node',
- splitting: false,
- treeshake: true,
banner: {
js: '#!/usr/bin/env node',
},