diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml index b0b8f52f..7041031f 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/actions.yaml @@ -4,9 +4,11 @@ on: pull_request: branches: - main + - master push: branches: - main + - master jobs: build: @@ -24,7 +26,12 @@ jobs: cache: npm - run: npm ci - run: npm run build - # - run: npm test + - name: Upload site for preview validation + uses: actions/upload-artifact@v4 + with: + name: site-dist + path: dist/ + retention-days: 1 check: runs-on: ubuntu-latest @@ -37,3 +44,15 @@ jobs: cache: npm - run: npm ci - run: npm run check + - run: npm run check:security-compat + - run: npm run check:braces-backport + - name: Audit all installed dependencies + shell: bash + run: npm audit --json | tee audit.json + - name: Upload full audit report + if: always() + uses: actions/upload-artifact@v4 + with: + name: dependency-audit + path: audit.json + retention-days: 1 diff --git a/.prettierignore b/.prettierignore index 9ffda029..030d94b7 100644 --- a/.prettierignore +++ b/.prettierignore @@ -8,4 +8,8 @@ node_modules/ *.min.css # Dependency files -package-lock.json \ No newline at end of file +package-lock.json + +# Preserve upstream source/test formatting for backport review +vendor/braces-backport/source/ +vendor/braces-backport/upstream-tests/ diff --git a/eslint.config.js b/eslint.config.js index d1b5583f..e423e910 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -59,6 +59,8 @@ export default [ "node_modules", ".github", "types.generated.d.ts", + "vendor/braces-backport/source/**", + "vendor/braces-backport/upstream-tests/**", ".astro", ], }, diff --git a/package-lock.json b/package-lock.json index 3048b00a..4604fa51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@astrolib/seo": "^1.0.0-beta.8", "@fontsource-variable/inter": "^5.2.6", "@fontsource-variable/outfit": "^5.2.8", - "astro": "^7.2.2", + "astro": "7.2.8", "astro-embed": "^0.13.1", "astro-icon": "^1.1.5", "limax": "4.1.0", @@ -34,23 +34,24 @@ "@types/js-yaml": "^4.0.9", "@types/lodash.merge": "^4.6.9", "@types/mdx": "^2.0.13", - "@typescript-eslint/eslint-plugin": "^8.39.0", - "@typescript-eslint/parser": "^8.39.0", + "@typescript-eslint/eslint-plugin": "8.71.1", + "@typescript-eslint/parser": "8.71.1", "astro-compress": "2.4.3", "astro-eslint-parser": "^1.2.2", + "braces": "file:vendor/braces-backport/braces-3.0.3-depth-guard.1.tgz", "eslint": "^9.33.0", "eslint-plugin-astro": "^1.3.1", "globals": "^16.3.0", - "js-yaml": "4.3.1", + "js-yaml": "4.3.2", "mdast-util-to-string": "^4.0.0", "prettier": "^3.6.2", "prettier-plugin-astro": "^0.14.1", "reading-time": "^1.5.0", - "sharp": "0.35.3", + "sharp": "0.35.5", "tailwind-merge": "^2.6.0", "tailwindcss": "^3.4.17", "typescript": "^5.8.3", - "typescript-eslint": "^8.39.0", + "typescript-eslint": "8.71.1", "unist-util-visit": "^5.0.0" }, "engines": { @@ -282,29 +283,46 @@ "license": "MIT" }, "node_modules/@astrojs/compiler-binding": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding/-/compiler-binding-0.3.2.tgz", - "integrity": "sha512-8w/9CWmYrAJJ8N0SY3O43ws2BgxoW6u3QsD8u2mE140lMYAlwh+tlNoUeSBq22wVheFuiBbR212l6ixZ2IIgCQ==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding/-/compiler-binding-0.4.1.tgz", + "integrity": "sha512-ZYVDW1P58OXyxqZbOMp+/2U9KA7y2esIx9r4pWdpZ/l6fCZhaw4ul+D7EgpRVxYLkyTWqzANbTTUFGPFP8zDHA==", "license": "MIT", "engines": { "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@astrojs/compiler-binding-darwin-arm64": "0.3.2", - "@astrojs/compiler-binding-darwin-x64": "0.3.2", - "@astrojs/compiler-binding-linux-arm64-gnu": "0.3.2", - "@astrojs/compiler-binding-linux-arm64-musl": "0.3.2", - "@astrojs/compiler-binding-linux-x64-gnu": "0.3.2", - "@astrojs/compiler-binding-linux-x64-musl": "0.3.2", - "@astrojs/compiler-binding-wasm32-wasi": "0.3.2", - "@astrojs/compiler-binding-win32-arm64-msvc": "0.3.2", - "@astrojs/compiler-binding-win32-x64-msvc": "0.3.2" + "@astrojs/compiler-binding-android-arm64": "0.4.1", + "@astrojs/compiler-binding-darwin-arm64": "0.4.1", + "@astrojs/compiler-binding-darwin-x64": "0.4.1", + "@astrojs/compiler-binding-linux-arm64-gnu": "0.4.1", + "@astrojs/compiler-binding-linux-arm64-musl": "0.4.1", + "@astrojs/compiler-binding-linux-x64-gnu": "0.4.1", + "@astrojs/compiler-binding-linux-x64-musl": "0.4.1", + "@astrojs/compiler-binding-wasm32-wasi": "0.4.1", + "@astrojs/compiler-binding-win32-arm64-msvc": "0.4.1", + "@astrojs/compiler-binding-win32-x64-msvc": "0.4.1" + } + }, + "node_modules/@astrojs/compiler-binding-android-arm64": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-android-arm64/-/compiler-binding-android-arm64-0.4.1.tgz", + "integrity": "sha512-Wtx2DZORuNTLASLLZ8hlrjFaJe1LUloatcCn9EPq7knBhRpjMGXeJANIJMeBZG4igvz7x+3nyAJM2iwCSW9xog==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, "node_modules/@astrojs/compiler-binding-darwin-arm64": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-darwin-arm64/-/compiler-binding-darwin-arm64-0.3.2.tgz", - "integrity": "sha512-MM8tn8CSimcfytaOla4b6acN8mKWiL/rlAA1fpT3/Wl7dNGSE4y8FjTN/zJVNnb63CsLWG5zZwCt01TXtDKh9g==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-darwin-arm64/-/compiler-binding-darwin-arm64-0.4.1.tgz", + "integrity": "sha512-7iwXcU+hB60Y1SvOfnWHNioT72gDsDQKaDipXh2Onwp/TvQMozhbvhy13wJR8Af940a0h6PbddCeJFpj791UDA==", "cpu": [ "arm64" ], @@ -318,9 +336,9 @@ } }, "node_modules/@astrojs/compiler-binding-darwin-x64": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-darwin-x64/-/compiler-binding-darwin-x64-0.3.2.tgz", - "integrity": "sha512-2lXOlzf8xb7jLomRsf/aswh61/NnGusynB2OwFkK6k4pmOtpfXMYnG0PLfXrEvxXYj69NdCnmUYXtHDd+JOOag==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-darwin-x64/-/compiler-binding-darwin-x64-0.4.1.tgz", + "integrity": "sha512-pifjICos49RXhSVKSDu5gDB0/8j0O7DmxSp1DaWW2PyLG5ekwSkcrfOZto5JqhdI7QYMZB3XOiXpsdOXpS4npA==", "cpu": [ "x64" ], @@ -334,9 +352,9 @@ } }, "node_modules/@astrojs/compiler-binding-linux-arm64-gnu": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-linux-arm64-gnu/-/compiler-binding-linux-arm64-gnu-0.3.2.tgz", - "integrity": "sha512-BmU3kWj7qnLrd4vzm49zFEPJ5oFnn1tCT4Vt9hZbqdU5Cmb8GZl7fn6VFsnNfe7B18a2gIFtVzbLINtYl5kBjQ==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-linux-arm64-gnu/-/compiler-binding-linux-arm64-gnu-0.4.1.tgz", + "integrity": "sha512-hsZMlNWc6LqWHh9LlSwTq1/XCY7pxA5rkkKIdZRV8mgbOz9OwLvjEoe5Jry13eIZjMUQO8XnQyzk8o/Pjw2YFA==", "cpu": [ "arm64" ], @@ -350,9 +368,9 @@ } }, "node_modules/@astrojs/compiler-binding-linux-arm64-musl": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-linux-arm64-musl/-/compiler-binding-linux-arm64-musl-0.3.2.tgz", - "integrity": "sha512-f0heT9ZZEseSu5bHCeb80eL2DH07ArE6U9xi1WT/PEusNjzPmEr3GJsjG1tRLo5VYUUYX7h3ScaqGmGrMOVGmw==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-linux-arm64-musl/-/compiler-binding-linux-arm64-musl-0.4.1.tgz", + "integrity": "sha512-a3EW27f+Z9uf57vYmpLgUriA1y9wDhKz57PT8D8XlFZt2HZEWhUxKuxI1jvKVI9p8okYee11WXEm/FHY1G9yoQ==", "cpu": [ "arm64" ], @@ -366,9 +384,9 @@ } }, "node_modules/@astrojs/compiler-binding-linux-x64-gnu": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-linux-x64-gnu/-/compiler-binding-linux-x64-gnu-0.3.2.tgz", - "integrity": "sha512-M8fOUt0itRpqiGyoEA/ij184s8O+hqbCz3+YozRusOOM3osgGljpDThhbKAJjqh82wOo6FioQ4w8PBvU1XMD5Q==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-linux-x64-gnu/-/compiler-binding-linux-x64-gnu-0.4.1.tgz", + "integrity": "sha512-XruPTKB/SS4DFzeAjQ1ZyM0ieHDjapHkOSnnzRApZ4FXY2YAI7UY3mETjfJiIS/acyZyrnPH5jObv1gATTdUJQ==", "cpu": [ "x64" ], @@ -382,9 +400,9 @@ } }, "node_modules/@astrojs/compiler-binding-linux-x64-musl": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-linux-x64-musl/-/compiler-binding-linux-x64-musl-0.3.2.tgz", - "integrity": "sha512-/Kebk8sO6HnLeSd691JkaAPfN7CqR9/KEXmWvyNPkaKNGmj8rTZ/lf2uXtnPu92Lan84UrKdIKVPy1fSo2encQ==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-linux-x64-musl/-/compiler-binding-linux-x64-musl-0.4.1.tgz", + "integrity": "sha512-E8j7lGanqNpudtkUbsFaOLJhmwFe4Ecqux7K9hkj4wULIPNZRM2bYZNcMSj8r1oWvaUiwZl8LaaNwv3+14jqhw==", "cpu": [ "x64" ], @@ -398,25 +416,25 @@ } }, "node_modules/@astrojs/compiler-binding-wasm32-wasi": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-wasm32-wasi/-/compiler-binding-wasm32-wasi-0.3.2.tgz", - "integrity": "sha512-pUA6xbcOSB7DhfzIArB8BCAkFfAIqriiR7zl5zOStd6oU2G0kIKj+GUdGnyXyhfiv881Hffyk5tC0mR18sDjDw==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-wasm32-wasi/-/compiler-binding-wasm32-wasi-0.4.1.tgz", + "integrity": "sha512-vNLxIv41ZE+nmPFtw24cRW5ZXG+ZPcAGtgigtjCP8lvcxKI7u2GrXoMsCgEH5fMw8WCEJpwLvsVBg15rJKAkyA==", "cpu": [ "wasm32" ], "license": "MIT", "optional": true, "dependencies": { - "@napi-rs/wasm-runtime": "^1.2.0" + "@napi-rs/wasm-runtime": "^1.2.4" }, "engines": { "node": ">=14.0.0" } }, "node_modules/@astrojs/compiler-binding-win32-arm64-msvc": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-win32-arm64-msvc/-/compiler-binding-win32-arm64-msvc-0.3.2.tgz", - "integrity": "sha512-ESruf+6Qkl1trHUFxI6GSf6t52j8yN2kCNSzMWdzt7V/T09tFHrYzrVaJQohb2C9bJUH76pNvX6Zb51+xCQc9Q==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-win32-arm64-msvc/-/compiler-binding-win32-arm64-msvc-0.4.1.tgz", + "integrity": "sha512-/xTDgRsFDoTh0/+KFXJ74DY4Jqn8CoSHwa8UP5RAblHfnRHkenwfSl4zYDET61O9vXKLk09UzHjjq09yP20/AQ==", "cpu": [ "arm64" ], @@ -430,9 +448,9 @@ } }, "node_modules/@astrojs/compiler-binding-win32-x64-msvc": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-win32-x64-msvc/-/compiler-binding-win32-x64-msvc-0.3.2.tgz", - "integrity": "sha512-wzzVrEbOwbsLWOdEbocskjMRx2aZPxJ7ZbmL+jnpBamFwmigm+2M/wzuM6JWncocgYwLic1csSpalBh96kQKXA==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-win32-x64-msvc/-/compiler-binding-win32-x64-msvc-0.4.1.tgz", + "integrity": "sha512-0x5J6iHZO0Fjo/CVzoIbXKzWnGESftDbEUQ/oXQ61HhUAFoR7+T1jfToZSNAS+gYyBXHSTpMWYC7lzarbhClcg==", "cpu": [ "x64" ], @@ -446,12 +464,12 @@ } }, "node_modules/@astrojs/compiler-rs": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@astrojs/compiler-rs/-/compiler-rs-0.3.2.tgz", - "integrity": "sha512-xlx/T7JovIKduu4ucbTQUxQ5+Q8wxkHxhLjnZk3VlJbhbQ9RLvvuDk1p2YYFYFQ5y14dVm3FGGO4isQXa4F+Tg==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-rs/-/compiler-rs-0.4.1.tgz", + "integrity": "sha512-//NmAuRhy7eU9iP0ceI5Pymy55M+nUZ//kS6XeOyhBWdDib2KbJOyFaVJ52k7sDkJwTKVox7oPu3SpYiVnGm5A==", "license": "MIT", "dependencies": { - "@astrojs/compiler-binding": "0.3.2" + "@astrojs/compiler-binding": "0.4.1" }, "engines": { "node": ">=22.12.0" @@ -461,6 +479,7 @@ "version": "0.10.2", "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.10.2.tgz", "integrity": "sha512-yt7fMgPYqSM4Tmr+taTW6Per+hjJ8Pk6lA1PAcDyqzOt8HzJ6Kje5WzCxA2Sd+9wsUW7uhkLeoTMK0cXPwH9rQ==", + "dev": true, "license": "MIT", "dependencies": { "@types/hast": "^3.0.4", @@ -542,16 +561,31 @@ } }, "node_modules/@astrojs/markdown-satteri": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@astrojs/markdown-satteri/-/markdown-satteri-0.3.5.tgz", - "integrity": "sha512-CvWVEFAbay7YO+i9SaqDJubipA5ckiVB89QWoMJ5XC0m5CtFg8JwZ7Kau6X9sYY7FZURH0w2l03ISH2jOS/RDQ==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@astrojs/markdown-satteri/-/markdown-satteri-0.3.8.tgz", + "integrity": "sha512-n8ItpFTCmlDsVR5+rwDmehSf+jFCYLWmZiisZNGuF7xILqYhsVeBfcha4qgS2Seq3fAc9Tm58ZVrvqFQ6RQgRQ==", "license": "MIT", "dependencies": { - "@astrojs/internal-helpers": "0.10.2", + "@astrojs/internal-helpers": "0.10.4", "@astrojs/prism": "4.0.2", "github-slugger": "^2.0.0", - "hast-util-from-html": "^2.0.3", - "satteri": "^0.9.1" + "satteri": "^0.10.3" + } + }, + "node_modules/@astrojs/markdown-satteri/node_modules/@astrojs/internal-helpers": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.10.4.tgz", + "integrity": "sha512-nozZSy/mKYLqe4YrqbKtdOszedAfXYCtw3wZ0d+CAjz4GqQ4L9rl1ltIL5BlgwmYVinJg/RZ0MgGuWOdlyRZlA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.4", + "@types/mdast": "^4.0.4", + "js-yaml": "^4.3.0", + "picomatch": "^4.0.4", + "retext-smartypants": "^6.2.0", + "shiki": "^4.0.2", + "smol-toml": "^1.6.0", + "unified": "^11.0.5" } }, "node_modules/@astrojs/mdx": { @@ -845,9 +879,9 @@ } }, "node_modules/@bruits/satteri-darwin-arm64": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@bruits/satteri-darwin-arm64/-/satteri-darwin-arm64-0.9.5.tgz", - "integrity": "sha512-iw4nZgx9v30lWo/MTngQqi1pI78KI0DnkSm+lVJGYdmPLgAyDNJigVhpG42/Iq55A6c1Ll8q66ljyyRiQUxwow==", + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@bruits/satteri-darwin-arm64/-/satteri-darwin-arm64-0.10.5.tgz", + "integrity": "sha512-27KTVl4TJkVahMy/ohyA7qd4938G5UNneFUz/PsScYfpIhj0IVAS23mpcJXdPF44sa6nva198lmV/cKIb2YPyA==", "cpu": [ "arm64" ], @@ -858,9 +892,9 @@ ] }, "node_modules/@bruits/satteri-darwin-x64": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@bruits/satteri-darwin-x64/-/satteri-darwin-x64-0.9.5.tgz", - "integrity": "sha512-6T26Z5Kf3cFW2PSlk9p7zT7yVxvuBSiJvYyz9u8KjYwMTqZyIDOj2wDyNpxKV4+6yUVG7rddq2QwvG/8LJA2+Q==", + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@bruits/satteri-darwin-x64/-/satteri-darwin-x64-0.10.5.tgz", + "integrity": "sha512-IjnLe3nKspq6qaeqGgjT7MT8VrTV74yWRlaag7ZdNsI8TDAYZ0iPxMCo+9KQZHUk5EyVB+reBI/PFWL5KuFw9Q==", "cpu": [ "x64" ], @@ -871,9 +905,9 @@ ] }, "node_modules/@bruits/satteri-linux-arm64-gnu": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-arm64-gnu/-/satteri-linux-arm64-gnu-0.9.5.tgz", - "integrity": "sha512-u51id17uJwNEMK9nBlICsq6U31c+XVqQueVBkwRIzZG+gMpS8TOJctt5h5Wz33Z8xnMdTd+adtACVz0yHgGuOA==", + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-arm64-gnu/-/satteri-linux-arm64-gnu-0.10.5.tgz", + "integrity": "sha512-glkYXZCJywjP13v67eAyAMSJdF+ncvEbYvgi/wOtffL9tQ27lr/zsyzUfgs+ovjJ9d8JNQKiXeiArJcX8PJL9w==", "cpu": [ "arm64" ], @@ -884,9 +918,9 @@ ] }, "node_modules/@bruits/satteri-linux-arm64-musl": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-arm64-musl/-/satteri-linux-arm64-musl-0.9.5.tgz", - "integrity": "sha512-v39HxiwGC5Rqm01HksP6+5Y+xKLPlsuVFgIgpEAo+SiQ22c+mJVhS3u7Z6ePAKdhL5NJoK1xq70kLz3L13AhpQ==", + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-arm64-musl/-/satteri-linux-arm64-musl-0.10.5.tgz", + "integrity": "sha512-yWdgG1g17Nh2QyGVlFUxGRa3FEFwiMcpZEyMNWkbM3deC94cmVc+/i9OuyFpdKuWo3GkgoCtYVOoxk1uCnCZIA==", "cpu": [ "arm64" ], @@ -897,9 +931,9 @@ ] }, "node_modules/@bruits/satteri-linux-x64-gnu": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-x64-gnu/-/satteri-linux-x64-gnu-0.9.5.tgz", - "integrity": "sha512-F3uO8uFp3pAP5ZGXttwvh57GS7s0lL953tnNdyI2gRyP4kOOkp6pyGojNJzCjkDvWI2Cvb9iNrKok3aqQPauAw==", + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-x64-gnu/-/satteri-linux-x64-gnu-0.10.5.tgz", + "integrity": "sha512-FVaLoPT1fBgGl0J+AYebyyXJYBachGl8Oyyrf1lye4RTqCB4S0Gwkj1uM9RJyThUOvx5VUmAT1CnNh1SFHA+kw==", "cpu": [ "x64" ], @@ -910,9 +944,9 @@ ] }, "node_modules/@bruits/satteri-linux-x64-musl": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-x64-musl/-/satteri-linux-x64-musl-0.9.5.tgz", - "integrity": "sha512-bicEqglLlz++mWyADaZoP0JY20s4vDfLjaPYgQqC+NI4zZLTOOg1T4GB8aqtc822Pqji8SQBmSrTb7CrP8i08Q==", + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-x64-musl/-/satteri-linux-x64-musl-0.10.5.tgz", + "integrity": "sha512-EHpVAx2bqW3GINHTKkljtxVfQmVDGWIuwOYOP5YghTj+0PkBa2o8oKPRtQ9Kbsr1Fye8jtUcDjhwj2jMNugZKg==", "cpu": [ "x64" ], @@ -923,9 +957,9 @@ ] }, "node_modules/@bruits/satteri-wasm32-wasi": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@bruits/satteri-wasm32-wasi/-/satteri-wasm32-wasi-0.9.5.tgz", - "integrity": "sha512-zauAuMwfPnKPUkd4AFixRFpXdgKwP2mKgxrIIo2gJzW0/ZneF9dbHnLkojSpaBnCCp7VUL1hIi5WWZvB1CqmAQ==", + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@bruits/satteri-wasm32-wasi/-/satteri-wasm32-wasi-0.10.5.tgz", + "integrity": "sha512-ypz8c/Zmipxp4IoeDa228Gstv6TLzVmNs3yC6wKCoNSOjx1iwpgzu87Y3hTkXFdwChVGU85qeUDuOIarGUZQLw==", "cpu": [ "wasm32" ], @@ -934,16 +968,16 @@ "dependencies": { "@emnapi/core": "1.11.1", "@emnapi/runtime": "1.11.1", - "@napi-rs/wasm-runtime": "^1.1.6" + "@napi-rs/wasm-runtime": "^1.2.3" }, "engines": { "node": ">=14.0.0" } }, "node_modules/@bruits/satteri-win32-arm64-msvc": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@bruits/satteri-win32-arm64-msvc/-/satteri-win32-arm64-msvc-0.9.5.tgz", - "integrity": "sha512-SrfE7NEsgZjBvU3c+RR6oQRu0ToXY5uVJEbieXEF0YTctIV2zAVlbaMjWLts074QCgh3a+XHWkR/lWh2VH2LUg==", + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@bruits/satteri-win32-arm64-msvc/-/satteri-win32-arm64-msvc-0.10.5.tgz", + "integrity": "sha512-siTV88nb0LRqNpkL2gXboqCwVdq95sLtzMHS1/3eONV2gLbB3NAK46wmSMvCO/yquBvI2lvaFIfd8P12ecsxBw==", "cpu": [ "arm64" ], @@ -954,9 +988,9 @@ ] }, "node_modules/@bruits/satteri-win32-x64-msvc": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@bruits/satteri-win32-x64-msvc/-/satteri-win32-x64-msvc-0.9.5.tgz", - "integrity": "sha512-5Kw9ZAtTGS8WHizyn+CJhjjfIQrw+7jcZodpmpXJjefnO15M8UexIi6JR2E5thyvsmHyhL6ZDDMUNR4bKJPd4g==", + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@bruits/satteri-win32-x64-msvc/-/satteri-win32-x64-msvc-0.10.5.tgz", + "integrity": "sha512-C3IfPvfvMXmlzBxaMPKFS1XiuV9pu2mC7YqkPk7PSvTgPZ8gbdASIpHpztDLvTTQjqZ0z1Ol8tK5X+V6XXC0wQ==", "cpu": [ "x64" ], @@ -1525,9 +1559,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.10.1.tgz", + "integrity": "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==", "dev": true, "license": "MIT", "dependencies": { @@ -1544,9 +1578,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", - "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true, "license": "MIT", "engines": { @@ -1855,12 +1889,13 @@ } }, "node_modules/@img/sharp-darwin-arm64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.3.tgz", - "integrity": "sha512-RMnFX7YQsMoh7lWfcM4NEHHymBX/rLuKNPVM84XE9ONPcaSCDgE7CHIHpSgPcO2xcRthgBy1HfNO319mwhIAkg==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.5.tgz", + "integrity": "sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg==", "cpu": [ "arm64" ], + "dev": true, "license": "Apache-2.0", "optional": true, "os": [ @@ -1873,16 +1908,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.3.2" + "@img/sharp-libvips-darwin-arm64": "1.3.4" } }, "node_modules/@img/sharp-darwin-x64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.3.tgz", - "integrity": "sha512-Xo+5uFBtLN0BKqieTxiFzFPQAUlBbbH5iBKyRX/z1JrbnYsHTfKJnUfL8+p2TPXr1pXqao4eeL4Rl144uDpK9w==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.5.tgz", + "integrity": "sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw==", "cpu": [ "x64" ], + "dev": true, "license": "Apache-2.0", "optional": true, "os": [ @@ -1895,20 +1931,21 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.3.2" + "@img/sharp-libvips-darwin-x64": "1.3.4" } }, "node_modules/@img/sharp-freebsd-wasm32": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.3.tgz", - "integrity": "sha512-lUxcqWIj2wMQ9BrwNjngcr1gWUr5xgaGThBRqPPalIC2n67Cqj1uPh8NnA/ZhAg8hUbKl+kVHKwgUIwe6ZYPrg==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.5.tgz", + "integrity": "sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw==", + "dev": true, "license": "Apache-2.0", "optional": true, "os": [ "freebsd" ], "dependencies": { - "@img/sharp-wasm32": "0.35.3" + "@img/sharp-wasm32": "0.35.5" }, "engines": { "node": ">=20.9.0" @@ -1918,12 +1955,13 @@ } }, "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.2.tgz", - "integrity": "sha512-9J6ypZFpQBj4YnePGoq/S38w6nz+vqg5WZLrLGY4YuSemdMq47GMLBPO42MzwdGwpg/agZ7xzZcFHa48xlywfg==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.4.tgz", + "integrity": "sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw==", "cpu": [ "arm64" ], + "dev": true, "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1934,12 +1972,13 @@ } }, "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.2.tgz", - "integrity": "sha512-m2pW1n6cns9VaubNwsZ+c3CRYjxNQWgJ5gPlnL1nbBcpkBvFm6SCFN5o0psFHI8w9n11NKhFkeEDns98tiqbEw==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.4.tgz", + "integrity": "sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ==", "cpu": [ "x64" ], + "dev": true, "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1950,12 +1989,13 @@ } }, "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.2.tgz", - "integrity": "sha512-1eMLzy92I4J6rmi4mAT8yC3HxOtniyGELlzGbNMLLeqe052ahFQ0h6LFq+lh5DsDIdYViIDst08abvSbcEdLXQ==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.4.tgz", + "integrity": "sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==", "cpu": [ "arm" ], + "dev": true, "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1966,12 +2006,13 @@ } }, "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.2.tgz", - "integrity": "sha512-dqVSFynCox4C/J8kT16V7SIFAns0IjgLwkvYT7p8LQVmJ5OS5b6tI9IGflxTeuBS//zXeFIUbwt5dwxyZ17cnA==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.4.tgz", + "integrity": "sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==", "cpu": [ "arm64" ], + "dev": true, "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1982,12 +2023,13 @@ } }, "node_modules/@img/sharp-libvips-linux-ppc64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.2.tgz", - "integrity": "sha512-3z0NHDxD6n5I9gc05U1eW1AyRm+Gznzq3naMrthPNqE6oYykcogW0l/jfpJdjYnuNl8R7yI9pNbE1XiUeyq0Aw==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.4.tgz", + "integrity": "sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==", "cpu": [ "ppc64" ], + "dev": true, "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1998,12 +2040,13 @@ } }, "node_modules/@img/sharp-libvips-linux-riscv64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.2.tgz", - "integrity": "sha512-bsb4rI+NldGOsXuej2r8OdSS8+zXDVaCWxyWrcv6kneTOlgAHtZABRzBBCwdsPiD90J4myNJuHpg6kA20ImW/w==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.4.tgz", + "integrity": "sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==", "cpu": [ "riscv64" ], + "dev": true, "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -2014,12 +2057,13 @@ } }, "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.2.tgz", - "integrity": "sha512-/ABshyj8gCpyIrNXnHn4LorDJ0HHm1VhXPBlxZ8zAtfVPAaSafXPGn+sUSIRiwaSBy0mmFjSjiXI5mkcwdChKQ==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.4.tgz", + "integrity": "sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==", "cpu": [ "s390x" ], + "dev": true, "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -2030,12 +2074,13 @@ } }, "node_modules/@img/sharp-libvips-linux-x64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.2.tgz", - "integrity": "sha512-ITPEtgffGJ0S6G9dRyw/366tJQqFRcHWPHhC+Stpg3Z8AEMrDrTr2lhdz4f/Y/HMbRh//7Z5mBzEpVdi62Oc3w==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.4.tgz", + "integrity": "sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==", "cpu": [ "x64" ], + "dev": true, "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -2046,12 +2091,13 @@ } }, "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.2.tgz", - "integrity": "sha512-zE9EdiUzUmg5mDT5a1rk5fYJ6GWPloTwWBYDS14naqHsL+EaMpDj1AWnpLgh3u0YCORv2Tt50wrcrpYqkP97Kw==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.4.tgz", + "integrity": "sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==", "cpu": [ "arm64" ], + "dev": true, "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -2062,12 +2108,13 @@ } }, "node_modules/@img/sharp-libvips-linuxmusl-x64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.2.tgz", - "integrity": "sha512-m0lrLiUt+lBYnCFr8qV/65yMR4E/c7/wf78I5eKTdkEakFAlZ9QlzEM3QIhhAwVeUhLAHLcCq7a7Vszq/oFNZQ==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.4.tgz", + "integrity": "sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==", "cpu": [ "x64" ], + "dev": true, "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -2078,12 +2125,13 @@ } }, "node_modules/@img/sharp-linux-arm": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.3.tgz", - "integrity": "sha512-affVWCTLooy8TSxbDx2qkzuDeaWLNVBA+P//FNBirHsXpP2fuBhk5AuboYUnrDnzoXes8GFjpTx0SBFOCRg+FA==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.5.tgz", + "integrity": "sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==", "cpu": [ "arm" ], + "dev": true, "license": "Apache-2.0", "optional": true, "os": [ @@ -2096,16 +2144,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.3.2" + "@img/sharp-libvips-linux-arm": "1.3.4" } }, "node_modules/@img/sharp-linux-arm64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.3.tgz", - "integrity": "sha512-QgKDspHPnrU+GQ55XPhGwyhC8acLVOOSyAvo1oVfFmrIXLkDNmGWzAfDZ4xK8oSA1qBQrALcHX0G5UZni/SuFQ==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.5.tgz", + "integrity": "sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==", "cpu": [ "arm64" ], + "dev": true, "license": "Apache-2.0", "optional": true, "os": [ @@ -2118,16 +2167,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.3.2" + "@img/sharp-libvips-linux-arm64": "1.3.4" } }, "node_modules/@img/sharp-linux-ppc64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.3.tgz", - "integrity": "sha512-sMd8rDxmpLOwv/7N44klFjOD5DUO7FLdjiXDI0hoxYaf7Ar262dQIEkosE98bps+5HPLtp/EvNqeqQtOycP/IA==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.5.tgz", + "integrity": "sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==", "cpu": [ "ppc64" ], + "dev": true, "license": "Apache-2.0", "optional": true, "os": [ @@ -2140,16 +2190,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-ppc64": "1.3.2" + "@img/sharp-libvips-linux-ppc64": "1.3.4" } }, "node_modules/@img/sharp-linux-riscv64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.3.tgz", - "integrity": "sha512-0Eob78yjlYPfL5vMNWAW55l3R9Y6BQS/gOfe0ZcP9mEz9ohhKSt4im1hayiknXgf8AWrFqMvJcKIdmLmEe7yeQ==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.5.tgz", + "integrity": "sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==", "cpu": [ "riscv64" ], + "dev": true, "license": "Apache-2.0", "optional": true, "os": [ @@ -2162,16 +2213,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-riscv64": "1.3.2" + "@img/sharp-libvips-linux-riscv64": "1.3.4" } }, "node_modules/@img/sharp-linux-s390x": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.3.tgz", - "integrity": "sha512-KgAxQ0DxpNOq1rG2t5cgTgShJFGSuU7XO45cqC+1NVOuZnP6tlgZRuSYOfNupGkHID0o3cJOsw4DVeJpMovcGw==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.5.tgz", + "integrity": "sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==", "cpu": [ "s390x" ], + "dev": true, "license": "Apache-2.0", "optional": true, "os": [ @@ -2184,16 +2236,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.3.2" + "@img/sharp-libvips-linux-s390x": "1.3.4" } }, "node_modules/@img/sharp-linux-x64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.3.tgz", - "integrity": "sha512-8pqvxubL2PGdhlPy6GLqzDYMUjyRmKAwKHYKixpdJYBUK7PJ0C029XdsnpFIdgRZG68fZiGdHVWcKPvtiPB4cA==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.5.tgz", + "integrity": "sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==", "cpu": [ "x64" ], + "dev": true, "license": "Apache-2.0", "optional": true, "os": [ @@ -2206,16 +2259,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-x64": "1.3.2" + "@img/sharp-libvips-linux-x64": "1.3.4" } }, "node_modules/@img/sharp-linuxmusl-arm64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.3.tgz", - "integrity": "sha512-Vz0iQjzzcSX3HCbfwFfCSG/9SCIqyO0mH2sXyiHaAYfBk0cRsCWXRyQYX0ovCK/PAQBbTzQ0dsPQHh5MAFL59w==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.5.tgz", + "integrity": "sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==", "cpu": [ "arm64" ], + "dev": true, "license": "Apache-2.0", "optional": true, "os": [ @@ -2228,16 +2282,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.3.2" + "@img/sharp-libvips-linuxmusl-arm64": "1.3.4" } }, "node_modules/@img/sharp-linuxmusl-x64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.3.tgz", - "integrity": "sha512-6O1NPKcDVj9QEdg7Hx549EX8U0rp6yXQERqru6yRN7fGBn32UvIRJUlWnk+8xDCiG76hXVBbX82NZ/ZKr0euIg==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.5.tgz", + "integrity": "sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==", "cpu": [ "x64" ], + "dev": true, "license": "Apache-2.0", "optional": true, "os": [ @@ -2250,17 +2305,18 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-x64": "1.3.2" + "@img/sharp-libvips-linuxmusl-x64": "1.3.4" } }, "node_modules/@img/sharp-wasm32": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.3.tgz", - "integrity": "sha512-cZ0XkcYGpHZkqW6iCkqTcmUC0CD9DhD5d/qeZlZkfRBn6GnHniZXLUo5+9xw8Iv76YE6LQFN9YNBlKREcCG76w==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.5.tgz", + "integrity": "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==", + "dev": true, "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", "optional": true, "dependencies": { - "@emnapi/runtime": "^1.11.1" + "@emnapi/runtime": "^1.11.3" }, "engines": { "node": ">=20.9.0" @@ -2269,17 +2325,29 @@ "url": "https://opencollective.com/libvips" } }, + "node_modules/@img/sharp-wasm32/node_modules/@emnapi/runtime": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz", + "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@img/sharp-webcontainers-wasm32": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.3.tgz", - "integrity": "sha512-2rnq7bX3NzeR2T4YWgz8qiG4h3TSdMe+vN1iQXpJleSJ3SM5zQ8Fy2SyyXAWlbxpEZ2Y+Z4u1BePgJEYbSy80Q==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.5.tgz", + "integrity": "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==", "cpu": [ "wasm32" ], + "dev": true, "license": "Apache-2.0", "optional": true, "dependencies": { - "@img/sharp-wasm32": "0.35.3" + "@img/sharp-wasm32": "0.35.5" }, "engines": { "node": ">=20.9.0" @@ -2289,12 +2357,13 @@ } }, "node_modules/@img/sharp-win32-arm64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.3.tgz", - "integrity": "sha512-4bPwFdMbeC4JQ8L8LOyWp6nsHcboP5fxkp6iPOXz2Vg49R42TuMs2whkJ5OAP4/Ul035qOzy0AecOF9VOscn4w==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.5.tgz", + "integrity": "sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q==", "cpu": [ "arm64" ], + "dev": true, "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ @@ -2308,12 +2377,13 @@ } }, "node_modules/@img/sharp-win32-ia32": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.3.tgz", - "integrity": "sha512-r53mXsBN6lFUDiST764SvgwUdHAqM4rPAiDzAmf4fLoB6X/rkfyTrLCg6+g17wJJiCmB3JYgHuUldCWUIRFSXw==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.5.tgz", + "integrity": "sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A==", "cpu": [ "ia32" ], + "dev": true, "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ @@ -2327,12 +2397,13 @@ } }, "node_modules/@img/sharp-win32-x64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.3.tgz", - "integrity": "sha512-D4y1vNeZrIIJCN+uHaWVtH86B+aCrdMYYjicy9pXHvbGZeGYLLSd3wdVuC37FxVXlU1ARsk84eKWfWMXGYEqvA==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.5.tgz", + "integrity": "sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg==", "cpu": [ "x64" ], + "dev": true, "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ @@ -2480,9 +2551,9 @@ } }, "node_modules/@napi-rs/wasm-runtime": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.3.tgz", - "integrity": "sha512-UMduMbqO5s5zF2NkNacMT/yK5Y5QiKvWr2+50bzIIxFDwVJ2h49b+oyjaCGPhJxd2/gC2x39EHv/gHVuu36x2Q==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.5.tgz", + "integrity": "sha512-HshSvXzmBxNzqejd3k/KemgQ3hdREUYFRRrgxOZ+gPljDIsO2SDZrVZMd4Z/HsxudQbE62OVyVFE8z9BCurfjA==", "license": "MIT", "optional": true, "dependencies": { @@ -2970,9 +3041,9 @@ } }, "node_modules/@tybys/wasm-util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", - "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz", + "integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==", "license": "MIT", "optional": true, "dependencies": { @@ -3117,21 +3188,20 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.39.0.tgz", - "integrity": "sha512-bhEz6OZeUR+O/6yx9Jk6ohX6H9JSFTaiY0v9/PuKT3oGK0rn0jNplLmyFUGV+a9gfYnVNwGDwS/UkLIuXNb2Rw==", + "version": "8.71.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.71.1.tgz", + "integrity": "sha512-nNlBf6HuotqMgZvSkWD5hNdemiBIxQ2NmrlgfcUIeZRs+BbakjscCQRq/Hb74EFVnFiSWWdL12JruqwBy3ERDw==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.39.0", - "@typescript-eslint/type-utils": "8.39.0", - "@typescript-eslint/utils": "8.39.0", - "@typescript-eslint/visitor-keys": "8.39.0", - "graphemer": "^1.4.0", - "ignore": "^7.0.0", + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.71.1", + "@typescript-eslint/type-utils": "8.71.1", + "@typescript-eslint/utils": "8.71.1", + "@typescript-eslint/visitor-keys": "8.71.1", + "ignore": "^7.0.5", "natural-compare": "^1.4.0", - "ts-api-utils": "^2.1.0" + "ts-api-utils": "^2.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3141,9 +3211,9 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.39.0", - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" + "@typescript-eslint/parser": "^8.71.1", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { @@ -3157,17 +3227,17 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.39.0.tgz", - "integrity": "sha512-g3WpVQHngx0aLXn6kfIYCZxM6rRJlWzEkVpqEFLT3SgEDsp9cpCbxxgwnE504q4H+ruSDh/VGS6nqZIDynP+vg==", + "version": "8.71.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.71.1.tgz", + "integrity": "sha512-oM/5sAqz/l1v/zYK1qTOPrn2+JIrBGC1V6uNYucRO5gh6eT9vWJ/RhPbGE59byvZEUQ4VP6XkLBaS5Jti5jpvw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.39.0", - "@typescript-eslint/types": "8.39.0", - "@typescript-eslint/typescript-estree": "8.39.0", - "@typescript-eslint/visitor-keys": "8.39.0", - "debug": "^4.3.4" + "@typescript-eslint/scope-manager": "8.71.1", + "@typescript-eslint/types": "8.71.1", + "@typescript-eslint/typescript-estree": "8.71.1", + "@typescript-eslint/visitor-keys": "8.71.1", + "debug": "^4.4.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3177,20 +3247,20 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.39.0.tgz", - "integrity": "sha512-CTzJqaSq30V/Z2Og9jogzZt8lJRR5TKlAdXmWgdu4hgcC9Kww5flQ+xFvMxIBWVNdxJO7OifgdOK4PokMIWPew==", + "version": "8.71.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.71.1.tgz", + "integrity": "sha512-Oijc9RUsohHjncg6iGi7gCtjnEjYt9FWv9u6ygK8uKcHK5eLjLAkqERQ9BaytbpceOFdk6kifPCS/zAZE+A99g==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.39.0", - "@typescript-eslint/types": "^8.39.0", - "debug": "^4.3.4" + "@typescript-eslint/tsconfig-utils": "^8.71.1", + "@typescript-eslint/types": "^8.71.1", + "debug": "^4.4.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3200,18 +3270,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.39.0.tgz", - "integrity": "sha512-8QOzff9UKxOh6npZQ/4FQu4mjdOCGSdO3p44ww0hk8Vu+IGbg0tB/H1LcTARRDzGCC8pDGbh2rissBuuoPgH8A==", + "version": "8.71.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.71.1.tgz", + "integrity": "sha512-1YUDZXdTnXLlob03SFHBipdyMBsDVm7zoSz0ytTJ39dk5J1TgsTK03VlR/dLXG/RLLUrPcYbD4rp23BmHxHP0w==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.39.0", - "@typescript-eslint/visitor-keys": "8.39.0" + "@typescript-eslint/types": "8.71.1", + "@typescript-eslint/visitor-keys": "8.71.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3222,9 +3292,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.39.0.tgz", - "integrity": "sha512-Fd3/QjmFV2sKmvv3Mrj8r6N8CryYiCS8Wdb/6/rgOXAWGcFuc+VkQuG28uk/4kVNVZBQuuDHEDUpo/pQ32zsIQ==", + "version": "8.71.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.71.1.tgz", + "integrity": "sha512-oTvkml5SxXhgg+WWKhod5qWQICDXtOB+/Hi9VdPKFAANJ2b7YOgMffgvzXuqog7R6A/JtrzRf128dsxummyWhg==", "dev": true, "license": "MIT", "engines": { @@ -3235,21 +3305,21 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.39.0.tgz", - "integrity": "sha512-6B3z0c1DXVT2vYA9+z9axjtc09rqKUPRmijD5m9iv8iQpHBRYRMBcgxSiKTZKm6FwWw1/cI4v6em35OsKCiN5Q==", + "version": "8.71.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.71.1.tgz", + "integrity": "sha512-kH3t3jZCYv2PZSBEWPKTariLrCaoF1CLoPitYFBJOhAGEwWnSRAtGEifrfrpBa4K9JlwWNZotgA5w3/wLSk/FQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.39.0", - "@typescript-eslint/typescript-estree": "8.39.0", - "@typescript-eslint/utils": "8.39.0", - "debug": "^4.3.4", - "ts-api-utils": "^2.1.0" + "@typescript-eslint/types": "8.71.1", + "@typescript-eslint/typescript-estree": "8.71.1", + "@typescript-eslint/utils": "8.71.1", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3259,14 +3329,14 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/types": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.39.0.tgz", - "integrity": "sha512-ArDdaOllnCj3yn/lzKn9s0pBQYmmyme/v1HbGIGB0GB/knFI3fWMHloC+oYTJW46tVbYnGKTMDK4ah1sC2v0Kg==", + "version": "8.71.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.71.1.tgz", + "integrity": "sha512-ybYnPTUwg3VQQOFEiBPLs8Jxl1ry2vXdn1kVKguomBbvxpetdu3MKTNDqFNUrlG8ylP9MpZosmXMFYlGQHk1oQ==", "dev": true, "license": "MIT", "engines": { @@ -3278,22 +3348,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.39.0.tgz", - "integrity": "sha512-ndWdiflRMvfIgQRpckQQLiB5qAKQ7w++V4LlCHwp62eym1HLB/kw7D9f2e8ytONls/jt89TEasgvb+VwnRprsw==", + "version": "8.71.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.71.1.tgz", + "integrity": "sha512-pSKSEK1JJpHs6KiKVtABCE4iJK5d7FLFzDXQNBQ2oRY7LEd3UwOt3TZemTgu9syTIf56dJWlTn/pdmrO9oKUXQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.39.0", - "@typescript-eslint/tsconfig-utils": "8.39.0", - "@typescript-eslint/types": "8.39.0", - "@typescript-eslint/visitor-keys": "8.39.0", - "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^2.1.0" + "@typescript-eslint/project-service": "8.71.1", + "@typescript-eslint/tsconfig-utils": "8.71.1", + "@typescript-eslint/types": "8.71.1", + "@typescript-eslint/visitor-keys": "8.71.1", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3303,20 +3372,20 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/utils": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.39.0.tgz", - "integrity": "sha512-4GVSvNA0Vx1Ktwvf4sFE+exxJ3QGUorQG1/A5mRfRNZtkBT2xrA/BCO2H0eALx/PnvCS6/vmYwRdDA41EoffkQ==", + "version": "8.71.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.71.1.tgz", + "integrity": "sha512-CBjT6gfAz3DW2j9Q4moFnqt208Aq+506sVGXfpRcyAeqn0EpayL0mjdWoCO2t3RC7GewNrFxdeehuEaPg6DMzQ==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.39.0", - "@typescript-eslint/types": "8.39.0", - "@typescript-eslint/typescript-estree": "8.39.0" + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.71.1", + "@typescript-eslint/types": "8.71.1", + "@typescript-eslint/typescript-estree": "8.71.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3326,19 +3395,19 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.39.0.tgz", - "integrity": "sha512-ldgiJ+VAhQCfIjeOgu8Kj5nSxds0ktPOSO9p4+0VDH2R2pLvQraaM5Oen2d7NxzMCm+Sn/vJT+mv2H5u6b/3fA==", + "version": "8.71.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.71.1.tgz", + "integrity": "sha512-0GxiUGqMU0qXJt58cBsiG3DP8lUmBaFo2vChtUX+CT7PnR3v/VGLLrzVP4K9r1lNiZXjHYefMBbPunplr09v6w==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.39.0", - "eslint-visitor-keys": "^4.2.1" + "@typescript-eslint/types": "8.71.1", + "eslint-visitor-keys": "^5.0.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3349,13 +3418,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", "dev": true, "license": "Apache-2.0", "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://opencollective.com/eslint" @@ -3629,14 +3698,14 @@ } }, "node_modules/astro": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/astro/-/astro-7.2.2.tgz", - "integrity": "sha512-OvLWCpXpb43lVYcWzSBJ0sk44qcEYYRZCjadtalLfAwb2RaC3P/zT+blZykBw/o6suw6sQQkn00ugN36akD8Mw==", + "version": "7.2.8", + "resolved": "https://registry.npmjs.org/astro/-/astro-7.2.8.tgz", + "integrity": "sha512-19nfgzl1IHNYzIfamUIr4dYSQcovWfMO5JGlN7Ahlg6Q6R+nzSPWAh+VO/mSg0hhcea35JHY0wL5ADZUi0WiYQ==", "license": "MIT", "dependencies": { - "@astrojs/compiler-rs": "^0.3.2", - "@astrojs/internal-helpers": "0.10.2", - "@astrojs/markdown-satteri": "0.3.5", + "@astrojs/compiler-rs": "^0.4.0", + "@astrojs/internal-helpers": "0.10.4", + "@astrojs/markdown-satteri": "0.3.8", "@astrojs/telemetry": "3.3.3", "@capsizecss/unpack": "^4.0.0", "@clack/prompts": "^1.1.0", @@ -3649,11 +3718,11 @@ "common-ancestor-path": "^2.0.0", "cookie": "^2.0.1", "devalue": "^5.8.1", - "diff": "^8.0.3", + "diff": "^9.0.0", "dset": "^3.1.4", "es-module-lexer": "^2.0.0", "esbuild": "^0.28.0", - "find-process": "^2.1.1", + "find-proc": "0.1.0", "flattie": "^1.1.1", "fontace": "~0.4.1", "get-tsconfig": "5.0.0-beta.4", @@ -3680,7 +3749,7 @@ "tinyexec": "^1.0.4", "tinyglobby": "^0.2.15", "ultrahtml": "^1.6.0", - "unifont": "~0.7.4", + "unifont": "~0.7.5", "unstorage": "^1.17.5", "vite": "^8.0.13", "vitefu": "^1.1.2", @@ -3701,10 +3770,10 @@ "url": "https://opencollective.com/astrodotbuild" }, "optionalDependencies": { - "sharp": "^0.34.0 || ^0.35.0" + "sharp": "^0.35.4" }, "peerDependencies": { - "@astrojs/markdown-remark": "7.2.2" + "@astrojs/markdown-remark": "7.2.4" }, "peerDependenciesMeta": { "@astrojs/markdown-remark": { @@ -3832,6 +3901,22 @@ "@iconify/utils": "^2.1.30" } }, + "node_modules/astro/node_modules/@astrojs/internal-helpers": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.10.4.tgz", + "integrity": "sha512-nozZSy/mKYLqe4YrqbKtdOszedAfXYCtw3wZ0d+CAjz4GqQ4L9rl1ltIL5BlgwmYVinJg/RZ0MgGuWOdlyRZlA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.4", + "@types/mdast": "^4.0.4", + "js-yaml": "^4.3.0", + "picomatch": "^4.0.4", + "retext-smartypants": "^6.2.0", + "shiki": "^4.0.2", + "smol-toml": "^1.6.0", + "unified": "^11.0.5" + } + }, "node_modules/astro/node_modules/jsonc-parser": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", @@ -3972,9 +4057,9 @@ "license": "ISC" }, "node_modules/brace-expansion": { - "version": "5.0.9", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", - "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "dev": true, "license": "MIT", "dependencies": { @@ -3986,9 +4071,10 @@ }, "node_modules/braces": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "resolved": "file:vendor/braces-backport/braces-3.0.3-depth-guard.1.tgz", + "integrity": "sha512-ZxnahgKW/8YddOOcMCGJImdOyB7OSYaBB7lwKUpQ+lxWMhf3kWTg2QS+8+oN77xK5RKhNHo1rEk3ikjiQ3QUeA==", "dev": true, + "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, @@ -4099,6 +4185,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -4115,6 +4202,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -4300,6 +4388,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -4312,6 +4401,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, "license": "MIT" }, "node_modules/comma-separated-tokens": { @@ -4390,14 +4480,16 @@ } }, "node_modules/css-select": { - "version": "5.1.0", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-6.0.0.tgz", + "integrity": "sha512-rZZVSLle8v0+EY8QAkDWrKhpgt6SA5OtHsgBnsj6ZaLb5dmDVOWUDtQitd9ydxxvEjhewNudS6eTVU7uOyzvXw==", "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" + "css-what": "^7.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.2.2", + "nth-check": "^2.1.1" }, "funding": { "url": "https://github.com/sponsors/fb55" @@ -4432,7 +4524,9 @@ } }, "node_modules/css-what": { - "version": "6.1.0", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-7.0.0.tgz", + "integrity": "sha512-wD5oz5xibMOPHzy13CyGmogB3phdvcDaB5t0W/Nr5Z2O/agcB8YwOz6e2Lsp10pNDzBoDO9nVa3RGs/2BttpHQ==", "license": "BSD-2-Clause", "engines": { "node": ">= 6" @@ -4546,9 +4640,9 @@ } }, "node_modules/devalue": { - "version": "5.8.1", - "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.8.1.tgz", - "integrity": "sha512-4CXDYRBGqN+57wVJkuXBYmpAVUSg3L6JAQa/DFqm238G73E1wuyc/JhGQJzN7vUf/CMphYau2zXbfWzDR5aTEw==", + "version": "5.9.4", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.9.4.tgz", + "integrity": "sha512-sPAT4pztbu6586/hrhOnMKS17IJrvg12mXiSPSS3W5qDeN2RGgvZ0diZCm31dBbnevfVmujNO3IM2wrS4Y2Rhg==", "license": "MIT" }, "node_modules/devlop": { @@ -4583,6 +4677,8 @@ }, "node_modules/dom-serializer": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", @@ -4595,6 +4691,8 @@ }, "node_modules/domelementtype": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", "funding": [ { "type": "github", @@ -4605,6 +4703,8 @@ }, "node_modules/domhandler": { "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.3.0" @@ -4928,20 +5028,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-plugin-astro/node_modules/postcss-selector-parser": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.0.0.tgz", - "integrity": "sha512-9RbEr1Y7FFfptd/1eEdntyjMwLeghW1bHX9GWjXo19vx4ytPQhANltvVxDggzJl7mnWM+dX28kb6cyS/4iQjlQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/eslint-scope": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", @@ -5237,9 +5323,9 @@ } }, "node_modules/fast-uri": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.6.tgz", - "integrity": "sha512-7Ical1vFEMr0onbVzEDIreM22I4khW+fzyQPwvAFWBp1iwdshSZRsL4jjRvPG9JP1uiqMHRto+YU6R2/CzDz5Q==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.8.tgz", + "integrity": "sha512-GZMtZUTNRpOVIECoXwLNZS5xUGE+mVNbTB8h/7Rwh2TFWcBQiPzTgyZi05BF9UMZKkLJv8XBRJTlU7zg8+ZfMg==", "dev": true, "funding": [ { @@ -5355,27 +5441,13 @@ "node": ">=8" } }, - "node_modules/find-process": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/find-process/-/find-process-2.1.1.tgz", - "integrity": "sha512-SrQDx3QhlmHM90iqn9rdjCQcw/T+WlpOkHFsjoRgB+zTpDfltNA1VSNYeYELwhUTJy12UFxqjWhmhOrJc+o4sA==", - "license": "MIT", - "dependencies": { - "chalk": "~4.1.2", - "commander": "^14.0.3", - "loglevel": "^1.9.2" - }, - "bin": { - "find-process": "dist/cjs/bin/find-process.js" - } - }, - "node_modules/find-process/node_modules/commander": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", - "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", + "node_modules/find-proc": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/find-proc/-/find-proc-0.1.0.tgz", + "integrity": "sha512-OaOpEYv2PiQ7SQ5LIrl+deA1XaWcxEjnpM6VuWXTUvn+teIXxeFTLDmu18/zDQpFmHN4o3oDBX+BT0AGwEhemg==", "license": "MIT", "engines": { - "node": ">=20" + "node": "^20.19.0 || >=22.12.0" } }, "node_modules/find-up": { @@ -5588,11 +5660,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/graphemer": { - "version": "1.4.0", - "dev": true, - "license": "MIT" - }, "node_modules/h3": { "version": "1.15.11", "resolved": "https://registry.npmjs.org/h3/-/h3-1.15.11.tgz", @@ -5614,6 +5681,7 @@ "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", "engines": { "node": ">=8" @@ -5636,6 +5704,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.3.tgz", "integrity": "sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw==", + "dev": true, "dependencies": { "@types/hast": "^3.0.0", "devlop": "^1.1.0", @@ -5651,6 +5720,7 @@ }, "node_modules/hast-util-from-parse5": { "version": "8.0.1", + "dev": true, "license": "MIT", "dependencies": { "@types/hast": "^3.0.0", @@ -5683,6 +5753,7 @@ }, "node_modules/hast-util-parse-selector": { "version": "4.0.0", + "dev": true, "license": "MIT", "dependencies": { "@types/hast": "^3.0.0" @@ -5876,6 +5947,7 @@ }, "node_modules/hastscript": { "version": "8.0.0", + "dev": true, "license": "MIT", "dependencies": { "@types/hast": "^3.0.0", @@ -5940,9 +6012,9 @@ } }, "node_modules/http-cache-semantics": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", - "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.3.0.tgz", + "integrity": "sha512-M5t5LlJpS1UHMjvwRQVdFHvPISGeLAxNcrWuJkeGh0KxsqCHZ1O3NXZU/8x7cD0BDcGW8kapxMKTvwlqrNkHkA==", "license": "BSD-2-Clause" }, "node_modules/ignore": { @@ -6167,9 +6239,9 @@ } }, "node_modules/js-yaml": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz", - "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz", + "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==", "funding": [ { "type": "github", @@ -6580,19 +6652,6 @@ "version": "4.6.2", "license": "MIT" }, - "node_modules/loglevel": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz", - "integrity": "sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==", - "license": "MIT", - "engines": { - "node": ">= 0.6.0" - }, - "funding": { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/loglevel" - } - }, "node_modules/longest-streak": { "version": "3.1.0", "dev": true, @@ -7910,9 +7969,9 @@ } }, "node_modules/ohash": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz", - "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.12.tgz", + "integrity": "sha512-65S/5gk9YSsaRjcyf7Nfa6h/d3E8/1gslpXfI4W7Dxn/oap8IKRuNT5VXkLQ1YFKIEg4apRY4Pj6aiwFzrDdmw==", "license": "MIT" }, "node_modules/oniguruma-parser": { @@ -8111,6 +8170,7 @@ }, "node_modules/parse5": { "version": "7.1.2", + "dev": true, "license": "MIT", "dependencies": { "entities": "^4.4.0" @@ -8380,9 +8440,9 @@ } }, "node_modules/postcss-selector-parser": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.3.tgz", - "integrity": "sha512-cDoO18VWCIWRsSaws3C23b0HXRxlUknttfdNcbXnf3IGHAPRNLlXPHc6dYiatOkxW0W4uZh524Plaaw5a7WEtQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.6.tgz", + "integrity": "sha512-7qASPzhKF2l2KLboRZux8CCTRMdGiV08vWmyKzPz22qZ7ZjQBOeY7rNzNoCLSUiftJ7HUq0GERHmxw/t0dCdMw==", "dev": true, "license": "MIT", "dependencies": { @@ -8456,6 +8516,7 @@ }, "node_modules/property-information": { "version": "6.5.0", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -8958,32 +9019,32 @@ } }, "node_modules/satteri": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/satteri/-/satteri-0.9.5.tgz", - "integrity": "sha512-ZuWVl+vnM64y+/TtX8Kosv2c00W+hLQiiwnEL6H0UKVVrxFqMw4D2CJHHQaouVd89OAhtBBfjWLqhKi3TVUV4w==", + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/satteri/-/satteri-0.10.5.tgz", + "integrity": "sha512-Ao1LKpAEa9Wdg0otgbVKViZHEq9ebdXe4DMrp3s9vQAU0HNIuHnFEuMuOcm0ZIXyV0Yzxj91NvhLpvXZJO/5ZQ==", "license": "MIT", "dependencies": { "@types/estree-jsx": "^1.0.5", - "@types/hast": "^3.0.4", + "@types/hast": "^3.0.5", "@types/mdast": "^4.0.4", "@types/unist": "^3.0.3" }, "optionalDependencies": { - "@bruits/satteri-darwin-arm64": "0.9.5", - "@bruits/satteri-darwin-x64": "0.9.5", - "@bruits/satteri-linux-arm64-gnu": "0.9.5", - "@bruits/satteri-linux-arm64-musl": "0.9.5", - "@bruits/satteri-linux-x64-gnu": "0.9.5", - "@bruits/satteri-linux-x64-musl": "0.9.5", - "@bruits/satteri-wasm32-wasi": "0.9.5", - "@bruits/satteri-win32-arm64-msvc": "0.9.5", - "@bruits/satteri-win32-x64-msvc": "0.9.5" + "@bruits/satteri-darwin-arm64": "0.10.5", + "@bruits/satteri-darwin-x64": "0.10.5", + "@bruits/satteri-linux-arm64-gnu": "0.10.5", + "@bruits/satteri-linux-arm64-musl": "0.10.5", + "@bruits/satteri-linux-x64-gnu": "0.10.5", + "@bruits/satteri-linux-x64-musl": "0.10.5", + "@bruits/satteri-wasm32-wasi": "0.10.5", + "@bruits/satteri-win32-arm64-msvc": "0.10.5", + "@bruits/satteri-win32-x64-msvc": "0.10.5" } }, "node_modules/sax": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.0.tgz", - "integrity": "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.1.tgz", + "integrity": "sha512-42tBVwLWnaQvW5zc4HbZrTuWccECCZfBi92FDuwtqxasH+JbPB3/FOKb1m222K42R4WxuxzzMsTswfzgtSu64Q==", "license": "BlueOak-1.0.0", "engines": { "node": ">=11.0.0" @@ -9002,9 +9063,9 @@ } }, "node_modules/sharp": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.3.tgz", - "integrity": "sha512-ej0zVHuZGHCiABXcNxeYhpRnPNPAcvbG8RMdBAhDAxLKkCRVSpK3Iyu7qbqw3JMzoj0REeM6f3tJLtVwl0023Q==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.5.tgz", + "integrity": "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g==", "devOptional": true, "license": "Apache-2.0", "dependencies": { @@ -9019,31 +9080,31 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.35.3", - "@img/sharp-darwin-x64": "0.35.3", - "@img/sharp-freebsd-wasm32": "0.35.3", - "@img/sharp-libvips-darwin-arm64": "1.3.2", - "@img/sharp-libvips-darwin-x64": "1.3.2", - "@img/sharp-libvips-linux-arm": "1.3.2", - "@img/sharp-libvips-linux-arm64": "1.3.2", - "@img/sharp-libvips-linux-ppc64": "1.3.2", - "@img/sharp-libvips-linux-riscv64": "1.3.2", - "@img/sharp-libvips-linux-s390x": "1.3.2", - "@img/sharp-libvips-linux-x64": "1.3.2", - "@img/sharp-libvips-linuxmusl-arm64": "1.3.2", - "@img/sharp-libvips-linuxmusl-x64": "1.3.2", - "@img/sharp-linux-arm": "0.35.3", - "@img/sharp-linux-arm64": "0.35.3", - "@img/sharp-linux-ppc64": "0.35.3", - "@img/sharp-linux-riscv64": "0.35.3", - "@img/sharp-linux-s390x": "0.35.3", - "@img/sharp-linux-x64": "0.35.3", - "@img/sharp-linuxmusl-arm64": "0.35.3", - "@img/sharp-linuxmusl-x64": "0.35.3", - "@img/sharp-webcontainers-wasm32": "0.35.3", - "@img/sharp-win32-arm64": "0.35.3", - "@img/sharp-win32-ia32": "0.35.3", - "@img/sharp-win32-x64": "0.35.3" + "@img/sharp-darwin-arm64": "0.35.5", + "@img/sharp-darwin-x64": "0.35.5", + "@img/sharp-freebsd-wasm32": "0.35.5", + "@img/sharp-libvips-darwin-arm64": "1.3.4", + "@img/sharp-libvips-darwin-x64": "1.3.4", + "@img/sharp-libvips-linux-arm": "1.3.4", + "@img/sharp-libvips-linux-arm64": "1.3.4", + "@img/sharp-libvips-linux-ppc64": "1.3.4", + "@img/sharp-libvips-linux-riscv64": "1.3.4", + "@img/sharp-libvips-linux-s390x": "1.3.4", + "@img/sharp-libvips-linux-x64": "1.3.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.3.4", + "@img/sharp-libvips-linuxmusl-x64": "1.3.4", + "@img/sharp-linux-arm": "0.35.5", + "@img/sharp-linux-arm64": "0.35.5", + "@img/sharp-linux-ppc64": "0.35.5", + "@img/sharp-linux-riscv64": "0.35.5", + "@img/sharp-linux-s390x": "0.35.5", + "@img/sharp-linux-x64": "0.35.5", + "@img/sharp-linuxmusl-arm64": "0.35.5", + "@img/sharp-linuxmusl-x64": "0.35.5", + "@img/sharp-webcontainers-wasm32": "0.35.5", + "@img/sharp-win32-arm64": "0.35.5", + "@img/sharp-win32-ia32": "0.35.5", + "@img/sharp-win32-x64": "0.35.5" }, "peerDependenciesMeta": { "@types/node": { @@ -9135,9 +9196,9 @@ } }, "node_modules/smol-toml": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.8.0.tgz", - "integrity": "sha512-kCZr2V3ch9i00x8zXRhjUNVcjG9ijES5dDudkXvUVCT5QlJNQWElSJdZqyPemffHoLNUYwOcou0Fy+ojN0uHSQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.9.0.tgz", + "integrity": "sha512-hpd+HLON7HdZXqYchMM/+LaTTbdK0AU3NngIJ4KVyWbY9bfQqdL9cD+4yf6dUoU2Ap4VsU0JkQi6FxAI1B2mXQ==", "license": "BSD-3-Clause", "engines": { "node": ">= 18" @@ -9157,9 +9218,9 @@ } }, "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -9399,6 +9460,7 @@ "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": { "has-flag": "^4.0.0" @@ -9419,18 +9481,18 @@ } }, "node_modules/svgo": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-4.0.2.tgz", - "integrity": "sha512-ekx94z1rRc5LDi6oSUaeRnYhd0UOJxdtQCL2rF8xpWxD3TPAsISWOrxezqGovqS38GRZOdpDfvQe3ts6F7nsng==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-4.1.0.tgz", + "integrity": "sha512-bkxnTg1kSU0guhIBmibA6UUhrQmPVA1XsQLN+ylCd+UWzbnLkySOcXpyk1mrl05f+pcaCx2eHb+sp6BgMZWX+Q==", "license": "MIT", "dependencies": { "commander": "^11.1.0", - "css-select": "^5.1.0", + "css-select": "^6.0.0", "css-tree": "^3.0.1", - "css-what": "^6.1.0", + "css-what": "^7.0.0", "csso": "^5.0.5", "picocolors": "^1.1.1", - "sax": "^1.5.0" + "sax": "1.6.1" }, "bin": { "svgo": "bin/svgo.js" @@ -9653,9 +9715,9 @@ } }, "node_modules/ts-api-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", - "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", "dev": true, "license": "MIT", "engines": { @@ -9720,16 +9782,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.39.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.39.0.tgz", - "integrity": "sha512-lH8FvtdtzcHJCkMOKnN73LIn6SLTpoojgJqDAxPm1jCR14eWSGPX8ul/gggBdPMk/d5+u9V854vTYQ8T5jF/1Q==", + "version": "8.71.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.71.1.tgz", + "integrity": "sha512-oiNVPC3/NbV1FpaHU07l8O6ynqG9v4PAiW2WvTrAmZdR0f2HI/gE668ElMLCK7Xbsu5k2fK5C4fXNiq05j7/nQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.39.0", - "@typescript-eslint/parser": "8.39.0", - "@typescript-eslint/typescript-estree": "8.39.0", - "@typescript-eslint/utils": "8.39.0" + "@typescript-eslint/eslint-plugin": "8.71.1", + "@typescript-eslint/parser": "8.71.1", + "@typescript-eslint/typescript-estree": "8.71.1", + "@typescript-eslint/utils": "8.71.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -9739,8 +9801,8 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/ufo": { @@ -9761,6 +9823,15 @@ "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==", "license": "MIT" }, + "node_modules/undici": { + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.29.1.tgz", + "integrity": "sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q==", + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, "node_modules/undici-types": { "version": "7.18.2", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", @@ -9792,14 +9863,14 @@ } }, "node_modules/unifont": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/unifont/-/unifont-0.7.4.tgz", - "integrity": "sha512-oHeis4/xl42HUIeHuNZRGEvxj5AaIKR+bHPNegRq5LV1gdc3jundpONbjglKpihmJf+dswygdMJn3eftGIMemg==", + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/unifont/-/unifont-0.7.5.tgz", + "integrity": "sha512-ULe/Cs+ZIsq+dcFofNkhqielCrUJnb5mr+Yc4EBM2VlL+6OZR6+cjtI2mT1bJvRBrVncqHAbLURxmPLcCXzWMg==", "license": "MIT", "dependencies": { "css-tree": "^3.1.0", - "ofetch": "^1.5.1", - "ohash": "^2.0.11" + "ohash": "^2.0.11", + "undici": "^8.0.0" } }, "node_modules/unifont/node_modules/css-tree": { @@ -10185,6 +10256,7 @@ }, "node_modules/vfile-location": { "version": "5.0.2", + "dev": true, "license": "MIT", "dependencies": { "@types/unist": "^3.0.0", @@ -10595,6 +10667,7 @@ }, "node_modules/web-namespaces": { "version": "2.0.1", + "dev": true, "license": "MIT", "funding": { "type": "github", diff --git a/package.json b/package.json index 906fbec5..504683a6 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,9 @@ "check:prettier": "prettier --check .", "fix": "npm run fix:eslint && npm run fix:prettier", "fix:eslint": "eslint --fix .", - "fix:prettier": "prettier -w ." + "fix:prettier": "prettier -w .", + "check:security-compat": "node scripts/check-security-compat.mjs", + "check:braces-backport": "python3 scripts/package-braces-backport.py && node scripts/check-braces-backport.mjs && node scripts/test-braces-upstream.mjs" }, "dependencies": { "@astrojs/rss": "^4.0.19", @@ -28,7 +30,7 @@ "@astrolib/seo": "^1.0.0-beta.8", "@fontsource-variable/inter": "^5.2.6", "@fontsource-variable/outfit": "^5.2.8", - "astro": "^7.2.2", + "astro": "7.2.8", "astro-embed": "^0.13.1", "astro-icon": "^1.1.5", "limax": "4.1.0", @@ -48,48 +50,63 @@ "@types/js-yaml": "^4.0.9", "@types/lodash.merge": "^4.6.9", "@types/mdx": "^2.0.13", - "@typescript-eslint/eslint-plugin": "^8.39.0", - "@typescript-eslint/parser": "^8.39.0", + "@typescript-eslint/eslint-plugin": "8.71.1", + "@typescript-eslint/parser": "8.71.1", "astro-compress": "2.4.3", "astro-eslint-parser": "^1.2.2", "eslint": "^9.33.0", "eslint-plugin-astro": "^1.3.1", "globals": "^16.3.0", - "js-yaml": "4.3.1", + "js-yaml": "4.3.2", "mdast-util-to-string": "^4.0.0", "prettier": "^3.6.2", "prettier-plugin-astro": "^0.14.1", "reading-time": "^1.5.0", - "sharp": "0.35.3", + "sharp": "0.35.5", "tailwind-merge": "^2.6.0", "tailwindcss": "^3.4.17", "typescript": "^5.8.3", - "typescript-eslint": "^8.39.0", - "unist-util-visit": "^5.0.0" + "typescript-eslint": "8.71.1", + "unist-util-visit": "^5.0.0", + "braces": "file:vendor/braces-backport/braces-3.0.3-depth-guard.1.tgz" }, "overrides": { "@iconify/tools": "5.0.12", - "brace-expansion": "5.0.9", + "brace-expansion": "5.0.12", "deepmerge-ts": "8.0.1", - "fast-uri": "3.1.6", + "fast-uri": "3.1.8", "h3": ">=1.15.6", "nanoid": "3.3.18", - "undici": "7.29.0", + "undici": "7.29.1", "fast-xml-parser": ">=5.5.7", "tar": "7.5.22", "minimatch": ">=9.0.7", "rollup": ">=4.59.0", "axios": ">=1.13.5", - "svgo": "4.0.2", + "svgo": "4.1.0", "flatted": ">=3.4.2", - "devalue": ">=5.6.4", + "devalue": "5.9.4", "lodash": ">=4.17.23", "diff": ">=5.2.2", "mdast-util-to-hast": ">=13.2.1", "picomatch": ">=4.0.4", "yaml": ">=2.8.3", "esbuild": "0.28.1", - "js-yaml": "4.3.1", - "postcss-selector-parser@^6": "6.1.3" + "js-yaml": "4.3.2", + "sharp": "$sharp", + "http-cache-semantics": "4.3.0", + "smol-toml": "1.9.0", + "source-map-js": "1.2.2", + "postcss-selector-parser@^7": "7.1.6", + "tailwindcss": { + "postcss-selector-parser": "7.1.6" + }, + "postcss-nested": { + "postcss-selector-parser": "7.1.6" + }, + "@tailwindcss/typography": { + "postcss-selector-parser": "7.1.6" + }, + "braces": "$braces" } } diff --git a/scripts/braces-depth-probe.mjs b/scripts/braces-depth-probe.mjs new file mode 100644 index 00000000..735ec7e1 --- /dev/null +++ b/scripts/braces-depth-probe.mjs @@ -0,0 +1,132 @@ +import assert from "node:assert/strict"; +import fs from "node:fs"; +import { createRequire } from "node:module"; +const require = createRequire(import.meta.url); +const { originalPath, patchedPath } = JSON.parse(fs.readFileSync(0, "utf8")); +const original = require(originalPath); +const patched = require(patchedPath); +const deep = "{".repeat(4000) + "x" + "}".repeat(4000); +assert.ok(deep.length < 10000); +const evidence = { inputLength: deep.length, original: {}, patched: {} }; +for (const method of ["compile", "expand"]) { + assert.throws( + () => original[method](deep), + (error) => { + evidence.original[method] = { name: error.name, message: error.message }; + return ( + error instanceof RangeError && + /call stack/i.test(error.message) && + !error.code + ); + }, + ); +} +const rejected = (fn, code = "ERR_BRACES_DEPTH") => + assert.throws( + fn, + (error) => + error instanceof RangeError && + error.code === code && + !/call stack/i.test(error.message), + ); +for (const pattern of [ + deep, + "(".repeat(4000) + "x" + ")".repeat(4000), + "{(".repeat(1500) + "x" + ")}".repeat(1500), + "{".repeat(101) + "x", +]) { + for (const method of ["parse", "compile", "expand", "stringify"]) + rejected(() => patched[method](pattern)); +} +// Bypass parsing intentionally: all public and internal AST entry points must guard. +for (const method of ["compile", "expand", "stringify"]) { + rejected(() => patched[method](original.parse(deep))); + const internal = require(patchedPath + "/lib/" + method); + rejected(() => internal(original.parse(deep))); + evidence.patched[method] = "ERR_BRACES_DEPTH for string and caller AST"; +} +for (const opening of ["{", "(", "{("]) { + const depth = opening.length === 2 ? 50 : 100; + const closing = opening === "{" ? "}" : opening === "(" ? ")" : ")}"; + const pattern = opening.repeat(depth) + "x" + closing.repeat(depth); + for (const method of ["compile", "expand", "stringify"]) + assert.deepEqual(patched[method](pattern), original[method](pattern)); + for (const method of ["parse", "compile", "expand", "stringify"]) + rejected(() => patched[method](opening + pattern + closing)); +} +for (const pattern of [ + "\\{".repeat(200) + "x" + "\\}".repeat(200), + '"' + deep + '"', + "[" + deep + "]", +]) { + for (const method of ["compile", "expand", "stringify"]) + assert.deepEqual(patched[method](pattern), original[method](pattern)); +} +for (const maxDepth of [false, 0, -1, NaN, Infinity, 101, "100"]) + rejected( + () => patched.parse("{a,b}", { maxDepth }), + "ERR_BRACES_DEPTH_OPTION", + ); +rejected(() => patched.compile("{{a,b}}", { maxDepth: 1 })); +const cycle = { type: "root", nodes: [] }; +cycle.nodes.push(cycle); +const parentCycle = { type: "root", nodes: [] }; +parentCycle.parent = parentCycle; +const wide = { + type: "root", + nodes: Array.from({ length: 20011 }, () => ({ type: "text", value: "x" })), +}; +for (const method of ["compile", "expand", "stringify"]) { + rejected(() => patched[method](cycle), "ERR_BRACES_AST"); + rejected(() => patched[method](parentCycle), "ERR_BRACES_AST"); + rejected(() => patched[method](wide), "ERR_BRACES_NODES"); +} +// Differential corpus preserves options and ordinary/incomplete pattern outputs. +const patterns = [ + "", + "x", + "a/{b,c}/d", + "{a,a,,b}", + "{01..05}", + "{5..1..2}", + "{a..e}", + "${a,b}", + "a{b{c,d}e", + "{a,b}}", + "\\{a,b}", + "(a|{b,c})", + "{1..x}", + "[{}]", + '"{a,b}"', +]; +for (const first of ["a", "{b,c}", "{1..3}", "{,x}", "{foo,bar}"]) + for (const second of ["", "{d,e}", "/{a,b}/x", "\\{x,y}"]) + patterns.push(first + second); +const options = [ + {}, + { expand: true }, + { expand: true, nodupes: true }, + { expand: true, noempty: true }, + { keepEscaping: true }, + { keepQuotes: true }, + { escapeInvalid: true }, + { rangeLimit: 50 }, +]; +let comparisons = 0; +for (const pattern of patterns) + for (const option of options) { + for (const method of ["compile", "expand", "stringify", "create"]) { + assert.deepEqual( + patched[method](pattern, option), + original[method](pattern, option), + ); + comparisons++; + } + assert.deepEqual( + patched([pattern, pattern], option), + original([pattern, pattern], option), + ); + comparisons++; + } +evidence.differentialComparisons = comparisons; +process.stdout.write(JSON.stringify(evidence)); diff --git a/scripts/check-braces-backport.mjs b/scripts/check-braces-backport.mjs new file mode 100644 index 00000000..9f822ce3 --- /dev/null +++ b/scripts/check-braces-backport.mjs @@ -0,0 +1,144 @@ +import assert from "node:assert/strict"; +import fs from "node:fs/promises"; +import os from "node:os"; +import path from "node:path"; +import { createHash } from "node:crypto"; +import { createRequire } from "node:module"; +import { spawnSync } from "node:child_process"; +const require = createRequire(import.meta.url); +const vendor = path.resolve("vendor/braces-backport"); +const manifest = JSON.parse( + await fs.readFile(path.join(vendor, "manifest.json"), "utf8"), +); +const provenance = JSON.parse( + await fs.readFile(path.join(vendor, "provenance.json"), "utf8"), +); +const digest = (bytes) => createHash("sha256").update(bytes).digest("hex"); +const installed = path.dirname(require.resolve("braces/package.json")); +for (const [file, hash] of Object.entries(manifest.source_sha256)) + assert.equal( + digest(await fs.readFile(path.join(installed, file))), + hash, + "Installed backport: " + file, + ); +assert.equal(require("braces/package.json").jvSecurityPatch, manifest.patch_id); +// Check every installed consumer, including nested copies, against the canonical artifact. +const lock = JSON.parse(await fs.readFile("package-lock.json", "utf8")); +const braceEntries = Object.entries(lock.packages).filter(([name]) => + name.endsWith("node_modules/braces"), +); +assert.ok(braceEntries.length > 0); +for (const [name, pkg] of braceEntries) { + assert.equal( + pkg.version, + "3.0.3", + "Retain upstream version; do not claim a registry fix", + ); + assert.ok( + pkg.resolved?.endsWith( + "vendor/braces-backport/braces-3.0.3-depth-guard.1.tgz", + ), + name, + ); + for (const [file, hash] of Object.entries(manifest.source_sha256)) + assert.equal( + digest(await fs.readFile(path.join(name, file))), + hash, + name + "/" + file, + ); +} +for (const [name, pkg] of Object.entries(lock.packages)) { + if (pkg.dependencies?.braces) { + const consumer = createRequire(path.resolve(name, "package.json")); + assert.equal(consumer.resolve("braces"), require.resolve("braces"), name); + } +} +const scratch = await fs.mkdtemp( + path.join(os.tmpdir(), "braces-backport-test-"), +); +try { + const baselineTar = path.join(vendor, "upstream/braces-3.0.3.tgz"); + assert.equal( + digest(await fs.readFile(baselineTar)), + provenance.upstream_sha256, + ); + const unpack = spawnSync("tar", ["-xzf", baselineTar, "-C", scratch], { + timeout: 5000, + encoding: "utf8", + }); + assert.ifError(unpack.error); + assert.equal(unpack.status, 0, unpack.stderr); + const probe = spawnSync( + process.execPath, + [ + "--stack-size=256", + "--max-old-space-size=64", + "scripts/braces-depth-probe.mjs", + ], + { + input: JSON.stringify({ + originalPath: path.join(scratch, "package"), + patchedPath: installed, + }), + env: { ...process.env, NODE_PATH: path.resolve("node_modules") }, + timeout: 15000, + maxBuffer: 64 * 1024, + encoding: "utf8", + }, + ); + assert.ifError(probe.error); + assert.equal(probe.status, 0, probe.stderr); + console.log("Bounded before/after reproduction:", probe.stdout); + // Actual micromatch and fast-glob integrations, not just the library API. + const mm = require("micromatch"); + assert.deepEqual(mm.braceExpand("src/*.{astro,ts}", { keepEscaping: true }), [ + "src/*.astro", + "src/*.ts", + ]); + assert.ok(mm.parse("src/*.{astro,ts}").length > 0); + assert.deepEqual(mm.braces("{a,b}"), ["(a|b)"]); + assert.deepEqual(mm(["a.ts", "b.astro", "c.css"], "*.{ts,astro}"), [ + "a.ts", + "b.astro", + ]); + await fs.writeFile(path.join(scratch, "a.ts"), ""); + await fs.writeFile(path.join(scratch, "b.astro"), ""); + const glob = require("fast-glob"); + assert.deepEqual((await glob("*.{ts,astro}", { cwd: scratch })).sort(), [ + "a.ts", + "b.astro", + ]); + const deep = "{".repeat(101) + "x" + "}".repeat(101); + assert.throws(() => mm.braces(deep), { code: "ERR_BRACES_DEPTH" }); + assert.throws(() => mm.braceExpand(deep), { code: "ERR_BRACES_DEPTH" }); + assert.throws(() => glob.sync(deep, { cwd: scratch }), { + code: "ERR_BRACES_DEPTH", + }); + // Chokidar's glob expansion is exercised by a real, isolated watcher. + const chokidar = require("chokidar"); + const seen = []; + const watcher = chokidar.watch(path.join(scratch, "*.{ts,astro}"), { + ignoreInitial: false, + }); + let timer; + try { + await new Promise((resolve, reject) => { + timer = setTimeout( + () => reject(new Error("Chokidar readiness timed out")), + 5000, + ); + watcher.on("add", (file) => seen.push(path.basename(file))); + watcher.once("error", reject); + watcher.once("ready", resolve); + }); + assert.deepEqual(seen.sort(), ["a.ts", "b.astro"]); + } finally { + clearTimeout(timer); + await watcher.close(); + } + console.log( + "Canonical artifact, every installed braces consumer and glob/watcher integrations passed.", + ); +} finally { + await fs.rm(scratch, { recursive: true, force: true }); +} diff --git a/scripts/check-security-compat.mjs b/scripts/check-security-compat.mjs new file mode 100644 index 00000000..4681dd19 --- /dev/null +++ b/scripts/check-security-compat.mjs @@ -0,0 +1,77 @@ +import assert from "node:assert/strict"; +import fs from "node:fs/promises"; +import { createRequire } from "node:module"; +import { spawnSync } from "node:child_process"; +import postcss from "postcss"; +import { compileSelectors } from "./security-fixtures/compile-selectors.mjs"; + +const require = createRequire(import.meta.url); +const csso = createRequire(require.resolve("astro-compress"))("csso"); +for (const consumer of [ + "tailwindcss", + "postcss-nested", + "@tailwindcss/typography", + "eslint-plugin-astro", +]) { + const consumerRequire = createRequire(require.resolve(consumer)); + assert.equal( + consumerRequire("postcss-selector-parser/package.json").version, + "7.1.6", + consumer, + ); +} +const expected = JSON.parse( + await fs.readFile( + new URL("security-fixtures/selectors-expected.json", import.meta.url), + "utf8", + ), +); +// v7 makes insertion during iteration safe. v6 lost these two variant rules; +// check their intended CSS explicitly, then compare every other rule to v6. +const actual = postcss.parse(await compileSelectors()); +const restoredVariants = new Map([ + [ + ".group:hover .group-hover\\:underline", + [["text-decoration-line", "underline"]], + ], + [".peer:checked ~ .peer-checked\\:block", [["display", "block"]]], +]); +actual.walkRules((rule) => { + if (restoredVariants.has(rule.selector)) { + assert.deepEqual( + rule.nodes.map(({ prop, value }) => [prop, value]), + restoredVariants.get(rule.selector), + ); + restoredVariants.delete(rule.selector); + rule.remove(); + } +}); +assert.equal( + restoredVariants.size, + 0, + "Group and peer variants must retain their intended declarations", +); +assert.equal( + csso.minify(actual.toString()).css, + csso.minify(expected.css).css, + "Nested, typography and Tailwind variant CSS must match the v6 baseline", +); +// Bound the regression probe so a vulnerable parser cannot hang the CI worker. +const probe = spawnSync( + process.execPath, + [ + "-e", + ` + const assert = require('node:assert/strict'); + const parser = require('postcss-selector-parser'); + const selector = '.a'.repeat(100000); + assert.equal(parser().processSync(selector), selector); +`, + ], + { timeout: 5000, encoding: "utf8" }, +); +assert.ifError(probe.error); +assert.equal(probe.status, 0, probe.stderr); +console.log( + "Parser consumers, CSS compatibility and flat-selector regression passed.", +); diff --git a/scripts/package-braces-backport.py b/scripts/package-braces-backport.py new file mode 100644 index 00000000..6d3c7ac7 --- /dev/null +++ b/scripts/package-braces-backport.py @@ -0,0 +1,60 @@ +"""Build/check the deterministic local braces package without npm lifecycle hooks.""" +import argparse +import difflib +import gzip +import hashlib +import io +import json +from pathlib import Path +import tarfile + +root = Path(__file__).resolve().parents[1] / "vendor/braces-backport" +source = root / "source" +archive = root / "braces-3.0.3-depth-guard.1.tgz" +manifest = root / "manifest.json" +parser = argparse.ArgumentParser() +parser.add_argument("--write", action="store_true") +args = parser.parse_args() +# Independently prove that the review diff covers every source change. +provenance = json.loads((root / "provenance.json").read_text()) +upstream_bytes = (root / "upstream/braces-3.0.3.tgz").read_bytes() +assert hashlib.sha256(upstream_bytes).hexdigest() == provenance["upstream_sha256"] +original = {} +with tarfile.open(fileobj=io.BytesIO(upstream_bytes), mode="r:gz") as upstream: + for entry in upstream.getmembers(): + if entry.isfile(): + original[entry.name.removeprefix("package/")] = upstream.extractfile(entry).read().decode() +review_diff = [] +for file in sorted(p for p in source.rglob("*") if p.is_file()): + name = file.relative_to(source).as_posix() + review_diff.extend(difflib.unified_diff(original.get(name, "").splitlines(True), file.read_text().splitlines(True), fromfile="a/" + name, tofile="b/" + name)) +assert "".join(review_diff) == (root / "depth-guard.1.patch").read_text(), "Review diff does not match upstream/source" +assert set(original).issubset({p.relative_to(source).as_posix() for p in source.rglob("*") if p.is_file()}), "Upstream files removed" + +buffer = io.BytesIO() +files = sorted(p for p in source.rglob("*") if p.is_file()) +with gzip.GzipFile(fileobj=buffer, mode="wb", filename="", mtime=0) as compressed: + with tarfile.open(fileobj=compressed, mode="w", format=tarfile.GNU_FORMAT) as package: + for path in files: + content = path.read_bytes() + entry = tarfile.TarInfo("package/" + path.relative_to(source).as_posix()) + entry.size = len(content) + entry.mode = 0o644 + package.addfile(entry, io.BytesIO(content)) +content = buffer.getvalue() +record = { + "patch_id": "depth-guard.1", + "package_name": "braces", + "package_version": "3.0.3", + "archive_sha256": hashlib.sha256(content).hexdigest(), + "source_sha256": {p.relative_to(source).as_posix(): hashlib.sha256(p.read_bytes()).hexdigest() for p in files}, + "patch_sha256": hashlib.sha256((root / "depth-guard.1.patch").read_bytes()).hexdigest(), + "upstream_test_sha256": {p.relative_to(root / "upstream-tests").as_posix(): hashlib.sha256(p.read_bytes()).hexdigest() for p in sorted((root / "upstream-tests/test").glob("*.js"))}, +} +if args.write: + archive.write_bytes(content) + manifest.write_text(json.dumps(record, indent=2) + "\n") +else: + assert archive.read_bytes() == content, "Package differs from its reviewed source" + assert json.loads(manifest.read_text()) == record, "Backport manifest mismatch" +print("Verified deterministic braces artifact:", record["archive_sha256"]) diff --git a/scripts/security-fixtures/README.md b/scripts/security-fixtures/README.md new file mode 100644 index 00000000..f74f0c0d --- /dev/null +++ b/scripts/security-fixtures/README.md @@ -0,0 +1,14 @@ +# Parser migration regression + +`selectors-expected.json` records output with Tailwind 3.4.17, Typography 0.5.16, +PostCSS Nested 6.2.0 and selector parser 6.1.3, before the scoped parser migration. +CSS minification ignores fixture formatting without ignoring selectors or declarations. + +Parser 7 makes insertion during iteration safe. The old parser lost group and peer +variants in this corpus. The test explicitly checks those restored declarations, +then compares every remaining rule against the old output. It also verifies the +parser resolved by each consumer and runs the flat-selector security regression +in a subprocess with a five-second timeout. + +Run `npm run check:security-compat` after changes to these consumers or overrides. +Do not regenerate the reference merely to make a changed output pass. diff --git a/scripts/security-fixtures/compile-selectors.mjs b/scripts/security-fixtures/compile-selectors.mjs new file mode 100644 index 00000000..ce047abf --- /dev/null +++ b/scripts/security-fixtures/compile-selectors.mjs @@ -0,0 +1,26 @@ +import fs from "node:fs/promises"; +import postcss from "postcss"; +import nested from "postcss-nested"; +import tailwind from "tailwindcss"; +import typography from "@tailwindcss/typography"; + +export async function compileSelectors() { + const input = await fs.readFile( + new URL("selectors-input.css", import.meta.url), + "utf8", + ); + const result = await postcss([ + nested, + tailwind({ + content: [ + { + raw: "
a:hover]:text-blue-500 [&:is(.a,.b)]:p-2 before:content-['x'] sm:focus-visible:ring-2\">
", + }, + ], + plugins: [typography], + darkMode: "class", + corePlugins: { preflight: false }, + }), + ]).process(input, { from: undefined }); + return result.css; +} diff --git a/scripts/security-fixtures/selectors-expected.json b/scripts/security-fixtures/selectors-expected.json new file mode 100644 index 00000000..a42fd906 --- /dev/null +++ b/scripts/security-fixtures/selectors-expected.json @@ -0,0 +1,3 @@ +{ + "css": ".prose { color: var(--tw-prose-body); max-width: 65ch; }\n.prose :where(p):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 1.25em; margin-bottom: 1.25em; }\n.prose :where([class~=\"lead\"]):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: var(--tw-prose-lead); font-size: 1.25em; line-height: 1.6; margin-top: 1.2em; margin-bottom: 1.2em; }\n.prose :where(a):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: var(--tw-prose-links); text-decoration: underline; font-weight: 500; }\n.prose :where(strong):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: var(--tw-prose-bold); font-weight: 600; }\n.prose :where(a strong):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: inherit; }\n.prose :where(blockquote strong):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: inherit; }\n.prose :where(thead th strong):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: inherit; }\n.prose :where(ol):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { list-style-type: decimal; margin-top: 1.25em; margin-bottom: 1.25em; padding-inline-start: 1.625em; }\n.prose :where(ol[type=\"A\"]):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { list-style-type: upper-alpha; }\n.prose :where(ol[type=\"a\"]):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { list-style-type: lower-alpha; }\n.prose :where(ol[type=\"A\" s]):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { list-style-type: upper-alpha; }\n.prose :where(ol[type=\"a\" s]):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { list-style-type: lower-alpha; }\n.prose :where(ol[type=\"I\"]):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { list-style-type: upper-roman; }\n.prose :where(ol[type=\"i\"]):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { list-style-type: lower-roman; }\n.prose :where(ol[type=\"I\" s]):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { list-style-type: upper-roman; }\n.prose :where(ol[type=\"i\" s]):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { list-style-type: lower-roman; }\n.prose :where(ol[type=\"1\"]):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { list-style-type: decimal; }\n.prose :where(ul):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { list-style-type: disc; margin-top: 1.25em; margin-bottom: 1.25em; padding-inline-start: 1.625em; }\n.prose :where(ol > li):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *))::marker { font-weight: 400; color: var(--tw-prose-counters); }\n.prose :where(ul > li):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *))::marker { color: var(--tw-prose-bullets); }\n.prose :where(dt):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: var(--tw-prose-headings); font-weight: 600; margin-top: 1.25em; }\n.prose :where(hr):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { border-color: var(--tw-prose-hr); border-top-width: 1px; margin-top: 3em; margin-bottom: 3em; }\n.prose :where(blockquote):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { font-weight: 500; font-style: italic; color: var(--tw-prose-quotes); border-inline-start-width: 0.25rem; border-inline-start-color: var(--tw-prose-quote-borders); quotes: \"\\201C\"\"\\201D\"\"\\2018\"\"\\2019\"; margin-top: 1.6em; margin-bottom: 1.6em; padding-inline-start: 1em; }\n.prose :where(blockquote p:first-of-type):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *))::before { content: open-quote; }\n.prose :where(blockquote p:last-of-type):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *))::after { content: close-quote; }\n.prose :where(h1):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: var(--tw-prose-headings); font-weight: 800; font-size: 2.25em; margin-top: 0; margin-bottom: 0.8888889em; line-height: 1.1111111; }\n.prose :where(h1 strong):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { font-weight: 900; color: inherit; }\n.prose :where(h2):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: var(--tw-prose-headings); font-weight: 700; font-size: 1.5em; margin-top: 2em; margin-bottom: 1em; line-height: 1.3333333; }\n.prose :where(h2 strong):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { font-weight: 800; color: inherit; }\n.prose :where(h3):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: var(--tw-prose-headings); font-weight: 600; font-size: 1.25em; margin-top: 1.6em; margin-bottom: 0.6em; line-height: 1.6; }\n.prose :where(h3 strong):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { font-weight: 700; color: inherit; }\n.prose :where(h4):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: var(--tw-prose-headings); font-weight: 600; margin-top: 1.5em; margin-bottom: 0.5em; line-height: 1.5; }\n.prose :where(h4 strong):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { font-weight: 700; color: inherit; }\n.prose :where(img):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 2em; margin-bottom: 2em; }\n.prose :where(picture):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { display: block; margin-top: 2em; margin-bottom: 2em; }\n.prose :where(video):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 2em; margin-bottom: 2em; }\n.prose :where(kbd):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { font-weight: 500; font-family: inherit; color: var(--tw-prose-kbd); box-shadow: 0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%), 0 3px 0 rgb(var(--tw-prose-kbd-shadows) / 10%); font-size: 0.875em; border-radius: 0.3125rem; padding-top: 0.1875em; padding-inline-end: 0.375em; padding-bottom: 0.1875em; padding-inline-start: 0.375em; }\n.prose :where(code):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: var(--tw-prose-code); font-weight: 600; font-size: 0.875em; }\n.prose :where(code):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *))::before { content: \"`\"; }\n.prose :where(code):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *))::after { content: \"`\"; }\n.prose :where(a code):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: inherit; }\n.prose :where(h1 code):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: inherit; }\n.prose :where(h2 code):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: inherit; font-size: 0.875em; }\n.prose :where(h3 code):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: inherit; font-size: 0.9em; }\n.prose :where(h4 code):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: inherit; }\n.prose :where(blockquote code):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: inherit; }\n.prose :where(thead th code):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: inherit; }\n.prose :where(pre):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: var(--tw-prose-pre-code); background-color: var(--tw-prose-pre-bg); overflow-x: auto; font-weight: 400; font-size: 0.875em; line-height: 1.7142857; margin-top: 1.7142857em; margin-bottom: 1.7142857em; border-radius: 0.375rem; padding-top: 0.8571429em; padding-inline-end: 1.1428571em; padding-bottom: 0.8571429em; padding-inline-start: 1.1428571em; }\n.prose :where(pre code):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { background-color: transparent; border-width: 0; border-radius: 0; padding: 0; font-weight: inherit; color: inherit; font-size: inherit; font-family: inherit; line-height: inherit; }\n.prose :where(pre code):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *))::before { content: none; }\n.prose :where(pre code):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *))::after { content: none; }\n.prose :where(table):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { width: 100%; table-layout: auto; margin-top: 2em; margin-bottom: 2em; font-size: 0.875em; line-height: 1.7142857; }\n.prose :where(thead):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { border-bottom-width: 1px; border-bottom-color: var(--tw-prose-th-borders); }\n.prose :where(thead th):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: var(--tw-prose-headings); font-weight: 600; vertical-align: bottom; padding-inline-end: 0.5714286em; padding-bottom: 0.5714286em; padding-inline-start: 0.5714286em; }\n.prose :where(tbody tr):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { border-bottom-width: 1px; border-bottom-color: var(--tw-prose-td-borders); }\n.prose :where(tbody tr:last-child):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { border-bottom-width: 0; }\n.prose :where(tbody td):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { vertical-align: baseline; }\n.prose :where(tfoot):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { border-top-width: 1px; border-top-color: var(--tw-prose-th-borders); }\n.prose :where(tfoot td):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { vertical-align: top; }\n.prose :where(th, td):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { text-align: start; }\n.prose :where(figure > *):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 0; margin-bottom: 0; }\n.prose :where(figcaption):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { color: var(--tw-prose-captions); font-size: 0.875em; line-height: 1.4285714; margin-top: 0.8571429em; }\n.prose { --tw-prose-body: #374151; --tw-prose-headings: #111827; --tw-prose-lead: #4b5563; --tw-prose-links: #111827; --tw-prose-bold: #111827; --tw-prose-counters: #6b7280; --tw-prose-bullets: #d1d5db; --tw-prose-hr: #e5e7eb; --tw-prose-quotes: #111827; --tw-prose-quote-borders: #e5e7eb; --tw-prose-captions: #6b7280; --tw-prose-kbd: #111827; --tw-prose-kbd-shadows: 17 24 39; --tw-prose-code: #111827; --tw-prose-pre-code: #e5e7eb; --tw-prose-pre-bg: #1f2937; --tw-prose-th-borders: #d1d5db; --tw-prose-td-borders: #e5e7eb; --tw-prose-invert-body: #d1d5db; --tw-prose-invert-headings: #fff; --tw-prose-invert-lead: #9ca3af; --tw-prose-invert-links: #fff; --tw-prose-invert-bold: #fff; --tw-prose-invert-counters: #9ca3af; --tw-prose-invert-bullets: #4b5563; --tw-prose-invert-hr: #374151; --tw-prose-invert-quotes: #f3f4f6; --tw-prose-invert-quote-borders: #374151; --tw-prose-invert-captions: #9ca3af; --tw-prose-invert-kbd: #fff; --tw-prose-invert-kbd-shadows: 255 255 255; --tw-prose-invert-code: #fff; --tw-prose-invert-pre-code: #d1d5db; --tw-prose-invert-pre-bg: rgb(0 0 0 / 50%); --tw-prose-invert-th-borders: #4b5563; --tw-prose-invert-td-borders: #374151; font-size: 1rem; line-height: 1.75; }\n.prose :where(picture > img):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 0; margin-bottom: 0; }\n.prose :where(li):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 0.5em; margin-bottom: 0.5em; }\n.prose :where(ol > li):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { padding-inline-start: 0.375em; }\n.prose :where(ul > li):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { padding-inline-start: 0.375em; }\n.prose :where(.prose > ul > li p):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 0.75em; margin-bottom: 0.75em; }\n.prose :where(.prose > ul > li > p:first-child):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 1.25em; }\n.prose :where(.prose > ul > li > p:last-child):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-bottom: 1.25em; }\n.prose :where(.prose > ol > li > p:first-child):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 1.25em; }\n.prose :where(.prose > ol > li > p:last-child):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-bottom: 1.25em; }\n.prose :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 0.75em; margin-bottom: 0.75em; }\n.prose :where(dl):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 1.25em; margin-bottom: 1.25em; }\n.prose :where(dd):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 0.5em; padding-inline-start: 1.625em; }\n.prose :where(hr + *):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 0; }\n.prose :where(h2 + *):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 0; }\n.prose :where(h3 + *):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 0; }\n.prose :where(h4 + *):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 0; }\n.prose :where(thead th:first-child):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { padding-inline-start: 0; }\n.prose :where(thead th:last-child):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { padding-inline-end: 0; }\n.prose :where(tbody td, tfoot td):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { padding-top: 0.5714286em; padding-inline-end: 0.5714286em; padding-bottom: 0.5714286em; padding-inline-start: 0.5714286em; }\n.prose :where(tbody td:first-child, tfoot td:first-child):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { padding-inline-start: 0; }\n.prose :where(tbody td:last-child, tfoot td:last-child):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { padding-inline-end: 0; }\n.prose :where(figure):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 2em; margin-bottom: 2em; }\n.prose :where(.prose > :first-child):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-top: 0; }\n.prose :where(.prose > :last-child):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)) { margin-bottom: 0; }\n.prose-invert { --tw-prose-body: var(--tw-prose-invert-body); --tw-prose-headings: var(--tw-prose-invert-headings); --tw-prose-lead: var(--tw-prose-invert-lead); --tw-prose-links: var(--tw-prose-invert-links); --tw-prose-bold: var(--tw-prose-invert-bold); --tw-prose-counters: var(--tw-prose-invert-counters); --tw-prose-bullets: var(--tw-prose-invert-bullets); --tw-prose-hr: var(--tw-prose-invert-hr); --tw-prose-quotes: var(--tw-prose-invert-quotes); --tw-prose-quote-borders: var(--tw-prose-invert-quote-borders); --tw-prose-captions: var(--tw-prose-invert-captions); --tw-prose-kbd: var(--tw-prose-invert-kbd); --tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows); --tw-prose-code: var(--tw-prose-invert-code); --tw-prose-pre-code: var(--tw-prose-invert-pre-code); --tw-prose-pre-bg: var(--tw-prose-invert-pre-bg); --tw-prose-th-borders: var(--tw-prose-invert-th-borders); --tw-prose-td-borders: var(--tw-prose-invert-td-borders); }\n.card:hover, .card[data-state=\"open\"], .panel:hover, .panel[data-state=\"open\"] { color: red; }\n.card :is(.item, .label), .panel :is(.item, .label) { color: blue; }\n.before\\:content-\\[\\'x\\'\\]::before { --tw-content: 'x'; content: var(--tw-content); }\n.hover\\:text-red-500:hover { --tw-text-opacity: 1; color: rgb(239 68 68 / var(--tw-text-opacity, 1)); }\n.prose-headings\\:font-bold :is(:where(h1, h2, h3, h4, h5, h6, th):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *))) { font-weight: 700; }\n.dark\\:hover\\:text-white:hover:is(.dark *) { --tw-text-opacity: 1; color: rgb(255 255 255 / var(--tw-text-opacity, 1)); }\n@media (min-width: 640px) {\n .sm\\:focus-visible\\:ring-2:focus-visible { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); } }\n.\\[\\&\\:is\\(\\.a\\2c \\.b\\)\\]\\:p-2:is(.a,.b) { padding: 0.5rem; }\n.\\[\\&\\>a\\:hover\\]\\:text-blue-500>a:hover { --tw-text-opacity: 1; color: rgb(59 130 246 / var(--tw-text-opacity, 1)); }\n" +} diff --git a/scripts/security-fixtures/selectors-input.css b/scripts/security-fixtures/selectors-input.css new file mode 100644 index 00000000..afa51e2a --- /dev/null +++ b/scripts/security-fixtures/selectors-input.css @@ -0,0 +1,12 @@ +@tailwind components; +@tailwind utilities; +.card, +.panel { + &:hover, + &[data-state="open"] { + color: red; + } + & :is(.item, .label) { + color: blue; + } +} diff --git a/scripts/test-braces-upstream.mjs b/scripts/test-braces-upstream.mjs new file mode 100644 index 00000000..5c92f220 --- /dev/null +++ b/scripts/test-braces-upstream.mjs @@ -0,0 +1,37 @@ +import path from "node:path"; +import fs from "node:fs"; +import Module, { createRequire } from "node:module"; +const require = createRequire(import.meta.url); +import { describe, it } from "node:test"; +import cp from "node:child_process"; +const base = path.resolve("vendor/braces-backport/upstream-tests"); +const target = path.resolve(process.argv[2] || "node_modules/braces"); +// Run the untouched upstream synchronous assertions using Node's test runner. +// Avoid installing upstream's obsolete Mocha 6/development dependency tree. +global.describe = describe; +global.it = it; +const originalLoad = Module._load; +Module._load = function (request, parent, isMain) { + if (parent?.filename.startsWith(base + path.sep)) { + if (request === "mocha") return {}; + if (request === "bash-path") return () => "/bin/bash"; + if (request === "..") return originalLoad(target, parent, isMain); + if (request.startsWith("../lib/")) { + return originalLoad(path.join(target, request.slice(3)), parent, isMain); + } + } + return originalLoad(request, parent, isMain); +}; +const originalSpawn = cp.spawnSync; +cp.spawnSync = (command, args, options = {}) => { + const result = originalSpawn(command, args, { + ...options, + timeout: 5000, + maxBuffer: 1024 * 1024, + }); + if (result.error) throw result.error; + return result; +}; +for (const file of fs.readdirSync(path.join(base, "test")).sort()) { + if (file.endsWith(".js")) require(path.join(base, "test", file)); +} diff --git a/src/utils/seo.ts b/src/utils/seo.ts index 65440f97..a5300324 100644 --- a/src/utils/seo.ts +++ b/src/utils/seo.ts @@ -6,10 +6,7 @@ export const normalizePagePath = (pathname: string) => export function isDemoPath(pathname: string) { const path = normalizePagePath(pathname); - return ( - /^\/(homes|landing)(\/|$)/.test(path) || - ["/pricing"].includes(path) - ); + return /^\/(homes|landing)(\/|$)/.test(path) || ["/pricing"].includes(path); } const pages: Record< diff --git a/vendor/braces-backport/LICENSE b/vendor/braces-backport/LICENSE new file mode 100644 index 00000000..9af4a67d --- /dev/null +++ b/vendor/braces-backport/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/braces-backport/README.md b/vendor/braces-backport/README.md new file mode 100644 index 00000000..1981b8ba --- /dev/null +++ b/vendor/braces-backport/README.md @@ -0,0 +1,76 @@ +# Canonical local braces backport + +This directory owns the shared `depth-guard.1` patch for the portfolio and +Blinktracking. Copy this directory and the four `scripts/*braces*` runners +unchanged into the other repository; do not create a second divergent fork. +The package is private, local and deterministic. Nothing is published to npm. + +## Integration + +Keep all unrelated dependencies/overrides. Add this direct development dependency: + +```json +"braces": "file:vendor/braces-backport/braces-3.0.3-depth-guard.1.tgz" +``` + +Resolve every transitive braces edge to it: + +```json +"overrides": { "braces": "$braces" } +``` + +Regenerate the lockfile with `npm install --package-lock-only --ignore-scripts`, +then run a clean `npm ci`. Run the full existing audit and add this independent CI +gate before it: + +```sh +python3 scripts/package-braces-backport.py +node scripts/check-braces-backport.mjs +node scripts/test-braces-upstream.mjs +``` + +These gates are separate from npm audit. The artifact deliberately keeps +`name: braces` and `version: 3.0.3`; `jvSecurityPatch` identifies the local patch. +The audit still reports the original advisory here. Do not dismiss it, lower its +threshold, change the name/version to evade it, or call this an upstream fix. +A green registry audit would not independently prove a local fork's security. + +## Evidence and scope + +`provenance.json` pins the official release commit, npm URL and SHA-512 integrity. +`upstream/braces-3.0.3.tgz` is that original, vulnerable release, used only as a +bounded regression baseline; it is never installed as the application's override. +`source/` is the readable patched package. `depth-guard.1.patch` shows every change +from the official tarball, including this package's security note and private +metadata. `manifest.json` pins every shipped file, the patch and upstream tests. +The original MIT copyright and license are preserved. + +The regression child uses a 256 KB stack, 64 MB heap, 15-second timeout and 64 KB +output cap. It demonstrates native stack exhaustion before the patch, controlled +errors afterwards, depth-boundary behavior, caller AST and internal walkers, +parent/child cycles, node budget, quoting/escaping, mixed parentheses/braces and +1,400 ordinary-input/option comparisons. The main gate verifies every installed +braces copy and its consumers; it also exercises micromatch, fast-glob and an +isolated Chokidar watcher. Temporary test files are removed on completion. + +All 764 upstream tests are imported unchanged from the release commit and run +using Node's native test runner. A narrow adapter maps the synchronous Mocha +`describe`/`it` globals, upstream package imports and `bash-path` to `/bin/bash`. +It adds time/output limits to Bash subprocesses. It does not skip or rewrite +assertions and avoids installing upstream's obsolete test dependency tree. + +See `source/BACKPORT.md` for the exact limits, controlled error codes and remaining +resource/application obligations. This patch does not claim to bound aggregate +Cartesian expansion, hostile JavaScript objects or arbitrary user-supplied input +arrays. Callers still need to handle input-validation exceptions. + +## Maintenance + +The repository owner maintains this backport until an upstream fix can replace it. +For an intentional source change, review the new diff against the pinned upstream +release, refresh `depth-guard.1.patch`, update the patch ID, and generate the +artifact with `python3 scripts/package-braces-backport.py --write`. Commit source, +patch, manifest and archive together. Run every independent gate, the full audit, +build and UI/content checks in both consumers. Do not merely regenerate hashes to +accept an unexplained change. Prefer an official compatible patch when available; +remove the local override only after its regression suite and all consumers pass. diff --git a/vendor/braces-backport/braces-3.0.3-depth-guard.1.tgz b/vendor/braces-backport/braces-3.0.3-depth-guard.1.tgz new file mode 100644 index 00000000..fba43ff4 Binary files /dev/null and b/vendor/braces-backport/braces-3.0.3-depth-guard.1.tgz differ diff --git a/vendor/braces-backport/depth-guard.1.patch b/vendor/braces-backport/depth-guard.1.patch new file mode 100644 index 00000000..6a65a13d --- /dev/null +++ b/vendor/braces-backport/depth-guard.1.patch @@ -0,0 +1,200 @@ +--- a/BACKPORT.md ++++ b/BACKPORT.md +@@ -0,0 +1,33 @@ ++# Local depth-guard backport, revision 1 ++ ++This is `braces` 3.0.3 (MIT, Jon Schlinkert), modified locally for ++[GHSA-vfj7-8cjw-p6xm](https://github.com/advisories/GHSA-vfj7-8cjw-p6xm). ++The original name and version are retained, with `jvSecurityPatch: depth-guard.1`. ++This is not a release endorsed by upstream. Do not publish it to a registry. ++ ++The parser rejects nesting of braces **and parentheses** over 100 containers, ++before allocating the next container. Recursive compile/expand/stringify walkers ++perform an iterative AST preflight, including for directly supplied ASTs. ++The preflight caps container depth at 100 and total visits at 20,010, and rejects ++child cycles and cyclic/deep parent chains. Original parent links retained by ++upstream while flattening invalid braces remain supported. ++`maxDepth` can tighten the depth bound (integer 1–100), never disable or raise it. ++Depth errors are `RangeError` with code `ERR_BRACES_DEPTH`, not a native stack ++exhaustion. AST/option/budget errors have distinct `ERR_BRACES_*` codes. ++ ++Intentional compatibility change: patterns/ASTs exceeding these limits now fail ++with a controlled error. CommonJS, normal outputs and existing options are kept. ++Callers processing untrusted input must catch validation errors; an uncaught ++validation exception can still terminate their application, just as upstream's ++existing type/length/range errors can. The patch prevents unbounded recursion, ++not every possible resource exhaustion. Existing input-length and numeric range ++limits remain. Aggregate Cartesian expansion size, input-array length, huge ++literal values in caller-created ASTs, accessors/proxies and hostile object ++behavior are outside this patch; use external quotas/isolation for such input. ++Caller-supplied ASTs are expected to be ordinary data objects, not executable ++objects. Resource tests run in memory/stack/time-limited subprocesses. ++ ++See the enclosing provenance manifest, patch diff, tests and reproducible local ++package artifact. Registry audit tools may still report 3.0.3, or omit a local ++artifact; neither outcome establishes whether this patch is correct. Independent ++source-integrity, regression, upstream and actual-consumer tests are required. +--- a/lib/compile.js ++++ b/lib/compile.js +@@ -1,9 +1,12 @@ + 'use strict'; ++ ++const depthGuard = require('./depth'); + + const fill = require('fill-range'); + const utils = require('./utils'); + + const compile = (ast, options = {}) => { ++ depthGuard.assert(ast, options); + const walk = (node, parent = {}) => { + const invalidBlock = utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; +--- a/lib/depth.js ++++ b/lib/depth.js +@@ -0,0 +1,69 @@ ++'use strict'; ++ ++// Local security backport for GHSA-vfj7-8cjw-p6xm; see BACKPORT.md. ++const MAX_DEPTH = 100; ++const MAX_NODES = 20010; ++ ++const failure = (code, message) => { ++ const error = new RangeError(message); ++ error.code = code; ++ return error; ++}; ++ ++const limit = options => { ++ const depth = options && options.maxDepth !== undefined ? options.maxDepth : MAX_DEPTH; ++ if (!Number.isInteger(depth) || depth < 1 || depth > MAX_DEPTH) { ++ throw failure('ERR_BRACES_DEPTH_OPTION', `maxDepth must be an integer from 1 to ${MAX_DEPTH}`); ++ } ++ return depth; ++}; ++ ++const check = (depth, max) => { ++ if (depth > max) { ++ throw failure('ERR_BRACES_DEPTH', `Brace AST nesting exceeds maximum depth (${max})`); ++ } ++}; ++ ++// Iterative preflight: never recurse over an unvalidated, caller-supplied AST. ++const assert = (ast, options) => { ++ const max = limit(options); ++ const active = new Set(); ++ const frames = [{ node: ast, parent: null, depth: ast.type === 'root' ? 0 : 1, index: -1 }]; ++ let count = 0; ++ while (frames.length) { ++ const frame = frames[frames.length - 1]; ++ const node = frame.node; ++ if (frame.index === -1) { ++ if (++count > MAX_NODES) { ++ throw failure('ERR_BRACES_NODES', `Brace AST exceeds maximum nodes (${MAX_NODES})`); ++ } ++ if (active.has(node)) throw failure('ERR_BRACES_AST', 'Cyclic brace AST'); ++ const parents = new Set(); ++ let parent = node; ++ while (parent) { ++ if (parents.has(parent)) throw failure('ERR_BRACES_AST', 'Cyclic brace AST parent'); ++ parents.add(parent); ++ // Upstream may retain old parent links when flattening invalid braces. ++ // Validate their bound, rather than requiring structural equality. ++ check(parents.size - 2, max); ++ parent = parent.parent; ++ } ++ if (node.nodes) { ++ check(frame.depth, max); ++ if (!Array.isArray(node.nodes)) throw failure('ERR_BRACES_AST', 'Expected AST nodes array'); ++ } ++ active.add(node); ++ frame.index = 0; ++ } ++ if (node.nodes && frame.index < node.nodes.length) { ++ const child = node.nodes[frame.index++]; ++ frames.push({ node: child, parent: node, depth: frame.depth + 1, index: -1 }); ++ } else { ++ active.delete(node); ++ frames.pop(); ++ } ++ } ++ ++}; ++ ++module.exports = { MAX_DEPTH, MAX_NODES, limit, check, assert }; +--- a/lib/expand.js ++++ b/lib/expand.js +@@ -1,4 +1,6 @@ + 'use strict'; ++ ++const depthGuard = require('./depth'); + + const fill = require('fill-range'); + const stringify = require('./stringify'); +@@ -31,6 +33,7 @@ + }; + + const expand = (ast, options = {}) => { ++ depthGuard.assert(ast, options); + const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit; + + const walk = (node, parent = {}) => { +--- a/lib/parse.js ++++ b/lib/parse.js +@@ -1,6 +1,7 @@ + 'use strict'; + + const stringify = require('./stringify'); ++const depthGuard = require('./depth'); + + /** + * Constants +@@ -39,6 +40,8 @@ + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + } + ++ const maxDepth = depthGuard.limit(opts); ++ + const ast = { type: 'root', input, nodes: [] }; + const stack = [ast]; + let block = ast; +@@ -143,6 +146,7 @@ + */ + + if (value === CHAR_LEFT_PARENTHESES) { ++ depthGuard.check(stack.length, maxDepth); + block = push({ type: 'paren', nodes: [] }); + stack.push(block); + push({ type: 'text', value }); +@@ -195,6 +199,7 @@ + */ + + if (value === CHAR_LEFT_CURLY_BRACE) { ++ depthGuard.check(stack.length, maxDepth); + depth++; + + const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; +--- a/lib/stringify.js ++++ b/lib/stringify.js +@@ -1,8 +1,11 @@ + 'use strict'; ++ ++const depthGuard = require('./depth'); + + const utils = require('./utils'); + + module.exports = (ast, options = {}) => { ++ depthGuard.assert(ast, options); + const stringify = (node, parent = {}) => { + const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; +--- a/package.json ++++ b/package.json +@@ -73,5 +73,7 @@ + "plugins": [ + "gulp-format-md" + ] +- } ++ }, ++ "private": true, ++ "jvSecurityPatch": "depth-guard.1" + } diff --git a/vendor/braces-backport/manifest.json b/vendor/braces-backport/manifest.json new file mode 100644 index 00000000..c2cfa872 --- /dev/null +++ b/vendor/braces-backport/manifest.json @@ -0,0 +1,35 @@ +{ + "patch_id": "depth-guard.1", + "package_name": "braces", + "package_version": "3.0.3", + "archive_sha256": "919a91c9ccbdedff3d1d974a1a735a09e690f24fbe4e01207cc3e751ab7b33bf", + "source_sha256": { + "BACKPORT.md": "9249e03d38f7c1c47927fca91e3356a0ce4bc577e9c753ee05937bb386661cb2", + "LICENSE": "35bdd8a44339719441900fb50fbefc5e2dca1ca662cbaed7a687de842c8b70f2", + "README.md": "947b0fc3cc12eaaa070207126213fbdf9ab2bf8cd13dcc6e4007b36b79309866", + "index.js": "332ea07c7b006361aad12aa994ca75dc1db8e8382b884909e2f38f10b85c88a4", + "lib/compile.js": "61e9f981df1a3080b77a5886a49bd00a986e0aec8e84260adaded4c9f0fe26ad", + "lib/constants.js": "c18ac5adb57308f1ce42a28552da3a31f5d83709743ebd9a636336813a744d4b", + "lib/depth.js": "6d20a9442b4bc9072aaabb41253e32e4278116aa17347e8daaf04191ef003fd7", + "lib/expand.js": "f8a23b38719bb01bdeb70913d5f91e2b6fa31fddd5e1893ae214a64c0cb896d2", + "lib/parse.js": "52a41299e9d10932bed07adca2d9a0f205cd44b32b05dde423bf369ddccfe443", + "lib/stringify.js": "5d1bca7958e3f7a3f945a2ac9f4e5a5ab77d7b27e5cdb35eb4d1f98b2b1c8685", + "lib/utils.js": "b5a7596aa67730412b3c029ef09e84e6b67b8e445cffd35d1d295549c89066c7", + "package.json": "dba7f4004e49da3f6e8377b49a732554e624f2086f5404f7efbbeead2362ddd5" + }, + "patch_sha256": "bf5e7901b6f2ce34a4e2dc8d7eb9f493c2e30dd14c04e1aada0897570847490d", + "upstream_test_sha256": { + "test/bash-compiled-ranges.js": "7e8a10ed467f19dd3723ebcb02c33ff13c973115ea101c8504b2fd32f9b3e9e3", + "test/bash-compiled-sets.js": "ff2dda0bdd8d1db4994f814d75117494e53b2a83cafd957048ddc9bca619d669", + "test/bash-expanded-ranges.js": "69c55956b57fe27160ce9dfab92a0a552001ee7aa992dc8d077410a282b92097", + "test/bash-expanded-sets.js": "b0759bb53728d98a71e4b06f566301f5aa3ccf28e8f99eaa2634fda8d877f96c", + "test/bash-spec.js": "c5208d38999e0fd0ac12e4bde7240b8e93890dff160ddb78ac62883f7ef632f4", + "test/braces.compile.js": "c47a9565c0be7287958667f31f64a060a38f91fbe98d27953b770ee2736ff077", + "test/braces.expand.js": "a6d70d8bec87025c58a6e14fffa9dcb3c0ae890fc2232e8b0af0966190fa733b", + "test/braces.parse.js": "4688e08098264b7851f03ea894d30bd992fea307f8a334bf833a4e2bdae30a87", + "test/minimatch.js": "6b65901c2a0a2b680dbe1178311578037ee6601eab1631929ac2d10b2e37dd08", + "test/multiples.js": "d0b779166faf40693b5898a3766ae6c91aec600a714cf1b36a8b85067e90b7ac", + "test/readme.js": "91202e5e3e926d47b11ebe5f2b04db560c1048aac97e67f61d521ce0cb220b15", + "test/regression.js": "1595ae9cea47947b1ea258673151c2428a780859fc1efd5d9d92b035f1887470" + } +} diff --git a/vendor/braces-backport/provenance.json b/vendor/braces-backport/provenance.json new file mode 100644 index 00000000..ee0da1d5 --- /dev/null +++ b/vendor/braces-backport/provenance.json @@ -0,0 +1,14 @@ +{ + "upstream_package": "braces", + "upstream_version": "3.0.3", + "upstream_commit": "74b2db2938fad48a2ea54a9c8bf27a37a62c350d", + "upstream_tarball": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "upstream_integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "upstream_sha256": "1cd18e862c8640b4568b1425a7df4ee030ff201d45b2da8f9f222d2987494ffc", + "license": "MIT", + "advisory": "https://github.com/advisories/GHSA-vfj7-8cjw-p6xm", + "patch_id": "depth-guard.1", + "upstream_tests_commit": "74b2db2938fad48a2ea54a9c8bf27a37a62c350d", + "upstream_source_archive": "https://codeload.github.com/micromatch/braces/tar.gz/74b2db2938fad48a2ea54a9c8bf27a37a62c350d", + "upstream_source_archive_sha256": "697311aa470de468a1e5cac70ab227262dce9e38f5a4e0eef306d515b71222af" +} diff --git a/vendor/braces-backport/source/BACKPORT.md b/vendor/braces-backport/source/BACKPORT.md new file mode 100644 index 00000000..7444ddbf --- /dev/null +++ b/vendor/braces-backport/source/BACKPORT.md @@ -0,0 +1,33 @@ +# Local depth-guard backport, revision 1 + +This is `braces` 3.0.3 (MIT, Jon Schlinkert), modified locally for +[GHSA-vfj7-8cjw-p6xm](https://github.com/advisories/GHSA-vfj7-8cjw-p6xm). +The original name and version are retained, with `jvSecurityPatch: depth-guard.1`. +This is not a release endorsed by upstream. Do not publish it to a registry. + +The parser rejects nesting of braces **and parentheses** over 100 containers, +before allocating the next container. Recursive compile/expand/stringify walkers +perform an iterative AST preflight, including for directly supplied ASTs. +The preflight caps container depth at 100 and total visits at 20,010, and rejects +child cycles and cyclic/deep parent chains. Original parent links retained by +upstream while flattening invalid braces remain supported. +`maxDepth` can tighten the depth bound (integer 1–100), never disable or raise it. +Depth errors are `RangeError` with code `ERR_BRACES_DEPTH`, not a native stack +exhaustion. AST/option/budget errors have distinct `ERR_BRACES_*` codes. + +Intentional compatibility change: patterns/ASTs exceeding these limits now fail +with a controlled error. CommonJS, normal outputs and existing options are kept. +Callers processing untrusted input must catch validation errors; an uncaught +validation exception can still terminate their application, just as upstream's +existing type/length/range errors can. The patch prevents unbounded recursion, +not every possible resource exhaustion. Existing input-length and numeric range +limits remain. Aggregate Cartesian expansion size, input-array length, huge +literal values in caller-created ASTs, accessors/proxies and hostile object +behavior are outside this patch; use external quotas/isolation for such input. +Caller-supplied ASTs are expected to be ordinary data objects, not executable +objects. Resource tests run in memory/stack/time-limited subprocesses. + +See the enclosing provenance manifest, patch diff, tests and reproducible local +package artifact. Registry audit tools may still report 3.0.3, or omit a local +artifact; neither outcome establishes whether this patch is correct. Independent +source-integrity, regression, upstream and actual-consumer tests are required. diff --git a/vendor/braces-backport/source/LICENSE b/vendor/braces-backport/source/LICENSE new file mode 100644 index 00000000..9af4a67d --- /dev/null +++ b/vendor/braces-backport/source/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/braces-backport/source/README.md b/vendor/braces-backport/source/README.md new file mode 100644 index 00000000..f59dd604 --- /dev/null +++ b/vendor/braces-backport/source/README.md @@ -0,0 +1,586 @@ +# braces [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/braces.svg?style=flat)](https://www.npmjs.com/package/braces) [![NPM monthly downloads](https://img.shields.io/npm/dm/braces.svg?style=flat)](https://npmjs.org/package/braces) [![NPM total downloads](https://img.shields.io/npm/dt/braces.svg?style=flat)](https://npmjs.org/package/braces) [![Linux Build Status](https://img.shields.io/travis/micromatch/braces.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/braces) + +> Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save braces +``` + +## v3.0.0 Released!! + +See the [changelog](CHANGELOG.md) for details. + +## Why use braces? + +Brace patterns make globs more powerful by adding the ability to match specific ranges and sequences of characters. + +- **Accurate** - complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests) +- **[fast and performant](#benchmarks)** - Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity. +- **Organized code base** - The parser and compiler are easy to maintain and update when edge cases crop up. +- **Well-tested** - Thousands of test assertions, and passes all of the Bash, minimatch, and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests (as of the date this was written). +- **Safer** - You shouldn't have to worry about users defining aggressive or malicious brace patterns that can break your application. Braces takes measures to prevent malicious regex that can be used for DDoS attacks (see [catastrophic backtracking](https://www.regular-expressions.info/catastrophic.html)). +- [Supports lists](#lists) - (aka "sets") `a/{b,c}/d` => `['a/b/d', 'a/c/d']` +- [Supports sequences](#sequences) - (aka "ranges") `{01..03}` => `['01', '02', '03']` +- [Supports steps](#steps) - (aka "increments") `{2..10..2}` => `['2', '4', '6', '8', '10']` +- [Supports escaping](#escaping) - To prevent evaluation of special characters. + +## Usage + +The main export is a function that takes one or more brace `patterns` and `options`. + +```js +const braces = require('braces'); +// braces(patterns[, options]); + +console.log(braces(['{01..05}', '{a..e}'])); +//=> ['(0[1-5])', '([a-e])'] + +console.log(braces(['{01..05}', '{a..e}'], { expand: true })); +//=> ['01', '02', '03', '04', '05', 'a', 'b', 'c', 'd', 'e'] +``` + +### Brace Expansion vs. Compilation + +By default, brace patterns are compiled into strings that are optimized for creating regular expressions and matching. + +**Compiled** + +```js +console.log(braces('a/{x,y,z}/b')); +//=> ['a/(x|y|z)/b'] +console.log(braces(['a/{01..20}/b', 'a/{1..5}/b'])); +//=> [ 'a/(0[1-9]|1[0-9]|20)/b', 'a/([1-5])/b' ] +``` + +**Expanded** + +Enable brace expansion by setting the `expand` option to true, or by using [braces.expand()](#expand) (returns an array similar to what you'd expect from Bash, or `echo {1..5}`, or [minimatch](https://github.com/isaacs/minimatch)): + +```js +console.log(braces('a/{x,y,z}/b', { expand: true })); +//=> ['a/x/b', 'a/y/b', 'a/z/b'] + +console.log(braces.expand('{01..10}')); +//=> ['01','02','03','04','05','06','07','08','09','10'] +``` + +### Lists + +Expand lists (like Bash "sets"): + +```js +console.log(braces('a/{foo,bar,baz}/*.js')); +//=> ['a/(foo|bar|baz)/*.js'] + +console.log(braces.expand('a/{foo,bar,baz}/*.js')); +//=> ['a/foo/*.js', 'a/bar/*.js', 'a/baz/*.js'] +``` + +### Sequences + +Expand ranges of characters (like Bash "sequences"): + +```js +console.log(braces.expand('{1..3}')); // ['1', '2', '3'] +console.log(braces.expand('a/{1..3}/b')); // ['a/1/b', 'a/2/b', 'a/3/b'] +console.log(braces('{a..c}', { expand: true })); // ['a', 'b', 'c'] +console.log(braces('foo/{a..c}', { expand: true })); // ['foo/a', 'foo/b', 'foo/c'] + +// supports zero-padded ranges +console.log(braces('a/{01..03}/b')); //=> ['a/(0[1-3])/b'] +console.log(braces('a/{001..300}/b')); //=> ['a/(0{2}[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)/b'] +``` + +See [fill-range](https://github.com/jonschlinkert/fill-range) for all available range-expansion options. + +### Steppped ranges + +Steps, or increments, may be used with ranges: + +```js +console.log(braces.expand('{2..10..2}')); +//=> ['2', '4', '6', '8', '10'] + +console.log(braces('{2..10..2}')); +//=> ['(2|4|6|8|10)'] +``` + +When the [.optimize](#optimize) method is used, or [options.optimize](#optionsoptimize) is set to true, sequences are passed to [to-regex-range](https://github.com/jonschlinkert/to-regex-range) for expansion. + +### Nesting + +Brace patterns may be nested. The results of each expanded string are not sorted, and left to right order is preserved. + +**"Expanded" braces** + +```js +console.log(braces.expand('a{b,c,/{x,y}}/e')); +//=> ['ab/e', 'ac/e', 'a/x/e', 'a/y/e'] + +console.log(braces.expand('a/{x,{1..5},y}/c')); +//=> ['a/x/c', 'a/1/c', 'a/2/c', 'a/3/c', 'a/4/c', 'a/5/c', 'a/y/c'] +``` + +**"Optimized" braces** + +```js +console.log(braces('a{b,c,/{x,y}}/e')); +//=> ['a(b|c|/(x|y))/e'] + +console.log(braces('a/{x,{1..5},y}/c')); +//=> ['a/(x|([1-5])|y)/c'] +``` + +### Escaping + +**Escaping braces** + +A brace pattern will not be expanded or evaluted if _either the opening or closing brace is escaped_: + +```js +console.log(braces.expand('a\\{d,c,b}e')); +//=> ['a{d,c,b}e'] + +console.log(braces.expand('a{d,c,b\\}e')); +//=> ['a{d,c,b}e'] +``` + +**Escaping commas** + +Commas inside braces may also be escaped: + +```js +console.log(braces.expand('a{b\\,c}d')); +//=> ['a{b,c}d'] + +console.log(braces.expand('a{d\\,c,b}e')); +//=> ['ad,ce', 'abe'] +``` + +**Single items** + +Following bash conventions, a brace pattern is also not expanded when it contains a single character: + +```js +console.log(braces.expand('a{b}c')); +//=> ['a{b}c'] +``` + +## Options + +### options.maxLength + +**Type**: `Number` + +**Default**: `10,000` + +**Description**: Limit the length of the input string. Useful when the input string is generated or your application allows users to pass a string, et cetera. + +```js +console.log(braces('a/{b,c}/d', { maxLength: 3 })); //=> throws an error +``` + +### options.expand + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: Generate an "expanded" brace pattern (alternatively you can use the `braces.expand()` method, which does the same thing). + +```js +console.log(braces('a/{b,c}/d', { expand: true })); +//=> [ 'a/b/d', 'a/c/d' ] +``` + +### options.nodupes + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: Remove duplicates from the returned array. + +### options.rangeLimit + +**Type**: `Number` + +**Default**: `1000` + +**Description**: To prevent malicious patterns from being passed by users, an error is thrown when `braces.expand()` is used or `options.expand` is true and the generated range will exceed the `rangeLimit`. + +You can customize `options.rangeLimit` or set it to `Inifinity` to disable this altogether. + +**Examples** + +```js +// pattern exceeds the "rangeLimit", so it's optimized automatically +console.log(braces.expand('{1..1000}')); +//=> ['([1-9]|[1-9][0-9]{1,2}|1000)'] + +// pattern does not exceed "rangeLimit", so it's NOT optimized +console.log(braces.expand('{1..100}')); +//=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100'] +``` + +### options.transform + +**Type**: `Function` + +**Default**: `undefined` + +**Description**: Customize range expansion. + +**Example: Transforming non-numeric values** + +```js +const alpha = braces.expand('x/{a..e}/y', { + transform(value, index) { + // When non-numeric values are passed, "value" is a character code. + return 'foo/' + String.fromCharCode(value) + '-' + index; + }, +}); +console.log(alpha); +//=> [ 'x/foo/a-0/y', 'x/foo/b-1/y', 'x/foo/c-2/y', 'x/foo/d-3/y', 'x/foo/e-4/y' ] +``` + +**Example: Transforming numeric values** + +```js +const numeric = braces.expand('{1..5}', { + transform(value) { + // when numeric values are passed, "value" is a number + return 'foo/' + value * 2; + }, +}); +console.log(numeric); +//=> [ 'foo/2', 'foo/4', 'foo/6', 'foo/8', 'foo/10' ] +``` + +### options.quantifiers + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times. + +Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists) + +The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) are defined in the given pattern, and not to try to expand them as lists. + +**Examples** + +```js +const braces = require('braces'); +console.log(braces('a/b{1,3}/{x,y,z}')); +//=> [ 'a/b(1|3)/(x|y|z)' ] +console.log(braces('a/b{1,3}/{x,y,z}', { quantifiers: true })); +//=> [ 'a/b{1,3}/(x|y|z)' ] +console.log(braces('a/b{1,3}/{x,y,z}', { quantifiers: true, expand: true })); +//=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ] +``` + +### options.keepEscaping + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: Do not strip backslashes that were used for escaping from the result. + +## What is "brace expansion"? + +Brace expansion is a type of parameter expansion that was made popular by unix shells for generating lists of strings, as well as regex-like matching when used alongside wildcards (globs). + +In addition to "expansion", braces are also used for matching. In other words: + +- [brace expansion](#brace-expansion) is for generating new lists +- [brace matching](#brace-matching) is for filtering existing lists + +
+More about brace expansion (click to expand) + +There are two main types of brace expansion: + +1. **lists**: which are defined using comma-separated values inside curly braces: `{a,b,c}` +2. **sequences**: which are defined using a starting value and an ending value, separated by two dots: `a{1..3}b`. Optionally, a third argument may be passed to define a "step" or increment to use: `a{1..100..10}b`. These are also sometimes referred to as "ranges". + +Here are some example brace patterns to illustrate how they work: + +**Sets** + +``` +{a,b,c} => a b c +{a,b,c}{1,2} => a1 a2 b1 b2 c1 c2 +``` + +**Sequences** + +``` +{1..9} => 1 2 3 4 5 6 7 8 9 +{4..-4} => 4 3 2 1 0 -1 -2 -3 -4 +{1..20..3} => 1 4 7 10 13 16 19 +{a..j} => a b c d e f g h i j +{j..a} => j i h g f e d c b a +{a..z..3} => a d g j m p s v y +``` + +**Combination** + +Sets and sequences can be mixed together or used along with any other strings. + +``` +{a,b,c}{1..3} => a1 a2 a3 b1 b2 b3 c1 c2 c3 +foo/{a,b,c}/bar => foo/a/bar foo/b/bar foo/c/bar +``` + +The fact that braces can be "expanded" from relatively simple patterns makes them ideal for quickly generating test fixtures, file paths, and similar use cases. + +## Brace matching + +In addition to _expansion_, brace patterns are also useful for performing regular-expression-like matching. + +For example, the pattern `foo/{1..3}/bar` would match any of following strings: + +``` +foo/1/bar +foo/2/bar +foo/3/bar +``` + +But not: + +``` +baz/1/qux +baz/2/qux +baz/3/qux +``` + +Braces can also be combined with [glob patterns](https://github.com/jonschlinkert/micromatch) to perform more advanced wildcard matching. For example, the pattern `*/{1..3}/*` would match any of following strings: + +``` +foo/1/bar +foo/2/bar +foo/3/bar +baz/1/qux +baz/2/qux +baz/3/qux +``` + +## Brace matching pitfalls + +Although brace patterns offer a user-friendly way of matching ranges or sets of strings, there are also some major disadvantages and potential risks you should be aware of. + +### tldr + +**"brace bombs"** + +- brace expansion can eat up a huge amount of processing resources +- as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially +- users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!) + +For a more detailed explanation with examples, see the [geometric complexity](#geometric-complexity) section. + +### The solution + +Jump to the [performance section](#performance) to see how Braces solves this problem in comparison to other libraries. + +### Geometric complexity + +At minimum, brace patterns with sets limited to two elements have quadradic or `O(n^2)` complexity. But the complexity of the algorithm increases exponentially as the number of sets, _and elements per set_, increases, which is `O(n^c)`. + +For example, the following sets demonstrate quadratic (`O(n^2)`) complexity: + +``` +{1,2}{3,4} => (2X2) => 13 14 23 24 +{1,2}{3,4}{5,6} => (2X2X2) => 135 136 145 146 235 236 245 246 +``` + +But add an element to a set, and we get a n-fold Cartesian product with `O(n^c)` complexity: + +``` +{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248 + 249 257 258 259 267 268 269 347 348 349 357 + 358 359 367 368 369 +``` + +Now, imagine how this complexity grows given that each element is a n-tuple: + +``` +{1..100}{1..100} => (100X100) => 10,000 elements (38.4 kB) +{1..100}{1..100}{1..100} => (100X100X100) => 1,000,000 elements (5.76 MB) +``` + +Although these examples are clearly contrived, they demonstrate how brace patterns can quickly grow out of control. + +**More information** + +Interested in learning more about brace expansion? + +- [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion) +- [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion) +- [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) + +
+ +## Performance + +Braces is not only screaming fast, it's also more accurate the other brace expansion libraries. + +### Better algorithms + +Fortunately there is a solution to the ["brace bomb" problem](#brace-matching-pitfalls): _don't expand brace patterns into an array when they're used for matching_. + +Instead, convert the pattern into an optimized regular expression. This is easier said than done, and braces is the only library that does this currently. + +**The proof is in the numbers** + +Minimatch gets exponentially slower as patterns increase in complexity, braces does not. The following results were generated using `braces()` and `minimatch.braceExpand()`, respectively. + +| **Pattern** | **braces** | **[minimatch][]** | +| --------------------------- | ------------------- | ---------------------------- | +| `{1..9007199254740991}`[^1] | `298 B` (5ms 459μs) | N/A (freezes) | +| `{1..1000000000000000}` | `41 B` (1ms 15μs) | N/A (freezes) | +| `{1..100000000000000}` | `40 B` (890μs) | N/A (freezes) | +| `{1..10000000000000}` | `39 B` (2ms 49μs) | N/A (freezes) | +| `{1..1000000000000}` | `38 B` (608μs) | N/A (freezes) | +| `{1..100000000000}` | `37 B` (397μs) | N/A (freezes) | +| `{1..10000000000}` | `35 B` (983μs) | N/A (freezes) | +| `{1..1000000000}` | `34 B` (798μs) | N/A (freezes) | +| `{1..100000000}` | `33 B` (733μs) | N/A (freezes) | +| `{1..10000000}` | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) | +| `{1..1000000}` | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs) | +| `{1..100000}` | `30 B` (950μs) | `588.89 kB` (146ms 921μs) | +| `{1..10000}` | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs) | +| `{1..1000}` | `28 B` (760μs) | `3.89 kB` (1ms 453μs) | +| `{1..100}` | `22 B` (345μs) | `291 B` (196μs) | +| `{1..10}` | `10 B` (533μs) | `20 B` (37μs) | +| `{1..3}` | `7 B` (190μs) | `5 B` (27μs) | + +### Faster algorithms + +When you need expansion, braces is still much faster. + +_(the following results were generated using `braces.expand()` and `minimatch.braceExpand()`, respectively)_ + +| **Pattern** | **braces** | **[minimatch][]** | +| --------------- | --------------------------- | ---------------------------- | +| `{1..10000000}` | `78.89 MB` (2s 698ms 642μs) | `78.89 MB` (18s 601ms 974μs) | +| `{1..1000000}` | `6.89 MB` (458ms 576μs) | `6.89 MB` (1s 491ms 621μs) | +| `{1..100000}` | `588.89 kB` (20ms 728μs) | `588.89 kB` (156ms 919μs) | +| `{1..10000}` | `48.89 kB` (2ms 202μs) | `48.89 kB` (13ms 641μs) | +| `{1..1000}` | `3.89 kB` (1ms 796μs) | `3.89 kB` (1ms 958μs) | +| `{1..100}` | `291 B` (424μs) | `291 B` (211μs) | +| `{1..10}` | `20 B` (487μs) | `20 B` (72μs) | +| `{1..3}` | `5 B` (166μs) | `5 B` (27μs) | + +If you'd like to run these comparisons yourself, see [test/support/generate.js](test/support/generate.js). + +## Benchmarks + +### Running benchmarks + +Install dev dependencies: + +```bash +npm i -d && npm benchmark +``` + +### Latest results + +Braces is more accurate, without sacrificing performance. + +```bash +● expand - range (expanded) + braces x 53,167 ops/sec ±0.12% (102 runs sampled) + minimatch x 11,378 ops/sec ±0.10% (102 runs sampled) +● expand - range (optimized for regex) + braces x 373,442 ops/sec ±0.04% (100 runs sampled) + minimatch x 3,262 ops/sec ±0.18% (100 runs sampled) +● expand - nested ranges (expanded) + braces x 33,921 ops/sec ±0.09% (99 runs sampled) + minimatch x 10,855 ops/sec ±0.28% (100 runs sampled) +● expand - nested ranges (optimized for regex) + braces x 287,479 ops/sec ±0.52% (98 runs sampled) + minimatch x 3,219 ops/sec ±0.28% (101 runs sampled) +● expand - set (expanded) + braces x 238,243 ops/sec ±0.19% (97 runs sampled) + minimatch x 538,268 ops/sec ±0.31% (96 runs sampled) +● expand - set (optimized for regex) + braces x 321,844 ops/sec ±0.10% (97 runs sampled) + minimatch x 140,600 ops/sec ±0.15% (100 runs sampled) +● expand - nested sets (expanded) + braces x 165,371 ops/sec ±0.42% (96 runs sampled) + minimatch x 337,720 ops/sec ±0.28% (100 runs sampled) +● expand - nested sets (optimized for regex) + braces x 242,948 ops/sec ±0.12% (99 runs sampled) + minimatch x 87,403 ops/sec ±0.79% (96 runs sampled) +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Contributors + +| **Commits** | **Contributor** | +| ----------- | ------------------------------------------------------------- | +| 197 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [es128](https://github.com/es128) | +| 1 | [eush77](https://github.com/eush77) | +| 1 | [hemanth](https://github.com/hemanth) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Author + +**Jon Schlinkert** + +- [GitHub Profile](https://github.com/jonschlinkert) +- [Twitter Profile](https://twitter.com/jonschlinkert) +- [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +--- + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._ diff --git a/vendor/braces-backport/source/index.js b/vendor/braces-backport/source/index.js new file mode 100644 index 00000000..d222c13b --- /dev/null +++ b/vendor/braces-backport/source/index.js @@ -0,0 +1,170 @@ +'use strict'; + +const stringify = require('./lib/stringify'); +const compile = require('./lib/compile'); +const expand = require('./lib/expand'); +const parse = require('./lib/parse'); + +/** + * Expand the given pattern or create a regex-compatible string. + * + * ```js + * const braces = require('braces'); + * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] + * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {String} + * @api public + */ + +const braces = (input, options = {}) => { + let output = []; + + if (Array.isArray(input)) { + for (const pattern of input) { + const result = braces.create(pattern, options); + if (Array.isArray(result)) { + output.push(...result); + } else { + output.push(result); + } + } + } else { + output = [].concat(braces.create(input, options)); + } + + if (options && options.expand === true && options.nodupes === true) { + output = [...new Set(output)]; + } + return output; +}; + +/** + * Parse the given `str` with the given `options`. + * + * ```js + * // braces.parse(pattern, [, options]); + * const ast = braces.parse('a/{b,c}/d'); + * console.log(ast); + * ``` + * @param {String} pattern Brace pattern to parse + * @param {Object} options + * @return {Object} Returns an AST + * @api public + */ + +braces.parse = (input, options = {}) => parse(input, options); + +/** + * Creates a braces string from an AST, or an AST node. + * + * ```js + * const braces = require('braces'); + * let ast = braces.parse('foo/{a,b}/bar'); + * console.log(stringify(ast.nodes[2])); //=> '{a,b}' + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.stringify = (input, options = {}) => { + if (typeof input === 'string') { + return stringify(braces.parse(input, options), options); + } + return stringify(input, options); +}; + +/** + * Compiles a brace pattern into a regex-compatible, optimized string. + * This method is called by the main [braces](#braces) function by default. + * + * ```js + * const braces = require('braces'); + * console.log(braces.compile('a/{b,c}/d')); + * //=> ['a/(b|c)/d'] + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.compile = (input, options = {}) => { + if (typeof input === 'string') { + input = braces.parse(input, options); + } + return compile(input, options); +}; + +/** + * Expands a brace pattern into an array. This method is called by the + * main [braces](#braces) function when `options.expand` is true. Before + * using this method it's recommended that you read the [performance notes](#performance)) + * and advantages of using [.compile](#compile) instead. + * + * ```js + * const braces = require('braces'); + * console.log(braces.expand('a/{b,c}/d')); + * //=> ['a/b/d', 'a/c/d']; + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.expand = (input, options = {}) => { + if (typeof input === 'string') { + input = braces.parse(input, options); + } + + let result = expand(input, options); + + // filter out empty strings if specified + if (options.noempty === true) { + result = result.filter(Boolean); + } + + // filter out duplicates if specified + if (options.nodupes === true) { + result = [...new Set(result)]; + } + + return result; +}; + +/** + * Processes a brace pattern and returns either an expanded array + * (if `options.expand` is true), a highly optimized regex-compatible string. + * This method is called by the main [braces](#braces) function. + * + * ```js + * const braces = require('braces'); + * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) + * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.create = (input, options = {}) => { + if (input === '' || input.length < 3) { + return [input]; + } + + return options.expand !== true + ? braces.compile(input, options) + : braces.expand(input, options); +}; + +/** + * Expose "braces" + */ + +module.exports = braces; diff --git a/vendor/braces-backport/source/lib/compile.js b/vendor/braces-backport/source/lib/compile.js new file mode 100644 index 00000000..edce5464 --- /dev/null +++ b/vendor/braces-backport/source/lib/compile.js @@ -0,0 +1,63 @@ +'use strict'; + +const depthGuard = require('./depth'); + +const fill = require('fill-range'); +const utils = require('./utils'); + +const compile = (ast, options = {}) => { + depthGuard.assert(ast, options); + const walk = (node, parent = {}) => { + const invalidBlock = utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; + const invalid = invalidBlock === true || invalidNode === true; + const prefix = options.escapeInvalid === true ? '\\' : ''; + let output = ''; + + if (node.isOpen === true) { + return prefix + node.value; + } + + if (node.isClose === true) { + console.log('node.isClose', prefix, node.value); + return prefix + node.value; + } + + if (node.type === 'open') { + return invalid ? prefix + node.value : '('; + } + + if (node.type === 'close') { + return invalid ? prefix + node.value : ')'; + } + + if (node.type === 'comma') { + return node.prev.type === 'comma' ? '' : invalid ? node.value : '|'; + } + + if (node.value) { + return node.value; + } + + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true }); + + if (range.length !== 0) { + return args.length > 1 && range.length > 1 ? `(${range})` : range; + } + } + + if (node.nodes) { + for (const child of node.nodes) { + output += walk(child, node); + } + } + + return output; + }; + + return walk(ast); +}; + +module.exports = compile; diff --git a/vendor/braces-backport/source/lib/constants.js b/vendor/braces-backport/source/lib/constants.js new file mode 100644 index 00000000..2bb3b884 --- /dev/null +++ b/vendor/braces-backport/source/lib/constants.js @@ -0,0 +1,57 @@ +'use strict'; + +module.exports = { + MAX_LENGTH: 10000, + + // Digits + CHAR_0: '0', /* 0 */ + CHAR_9: '9', /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 'A', /* A */ + CHAR_LOWERCASE_A: 'a', /* a */ + CHAR_UPPERCASE_Z: 'Z', /* Z */ + CHAR_LOWERCASE_Z: 'z', /* z */ + + CHAR_LEFT_PARENTHESES: '(', /* ( */ + CHAR_RIGHT_PARENTHESES: ')', /* ) */ + + CHAR_ASTERISK: '*', /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: '&', /* & */ + CHAR_AT: '@', /* @ */ + CHAR_BACKSLASH: '\\', /* \ */ + CHAR_BACKTICK: '`', /* ` */ + CHAR_CARRIAGE_RETURN: '\r', /* \r */ + CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ + CHAR_COLON: ':', /* : */ + CHAR_COMMA: ',', /* , */ + CHAR_DOLLAR: '$', /* . */ + CHAR_DOT: '.', /* . */ + CHAR_DOUBLE_QUOTE: '"', /* " */ + CHAR_EQUAL: '=', /* = */ + CHAR_EXCLAMATION_MARK: '!', /* ! */ + CHAR_FORM_FEED: '\f', /* \f */ + CHAR_FORWARD_SLASH: '/', /* / */ + CHAR_HASH: '#', /* # */ + CHAR_HYPHEN_MINUS: '-', /* - */ + CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ + CHAR_LEFT_CURLY_BRACE: '{', /* { */ + CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ + CHAR_LINE_FEED: '\n', /* \n */ + CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ + CHAR_PERCENT: '%', /* % */ + CHAR_PLUS: '+', /* + */ + CHAR_QUESTION_MARK: '?', /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ + CHAR_RIGHT_CURLY_BRACE: '}', /* } */ + CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ + CHAR_SEMICOLON: ';', /* ; */ + CHAR_SINGLE_QUOTE: '\'', /* ' */ + CHAR_SPACE: ' ', /* */ + CHAR_TAB: '\t', /* \t */ + CHAR_UNDERSCORE: '_', /* _ */ + CHAR_VERTICAL_LINE: '|', /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ +}; diff --git a/vendor/braces-backport/source/lib/depth.js b/vendor/braces-backport/source/lib/depth.js new file mode 100644 index 00000000..7e5ff7d5 --- /dev/null +++ b/vendor/braces-backport/source/lib/depth.js @@ -0,0 +1,69 @@ +'use strict'; + +// Local security backport for GHSA-vfj7-8cjw-p6xm; see BACKPORT.md. +const MAX_DEPTH = 100; +const MAX_NODES = 20010; + +const failure = (code, message) => { + const error = new RangeError(message); + error.code = code; + return error; +}; + +const limit = options => { + const depth = options && options.maxDepth !== undefined ? options.maxDepth : MAX_DEPTH; + if (!Number.isInteger(depth) || depth < 1 || depth > MAX_DEPTH) { + throw failure('ERR_BRACES_DEPTH_OPTION', `maxDepth must be an integer from 1 to ${MAX_DEPTH}`); + } + return depth; +}; + +const check = (depth, max) => { + if (depth > max) { + throw failure('ERR_BRACES_DEPTH', `Brace AST nesting exceeds maximum depth (${max})`); + } +}; + +// Iterative preflight: never recurse over an unvalidated, caller-supplied AST. +const assert = (ast, options) => { + const max = limit(options); + const active = new Set(); + const frames = [{ node: ast, parent: null, depth: ast.type === 'root' ? 0 : 1, index: -1 }]; + let count = 0; + while (frames.length) { + const frame = frames[frames.length - 1]; + const node = frame.node; + if (frame.index === -1) { + if (++count > MAX_NODES) { + throw failure('ERR_BRACES_NODES', `Brace AST exceeds maximum nodes (${MAX_NODES})`); + } + if (active.has(node)) throw failure('ERR_BRACES_AST', 'Cyclic brace AST'); + const parents = new Set(); + let parent = node; + while (parent) { + if (parents.has(parent)) throw failure('ERR_BRACES_AST', 'Cyclic brace AST parent'); + parents.add(parent); + // Upstream may retain old parent links when flattening invalid braces. + // Validate their bound, rather than requiring structural equality. + check(parents.size - 2, max); + parent = parent.parent; + } + if (node.nodes) { + check(frame.depth, max); + if (!Array.isArray(node.nodes)) throw failure('ERR_BRACES_AST', 'Expected AST nodes array'); + } + active.add(node); + frame.index = 0; + } + if (node.nodes && frame.index < node.nodes.length) { + const child = node.nodes[frame.index++]; + frames.push({ node: child, parent: node, depth: frame.depth + 1, index: -1 }); + } else { + active.delete(node); + frames.pop(); + } + } + +}; + +module.exports = { MAX_DEPTH, MAX_NODES, limit, check, assert }; diff --git a/vendor/braces-backport/source/lib/expand.js b/vendor/braces-backport/source/lib/expand.js new file mode 100644 index 00000000..1da7e844 --- /dev/null +++ b/vendor/braces-backport/source/lib/expand.js @@ -0,0 +1,116 @@ +'use strict'; + +const depthGuard = require('./depth'); + +const fill = require('fill-range'); +const stringify = require('./stringify'); +const utils = require('./utils'); + +const append = (queue = '', stash = '', enclose = false) => { + const result = []; + + queue = [].concat(queue); + stash = [].concat(stash); + + if (!stash.length) return queue; + if (!queue.length) { + return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; + } + + for (const item of queue) { + if (Array.isArray(item)) { + for (const value of item) { + result.push(append(value, stash, enclose)); + } + } else { + for (let ele of stash) { + if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; + result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele); + } + } + } + return utils.flatten(result); +}; + +const expand = (ast, options = {}) => { + depthGuard.assert(ast, options); + const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit; + + const walk = (node, parent = {}) => { + node.queue = []; + + let p = parent; + let q = parent.queue; + + while (p.type !== 'brace' && p.type !== 'root' && p.parent) { + p = p.parent; + q = p.queue; + } + + if (node.invalid || node.dollar) { + q.push(append(q.pop(), stringify(node, options))); + return; + } + + if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { + q.push(append(q.pop(), ['{}'])); + return; + } + + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + + if (utils.exceedsLimit(...args, options.step, rangeLimit)) { + throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); + } + + let range = fill(...args, options); + if (range.length === 0) { + range = stringify(node, options); + } + + q.push(append(q.pop(), range)); + node.nodes = []; + return; + } + + const enclose = utils.encloseBrace(node); + let queue = node.queue; + let block = node; + + while (block.type !== 'brace' && block.type !== 'root' && block.parent) { + block = block.parent; + queue = block.queue; + } + + for (let i = 0; i < node.nodes.length; i++) { + const child = node.nodes[i]; + + if (child.type === 'comma' && node.type === 'brace') { + if (i === 1) queue.push(''); + queue.push(''); + continue; + } + + if (child.type === 'close') { + q.push(append(q.pop(), queue, enclose)); + continue; + } + + if (child.value && child.type !== 'open') { + queue.push(append(queue.pop(), child.value)); + continue; + } + + if (child.nodes) { + walk(child, node); + } + } + + return queue; + }; + + return utils.flatten(walk(ast)); +}; + +module.exports = expand; diff --git a/vendor/braces-backport/source/lib/parse.js b/vendor/braces-backport/source/lib/parse.js new file mode 100644 index 00000000..7921a8df --- /dev/null +++ b/vendor/braces-backport/source/lib/parse.js @@ -0,0 +1,336 @@ +'use strict'; + +const stringify = require('./stringify'); +const depthGuard = require('./depth'); + +/** + * Constants + */ + +const { + MAX_LENGTH, + CHAR_BACKSLASH, /* \ */ + CHAR_BACKTICK, /* ` */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_RIGHT_SQUARE_BRACKET, /* ] */ + CHAR_DOUBLE_QUOTE, /* " */ + CHAR_SINGLE_QUOTE, /* ' */ + CHAR_NO_BREAK_SPACE, + CHAR_ZERO_WIDTH_NOBREAK_SPACE +} = require('./constants'); + +/** + * parse + */ + +const parse = (input, options = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + const opts = options || {}; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + } + + const maxDepth = depthGuard.limit(opts); + + const ast = { type: 'root', input, nodes: [] }; + const stack = [ast]; + let block = ast; + let prev = ast; + let brackets = 0; + const length = input.length; + let index = 0; + let depth = 0; + let value; + + /** + * Helpers + */ + + const advance = () => input[index++]; + const push = node => { + if (node.type === 'text' && prev.type === 'dot') { + prev.type = 'text'; + } + + if (prev && prev.type === 'text' && node.type === 'text') { + prev.value += node.value; + return; + } + + block.nodes.push(node); + node.parent = block; + node.prev = prev; + prev = node; + return node; + }; + + push({ type: 'bos' }); + + while (index < length) { + block = stack[stack.length - 1]; + value = advance(); + + /** + * Invalid chars + */ + + if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { + continue; + } + + /** + * Escaped chars + */ + + if (value === CHAR_BACKSLASH) { + push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); + continue; + } + + /** + * Right square bracket (literal): ']' + */ + + if (value === CHAR_RIGHT_SQUARE_BRACKET) { + push({ type: 'text', value: '\\' + value }); + continue; + } + + /** + * Left square bracket: '[' + */ + + if (value === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + + let next; + + while (index < length && (next = advance())) { + value += next; + + if (next === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + continue; + } + + if (next === CHAR_BACKSLASH) { + value += advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + brackets--; + + if (brackets === 0) { + break; + } + } + } + + push({ type: 'text', value }); + continue; + } + + /** + * Parentheses + */ + + if (value === CHAR_LEFT_PARENTHESES) { + depthGuard.check(stack.length, maxDepth); + block = push({ type: 'paren', nodes: [] }); + stack.push(block); + push({ type: 'text', value }); + continue; + } + + if (value === CHAR_RIGHT_PARENTHESES) { + if (block.type !== 'paren') { + push({ type: 'text', value }); + continue; + } + block = stack.pop(); + push({ type: 'text', value }); + block = stack[stack.length - 1]; + continue; + } + + /** + * Quotes: '|"|` + */ + + if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { + const open = value; + let next; + + if (options.keepQuotes !== true) { + value = ''; + } + + while (index < length && (next = advance())) { + if (next === CHAR_BACKSLASH) { + value += next + advance(); + continue; + } + + if (next === open) { + if (options.keepQuotes === true) value += next; + break; + } + + value += next; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Left curly brace: '{' + */ + + if (value === CHAR_LEFT_CURLY_BRACE) { + depthGuard.check(stack.length, maxDepth); + depth++; + + const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; + const brace = { + type: 'brace', + open: true, + close: false, + dollar, + depth, + commas: 0, + ranges: 0, + nodes: [] + }; + + block = push(brace); + stack.push(block); + push({ type: 'open', value }); + continue; + } + + /** + * Right curly brace: '}' + */ + + if (value === CHAR_RIGHT_CURLY_BRACE) { + if (block.type !== 'brace') { + push({ type: 'text', value }); + continue; + } + + const type = 'close'; + block = stack.pop(); + block.close = true; + + push({ type, value }); + depth--; + + block = stack[stack.length - 1]; + continue; + } + + /** + * Comma: ',' + */ + + if (value === CHAR_COMMA && depth > 0) { + if (block.ranges > 0) { + block.ranges = 0; + const open = block.nodes.shift(); + block.nodes = [open, { type: 'text', value: stringify(block) }]; + } + + push({ type: 'comma', value }); + block.commas++; + continue; + } + + /** + * Dot: '.' + */ + + if (value === CHAR_DOT && depth > 0 && block.commas === 0) { + const siblings = block.nodes; + + if (depth === 0 || siblings.length === 0) { + push({ type: 'text', value }); + continue; + } + + if (prev.type === 'dot') { + block.range = []; + prev.value += value; + prev.type = 'range'; + + if (block.nodes.length !== 3 && block.nodes.length !== 5) { + block.invalid = true; + block.ranges = 0; + prev.type = 'text'; + continue; + } + + block.ranges++; + block.args = []; + continue; + } + + if (prev.type === 'range') { + siblings.pop(); + + const before = siblings[siblings.length - 1]; + before.value += prev.value + value; + prev = before; + block.ranges--; + continue; + } + + push({ type: 'dot', value }); + continue; + } + + /** + * Text + */ + + push({ type: 'text', value }); + } + + // Mark imbalanced braces and brackets as invalid + do { + block = stack.pop(); + + if (block.type !== 'root') { + block.nodes.forEach(node => { + if (!node.nodes) { + if (node.type === 'open') node.isOpen = true; + if (node.type === 'close') node.isClose = true; + if (!node.nodes) node.type = 'text'; + node.invalid = true; + } + }); + + // get the location of the block on parent.nodes (block's siblings) + const parent = stack[stack.length - 1]; + const index = parent.nodes.indexOf(block); + // replace the (invalid) block with it's nodes + parent.nodes.splice(index, 1, ...block.nodes); + } + } while (stack.length > 0); + + push({ type: 'eos' }); + return ast; +}; + +module.exports = parse; diff --git a/vendor/braces-backport/source/lib/stringify.js b/vendor/braces-backport/source/lib/stringify.js new file mode 100644 index 00000000..b4393049 --- /dev/null +++ b/vendor/braces-backport/source/lib/stringify.js @@ -0,0 +1,35 @@ +'use strict'; + +const depthGuard = require('./depth'); + +const utils = require('./utils'); + +module.exports = (ast, options = {}) => { + depthGuard.assert(ast, options); + const stringify = (node, parent = {}) => { + const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; + let output = ''; + + if (node.value) { + if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { + return '\\' + node.value; + } + return node.value; + } + + if (node.value) { + return node.value; + } + + if (node.nodes) { + for (const child of node.nodes) { + output += stringify(child); + } + } + return output; + }; + + return stringify(ast); +}; + diff --git a/vendor/braces-backport/source/lib/utils.js b/vendor/braces-backport/source/lib/utils.js new file mode 100644 index 00000000..d19311fe --- /dev/null +++ b/vendor/braces-backport/source/lib/utils.js @@ -0,0 +1,122 @@ +'use strict'; + +exports.isInteger = num => { + if (typeof num === 'number') { + return Number.isInteger(num); + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isInteger(Number(num)); + } + return false; +}; + +/** + * Find a node of the given type + */ + +exports.find = (node, type) => node.nodes.find(node => node.type === type); + +/** + * Find a node of the given type + */ + +exports.exceedsLimit = (min, max, step = 1, limit) => { + if (limit === false) return false; + if (!exports.isInteger(min) || !exports.isInteger(max)) return false; + return ((Number(max) - Number(min)) / Number(step)) >= limit; +}; + +/** + * Escape the given node with '\\' before node.value + */ + +exports.escapeNode = (block, n = 0, type) => { + const node = block.nodes[n]; + if (!node) return; + + if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { + if (node.escaped !== true) { + node.value = '\\' + node.value; + node.escaped = true; + } + } +}; + +/** + * Returns true if the given brace node should be enclosed in literal braces + */ + +exports.encloseBrace = node => { + if (node.type !== 'brace') return false; + if ((node.commas >> 0 + node.ranges >> 0) === 0) { + node.invalid = true; + return true; + } + return false; +}; + +/** + * Returns true if a brace node is invalid. + */ + +exports.isInvalidBrace = block => { + if (block.type !== 'brace') return false; + if (block.invalid === true || block.dollar) return true; + if ((block.commas >> 0 + block.ranges >> 0) === 0) { + block.invalid = true; + return true; + } + if (block.open !== true || block.close !== true) { + block.invalid = true; + return true; + } + return false; +}; + +/** + * Returns true if a node is an open or close node + */ + +exports.isOpenOrClose = node => { + if (node.type === 'open' || node.type === 'close') { + return true; + } + return node.open === true || node.close === true; +}; + +/** + * Reduce an array of text nodes. + */ + +exports.reduce = nodes => nodes.reduce((acc, node) => { + if (node.type === 'text') acc.push(node.value); + if (node.type === 'range') node.type = 'text'; + return acc; +}, []); + +/** + * Flatten an array + */ + +exports.flatten = (...args) => { + const result = []; + + const flat = arr => { + for (let i = 0; i < arr.length; i++) { + const ele = arr[i]; + + if (Array.isArray(ele)) { + flat(ele); + continue; + } + + if (ele !== undefined) { + result.push(ele); + } + } + return result; + }; + + flat(args); + return result; +}; diff --git a/vendor/braces-backport/source/package.json b/vendor/braces-backport/source/package.json new file mode 100644 index 00000000..3516d12e --- /dev/null +++ b/vendor/braces-backport/source/package.json @@ -0,0 +1,79 @@ +{ + "name": "braces", + "description": "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.", + "version": "3.0.3", + "homepage": "https://github.com/micromatch/braces", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Elan Shanker (https://github.com/es128)", + "Eugene Sharygin (https://github.com/eush77)", + "hemanth.hm (http://h3manth.com)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "micromatch/braces", + "bugs": { + "url": "https://github.com/micromatch/braces/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "lib" + ], + "main": "index.js", + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "mocha", + "benchmark": "node benchmark" + }, + "dependencies": { + "fill-range": "^7.1.1" + }, + "devDependencies": { + "ansi-colors": "^3.2.4", + "bash-path": "^2.0.1", + "gulp-format-md": "^2.0.0", + "mocha": "^6.1.1" + }, + "keywords": [ + "alpha", + "alphabetical", + "bash", + "brace", + "braces", + "expand", + "expansion", + "filepath", + "fill", + "fs", + "glob", + "globbing", + "letter", + "match", + "matches", + "matching", + "number", + "numerical", + "path", + "range", + "ranges", + "sh" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "lint": { + "reflinks": true + }, + "plugins": [ + "gulp-format-md" + ] + }, + "private": true, + "jvSecurityPatch": "depth-guard.1" +} diff --git a/vendor/braces-backport/upstream-tests/package.json b/vendor/braces-backport/upstream-tests/package.json new file mode 100644 index 00000000..e048b9ae --- /dev/null +++ b/vendor/braces-backport/upstream-tests/package.json @@ -0,0 +1 @@ +{"private":true,"type":"commonjs"} diff --git a/vendor/braces-backport/upstream-tests/test/bash-compiled-ranges.js b/vendor/braces-backport/upstream-tests/test/bash-compiled-ranges.js new file mode 100644 index 00000000..8181a35e --- /dev/null +++ b/vendor/braces-backport/upstream-tests/test/bash-compiled-ranges.js @@ -0,0 +1,203 @@ +'use strict'; + +require('mocha'); +const assert = require('assert').strict; +const bashPath = require('bash-path'); +const cp = require('child_process'); +const braces = require('..'); + +const bash = input => { + return cp.spawnSync(bashPath(), ['-c', `echo ${input}`]) + .stdout.toString() + .split(/\s+/) + .filter(Boolean); +}; + +const equal = (input, expected = bash(input), options) => { + assert.deepEqual(braces.compile(input, options), expected); +}; + +/** + * Bash 4.3 unit tests with `braces.compile()` + */ + +describe('bash ranges - braces.compile()', () => { + const fixtures = [ + ['a{b,c{1..100}/{foo,bar}/,h}x/z', {}, 'a(b|c([1-9]|[1-9][0-9]|100)/(foo|bar)/|h)x/z'], + ['0{1..9} {10..20}', {}, '0([1-9]) (1[0-9]|20)'], + + // should not try to expand ranges with decimals + ['{1.1..2.1}', {}, '{1.1..2.1}'], + ['{1.1..~2.1}', {}, '{1.1..~2.1}'], + + // should escape invalid ranges + ['{1..0f}', {}, '{1..0f}'], + ['{1..10..ff}', {}, '{1..10..ff}'], + ['{1..10.f}', {}, '{1..10.f}'], + ['{1..10f}', {}, '{1..10f}'], + ['{1..20..2f}', {}, '{1..20..2f}'], + ['{1..20..f2}', {}, '{1..20..f2}'], + ['{1..2f..2}', {}, '{1..2f..2}'], + ['{1..ff..2}', {}, '{1..ff..2}'], + ['{1..ff}', {}, '{1..ff}'], + ['{1.20..2}', {}, '{1.20..2}'], + + // should handle weirdly-formed brace expansions (fixed in post-bash-3.1) + ['a-{b{d,e}}-c', {}, 'a-{b(d|e)}-c'], + ['a-{bdef-{g,i}-c', {}, 'a-{bdef-(g|i)-c'], + + // should not expand quoted strings + ['{"klklkl"}{1,2,3}', {}, '{klklkl}(1|2|3)'], + ['{"x,x"}', {}, '{x,x}'], + + // should escaped outer braces in nested non-sets + ['{a-{b,c,d}}', {}, '{a-(b|c|d)}'], + ['{a,{a-{b,c,d}}}', {}, '(a|{a-(b|c|d)})'], + + // should escape imbalanced braces + ['abc{', {}, 'abc{'], + ['{abc{', {}, '{abc{'], + ['{abc', {}, '{abc'], + ['}abc', {}, '}abc'], + ['ab{c', {}, 'ab{c'], + ['{{a,b}', {}, '{(a|b)'], + ['{a,b}}', {}, '(a|b)}'], + ['abcd{efgh', {}, 'abcd{efgh'], + ['a{b{c{d,e}f}gh', {}, 'a{b{c(d|e)f}gh'], + ['a{b{c{d,e}f}g}h', {}, 'a{b{c(d|e)f}g}h'], + ['f{x,y{{g,z}}h}', {}, 'f(x|y{(g|z)}h)'], + ['z{a,b},c}d', {}, 'z(a|b),c}d'], + ['a{b{c{d,e}f{x,y{{g}h', {}, 'a{b{c(d|e)f{x,y{{g}h'], + ['f{x,y{{g}h', {}, 'f{x,y{{g}h'], + ['f{x,y{{g}}h', {}, 'f{x,y{{g}}h'], + ['a{b{c{d,e}f{x,y{}g}h', {}, 'a{b{c(d|e)f(x|y{}g)h'], + ['f{x,y{}g}h', {}, 'f(x|y{}g)h'], + ['z{a,b{,c}d', {}, 'z{a,b(|c)d'], + + // should expand numeric ranges + ['a{0..3}d', {}, 'a([0-3])d'], + ['x{10..1}y', {}, 'x([1-9]|10)y'], + ['x{3..3}y', {}, 'x3y'], + ['{1..10}', {}, '([1-9]|10)'], + ['{1..3}', {}, '([1-3])'], + ['{1..9}', {}, '([1-9])'], + ['{10..1}', {}, '([1-9]|10)'], + ['{10..1}y', {}, '([1-9]|10)y'], + ['{3..3}', {}, '3'], + ['{5..8}', {}, '([5-8])'], + + // should expand ranges with negative numbers + ['{-10..-1}', {}, '(-[1-9]|-10)'], + ['{-20..0}', {}, '(-[1-9]|-1[0-9]|-20|0)'], + ['{0..-5}', {}, '(-[1-5]|0)'], + ['{9..-4}', {}, '(-[1-4]|[0-9])'], + + // should expand alphabetical ranges + ['0{1..9}/{10..20}', {}, '0([1-9])/(1[0-9]|20)'], + ['0{a..d}0', {}, '0([a-d])0'], + ['a/{b..d}/e', {}, 'a/([b-d])/e'], + ['{1..f}', {}, '([1-f])'], + ['{a..A}', {}, '([A-a])'], + ['{A..a}', {}, '([A-a])'], + ['{a..e}', {}, '([a-e])'], + ['{A..E}', {}, '([A-E])'], + ['{a..f}', {}, '([a-f])'], + ['{a..z}', {}, '([a-z])'], + ['{E..A}', {}, '([A-E])'], + ['{f..1}', {}, '([1-f])'], + ['{f..a}', {}, '([a-f])'], + ['{f..f}', {}, 'f'], + + // should expand multiple ranges + ['a/{b..d}/e/{f..h}', {}, 'a/([b-d])/e/([f-h])'], + + // should expand numerical ranges - positive and negative + ['{-10..10}', {}, '(-[1-9]|-?10|[0-9])'], + + // HEADS UP! If you're using the `--mm` flag minimatch freezes on these + // should expand large numbers + ['{2147483645..2147483649}', {}, '(214748364[5-9])'], + ['{214748364..2147483649}', {}, '(21474836[4-9]|2147483[7-9][0-9]|214748[4-9][0-9]{2}|214749[0-9]{3}|2147[5-9][0-9]{4}|214[89][0-9]{5}|21[5-9][0-9]{6}|2[2-9][0-9]{7}|[3-9][0-9]{8}|1[0-9]{9}|20[0-9]{8}|21[0-3][0-9]{7}|214[0-6][0-9]{6}|2147[0-3][0-9]{5}|21474[0-7][0-9]{4}|214748[0-2][0-9]{3}|2147483[0-5][0-9]{2}|21474836[0-4][0-9])'], + + // should expand ranges using steps + ['{1..10..1}', { bash: false }, '([1-9]|10)'], + ['{1..10..2}', { bash: false }, '(1|3|5|7|9)'], + ['{1..20..20}', { bash: false }, '1'], + ['{1..20..2}', { bash: false }, '(1|3|5|7|9|11|13|15|17|19)'], + ['{10..1..2}', { bash: false }, '(2|4|6|8|10)'], + ['{100..0..5}', { bash: false }, '(0|5|10|15|20|25|30|35|40|45|50|55|60|65|70|75|80|85|90|95|100)'], + ['{2..10..1}', { bash: false }, '([2-9]|10)'], + ['{2..10..2}', { bash: false }, '(2|4|6|8|10)'], + ['{2..10..3}', { bash: false }, '(2|5|8)'], + + // should expand negative ranges using steps + ['{-1..-10..-2}', { bash: false }, '(-(?:1|3|5|7|9))'], + ['{-1..-10..2}', { bash: false }, '(-(?:1|3|5|7|9))'], + ['{-10..-2..2}', { bash: false }, '(-(?:2|4|6|8|10))'], + ['{-2..-10..1}', { bash: false }, '(-[2-9]|-10)'], + ['{-2..-10..2}', { bash: false }, '(-(?:2|4|6|8|10))'], + ['{-2..-10..3}', { bash: false }, '(-(?:2|5|8))'], + ['{-9..9..3}', { bash: false }, '(0|3|6|9|-(?:3|6|9))'], + ['{10..1..-2}', { bash: false }, '(2|4|6|8|10)'], + ['{100..0..-5}', { bash: false }, '(0|5|10|15|20|25|30|35|40|45|50|55|60|65|70|75|80|85|90|95|100)'], + + // should expand alpha ranges with steps + ['{a..e..2}', { bash: false }, '(a|c|e)'], + ['{E..A..2}', { bash: false }, '(E|C|A)'], + ['{a..z..2}', { bash: false }, '(a|c|e|g|i|k|m|o|q|s|u|w|y)'], + + // should expand alpha ranges with negative steps + ['{z..a..-2}', { bash: false }, '(z|x|v|t|r|p|n|l|j|h|f|d|b)'], + + // unwanted zero-padding (fixed post-bash-4.0) + ['{10..0..2}', { bash: false }, '(0|2|4|6|8|10)'], + ['{10..0..-2}', { bash: false }, '(0|2|4|6|8|10)'], + ['{-50..-0..5}', { bash: false }, '(0|-(?:5|10|15|20|25|30|35|40|45|50))'], + + // should work with dots in file paths + ['../{1..3}/../foo', {}, '../([1-3])/../foo'], + ['../{2..10..2}/../foo', {}, '../(2|4|6|8|10)/../foo'], + ['../{1..3}/../{a,b,c}/foo', {}, '../([1-3])/../(a|b|c)/foo'], + ['./{a..z..3}/', {}, './(a|d|g|j|m|p|s|v|y)/'], + ['./{"x,y"}/{a..z..3}/', { keepQuotes: true }, './{"x,y"}/(a|d|g|j|m|p|s|v|y)/'], + + // should expand a complex combination of ranges and sets + ['a/{x,y}/{1..5}c{d,e}f.{md,txt}', {}, 'a/(x|y)/([1-5])c(d|e)f.(md|txt)'], + + // should expand complex sets and ranges in `bash` mode + ['a/{x,{1..5},y}/c{d}e', {}, 'a/(x|([1-5])|y)/c{d}e'], + + // should treat glob characters as literal + ['**/{1..5}/a.js', {}, '**/([1-5])/a.js'], + ['x{{0..10},braces}y', {}, 'x(([0-9]|10)|braces)y'], + + // should handle sets with invalid ranges + ['{0..10,braces}', {}, '(0..10|braces)'], + ['{1..10,braces}', {}, '(1..10|braces)'], + + ['./\\{x,y}/{a..z..3}/', {}, './{x,y}/(a|d|g|j|m|p|s|v|y)/'], + ['{braces,{0..10}}', {}, '(braces|([0-9]|10))'], + ['{{0..10},braces}', {}, '(([0-9]|10)|braces)'], + ['{{1..10..2},braces}', { bash: false }, '((1|3|5|7|9)|braces)'], + ['{{1..10..2},braces}', {}, '((1|3|5|7|9)|braces)'] + ]; + + fixtures.forEach(arr => { + if (typeof arr === 'string') { + return; + } + + const options = { ...arr[1] }; + const pattern = arr[0]; + const expected = arr[2]; + + if (options.skip === true) { + return; + } + + it('should compile: ' + pattern, () => { + equal(pattern, expected, options); + }); + }); +}); + diff --git a/vendor/braces-backport/upstream-tests/test/bash-compiled-sets.js b/vendor/braces-backport/upstream-tests/test/bash-compiled-sets.js new file mode 100644 index 00000000..1a95c199 --- /dev/null +++ b/vendor/braces-backport/upstream-tests/test/bash-compiled-sets.js @@ -0,0 +1,199 @@ +'use strict'; + +require('mocha'); +const assert = require('assert').strict; +const bashPath = require('bash-path'); +const cp = require('child_process'); +const braces = require('..'); + +const bash = input => { + return cp.spawnSync(bashPath(), ['-c', `echo ${input}`]) + .stdout.toString() + .split(/\s+/) + .filter(Boolean); +}; + +const equal = (input, expected = bash(input), options) => { + assert.deepEqual(braces.compile(input, options), expected); +}; + +/** + * Bash 4.3 unit tests with `braces.expand()` + */ + +describe('bash sets - braces.compile()', () => { + const fixtures = [ + ['{a,b,c,d,e}', {}, '(a|b|c|d|e)'], + ['a/\\{b,c,d,{x,y}}{e,f\\}/g', {}, 'a/{b,c,d,(x|y)}{e,f}/g'], + ['a/\\{b,c,d\\}\\{e,f\\}/g', {}, 'a/{b,c,d}{e,f}/g'], + ['a/\\{b,c,d\\}\\{e,f}/g', {}, 'a/{b,c,d}{e,f}/g'], + ['a/\\{b,c,d\\}{e,f}/g', {}, 'a/{b,c,d}(e|f)/g'], + ['a/\\{b,c,d{x,y}}{e,f\\}/g', {}, 'a/{b,c,d(x|y)}{e,f}/g'], + ['a/\\{b,c,d}{e,f\\}/g', {}, 'a/{b,c,d}{e,f}/g'], + ['a/\\{b,c,d}{e,f}/g', {}, 'a/{b,c,d}(e|f)/g'], + ['a/\\{{b,c}{e,f}/g', {}, 'a/{(b|c)(e|f)/g'], + ['a/\\{{b,c}{e,f}\\}/g', {}, 'a/{(b|c)(e|f)}/g'], + ['a/\\{{b,c}{e,f}}/g', {}, 'a/{(b|c)(e|f)}/g'], + ['a/b/{b,c,{d,e{f,g},{w,x}/{y,z}}}/h/i', {}, 'a/b/(b|c|(d|e(f|g)|(w|x)/(y|z)))/h/i'], + ['a/{b,c}}{e,f}/g', {}, 'a/(b|c)}(e|f)/g'], + ['a/{b,c\\,d}{e,f}/g', {}, 'a/(b|c,d)(e|f)/g'], + ['a/{b,c\\}}{e,f}/g', {}, 'a/(b|c})(e|f)/g'], + ['a/{b,c}', {}, 'a/(b|c)'], + ['a/{b,c}d{e,f}/g', {}, 'a/(b|c)d(e|f)/g'], + ['a/{b,c}{e,f}/g', {}, 'a/(b|c)(e|f)/g'], + ['a/{b,c}{e,f}{g,h,i}/k', {}, 'a/(b|c)(e|f)(g|h|i)/k'], + ['a/{b,{c,d},e}/f', {}, 'a/(b|(c|d)|e)/f'], + ['a/{b,{c,d}/{e,f},g}/h', {}, 'a/(b|(c|d)/(e|f)|g)/h'], + ['a/{b{c,d},e{f,g}h{i,j}}/k', {}, 'a/(b(c|d)|e(f|g)h(i|j))/k'], + ['a/{b{c,d},e}/f', {}, 'a/(b(c|d)|e)/f'], + ['a/{b{c,d}e{f,g}h{i,j}}/k', {}, 'a/{b(c|d)e(f|g)h(i|j)}/k'], + ['a/{b{c,d}e{f,g},h{i,j}}/k', {}, 'a/(b(c|d)e(f|g)|h(i|j))/k'], + ['a/{x,z}{b,{c,d}/{e,f},g}/h', {}, 'a/(x|z)(b|(c|d)/(e|f)|g)/h'], + ['a/{{a,b}/{c,d}}/z', {}, 'a/{(a|b)/(c|d)}/z'], + ['a/{{b,c}/{d,e}}', {}, 'a/{(b|c)/(d|e)}'], + ['a/{{b,c}/{d,e}}/f', {}, 'a/{(b|c)/(d|e)}/f'], + ['a{b{c{d,e}f{x,y{{g}h', {}, 'a{b{c(d|e)f{x,y{{g}h'], + ['{a,b,{c,d},e}', {}, '(a|b|(c|d)|e)'], + ['{a,b,{c,d}e}', {}, '(a|b|(c|d)e)'], + ['{a,b,{c,d}}', {}, '(a|b|(c|d))'], + ['{a,b{c,d}}', {}, '(a|b(c|d))'], + ['{a,b}/{c,d}', {}, '(a|b)/(c|d)'], + ['{a,b}{c,d}', {}, '(a|b)(c|d)'], + + ['{{a,b},{c,d}}', {}, '((a|b)|(c|d))'], + ['{{a,b}/{c,d}}', {}, '{(a|b)/(c|d)}'], + ['{{a,b}/{c,d}}/z', {}, '{(a|b)/(c|d)}/z'], + + // should not process glob characters + ['{generate,{assemble,update,verb}{file,-generate-*},generator}.js', {}, '(generate|(assemble|update|verb)(file|-generate-*)|generator).js'], + ['**/{foo,bar}.js', {}, '**/(foo|bar).js'], + ['**/{a,b,c}/*.js', {}, '**/(a|b|c)/*.js'], + ['**/{a,b,*}/*.js', {}, '**/(a|b|*)/*.js'], + ['**/{**,b,*}/*.js', {}, '**/(**|b|*)/*.js'], + + // should not expand escaped braces + ['\\{a,b,c,d,e}', {}, '{a,b,c,d,e}'], + ['a/b/c/{x,y\\}', {}, 'a/b/c/{x,y}'], + ['a/\\{x,y}/cde', {}, 'a/{x,y}/cde'], + ['abcd{efgh', {}, 'abcd{efgh'], + ['\\{abc\\}', {}, '{abc}'], + ['{x,y,\\{a,b,c\\}}', {}, '(x|y|{a|b|c})'], + ['{x,y,{a,b,c\\}}', {}, '{x,y,(a|b|c})'], + ['{x,y,{abc},trie}', {}, '(x|y|{abc}|trie)'], + ['x,y,{abc},trie', {}, 'x,y,{abc},trie'], + ['{b{c,d},e}', {}, '(b(c|d)|e)'], + ['{b{c,d},e}/f', {}, '(b(c|d)|e)/f'], + ['{abc}', {}, '{abc}'], + + // should handle empty braces + ['{ }', {}, '{ }'], + ['{', {}, '{'], + ['{}', {}, '{}'], + ['}', {}, '}'], + + // should escape braces when only one value is defined + ['a{b}c', {}, 'a{b}c'], + ['a/b/c{d}e', {}, 'a/b/c{d}e'], + + // should escape closing braces when open is not defined + ['{a,b}c,d}', {}, '(a|b)c,d}'], + ['a,b,c,d}', {}, 'a,b,c,d}'], + + // should not expand braces in sets with es6/bash-like variables + ['abc/${ddd}/xyz', {}, 'abc/${ddd}/xyz'], + ['a${b}c', {}, 'a${b}c'], + ['a${b{a,b}}c', {}, 'a${b{a,b}}c'], + ['a/{${b},c}/d', {}, 'a/(${b}|c)/d'], + ['a${b,d}/{foo,bar}c', {}, 'a${b,d}/(foo|bar)c'], + + // should not expand escaped commas + ['a{b\\,c\\,d}e', {}, 'a{b,c,d}e'], + ['a{b\\,c}d', {}, 'a{b,c}d'], + ['{abc\\,def}', {}, '{abc,def}'], + ['{abc\\,def,ghi}', {}, '(abc,def|ghi)'], + ['a/{b,c}/{x\\,y}/d/e', {}, 'a/(b|c)/{x,y}/d/e'], + + // should not expand escaped braces + ['{a,b\\}c,d}', {}, '(a|b}c|d)'], + ['a/{z,\\{a,b,c,d,e}/d', {}, 'a/(z|{a|b|c|d|e)/d'], + ['a/\\{b,c}/{d,e}/f', {}, 'a/{b,c}/(d|e)/f'], + + // should not expand escaped braces or commas + ['{x\\,y,\\{abc\\},trie}', {}, '(x,y|{abc}|trie)'], + + // should support sequence brace operators + ['ff{c,b,a}', {}, 'ff(c|b|a)'], + ['f{d,e,f}g', {}, 'f(d|e|f)g'], + ['{a,b,c}', {}, '(a|b|c)'], + ['{l,n,m}xyz', {}, '(l|n|m)xyz'], + + // should expand multiple sets + ['a/{a,b}/{c,d}/e', {}, 'a/(a|b)/(c|d)/e'], + ['a{b,c}d{e,f}g', {}, 'a(b|c)d(e|f)g'], + ['a/{x,y}/c{d,e}f.{md,txt}', {}, 'a/(x|y)/c(d|e)f.(md|txt)'], + + // should expand nested sets + ['{a,b}{{a,b},a,b}', {}, '(a|b)((a|b)|a|b)'], + ['/usr/{ucb/{ex,edit},lib/{ex,how_ex}}', {}, '/usr/(ucb/(ex|edit)|lib/(ex|how_ex))'], + ['a{b,c{d,e}f}g', {}, 'a(b|c(d|e)f)g'], + ['a{{x,y},z}b', {}, 'a((x|y)|z)b'], + ['f{x,y{g,z}}h', {}, 'f(x|y(g|z))h'], + ['a{b,c{d,e},h}x/z', {}, 'a(b|c(d|e)|h)x/z'], + ['a{b,c{d,e},h}x{y,z}', {}, 'a(b|c(d|e)|h)x(y|z)'], + ['a{b,c{d,e},{f,g}h}x{y,z}', {}, 'a(b|c(d|e)|(f|g)h)x(y|z)'], + ['a-{b{d,e}}-c', {}, 'a-{b(d|e)}-c'], + + // should expand not modify non-brace characters + ['a/b/{d,e}/*.js', {}, 'a/b/(d|e)/*.js'], + ['a/**/c/{d,e}/f*.js', {}, 'a/**/c/(d|e)/f*.js'], + ['a/**/c/{d,e}/f*.{md,txt}', {}, 'a/**/c/(d|e)/f*.(md|txt)'], + + // should work with leading and trailing commas + ['a{b,}c', {}, 'a(b|)c'], + ['a{,b}c', {}, 'a(|b)c'], + + // should handle spaces + // Bash 4.3 says the this first one should be equivalent to `foo|(1|2)|bar + // That makes sense in Bash, since ' ' is a separator, but not here. + ['foo {1,2} bar', {}, 'foo (1|2) bar'], + ['a{ ,c{d, },h}x', {}, 'a( |c(d| )|h)x'], + ['a{ ,c{d, },h} ', {}, 'a( |c(d| )|h) '], + + // see https://github.com/jonschlinkert/microequal/issues/66 + ['/Users/tobiasreich/Sites/aaa/bbb/ccc 2016/src/**/[^_]*.{html,ejs}', {}, '/Users/tobiasreich/Sites/aaa/bbb/ccc 2016/src/**/[^_]*.(html|ejs)'] + ]; + + const seen = new Map(); + const dupes = []; + + for (let i = 0; i < fixtures.length; i++) { + const fixture = fixtures[i]; + + const key = fixture[0] + String(fixture[1].bash); + if (seen.has(key)) { + dupes.push(i + 21, fixture[0]); + } else { + + seen.set(key, i + 21); + } + } + + fixtures.forEach(arr => { + if (typeof arr === 'string') { + return; + } + + const options = { ...arr[1] }; + const pattern = arr[0]; + const expected = arr[2]; + + if (options.skip === true) { + return; + } + + it('should compile: ' + pattern, () => { + equal(pattern, expected, options); + }); + }); +}); + diff --git a/vendor/braces-backport/upstream-tests/test/bash-expanded-ranges.js b/vendor/braces-backport/upstream-tests/test/bash-expanded-ranges.js new file mode 100644 index 00000000..21c1db24 --- /dev/null +++ b/vendor/braces-backport/upstream-tests/test/bash-expanded-ranges.js @@ -0,0 +1,317 @@ +'use strict'; + +require('mocha'); +const assert = require('assert').strict; +const bashPath = require('bash-path'); +const cp = require('child_process'); +const braces = require('..'); + +const bash = input => { + return cp.spawnSync(bashPath(), ['-c', `echo ${input}`]) + .stdout.toString() + .split(/\s+/) + .filter(Boolean); +}; + +const equal = (input, expected = bash(input), options) => { + assert.deepEqual(braces.expand(input, options), expected); +}; + +/** + * Bash 4.3 unit tests with `braces.expand()` + */ + +describe('bash - expanded brace ranges', () => { + describe('large numbers', () => { + it('should expand large numbers', () => { + equal('{2147483645..2147483649}', ['2147483645', '2147483646', '2147483647', '2147483648', '2147483649']); + }); + + it('should throw an error when range exceeds rangeLimit', () => { + assert.throws(() => braces.expand('{214748364..2147483649}')); + }); + }); + + describe('escaping / invalid ranges', () => { + it('should not try to expand ranges with decimals', () => { + equal('{1.1..2.1}', ['{1.1..2.1}']); + equal('{1.1..~2.1}', ['{1.1..~2.1}']); + }); + + it('should escape invalid ranges:', () => { + equal('{1..0f}', ['{1..0f}']); + equal('{1..10..ff}', ['{1..10..ff}']); + equal('{1..10.f}', ['{1..10.f}']); + equal('{1..10f}', ['{1..10f}']); + equal('{1..20..2f}', ['{1..20..2f}']); + equal('{1..20..f2}', ['{1..20..f2}']); + equal('{1..2f..2}', ['{1..2f..2}']); + equal('{1..ff..2}', ['{1..ff..2}']); + equal('{1..ff}', ['{1..ff}']); + equal('{1.20..2}', ['{1.20..2}']); + }); + + it('weirdly-formed brace expansions -- fixed in post-bash-3.1', () => { + equal('a-{b{d,e}}-c', ['a-{bd}-c', 'a-{be}-c']); + equal('a-{bdef-{g,i}-c', ['a-{bdef-g-c', 'a-{bdef-i-c']); + }); + + it('should not expand quoted strings.', () => { + equal('{"klklkl"}{1,2,3}', ['{klklkl}1', '{klklkl}2', '{klklkl}3']); + equal('{"x,x"}', ['{x,x}']); + }); + + it('should escaped outer braces in nested non-sets', () => { + equal('{a-{b,c,d}}', ['{a-b}', '{a-c}', '{a-d}']); + equal('{a,{a-{b,c,d}}}', ['a', '{a-b}', '{a-c}', '{a-d}']); + }); + + it('should escape imbalanced braces', () => { + equal('a-{bdef-{g,i}-c', ['a-{bdef-g-c', 'a-{bdef-i-c']); + equal('abc{', ['abc{']); + equal('{abc{', ['{abc{']); + equal('{abc', ['{abc']); + equal('}abc', ['}abc']); + equal('ab{c', ['ab{c']); + equal('ab{c', ['ab{c']); + equal('{{a,b}', ['{a', '{b']); + equal('{a,b}}', ['a}', 'b}']); + equal('abcd{efgh', ['abcd{efgh']); + equal('a{b{c{d,e}f}g}h', ['a{b{cdf}g}h', 'a{b{cef}g}h']); + equal('f{x,y{{g,z}}h}', ['fx', 'fy{g}h', 'fy{z}h']); + equal('z{a,b},c}d', ['za,c}d', 'zb,c}d']); + equal('a{b{c{d,e}f{x,y{{g}h', ['a{b{cdf{x,y{{g}h', 'a{b{cef{x,y{{g}h']); + equal('f{x,y{{g}h', ['f{x,y{{g}h']); + equal('f{x,y{{g}}h', ['f{x,y{{g}}h']); + equal('a{b{c{d,e}f{x,y{}g}h', ['a{b{cdfxh', 'a{b{cdfy{}gh', 'a{b{cefxh', 'a{b{cefy{}gh']); + equal('f{x,y{}g}h', ['fxh', 'fy{}gh']); + equal('z{a,b{,c}d', ['z{a,bd', 'z{a,bcd']); + }); + }); + + describe('positive numeric ranges', () => { + it('should expand numeric ranges', () => { + equal('a{0..3}d', ['a0d', 'a1d', 'a2d', 'a3d']); + equal('x{10..1}y', ['x10y', 'x9y', 'x8y', 'x7y', 'x6y', 'x5y', 'x4y', 'x3y', 'x2y', 'x1y']); + equal('x{3..3}y', ['x3y']); + equal('{1..10}', ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']); + equal('{1..3}', ['1', '2', '3']); + equal('{1..9}', ['1', '2', '3', '4', '5', '6', '7', '8', '9']); + equal('{10..1}', ['10', '9', '8', '7', '6', '5', '4', '3', '2', '1']); + equal('{10..1}y', ['10y', '9y', '8y', '7y', '6y', '5y', '4y', '3y', '2y', '1y']); + equal('{3..3}', ['3']); + equal('{5..8}', ['5', '6', '7', '8']); + }); + }); + + describe('negative ranges', () => { + it('should expand ranges with negative numbers', () => { + equal('{-10..-1}', ['-10', '-9', '-8', '-7', '-6', '-5', '-4', '-3', '-2', '-1']); + equal('{-20..0}', ['-20', '-19', '-18', '-17', '-16', '-15', '-14', '-13', '-12', '-11', '-10', '-9', '-8', '-7', '-6', '-5', '-4', '-3', '-2', '-1', '0']); + equal('{0..-5}', ['0', '-1', '-2', '-3', '-4', '-5']); + equal('{9..-4}', ['9', '8', '7', '6', '5', '4', '3', '2', '1', '0', '-1', '-2', '-3', '-4']); + }); + }); + + describe('alphabetical ranges', () => { + it('should expand alphabetical ranges', () => { + equal('{a..F}', ['a', '`', '_', '^', ']', '\\', '[', 'Z', 'Y', 'X', 'W', 'V', 'U', 'T', 'S', 'R', 'Q', 'P', 'O', 'N', 'M', 'L', 'K', 'J', 'I', 'H', 'G', 'F']); + equal('0{a..d}0', ['0a0', '0b0', '0c0', '0d0']); + equal('a/{b..d}/e', ['a/b/e', 'a/c/e', 'a/d/e']); + equal('{1..f}', ['1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f']); + equal('{a..A}', ['a', '`', '_', '^', ']', '\\', '[', 'Z', 'Y', 'X', 'W', 'V', 'U', 'T', 'S', 'R', 'Q', 'P', 'O', 'N', 'M', 'L', 'K', 'J', 'I', 'H', 'G', 'F', 'E', 'D', 'C', 'B', 'A']); + equal('{A..a}', ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a']); + equal('{a..e}', ['a', 'b', 'c', 'd', 'e']); + equal('{A..E}', ['A', 'B', 'C', 'D', 'E']); + equal('{a..f}', ['a', 'b', 'c', 'd', 'e', 'f']); + equal('{a..z}', ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']); + equal('{E..A}', ['E', 'D', 'C', 'B', 'A']); + equal('{f..1}', ['f', 'e', 'd', 'c', 'b', 'a', '`', '_', '^', ']', '\\', '[', 'Z', 'Y', 'X', 'W', 'V', 'U', 'T', 'S', 'R', 'Q', 'P', 'O', 'N', 'M', 'L', 'K', 'J', 'I', 'H', 'G', 'F', 'E', 'D', 'C', 'B', 'A', '@', '?', '>', '=', '<', ';', ':', '9', '8', '7', '6', '5', '4', '3', '2', '1']); + equal('{f..a}', ['f', 'e', 'd', 'c', 'b', 'a']); + equal('{f..f}', ['f']); + }); + + it('should expand multiple ranges:', () => { + equal('a/{b..d}/e/{f..h}', ['a/b/e/f', 'a/b/e/g', 'a/b/e/h', 'a/c/e/f', 'a/c/e/g', 'a/c/e/h', 'a/d/e/f', 'a/d/e/g', 'a/d/e/h']); + }); + }); + + describe('combo', () => { + it('should expand numerical ranges - positive and negative', () => { + equal('a{01..05}b', ['a01b', 'a02b', 'a03b', 'a04b', 'a05b']); + equal('0{1..9}/{10..20}', ['01/10', '01/11', '01/12', '01/13', '01/14', '01/15', '01/16', '01/17', '01/18', '01/19', '01/20', '02/10', '02/11', '02/12', '02/13', '02/14', '02/15', '02/16', '02/17', '02/18', '02/19', '02/20', '03/10', '03/11', '03/12', '03/13', '03/14', '03/15', '03/16', '03/17', '03/18', '03/19', '03/20', '04/10', '04/11', '04/12', '04/13', '04/14', '04/15', '04/16', '04/17', '04/18', '04/19', '04/20', '05/10', '05/11', '05/12', '05/13', '05/14', '05/15', '05/16', '05/17', '05/18', '05/19', '05/20', '06/10', '06/11', '06/12', '06/13', '06/14', '06/15', '06/16', '06/17', '06/18', '06/19', '06/20', '07/10', '07/11', '07/12', '07/13', '07/14', '07/15', '07/16', '07/17', '07/18', '07/19', '07/20', '08/10', '08/11', '08/12', '08/13', '08/14', '08/15', '08/16', '08/17', '08/18', '08/19', '08/20', '09/10', '09/11', '09/12', '09/13', '09/14', '09/15', '09/16', '09/17', '09/18', '09/19', '09/20']); + equal('{-10..10}', ['-10', '-9', '-8', '-7', '-6', '-5', '-4', '-3', '-2', '-1', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']); + }); + }); + + describe('steps > positive ranges', () => { + it('should expand ranges using steps:', () => { + equal('{1..10..1}', ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']); + equal('{1..10..2}', ['1', '3', '5', '7', '9']); + equal('{1..20..20}', ['1']); + equal('{1..20..2}', ['1', '3', '5', '7', '9', '11', '13', '15', '17', '19']); + equal('{10..0..2}', ['10', '8', '6', '4', '2', '0']); + equal('{10..1..2}', ['10', '8', '6', '4', '2']); + equal('{100..0..5}', ['100', '95', '90', '85', '80', '75', '70', '65', '60', '55', '50', '45', '40', '35', '30', '25', '20', '15', '10', '5', '0']); + equal('{2..10..1}', ['2', '3', '4', '5', '6', '7', '8', '9', '10']); + equal('{2..10..2}', ['2', '4', '6', '8', '10']); + equal('{2..10..3}', ['2', '5', '8']); + equal('{a..z..2}', ['a', 'c', 'e', 'g', 'i', 'k', 'm', 'o', 'q', 's', 'u', 'w', 'y']); + }); + + it('should expand positive ranges with negative steps:', () => { + equal('{10..0..-2}', ['10', '8', '6', '4', '2', '0']); + }); + }); + + describe('steps > negative ranges', () => { + it('should expand negative ranges using steps:', () => { + equal('{-1..-10..-2}', ['-1', '-3', '-5', '-7', '-9']); + equal('{-1..-10..2}', ['-1', '-3', '-5', '-7', '-9']); + equal('{-10..-2..2}', ['-10', '-8', '-6', '-4', '-2']); + equal('{-2..-10..1}', ['-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10']); + equal('{-2..-10..2}', ['-2', '-4', '-6', '-8', '-10']); + equal('{-2..-10..3}', ['-2', '-5', '-8']); + equal('{-50..-0..5}', ['-50', '-45', '-40', '-35', '-30', '-25', '-20', '-15', '-10', '-5', '0']); + equal('{10..1..-2}', ['10', '8', '6', '4', '2']); + equal('{100..0..-5}', ['100', '95', '90', '85', '80', '75', '70', '65', '60', '55', '50', '45', '40', '35', '30', '25', '20', '15', '10', '5', '0']); + }); + }); + + describe('steps > alphabetical ranges', () => { + it('should expand alpha ranges with steps', () => { + equal('{a..e..2}', ['a', 'c', 'e']); + equal('{E..A..2}', ['E', 'C', 'A']); + equal('{a..z}', ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']); + equal('{a..z..2}', ['a', 'c', 'e', 'g', 'i', 'k', 'm', 'o', 'q', 's', 'u', 'w', 'y']); + equal('{z..a..-2}', ['z', 'x', 'v', 't', 'r', 'p', 'n', 'l', 'j', 'h', 'f', 'd', 'b']); + }); + + it('should expand alpha ranges with negative steps', () => { + equal('{z..a..-2}', ['z', 'x', 'v', 't', 'r', 'p', 'n', 'l', 'j', 'h', 'f', 'd', 'b']); + }); + }); + + describe('padding', () => { + it('unwanted zero-padding -- fixed post-bash-4.0', () => { + equal('{10..0..2}', ['10', '8', '6', '4', '2', '0']); + equal('{10..0..-2}', ['10', '8', '6', '4', '2', '0']); + equal('{-50..-0..5}', ['-50', '-45', '-40', '-35', '-30', '-25', '-20', '-15', '-10', '-5', '0']); + }); + }); + + describe('ranges', () => { + const fixtures = [ + 'should expand ranges', + + ['a{b,c{1..50}/{d,e,f}/,g}h/i', {}, ['abh/i', 'ac1/d/h/i', 'ac1/e/h/i', 'ac1/f/h/i', 'ac2/d/h/i', 'ac2/e/h/i', 'ac2/f/h/i', 'ac3/d/h/i', 'ac3/e/h/i', 'ac3/f/h/i', 'ac4/d/h/i', 'ac4/e/h/i', 'ac4/f/h/i', 'ac5/d/h/i', 'ac5/e/h/i', 'ac5/f/h/i', 'ac6/d/h/i', 'ac6/e/h/i', 'ac6/f/h/i', 'ac7/d/h/i', 'ac7/e/h/i', 'ac7/f/h/i', 'ac8/d/h/i', 'ac8/e/h/i', 'ac8/f/h/i', 'ac9/d/h/i', 'ac9/e/h/i', 'ac9/f/h/i', 'ac10/d/h/i', 'ac10/e/h/i', 'ac10/f/h/i', 'ac11/d/h/i', 'ac11/e/h/i', 'ac11/f/h/i', 'ac12/d/h/i', 'ac12/e/h/i', 'ac12/f/h/i', 'ac13/d/h/i', 'ac13/e/h/i', 'ac13/f/h/i', 'ac14/d/h/i', 'ac14/e/h/i', 'ac14/f/h/i', 'ac15/d/h/i', 'ac15/e/h/i', 'ac15/f/h/i', 'ac16/d/h/i', 'ac16/e/h/i', 'ac16/f/h/i', 'ac17/d/h/i', 'ac17/e/h/i', 'ac17/f/h/i', 'ac18/d/h/i', 'ac18/e/h/i', 'ac18/f/h/i', 'ac19/d/h/i', 'ac19/e/h/i', 'ac19/f/h/i', 'ac20/d/h/i', 'ac20/e/h/i', 'ac20/f/h/i', 'ac21/d/h/i', 'ac21/e/h/i', 'ac21/f/h/i', 'ac22/d/h/i', 'ac22/e/h/i', 'ac22/f/h/i', 'ac23/d/h/i', 'ac23/e/h/i', 'ac23/f/h/i', 'ac24/d/h/i', 'ac24/e/h/i', 'ac24/f/h/i', 'ac25/d/h/i', 'ac25/e/h/i', 'ac25/f/h/i', 'ac26/d/h/i', 'ac26/e/h/i', 'ac26/f/h/i', 'ac27/d/h/i', 'ac27/e/h/i', 'ac27/f/h/i', 'ac28/d/h/i', 'ac28/e/h/i', 'ac28/f/h/i', 'ac29/d/h/i', 'ac29/e/h/i', 'ac29/f/h/i', 'ac30/d/h/i', 'ac30/e/h/i', 'ac30/f/h/i', 'ac31/d/h/i', 'ac31/e/h/i', 'ac31/f/h/i', 'ac32/d/h/i', 'ac32/e/h/i', 'ac32/f/h/i', 'ac33/d/h/i', 'ac33/e/h/i', 'ac33/f/h/i', 'ac34/d/h/i', 'ac34/e/h/i', 'ac34/f/h/i', 'ac35/d/h/i', 'ac35/e/h/i', 'ac35/f/h/i', 'ac36/d/h/i', 'ac36/e/h/i', 'ac36/f/h/i', 'ac37/d/h/i', 'ac37/e/h/i', 'ac37/f/h/i', 'ac38/d/h/i', 'ac38/e/h/i', 'ac38/f/h/i', 'ac39/d/h/i', 'ac39/e/h/i', 'ac39/f/h/i', 'ac40/d/h/i', 'ac40/e/h/i', 'ac40/f/h/i', 'ac41/d/h/i', 'ac41/e/h/i', 'ac41/f/h/i', 'ac42/d/h/i', 'ac42/e/h/i', 'ac42/f/h/i', 'ac43/d/h/i', 'ac43/e/h/i', 'ac43/f/h/i', 'ac44/d/h/i', 'ac44/e/h/i', 'ac44/f/h/i', 'ac45/d/h/i', 'ac45/e/h/i', 'ac45/f/h/i', 'ac46/d/h/i', 'ac46/e/h/i', 'ac46/f/h/i', 'ac47/d/h/i', 'ac47/e/h/i', 'ac47/f/h/i', 'ac48/d/h/i', 'ac48/e/h/i', 'ac48/f/h/i', 'ac49/d/h/i', 'ac49/e/h/i', 'ac49/f/h/i', 'ac50/d/h/i', 'ac50/e/h/i', 'ac50/f/h/i', 'agh/i']], + ['0{1..9} {10..20}', {}, ['01 10', '01 11', '01 12', '01 13', '01 14', '01 15', '01 16', '01 17', '01 18', '01 19', '01 20', '02 10', '02 11', '02 12', '02 13', '02 14', '02 15', '02 16', '02 17', '02 18', '02 19', '02 20', '03 10', '03 11', '03 12', '03 13', '03 14', '03 15', '03 16', '03 17', '03 18', '03 19', '03 20', '04 10', '04 11', '04 12', '04 13', '04 14', '04 15', '04 16', '04 17', '04 18', '04 19', '04 20', '05 10', '05 11', '05 12', '05 13', '05 14', '05 15', '05 16', '05 17', '05 18', '05 19', '05 20', '06 10', '06 11', '06 12', '06 13', '06 14', '06 15', '06 16', '06 17', '06 18', '06 19', '06 20', '07 10', '07 11', '07 12', '07 13', '07 14', '07 15', '07 16', '07 17', '07 18', '07 19', '07 20', '08 10', '08 11', '08 12', '08 13', '08 14', '08 15', '08 16', '08 17', '08 18', '08 19', '08 20', '09 10', '09 11', '09 12', '09 13', '09 14', '09 15', '09 16', '09 17', '09 18', '09 19', '09 20']], + ['a{0..3}d', {}, ['a0d', 'a1d', 'a2d', 'a3d']], + ['x{10..1}y', {}, ['x10y', 'x9y', 'x8y', 'x7y', 'x6y', 'x5y', 'x4y', 'x3y', 'x2y', 'x1y']], + ['x{3..3}y', {}, ['x3y']], + ['{0..10,braces}', {}, ['0..10', 'braces']], + ['{3..3}', {}, ['3']], + ['{5..8}', {}, ['5', '6', '7', '8']], + ['**/{1..5}/a.js', {}, ['**/1/a.js', '**/2/a.js', '**/3/a.js', '**/4/a.js', '**/5/a.js']], + ['{braces,{0..10}}', {}, ['braces', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']], + ['./\\{x,y}/{a..z..3}/', {}, ['./{x,y}/a/', './{x,y}/d/', './{x,y}/g/', './{x,y}/j/', './{x,y}/m/', './{x,y}/p/', './{x,y}/s/', './{x,y}/v/', './{x,y}/y/']], + ['x{{0..10},braces}y', {}, ['x0y', 'x1y', 'x2y', 'x3y', 'x4y', 'x5y', 'x6y', 'x7y', 'x8y', 'x9y', 'x10y', 'xbracesy']], + ['{braces,{0..10}}', {}, ['braces', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']], + ['{{0..10},braces}', {}, ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'braces']], + ['{{1..10..2},braces}', {}, ['1', '3', '5', '7', '9', 'braces']], + ['{{1..10},braces}', {}, ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'braces']], + ['{1.1..2.1}', {}, ['{1.1..2.1}']], + ['{1.1..~2.1}', {}, ['{1.1..~2.1}']], + ['{1..0f}', {}, ['{1..0f}']], + ['{1..10..ff}', {}, ['{1..10..ff}']], + ['{1..10.f}', {}, ['{1..10.f}']], + ['{1..10f}', {}, ['{1..10f}']], + ['{1..20..2f}', {}, ['{1..20..2f}']], + ['{1..20..f2}', {}, ['{1..20..f2}']], + ['{1..2f..2}', {}, ['{1..2f..2}']], + ['{1..ff..2}', {}, ['{1..ff..2}']], + ['{1..ff}', {}, ['{1..ff}']], + ['{1.20..2}', {}, ['{1.20..2}']], + ['a{0..3}d', {}, ['a0d', 'a1d', 'a2d', 'a3d']], + ['x{10..1}y', {}, ['x10y', 'x9y', 'x8y', 'x7y', 'x6y', 'x5y', 'x4y', 'x3y', 'x2y', 'x1y']], + ['x{3..3}y', {}, ['x3y']], + ['{1..10}', {}, ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']], + ['{1..3}', {}, ['1', '2', '3']], + ['{1..9}', {}, ['1', '2', '3', '4', '5', '6', '7', '8', '9']], + ['{10..1}y', {}, ['10y', '9y', '8y', '7y', '6y', '5y', '4y', '3y', '2y', '1y']], + ['{3..3}', {}, ['3']], + ['{5..8}', {}, ['5', '6', '7', '8']], + ['{-10..-1}', {}, ['-10', '-9', '-8', '-7', '-6', '-5', '-4', '-3', '-2', '-1']], + ['{-20..0}', {}, ['-20', '-19', '-18', '-17', '-16', '-15', '-14', '-13', '-12', '-11', '-10', '-9', '-8', '-7', '-6', '-5', '-4', '-3', '-2', '-1', '0']], + ['{0..-5}', {}, ['0', '-1', '-2', '-3', '-4', '-5']], + ['{9..-4}', {}, ['9', '8', '7', '6', '5', '4', '3', '2', '1', '0', '-1', '-2', '-3', '-4']], + ['0{1..9}/{10..20}', {}, ['01/10', '01/11', '01/12', '01/13', '01/14', '01/15', '01/16', '01/17', '01/18', '01/19', '01/20', '02/10', '02/11', '02/12', '02/13', '02/14', '02/15', '02/16', '02/17', '02/18', '02/19', '02/20', '03/10', '03/11', '03/12', '03/13', '03/14', '03/15', '03/16', '03/17', '03/18', '03/19', '03/20', '04/10', '04/11', '04/12', '04/13', '04/14', '04/15', '04/16', '04/17', '04/18', '04/19', '04/20', '05/10', '05/11', '05/12', '05/13', '05/14', '05/15', '05/16', '05/17', '05/18', '05/19', '05/20', '06/10', '06/11', '06/12', '06/13', '06/14', '06/15', '06/16', '06/17', '06/18', '06/19', '06/20', '07/10', '07/11', '07/12', '07/13', '07/14', '07/15', '07/16', '07/17', '07/18', '07/19', '07/20', '08/10', '08/11', '08/12', '08/13', '08/14', '08/15', '08/16', '08/17', '08/18', '08/19', '08/20', '09/10', '09/11', '09/12', '09/13', '09/14', '09/15', '09/16', '09/17', '09/18', '09/19', '09/20']], + ['0{a..d}0', {}, ['0a0', '0b0', '0c0', '0d0']], + ['a/{b..d}/e', {}, ['a/b/e', 'a/c/e', 'a/d/e']], + ['{1..f}', { minimatch: false }, ['1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f']], + ['{a..A}', {}, ['a', '`', '_', '^', ']', '\\', '[', 'Z', 'Y', 'X', 'W', 'V', 'U', 'T', 'S', 'R', 'Q', 'P', 'O', 'N', 'M', 'L', 'K', 'J', 'I', 'H', 'G', 'F', 'E', 'D', 'C', 'B', 'A']], + ['{A..a}', {}, ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a']], + ['{a..e}', {}, ['a', 'b', 'c', 'd', 'e']], + ['{A..E}', {}, ['A', 'B', 'C', 'D', 'E']], + ['{a..f}', {}, ['a', 'b', 'c', 'd', 'e', 'f']], + ['{a..z}', {}, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']], + ['{E..A}', {}, ['E', 'D', 'C', 'B', 'A']], + ['{f..1}', { minimatch: false }, ['f', 'e', 'd', 'c', 'b', 'a', '`', '_', '^', ']', '\\', '[', 'Z', 'Y', 'X', 'W', 'V', 'U', 'T', 'S', 'R', 'Q', 'P', 'O', 'N', 'M', 'L', 'K', 'J', 'I', 'H', 'G', 'F', 'E', 'D', 'C', 'B', 'A', '@', '?', '>', '=', '<', ';', ':', '9', '8', '7', '6', '5', '4', '3', '2', '1']], + ['{f..a}', {}, ['f', 'e', 'd', 'c', 'b', 'a']], + ['{f..f}', {}, ['f']], + ['a/{b..d}/e/{f..h}', {}, ['a/b/e/f', 'a/b/e/g', 'a/b/e/h', 'a/c/e/f', 'a/c/e/g', 'a/c/e/h', 'a/d/e/f', 'a/d/e/g', 'a/d/e/h']], + ['{-10..10}', {}, ['-10', '-9', '-8', '-7', '-6', '-5', '-4', '-3', '-2', '-1', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']], + ['{1..10..1}', { optimize: false }, ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']], + ['{1..10..2}', { optimize: false }, ['1', '3', '5', '7', '9']], + ['{1..20..20}', { optimize: false }, ['1']], + ['{1..20..2}', { optimize: false }, ['1', '3', '5', '7', '9', '11', '13', '15', '17', '19']], + ['{10..0..2}', { optimize: false }, ['10', '8', '6', '4', '2', '0']], + ['{10..1..2}', { optimize: false }, ['10', '8', '6', '4', '2']], + ['{100..0..5}', { optimize: false }, ['100', '95', '90', '85', '80', '75', '70', '65', '60', '55', '50', '45', '40', '35', '30', '25', '20', '15', '10', '5', '0']], + ['{2..10..1}', { optimize: false }, ['2', '3', '4', '5', '6', '7', '8', '9', '10']], + ['{2..10..2}', { optimize: false }, ['2', '4', '6', '8', '10']], + ['{2..10..3}', { optimize: false }, ['2', '5', '8']], + ['{a..z..2}', { optimize: false }, ['a', 'c', 'e', 'g', 'i', 'k', 'm', 'o', 'q', 's', 'u', 'w', 'y']], + ['{10..0..-2}', { optimize: false }, ['10', '8', '6', '4', '2', '0']], + ['{-1..-10..-2}', { optimize: false }, ['-1', '-3', '-5', '-7', '-9']], + ['{-1..-10..2}', { optimize: false }, ['-1', '-3', '-5', '-7', '-9']], + ['{-10..-2..2}', { optimize: false }, ['-10', '-8', '-6', '-4', '-2']], + ['{-2..-10..1}', { optimize: false }, ['-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10']], + ['{-2..-10..2}', { optimize: false }, ['-2', '-4', '-6', '-8', '-10']], + ['{-2..-10..3}', { optimize: false }, ['-2', '-5', '-8']], + ['{-50..-0..5}', { optimize: false }, ['-50', '-45', '-40', '-35', '-30', '-25', '-20', '-15', '-10', '-5', '0']], + ['{-9..9..3}', { optimize: false }, ['-9', '-6', '-3', '0', '3', '6', '9']], + ['{10..1..-2}', { optimize: false }, ['10', '8', '6', '4', '2']], + ['{100..0..-5}', { optimize: false }, ['100', '95', '90', '85', '80', '75', '70', '65', '60', '55', '50', '45', '40', '35', '30', '25', '20', '15', '10', '5', '0']], + ['{a..e..2}', { optimize: false }, ['a', 'c', 'e']], + ['{E..A..2}', { optimize: false }, ['E', 'C', 'A']], + ['{a..z..2}', { optimize: false }, ['a', 'c', 'e', 'g', 'i', 'k', 'm', 'o', 'q', 's', 'u', 'w', 'y']], + ['{z..a..-2}', { optimize: false }, ['z', 'x', 'v', 't', 'r', 'p', 'n', 'l', 'j', 'h', 'f', 'd', 'b']], + ['{z..a..-2}', { optimize: false }, ['z', 'x', 'v', 't', 'r', 'p', 'n', 'l', 'j', 'h', 'f', 'd', 'b']], + ['{10..0..2}', { optimize: false }, ['10', '8', '6', '4', '2', '0']], + ['{10..0..-2}', { optimize: false }, ['10', '8', '6', '4', '2', '0']], + ['{-50..-0..5}', { optimize: false }, ['-50', '-45', '-40', '-35', '-30', '-25', '-20', '-15', '-10', '-5', '0']], + ['../{1..3}/../foo', {}, ['../1/../foo', '../2/../foo', '../3/../foo']], + ['../{2..10..2}/../foo', { optimize: false }, ['../2/../foo', '../4/../foo', '../6/../foo', '../8/../foo', '../10/../foo']], + ['../{1..3}/../{a,b,c}/foo', {}, ['../1/../a/foo', '../1/../b/foo', '../1/../c/foo', '../2/../a/foo', '../2/../b/foo', '../2/../c/foo', '../3/../a/foo', '../3/../b/foo', '../3/../c/foo']], + ['./{a..z..3}/', { optimize: false }, ['./a/', './d/', './g/', './j/', './m/', './p/', './s/', './v/', './y/']], + ['./{"x,y"}/{a..z..3}/', { minimatch: false, optimize: false }, ['./{x,y}/a/', './{x,y}/d/', './{x,y}/g/', './{x,y}/j/', './{x,y}/m/', './{x,y}/p/', './{x,y}/s/', './{x,y}/v/', './{x,y}/y/']], + ['a/{x,y}/{1..5}c{d,e}f.{md,txt}', {}, ['a/x/1cdf.md', 'a/x/1cdf.txt', 'a/x/1cef.md', 'a/x/1cef.txt', 'a/x/2cdf.md', 'a/x/2cdf.txt', 'a/x/2cef.md', 'a/x/2cef.txt', 'a/x/3cdf.md', 'a/x/3cdf.txt', 'a/x/3cef.md', 'a/x/3cef.txt', 'a/x/4cdf.md', 'a/x/4cdf.txt', 'a/x/4cef.md', 'a/x/4cef.txt', 'a/x/5cdf.md', 'a/x/5cdf.txt', 'a/x/5cef.md', 'a/x/5cef.txt', 'a/y/1cdf.md', 'a/y/1cdf.txt', 'a/y/1cef.md', 'a/y/1cef.txt', 'a/y/2cdf.md', 'a/y/2cdf.txt', 'a/y/2cef.md', 'a/y/2cef.txt', 'a/y/3cdf.md', 'a/y/3cdf.txt', 'a/y/3cef.md', 'a/y/3cef.txt', 'a/y/4cdf.md', 'a/y/4cdf.txt', 'a/y/4cef.md', 'a/y/4cef.txt', 'a/y/5cdf.md', 'a/y/5cdf.txt', 'a/y/5cef.md', 'a/y/5cef.txt']], + ['a/{x,{1..5},y}/c{d}e', {}, ['a/x/c{d}e', 'a/1/c{d}e', 'a/2/c{d}e', 'a/3/c{d}e', 'a/4/c{d}e', 'a/5/c{d}e', 'a/y/c{d}e']] + ]; + + fixtures.forEach(arr => { + if (typeof arr === 'string') { + return; + } + + const options = { ...arr[1] }; + const pattern = arr[0]; + const expected = arr[2]; + + if (options.skip !== true) { + it('should compile: ' + pattern, () => equal(pattern, expected, options)); + } + }); + }); +}); diff --git a/vendor/braces-backport/upstream-tests/test/bash-expanded-sets.js b/vendor/braces-backport/upstream-tests/test/bash-expanded-sets.js new file mode 100644 index 00000000..b5a40cc2 --- /dev/null +++ b/vendor/braces-backport/upstream-tests/test/bash-expanded-sets.js @@ -0,0 +1,241 @@ +'use strict'; + +require('mocha'); +const assert = require('assert').strict; +const bashPath = require('bash-path'); +const cp = require('child_process'); +const braces = require('..'); + +const bash = input => { + return cp.spawnSync(bashPath(), ['-c', `echo ${input}`]) + .stdout.toString() + .split(/\s+/) + .filter(Boolean); +}; + +const equal = (input, expected = bash(input), options) => { + assert.deepEqual(braces.expand(input, options), expected); +}; + +/** + * Bash 4.3 unit tests with `braces.expand()` + */ + +describe('bash - expanded brace sets', () => { + const fixtures = [ + ['a/\\{b,c,d,{x,y}}{e,f\\}/g', {}, ['a/{b,c,d,x}{e,f}/g', 'a/{b,c,d,y}{e,f}/g']], + ['a/\\{b,c,d\\}\\{e,f\\}/g', {}, ['a/{b,c,d}{e,f}/g']], + ['a/\\{b,c,d\\}\\{e,f}/g', {}, ['a/{b,c,d}{e,f}/g']], + ['a/\\{b,c,d\\}{e,f}/g', {}, ['a/{b,c,d}e/g', 'a/{b,c,d}f/g']], + ['a/\\{b,c,d{x,y}}{e,f\\}/g', {}, ['a/{b,c,dx}{e,f}/g', 'a/{b,c,dy}{e,f}/g']], + ['a/\\{b,c,d}{e,f\\}/g', {}, ['a/{b,c,d}{e,f}/g']], + ['a/\\{b,c,d}{e,f}/g', {}, ['a/{b,c,d}e/g', 'a/{b,c,d}f/g']], + ['a/\\{x,y}/cde', {}, ['a/{x,y}/cde']], + ['a/\\{{b,c}{e,f}/g', {}, ['a/{be/g', 'a/{bf/g', 'a/{ce/g', 'a/{cf/g']], + ['a/\\{{b,c}{e,f}\\}/g', {}, ['a/{be}/g', 'a/{bf}/g', 'a/{ce}/g', 'a/{cf}/g']], + ['a/\\{{b,c}{e,f}}/g', {}, ['a/{be}/g', 'a/{bf}/g', 'a/{ce}/g', 'a/{cf}/g']], + ['a/b/{b,c,{d,e{f,g},{w,x}/{y,z}}}/h/i', {}, ['a/b/b/h/i', 'a/b/c/h/i', 'a/b/d/h/i', 'a/b/ef/h/i', 'a/b/eg/h/i', 'a/b/w/y/h/i', 'a/b/w/z/h/i', 'a/b/x/y/h/i', 'a/b/x/z/h/i']], + ['a/{b,c,d}{e,f}/g', {}, ['a/be/g', 'a/bf/g', 'a/ce/g', 'a/cf/g', 'a/de/g', 'a/df/g']], + ['a/{b,c\\,d}{e,f}/g', {}, ['a/be/g', 'a/bf/g', 'a/c,de/g', 'a/c,df/g']], + ['a/{b,c\\}}{e,f}/g', {}, ['a/be/g', 'a/bf/g', 'a/c}e/g', 'a/c}f/g']], + ['a/{b,c}', {}, ['a/b', 'a/c']], + ['a/{b,c}d{e,f}/g', {}, ['a/bde/g', 'a/bdf/g', 'a/cde/g', 'a/cdf/g']], + ['a/{b,c}{e,f}/g', {}, ['a/be/g', 'a/bf/g', 'a/ce/g', 'a/cf/g']], + ['a/{b,c}{e,f}{g,h,i}/k', {}, ['a/beg/k', 'a/beh/k', 'a/bei/k', 'a/bfg/k', 'a/bfh/k', 'a/bfi/k', 'a/ceg/k', 'a/ceh/k', 'a/cei/k', 'a/cfg/k', 'a/cfh/k', 'a/cfi/k']], + ['a/{b,{c,d},e}/f', {}, ['a/b/f', 'a/c/f', 'a/d/f', 'a/e/f']], + ['a/{b,{c,d}/{e,f},g}/h', {}, ['a/b/h', 'a/c/e/h', 'a/c/f/h', 'a/d/e/h', 'a/d/f/h', 'a/g/h']], + ['a/{b{c,d},e{f,g}h{i,j}}/k', {}, ['a/bc/k', 'a/bd/k', 'a/efhi/k', 'a/efhj/k', 'a/eghi/k', 'a/eghj/k']], + ['a/{b{c,d},e}/f', {}, ['a/bc/f', 'a/bd/f', 'a/e/f']], + ['a/{b{c,d}e{f,g}h{i,j}}/k', {}, ['a/{bcefhi}/k', 'a/{bcefhj}/k', 'a/{bceghi}/k', 'a/{bceghj}/k', 'a/{bdefhi}/k', 'a/{bdefhj}/k', 'a/{bdeghi}/k', 'a/{bdeghj}/k']], + ['a/{b{c,d}e{f,g},h{i,j}}/k', {}, ['a/bcef/k', 'a/bceg/k', 'a/bdef/k', 'a/bdeg/k', 'a/hi/k', 'a/hj/k']], + ['a/{x,z}{b,{c,d}/{e,f},g}/h', {}, ['a/xb/h', 'a/xc/e/h', 'a/xc/f/h', 'a/xd/e/h', 'a/xd/f/h', 'a/xg/h', 'a/zb/h', 'a/zc/e/h', 'a/zc/f/h', 'a/zd/e/h', 'a/zd/f/h', 'a/zg/h']], + ['a/{{a,b}/{c,d}}/z', {}, ['a/{a/c}/z', 'a/{a/d}/z', 'a/{b/c}/z', 'a/{b/d}/z']], + ['a/{{b,c}/{d,e}}', {}, ['a/{b/d}', 'a/{b/e}', 'a/{c/d}', 'a/{c/e}']], + ['a/{{b,c}/{d,e}}/f', {}, ['a/{b/d}/f', 'a/{b/e}/f', 'a/{c/d}/f', 'a/{c/e}/f']], + ['a{b}c', {}, ['a{b}c']], + ['foo {1,2} bar', {}, ['foo 1 bar', 'foo 2 bar']], + ['{ }', {}, ['{ }']], + ['{', {}, ['{']], + ['{a,b,{c,d},e}', {}, ['a', 'b', 'c', 'd', 'e']], + ['{a,b,{c,d}e}', {}, ['a', 'b', 'ce', 'de']], + ['{a,b,{c,d}}', {}, ['a', 'b', 'c', 'd']], + ['{a,b{c,d}}', {}, ['a', 'bc', 'bd']], + ['{a,b}/{c,d}', {}, ['a/c', 'a/d', 'b/c', 'b/d']], + ['{a,b}c,d\\}', {}, ['ac,d}', 'bc,d}']], + ['{a,b\\}c,d}', {}, ['a', 'b}c', 'd']], + ['{a,b}{c,d}', {}, ['ac', 'ad', 'bc', 'bd']], + ['{abc}', {}, ['{abc}']], + ['{b{c,d},e}', {}, ['bc', 'bd', 'e']], + ['{b{c,d},e}/f', {}, ['bc/f', 'bd/f', 'e/f']], + ['x,y,{abc},trie', {}, ['x,y,{abc},trie']], + ['{{a,b},{c,d}}', {}, ['a', 'b', 'c', 'd']], + ['{{a,b}/{c,d}}', {}, ['{a/c}', '{a/d}', '{b/c}', '{b/d}']], + ['{{a,b}/{c,d}}/z', {}, ['{a/c}/z', '{a/d}/z', '{b/c}/z', '{b/d}/z']], + ['{}', {}, ['{}']], + + // // should ignore globs + ['}', {}, ['}']], + + // 'should ignore globs', + + ['{generate,{assemble,update,verb}{file,-generate-*},generator}.js', {}, ['generate.js', 'assemblefile.js', 'assemble-generate-*.js', 'updatefile.js', 'update-generate-*.js', 'verbfile.js', 'verb-generate-*.js', 'generator.js']], + ['**/{foo,bar}.js', {}, ['**/foo.js', '**/bar.js']], + ['**/{a,b,c}/*.js', {}, ['**/a/*.js', '**/b/*.js', '**/c/*.js']], + ['**/{a,b,*}/*.js', {}, ['**/a/*.js', '**/b/*.js', '**/*/*.js']], + ['**/{**,b,*}/*.js', {}, ['**/**/*.js', '**/b/*.js', '**/*/*.js']], + ['/usr/{ucb/{ex,edit},lib/{ex,how_ex}}', {}, ['/usr/ucb/ex', '/usr/ucb/edit', '/usr/lib/ex', '/usr/lib/how_ex']], + ['ff{c,b,a}', {}, ['ffc', 'ffb', 'ffa']], + ['f{d,e,f}g', {}, ['fdg', 'feg', 'ffg']], + ['{a,b,c}', {}, ['a', 'b', 'c']], + ['{l,m,n}xyz', {}, ['lxyz', 'mxyz', 'nxyz']], + ['a/{a,b}/{c,d}/e', {}, ['a/a/c/e', 'a/a/d/e', 'a/b/c/e', 'a/b/d/e']], + ['a{b,c}d{e,f}g', {}, ['abdeg', 'abdfg', 'acdeg', 'acdfg']], + ['a/{x,y}/c{d,e}f.{md,txt}', {}, ['a/x/cdf.md', 'a/x/cdf.txt', 'a/x/cef.md', 'a/x/cef.txt', 'a/y/cdf.md', 'a/y/cdf.txt', 'a/y/cef.md', 'a/y/cef.txt']], + ['{a,b}{{a,b},a,b}', {}, ['aa', 'ab', 'aa', 'ab', 'ba', 'bb', 'ba', 'bb']], + ['a{b,c{d,e}f}g', {}, ['abg', 'acdfg', 'acefg']], + ['a{{x,y},z}b', {}, ['axb', 'ayb', 'azb']], + ['f{x,y{g,z}}h', {}, ['fxh', 'fygh', 'fyzh']], + ['a{b,c{d,e},h}x/z', {}, ['abx/z', 'acdx/z', 'acex/z', 'ahx/z']], + ['a{b,c{d,e},h}x{y,z}', {}, ['abxy', 'abxz', 'acdxy', 'acdxz', 'acexy', 'acexz', 'ahxy', 'ahxz']], + ['a{b,c{d,e},{f,g}h}x{y,z}', {}, ['abxy', 'abxz', 'acdxy', 'acdxz', 'acexy', 'acexz', 'afhxy', 'afhxz', 'aghxy', 'aghxz']], + + // 'should not expand escaped braces', + + ['\\{a,b,c,d,e}', {}, ['{a,b,c,d,e}']], + ['a/\\{b,c}/{d,e}/f', {}, ['a/{b,c}/d/f', 'a/{b,c}/e/f']], + ['a/\\{x,y}/cde', {}, ['a/{x,y}/cde']], + ['a/b/c/{x,y\\}', {}, ['a/b/c/{x,y}']], + ['a/{z,\\{a,b,c,d,e}/d', {}, ['a/z/d', 'a/{a/d', 'a/b/d', 'a/c/d', 'a/d/d', 'a/e/d']], + ['abcd{efgh', {}, ['abcd{efgh']], + ['{a,b\\}c,d}', {}, ['a', 'b}c', 'd']], + ['{abc}', {}, ['{abc}']], + ['{x,y,\\{a,b,c\\}}', {}, ['x', 'y', '{a', 'b', 'c}']], + ['{x,y,{abc},trie}', {}, ['x', 'y', '{abc}', 'trie']], + ['{x,y,{a,b,c\\}}', {}, ['{x,y,a', '{x,y,b', '{x,y,c}']], + + 'should not expand escaped commas', + + ['{x\\,y,\\{abc\\},trie}', {}, ['x,y', '{abc}', 'trie']], + ['a{b\\,c\\,d}e', {}, ['a{b,c,d}e']], + ['a{b\\,c}d', {}, ['a{b,c}d']], + ['{abc\\,def}', {}, ['{abc,def}']], + ['{abc\\,def,ghi}', {}, ['abc,def', 'ghi']], + ['a/{b,c}/{x\\,y}/d/e', {}, ['a/b/{x,y}/d/e', 'a/c/{x,y}/d/e']], + + 'should handle empty braces', + + ['{ }', {}, ['{ }']], + ['{', {}, ['{']], + ['{}', {}, ['{}']], + ['}', {}, ['}']], + + 'should escape braces when only one value is defined', + + ['a{b}c', {}, ['a{b}c']], + ['a/b/c{d}e', {}, ['a/b/c{d}e']], + + 'should escape closing braces when open is not defined', + + ['{a,b}c,d}', {}, ['ac,d}', 'bc,d}']], + + 'should not expand braces in sets with es6/bash-like variables', + + ['abc/${ddd}/xyz', {}, ['abc/${ddd}/xyz']], + ['a${b}c', {}, ['a${b}c']], + ['a/{${b},c}/d', {}, ['a/${b}/d', 'a/c/d']], + ['a${b,d}/{foo,bar}c', {}, ['a${b,d}/fooc', 'a${b,d}/barc']], + + 'should support sequence brace operators', + + ['ff{a,b,c}', {}, ['ffa', 'ffb', 'ffc']], + ['f{d,e,f}g', {}, ['fdg', 'feg', 'ffg']], + ['{a,b,c}', {}, ['a', 'b', 'c']], + ['{l,m,n}xyz', {}, ['lxyz', 'mxyz', 'nxyz']], + + 'should expand multiple sets', + + ['a/{a,b}/{c,d}/e', {}, ['a/a/c/e', 'a/a/d/e', 'a/b/c/e', 'a/b/d/e']], + ['a{b,c}d{e,f}g', {}, ['abdeg', 'abdfg', 'acdeg', 'acdfg']], + ['a/{x,y}/c{d,e}f.{md,txt}', {}, ['a/x/cdf.md', 'a/x/cdf.txt', 'a/x/cef.md', 'a/x/cef.txt', 'a/y/cdf.md', 'a/y/cdf.txt', 'a/y/cef.md', 'a/y/cef.txt']], + + 'should expand nested sets', + + ['a{b,c{d,e}f}g', {}, ['abg', 'acdfg', 'acefg']], + ['a{{x,y},z}b', {}, ['axb', 'ayb', 'azb']], + ['f{x,y{g,z}}h', {}, ['fxh', 'fygh', 'fyzh']], + ['a{b,c{d,e},h}x/z', {}, ['abx/z', 'acdx/z', 'acex/z', 'ahx/z']], + ['a{b,c{d,e},h}x{y,z}', {}, ['abxy', 'abxz', 'acdxy', 'acdxz', 'acexy', 'acexz', 'ahxy', 'ahxz']], + ['a{b,c{d,e},{f,g}h}x{y,z}', {}, ['abxy', 'abxz', 'acdxy', 'acdxz', 'acexy', 'acexz', 'afhxy', 'afhxz', 'aghxy', 'aghxz']], + ['a-{b{d,e}}-c', {}, ['a-{bd}-c', 'a-{be}-c']], + + 'should do nothing to glob characters', + + ['a/b/{d,e}/*.js', {}, ['a/b/d/*.js', 'a/b/e/*.js']], + ['a/**/c/{d,e}/f*.js', {}, ['a/**/c/d/f*.js', 'a/**/c/e/f*.js']], + ['a/**/c/{d,e}/f*.{md,txt}', {}, ['a/**/c/d/f*.md', 'a/**/c/d/f*.txt', 'a/**/c/e/f*.md', 'a/**/c/e/f*.txt']], + ['a/b/{d,e,[1-5]}/*.js', {}, ['a/b/d/*.js', 'a/b/e/*.js', 'a/b/[1-5]/*.js']], + + 'should work with leading and trailing commas', + ['a{b,}c', {}, ['abc', 'ac']], + ['a{,b}c', {}, ['ac', 'abc']], + + 'should handle spaces', + ['a{ ,c{d, },h}x', {}, ['a x', 'acdx', 'ac x', 'ahx']], + ['a{ ,c{d, },h} ', {}, ['a ', 'acd ', 'ac ', 'ah ']], + + 'see https://github.com/jonschlinkert/microequal/issues/66', + ['/Users/tobiasreich/Sites/aaa/bbb/ccc 2016/src/**/[^_]*.{html,ejs}', {}, ['/Users/tobiasreich/Sites/aaa/bbb/ccc 2016/src/**/[^_]*.html', '/Users/tobiasreich/Sites/aaa/bbb/ccc 2016/src/**/[^_]*.ejs']], + + 'should handle weirdly-formed brace expansions (fixed in post-bash-3.1)', + + ['a-{b{d,e}}-c', {}, ['a-{bd}-c', 'a-{be}-c']], + ['a-{bdef-{g,i}-c', {}, ['a-{bdef-g-c', 'a-{bdef-i-c']], + + // 'should not expand quoted strings', + + ['{"foo"}{1,2,3}', {}, ['{foo}1', '{foo}2', '{foo}3']], + ['{"foo"}{1,2,3}', { keepQuotes: true }, ['{"foo"}1', '{"foo"}2', '{"foo"}3']], + ['{"x,x"}', { keepQuotes: true }, ['{"x,x"}']], + ['{\'x,x\'}', { keepQuotes: true }, ['{\'x,x\'}']], + + 'should escape outer braces in nested non-sets', + + ['{a-{b,c,d}}', {}, ['{a-b}', '{a-c}', '{a-d}']], + ['{a,{a-{b,c,d}}}', {}, ['a', '{a-b}', '{a-c}', '{a-d}']], + + 'should escape imbalanced braces', + + ['abc{', {}, ['abc{']], + ['{abc{', {}, ['{abc{']], + ['{abc', {}, ['{abc']], + ['}abc', {}, ['}abc']], + ['ab{c', {}, ['ab{c']], + ['ab{c', {}, ['ab{c']], + ['{{a,b}', {}, ['{a', '{b']], + ['{a,b}}', {}, ['a}', 'b}']], + ['a{b{c{d,e}f}gh', {}, ['a{b{cdf}gh', 'a{b{cef}gh']], + ['a{b{c{d,e}f}g}h', {}, ['a{b{cdf}g}h', 'a{b{cef}g}h']], + ['f{x,y{{g,z}}h}', {}, ['fx', 'fy{g}h', 'fy{z}h']], + ['z{a,b},c}d', {}, ['za,c}d', 'zb,c}d']], + ['a{b{c{d,e}f{x,y{{g}h', {}, ['a{b{cdf{x,y{{g}h', 'a{b{cef{x,y{{g}h']], + ['f{x,y{{g}h', {}, ['f{x,y{{g}h']], + ['f{x,y{{g}}h', {}, ['f{x,y{{g}}h']], + ['a{b{c{d,e}f{x,y{}g}h', {}, ['a{b{cdfxh', 'a{b{cdfy{}gh', 'a{b{cefxh', 'a{b{cefy{}gh']], + ['f{x,y{}g}h', {}, ['fxh', 'fy{}gh']], + ['z{a,b{,c}d', {}, ['z{a,bd', 'z{a,bcd']] + ]; + + fixtures.forEach(arr => { + if (typeof arr === 'string') { + return; + } + + const options = { ...arr[1] }; + const pattern = arr[0]; + const expected = arr[2]; + + if (options.skip !== true) { + it('should compile: ' + pattern, () => equal(pattern, expected, options)); + } + }); +}); diff --git a/vendor/braces-backport/upstream-tests/test/bash-spec.js b/vendor/braces-backport/upstream-tests/test/bash-spec.js new file mode 100644 index 00000000..5675f5eb --- /dev/null +++ b/vendor/braces-backport/upstream-tests/test/bash-spec.js @@ -0,0 +1,197 @@ +'use strict'; + +require('mocha'); +const assert = require('assert').strict; +const bashPath = require('bash-path'); +const cp = require('child_process'); +const braces = require('..'); + +const bash = input => { + return cp.spawnSync(bashPath(), ['-c', `echo ${input}`]) + .stdout.toString() + .split(/\s+/) + .filter(Boolean); +}; + +const equal = (input, expected = bash(input), options) => { + assert.deepEqual(braces.expand(input, options), expected); +}; + +/** + * Bash 4.3 unit tests + */ + +describe('bash', () => { + const fixtures = [ + ['{1\\.2}', {}, ['{1.2}']], + ['{1\\.2}', { keepEscaping: true }, ['{1\\.2}']], + ['{"x,x"}', {}, ['{x,x}']], + ['{x","x}', {}, ['{x,x}']], + ['\'{x,x}\'', {}, ['{x,x}']], + ['{x`,`x}', {}, ['{x,x}']], + ['{x`,`x}', { keepQuotes: true }, ['{x`,`x}']], + ['\'{a,b}{{a,b},a,b}\'', {}, ['{a,b}{{a,b},a,b}']], + ['A{b,{d,e},{f,g}}Z', {}, ['AbZ', 'AdZ', 'AeZ', 'AfZ', 'AgZ']], + ['PRE-{a,b}{{a,b},a,b}-POST', {}, ['PRE-aa-POST', 'PRE-ab-POST', 'PRE-aa-POST', 'PRE-ab-POST', 'PRE-ba-POST', 'PRE-bb-POST', 'PRE-ba-POST', 'PRE-bb-POST']], + ['\\{a,b}{{a,b},a,b}', {}, ['{a,b}a', '{a,b}b', '{a,b}a', '{a,b}b']], + ['{{a,b}', {}, ['{a', '{b']], + ['{a,b}}', {}, ['a}', 'b}']], + ['{,}', {}, ['', '']], + ['a{,}', {}, ['a', 'a']], + ['{,}b', {}, ['b', 'b']], + ['a{,}b', {}, ['ab', 'ab']], + ['a{b}c', {}, ['a{b}c']], + ['a{1..5}b', {}, ['a1b', 'a2b', 'a3b', 'a4b', 'a5b']], + ['a{01..5}b', {}, ['a01b', 'a02b', 'a03b', 'a04b', 'a05b']], + ['a{-01..5}b', {}, ['a-01b', 'a000b', 'a001b', 'a002b', 'a003b', 'a004b', 'a005b']], + ['a{-01..5..3}b', {}, ['a-01b', 'a002b', 'a005b']], + ['a{001..9}b', {}, ['a001b', 'a002b', 'a003b', 'a004b', 'a005b', 'a006b', 'a007b', 'a008b', 'a009b']], + ['a{b,c{d,e},{f,g}h}x{y,z', {}, ['abx{y,z', 'acdx{y,z', 'acex{y,z', 'afhx{y,z', 'aghx{y,z']], + ['a{b,c{d,e},{f,g}h}x{y,z\\}', {}, ['abx{y,z}', 'acdx{y,z}', 'acex{y,z}', 'afhx{y,z}', 'aghx{y,z}']], + ['a{b,c{d,e},{f,g}h}x{y,z}', {}, ['abxy', 'abxz', 'acdxy', 'acdxz', 'acexy', 'acexz', 'afhxy', 'afhxz', 'aghxy', 'aghxz']], + ['a{b{c{d,e}f{x,y{{g}h', {}, ['a{b{cdf{x,y{{g}h', 'a{b{cef{x,y{{g}h']], + ['a{b{c{d,e}f{x,y{}g}h', {}, ['a{b{cdfxh', 'a{b{cdfy{}gh', 'a{b{cefxh', 'a{b{cefy{}gh']], + ['a{b{c{d,e}f{x,y}}g}h', {}, ['a{b{cdfx}g}h', 'a{b{cdfy}g}h', 'a{b{cefx}g}h', 'a{b{cefy}g}h']], + ['a{b{c{d,e}f}g}h', {}, ['a{b{cdf}g}h', 'a{b{cef}g}h']], + ['a{{x,y},z}b', {}, ['axb', 'ayb', 'azb']], + ['f{x,y{g,z}}h', {}, ['fxh', 'fygh', 'fyzh']], + ['f{x,y{{g,z}}h', {}, ['f{x,y{g}h', 'f{x,y{z}h']], + ['f{x,y{{g,z}}h}', {}, ['fx', 'fy{g}h', 'fy{z}h']], + ['f{x,y{{g}h', {}, ['f{x,y{{g}h']], + ['f{x,y{{g}}h', {}, ['f{x,y{{g}}h']], + ['f{x,y{}g}h', {}, ['fxh', 'fy{}gh']], + ['z{a,b{,c}d', {}, ['z{a,bd', 'z{a,bcd']], + ['z{a,b},c}d', {}, ['za,c}d', 'zb,c}d']], + ['{-01..5}', {}, ['-01', '000', '001', '002', '003', '004', '005']], + ['{-05..100..5}', {}, ['-05', '000', '005', '010', '015', '020', '025', '030', '035', '040', '045', '050', '055', '060', '065', '070', '075', '080', '085', '090', '095', '100']], + ['{-05..100}', {}, ['-05', '-04', '-03', '-02', '-01', '000', '001', '002', '003', '004', '005', '006', '007', '008', '009', '010', '011', '012', '013', '014', '015', '016', '017', '018', '019', '020', '021', '022', '023', '024', '025', '026', '027', '028', '029', '030', '031', '032', '033', '034', '035', '036', '037', '038', '039', '040', '041', '042', '043', '044', '045', '046', '047', '048', '049', '050', '051', '052', '053', '054', '055', '056', '057', '058', '059', '060', '061', '062', '063', '064', '065', '066', '067', '068', '069', '070', '071', '072', '073', '074', '075', '076', '077', '078', '079', '080', '081', '082', '083', '084', '085', '086', '087', '088', '089', '090', '091', '092', '093', '094', '095', '096', '097', '098', '099', '100']], + ['{0..5..2}', {}, ['0', '2', '4']], + ['{0001..05..2}', {}, ['0001', '0003', '0005']], + ['{0001..-5..2}', {}, ['0001', '-001', '-003', '-005']], + ['{0001..-5..-2}', {}, ['0001', '-001', '-003', '-005']], + ['{0001..5..-2}', {}, ['0001', '0003', '0005']], + ['{01..5}', {}, ['01', '02', '03', '04', '05']], + ['{1..05}', {}, ['01', '02', '03', '04', '05']], + ['{1..05..3}', {}, ['01', '04']], + ['{05..100}', {}, ['005', '006', '007', '008', '009', '010', '011', '012', '013', '014', '015', '016', '017', '018', '019', '020', '021', '022', '023', '024', '025', '026', '027', '028', '029', '030', '031', '032', '033', '034', '035', '036', '037', '038', '039', '040', '041', '042', '043', '044', '045', '046', '047', '048', '049', '050', '051', '052', '053', '054', '055', '056', '057', '058', '059', '060', '061', '062', '063', '064', '065', '066', '067', '068', '069', '070', '071', '072', '073', '074', '075', '076', '077', '078', '079', '080', '081', '082', '083', '084', '085', '086', '087', '088', '089', '090', '091', '092', '093', '094', '095', '096', '097', '098', '099', '100']], + ['{0a..0z}', {}, ['{0a..0z}']], + ['{a,b\\}c,d}', {}, ['a', 'b}c', 'd']], + ['{a,b{c,d}', {}, ['{a,bc', '{a,bd']], + ['{a,b}c,d}', {}, ['ac,d}', 'bc,d}']], + ['{a..F}', {}, ['a', '`', '_', '^', ']', '\\', '[', 'Z', 'Y', 'X', 'W', 'V', 'U', 'T', 'S', 'R', 'Q', 'P', 'O', 'N', 'M', 'L', 'K', 'J', 'I', 'H', 'G', 'F']], + ['{A..f}', {}, ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f']], + ['{a..Z}', {}, ['a', '`', '_', '^', ']', '\\', '[', 'Z']], + ['{A..z}', {}, ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']], + ['{z..A}', {}, ['z', 'y', 'x', 'w', 'v', 'u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a', '`', '_', '^', ']', '\\', '[', 'Z', 'Y', 'X', 'W', 'V', 'U', 'T', 'S', 'R', 'Q', 'P', 'O', 'N', 'M', 'L', 'K', 'J', 'I', 'H', 'G', 'F', 'E', 'D', 'C', 'B', 'A']], + ['{Z..a}', {}, ['Z', '[', '\\', ']', '^', '_', '`', 'a']], + ['{a..F..2}', {}, ['a', '_', ']', '[', 'Y', 'W', 'U', 'S', 'Q', 'O', 'M', 'K', 'I', 'G']], + ['{A..f..02}', {}, ['A', 'C', 'E', 'G', 'I', 'K', 'M', 'O', 'Q', 'S', 'U', 'W', 'Y', '[', ']', '_', 'a', 'c', 'e']], + ['{a..Z..5}', {}, ['a', '\\']], + ['d{a..Z..5}b', {}, ['dab', 'd\\b']], + ['{A..z..10}', {}, ['A', 'K', 'U', '_', 'i', 's']], + ['{z..A..-2}', {}, ['z', 'x', 'v', 't', 'r', 'p', 'n', 'l', 'j', 'h', 'f', 'd', 'b', '`', '^', '\\', 'Z', 'X', 'V', 'T', 'R', 'P', 'N', 'L', 'J', 'H', 'F', 'D', 'B']], + ['{Z..a..20}', {}, ['Z']], + ['{a{,b}', {}, ['{a', '{ab']], + ['{a\\},b}', {}, ['a}', 'b']], + ['{x,y{,}g}', {}, ['x', 'yg', 'yg']], + ['{x,y{}g}', {}, ['x', 'y{}g']], + ['{{a,b}', {}, ['{a', '{b']], + ['{{a,b},c}', {}, ['a', 'b', 'c']], + ['{{a,b}c}', {}, ['{ac}', '{bc}']], + ['{{a,b},}', {}, ['a', 'b', '']], + ['X{{a,b},}X', {}, ['XaX', 'XbX', 'XX']], + ['{{a,b},}c', {}, ['ac', 'bc', 'c']], + ['{{a,b}.}', {}, ['{a.}', '{b.}']], + ['{{a,b}}', {}, ['{a}', '{b}']], + ['X{a..#}X', {}, ['XaX', 'X`X', 'X_X', 'X^X', 'X]X', 'X\\X', 'X[X', 'XZX', 'XYX', 'XXX', 'XWX', 'XVX', 'XUX', 'XTX', 'XSX', 'XRX', 'XQX', 'XPX', 'XOX', 'XNX', 'XMX', 'XLX', 'XKX', 'XJX', 'XIX', 'XHX', 'XGX', 'XFX', 'XEX', 'XDX', 'XCX', 'XBX', 'XAX', 'X@X', 'X?X', 'X>X', 'X=X', 'X { + if (typeof arr === 'string') { + return; + } + + const options = { ...arr[1] }; + const pattern = arr[0]; + const expected = arr[2]; + + if (options.skip === true) { + return; + } + + it('should compile: ' + pattern, () => { + equal(pattern, expected, options); + }); + }); +}); diff --git a/vendor/braces-backport/upstream-tests/test/braces.compile.js b/vendor/braces-backport/upstream-tests/test/braces.compile.js new file mode 100644 index 00000000..04b42b1c --- /dev/null +++ b/vendor/braces-backport/upstream-tests/test/braces.compile.js @@ -0,0 +1,76 @@ +'use strict'; + +require('mocha'); +const assert = require('assert').strict; +const compile = require('../lib/compile'); +const parse = require('../lib/parse'); + +describe('braces.compile()', () => { + describe('errors', () => { + it('should throw an error when invalid args are passed', () => { + assert.throws(() => compile()); + }); + }); + + describe('invalid characters', () => { + it('should escape invalid bracket characters', () => { + assert.equal(compile(parse(']{a,b,c}')), '\\](a|b|c)'); + }); + }); + + describe('sets', () => { + it('should support empty sets', () => { + assert.equal(compile(parse('{a,}')), '(a|)'); + assert.equal(compile(parse('{a,,}')), '(a|)'); + assert.equal(compile(parse('{a,,,}')), '(a|)'); + assert.equal(compile(parse('{a,,,,}')), '(a|)'); + assert.equal(compile(parse('{a,,,,,}')), '(a|)'); + }); + }); + + describe('ranges', () => { + it('should escape braces with invalid ranges', () => { + assert.equal(compile(parse('{a...b}')), '{a...b}'); + assert.equal(compile(parse('{a...b}'), { escapeInvalid: true }), '\\{a...b\\}'); + }); + + it('should expand brace patterns with both sets and ranges', () => { + assert.equal(compile(parse('{a..e,z}')), '(a..e|z)'); + assert.equal(compile(parse('{a..e,a..z}')), '(a..e|a..z)'); + }); + + it('should escape braces with too many range expressions', () => { + assert.equal(compile(parse('{a..e..x..z}')), '{a..e..x..z}'); + assert.equal(compile(parse('{a..e..x..z}'), { escapeInvalid: true }), '\\{a..e..x..z\\}'); + }); + + it('should compile very simple numeric ranges', () => { + assert.equal(compile(parse('{1..5}')), '([1-5])'); + }); + + it('should compile numeric ranges with increments', () => { + assert.equal(compile(parse('{1..5..2}')), '(1|3|5)'); + }); + + it('should compile zero-padded numeric ranges', () => { + assert.equal(compile(parse('{01..05}')), '(0[1-5])'); + }); + + it('should compile zero-padded numeric ranges with increments', () => { + assert.equal(compile(parse('{01..05..2}')), '(01|03|05)'); + assert.equal(compile(parse('{01..05..3}')), '(01|04)'); + }); + }); + + describe('invalid', () => { + it('should escape incomplete brace patterns', () => { + assert.equal(compile(parse(']{a/b')), '\\]{a/b'); + assert.equal(compile(parse(']{a/b'), { escapeInvalid: true }), '\\]\\{a/b'); + }); + + it('should escape non-brace patterns (no sets or ranges)', () => { + assert.equal(compile(parse(']{a/b}')), '\\]{a/b}'); + assert.equal(compile(parse(']{a/b}'), { escapeInvalid: true }), '\\]\\{a/b\\}'); + }); + }); +}); diff --git a/vendor/braces-backport/upstream-tests/test/braces.expand.js b/vendor/braces-backport/upstream-tests/test/braces.expand.js new file mode 100644 index 00000000..c95fbb86 --- /dev/null +++ b/vendor/braces-backport/upstream-tests/test/braces.expand.js @@ -0,0 +1,202 @@ +'use strict'; + +require('mocha'); +const assert = require('assert').strict; +const expand = require('../lib/expand'); +const parse = require('../lib/parse'); +const bashPath = require('bash-path'); +const cp = require('child_process'); +const braces = require('..'); + +const bash = input => { + return cp + .spawnSync(bashPath(), ['-c', `echo ${input}`]) + .stdout.toString() + .split(/\s+/) + .filter(Boolean); +}; + +const equal = (input, expected = bash(input), options) => { + assert.deepEqual(braces.expand(input, options), expected); +}; + +describe('unit tests from brace-expand', () => { + describe('extglobs', () => { + it('should split on commas when braces are inside extglobs', () => { + equal('*(a|{b|c,d})', ['*(a|b|c)', '*(a|d)']); + }); + + it('should not split on commas in extglobs when inside braces', () => { + equal('{a,@(b,c)}', ['a', '@(b,c)']); + equal('{a,*(b|c,d)}', ['a', '*(b|c,d)']); + }); + }); + + describe('expand', () => { + it('should expand an AST', () => { + assert.deepEqual(expand(parse('a/{b,c}/d')), ['a/b/d', 'a/c/d']); + }); + + it('should support expanded nested empty sets', () => { + equal('{`foo,bar`}', ['{`foo,bar`}'], { keepQuotes: true }); + equal('{\\`foo,bar\\`}', ['`foo', 'bar`'], { keepQuotes: true }); + equal('{`foo,bar`}', ['{`foo,bar`}'], { keepQuotes: true }); + equal('{`foo\\,bar`}', ['{`foo\\,bar`}'], { keepQuotes: true }); + + equal('{`foo,bar`}', ['{foo,bar}']); + equal('{\\`foo,bar\\`}', ['`foo', 'bar`']); + equal('{`foo,bar`}', ['{foo,bar}']); + equal('{`foo\\,bar`}', ['{foo\\,bar}']); + + equal('{a,\\\\{a,b}c}', ['a', '\\ac', '\\bc']); + equal('{a,\\{a,b}c}', ['ac}', '{ac}', 'bc}']); + equal('{,eno,thro,ro}ugh', ['ugh', 'enough', 'through', 'rough']); + equal('{,{,eno,thro,ro}ugh}{,out}', [ + '', + 'out', + 'ugh', + 'ughout', + 'enough', + 'enoughout', + 'through', + 'throughout', + 'rough', + 'roughout' + ]); + equal('{{,eno,thro,ro}ugh,}{,out}', [ + 'ugh', + 'ughout', + 'enough', + 'enoughout', + 'through', + 'throughout', + 'rough', + 'roughout', + '', + 'out' + ]); + equal('{,{,a,b}z}{,c}', ['', 'c', 'z', 'zc', 'az', 'azc', 'bz', 'bzc']); + equal('{,{,a,b}z}{c,}', ['c', '', 'zc', 'z', 'azc', 'az', 'bzc', 'bz']); + equal('{,{,a,b}z}{,c,}', ['', 'c', '', 'z', 'zc', 'z', 'az', 'azc', 'az', 'bz', 'bzc', 'bz']); + equal('{,{,a,b}z}{c,d}', ['c', 'd', 'zc', 'zd', 'azc', 'azd', 'bzc', 'bzd']); + equal('{{,a,b}z,}{,c}', ['z', 'zc', 'az', 'azc', 'bz', 'bzc', '', 'c']); + equal('{,a{,b}z,}{,c}', ['', 'c', 'az', 'azc', 'abz', 'abzc', '', 'c']); + equal('{,a{,b},}{,c}', ['', 'c', 'a', 'ac', 'ab', 'abc', '', 'c']); + equal('{,a{,b}}{,c}', ['', 'c', 'a', 'ac', 'ab', 'abc']); + equal('{,b}{,d}', ['', 'd', 'b', 'bd']); + equal('{a,b}{,d}', ['a', 'ad', 'b', 'bd']); + equal('{,a}{z,c}', ['z', 'c', 'az', 'ac']); + equal('{,{a,}}{z,c}', ['z', 'c', 'az', 'ac', 'z', 'c']); + equal('{,{,a}}{z,c}', ['z', 'c', 'z', 'c', 'az', 'ac']); + equal('{,{,a},}{z,c}', ['z', 'c', 'z', 'c', 'az', 'ac', 'z', 'c']); + equal('{{,,a}}{z,c}', ['{}z', '{}c', '{}z', '{}c', '{a}z', '{a}c']); + equal('{{,a},}{z,c}', ['z', 'c', 'az', 'ac', 'z', 'c']); + equal('{,,a}{z,c}', ['z', 'c', 'z', 'c', 'az', 'ac']); + equal('{,{,}}{z,c}', ['z', 'c', 'z', 'c', 'z', 'c']); + equal('{,{a,b}}{,c}', ['', 'c', 'a', 'ac', 'b', 'bc']); + equal('{,{a,}}{,c}', ['', 'c', 'a', 'ac', '', 'c']); + equal('{,{,b}}{,c}', ['', 'c', '', 'c', 'b', 'bc']); + equal('{,{,}}{,c}', ['', 'c', '', 'c', '', 'c']); + equal('{,a}{,c}', ['', 'c', 'a', 'ac']); + equal('{,{,a}b}', ['', 'b', 'ab']); + equal('{,b}', ['', 'b']); + equal('{,b{,a}}', ['', 'b', 'ba']); + equal('{b,{,a}}', ['b', '', 'a']); + equal('{,b}{,d}', ['', 'd', 'b', 'bd']); + equal('{a,b}{,d}', ['a', 'ad', 'b', 'bd']); + }); + }); + + /** + * The following unit tests are from brace-expansion v1.1.6 + * https://github.com/juliangruber/brace-expansion + */ + + describe('brace expansion unit tests from brace-expand', () => { + describe('sequences', () => { + it('numeric sequences', () => { + equal('a{1..2}b{2..3}c', ['a1b2c', 'a1b3c', 'a2b2c', 'a2b3c']); + equal('{1..2}{2..3}', ['12', '13', '22', '23']); + }); + + it('numeric sequences with step count', () => { + equal('{0..8..2}', ['0', '2', '4', '6', '8']); + equal('{1..8..2}', ['1', '3', '5', '7']); + }); + + it('numeric sequence with negative x / y', () => { + equal('{3..-2}', ['3', '2', '1', '0', '-1', '-2']); + }); + + it('alphabetic sequences', () => { + equal('1{a..b}2{b..c}3', ['1a2b3', '1a2c3', '1b2b3', '1b2c3']); + equal('{a..b}{b..c}', ['ab', 'ac', 'bb', 'bc']); + }); + + it('alphabetic sequences with step count', () => { + equal('{a..k..2}', ['a', 'c', 'e', 'g', 'i', 'k']); + equal('{b..k..2}', ['b', 'd', 'f', 'h', 'j']); + }); + }); + + describe('dollar', () => { + it('ignores ${', () => { + equal('${1..3}', ['${1..3}']); + equal('${a,b}${c,d}', ['${a,b}${c,d}']); + equal('x${a,b}x${c,d}x', ['x${a,b}x${c,d}x']); + }); + }); + + describe('empty option', () => { + it('should support empty sets', () => { + equal('-v{,,,,}', ['-v', '-v', '-v', '-v', '-v']); + }); + }); + + describe('negative increments', () => { + it('should support negative steps', () => { + equal('{3..1}', ['3', '2', '1']); + equal('{10..8}', ['10', '9', '8']); + equal('{10..08}', ['10', '09', '08']); + equal('{c..a}', ['c', 'b', 'a']); + + equal('{4..0..2}', ['4', '2', '0']); + equal('{4..0..-2}', ['4', '2', '0']); + equal('{e..a..2}', ['e', 'c', 'a']); + }); + }); + + describe('nested', () => { + it('should support nested sets', () => { + equal('{a,b{1..3},c}', ['a', 'b1', 'b2', 'b3', 'c']); + equal('{{A..E},{a..e}}', ['A', 'B', 'C', 'D', 'E', 'a', 'b', 'c', 'd', 'e']); + equal('ppp{,config,oe{,conf}}', ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']); + }); + }); + + describe('order', () => { + it('should expand in given order', () => { + equal('a{d,c,b}e', ['ade', 'ace', 'abe']); + }); + }); + + describe('pad', () => { + it('should support padding', () => { + equal('{9..11}', ['9', '10', '11']); + equal('{09..11}', ['09', '10', '11']); + }); + }); + }); + + describe('additional brace expansion test', () => { + describe('sequences', () => { + it('zero-padded numeric sequences', () => { + equal('{008..012}', ['008', '009', '010', '011', '012']); + }); + + it('zero-padded numeric sequences with increments', () => { + equal('{008..012..2}', ['008', '010', '012']); + }); + }); + }); +}); diff --git a/vendor/braces-backport/upstream-tests/test/braces.parse.js b/vendor/braces-backport/upstream-tests/test/braces.parse.js new file mode 100644 index 00000000..9158316f --- /dev/null +++ b/vendor/braces-backport/upstream-tests/test/braces.parse.js @@ -0,0 +1,49 @@ +'use strict'; + +require('mocha'); +const assert = require('assert').strict; +const parse = require('../lib/parse'); + +describe('braces.parse()', () => { + describe('errors', () => { + it('should throw an error when string exceeds max safe length', () => { + const MAX_LENGTH = 1024 * 64; + assert.throws(() => parse('.'.repeat(MAX_LENGTH + 2))); + }); + }); + + describe('valid', () => { + it('should return an AST', () => { + const ast = parse('a/{b,c}/d'); + const brace = ast.nodes.find(node => node.type === 'brace'); + assert(brace); + assert.equal(brace.nodes.length, 5); + }); + + it('should ignore braces inside brackets', () => { + const ast = parse('a/[{b,c}]/d'); + assert.equal(ast.nodes[1].type, 'text'); + assert.equal(ast.nodes[1].value, 'a/[{b,c}]/d'); + }); + + it('should parse braces with brackets inside', () => { + const ast = parse('a/{a,b,[{c,d}]}/e'); + const brace = ast.nodes[2]; + const bracket = brace.nodes.find(node => node.value[0] === '['); + assert(bracket); + assert.equal(bracket.value, '[{c,d}]'); + }); + }); + + describe('invalid', () => { + it('should escape standalone closing braces', () => { + const one = parse('}'); + assert.equal(one.nodes[1].type, 'text'); + assert.equal(one.nodes[1].value, '}'); + + const two = parse('a}b'); + assert.equal(two.nodes[1].type, 'text'); + assert.equal(two.nodes[1].value, 'a}b'); + }); + }); +}); diff --git a/vendor/braces-backport/upstream-tests/test/minimatch.js b/vendor/braces-backport/upstream-tests/test/minimatch.js new file mode 100644 index 00000000..c2d42f24 --- /dev/null +++ b/vendor/braces-backport/upstream-tests/test/minimatch.js @@ -0,0 +1,28 @@ +'use strict'; + +const assert = require('assert').strict; +const braces = require('..'); + +/** + * minimatch v3.0.3 unit tests + */ + +describe('brace expansion', () => { + const units = [ + ['a{b,c{d,e},{f,g}h}x{y,z}', ['abxy', 'abxz', 'acdxy', 'acdxz', 'acexy', 'acexz', 'afhxy', 'afhxz', 'aghxy', 'aghxz']], + ['a{1..5}b', ['a1b', 'a2b', 'a3b', 'a4b', 'a5b']], + ['a{b}c', ['a{b}c']], + ['a{00..05}b', ['a00b', 'a01b', 'a02b', 'a03b', 'a04b', 'a05b']], + ['z{a,b},c}d', ['za,c}d', 'zb,c}d']], + ['z{a,b{,c}d', ['z{a,bd', 'z{a,bcd']], + ['a{b{c{d,e}f}g}h', ['a{b{cdf}g}h', 'a{b{cef}g}h']], + ['a{b{c{d,e}f{x,y}}g}h', ['a{b{cdfx}g}h', 'a{b{cdfy}g}h', 'a{b{cefx}g}h', 'a{b{cefy}g}h']], + ['a{b{c{d,e}f{x,y{}g}h', ['a{b{cdfxh', 'a{b{cdfy{}gh', 'a{b{cefxh', 'a{b{cefy{}gh']] + ]; + + units.forEach(unit => { + it('should expand: ' + unit[0], () => { + assert.deepEqual(braces.expand(unit[0]), unit[1], unit[0]); + }); + }); +}); diff --git a/vendor/braces-backport/upstream-tests/test/multiples.js b/vendor/braces-backport/upstream-tests/test/multiples.js new file mode 100644 index 00000000..e433aa41 --- /dev/null +++ b/vendor/braces-backport/upstream-tests/test/multiples.js @@ -0,0 +1,58 @@ +'use strict'; + +const assert = require('assert').strict; +const braces = require('..'); + +const equal = (input, expected, options) => { + assert.deepEqual(braces.expand(input, options), expected); +}; + +describe('multiples', () => { + const patterns = [ + ['-v{,,,,}', ['-v', '-v', '-v', '-v', '-v']], + ['-v{,,,,}{,}', ['-v', '-v', '-v', '-v', '-v', '-v', '-v', '-v', '-v', '-v']], + ['a/b{,}', ['a/b', 'a/b']], + ['a/{,}/b', ['a//b', 'a//b']], + ['a/{,}{c,d}/e', ['a/c/e', 'a/d/e', 'a/c/e', 'a/d/e']], + ['a/{a,b,{,}{,}{,},c}/b', ['a/a/b', 'a/b/b', 'a//b', 'a//b', 'a//b', 'a//b', 'a//b', 'a//b', 'a//b', 'a//b', 'a/c/b']], + ['a/{a,b,{,},c}/b', ['a/a/b', 'a/b/b', 'a//b', 'a//b', 'a/c/b']], + ['a/{a,b,{,}{,}{,}}/b', ['a/a/b', 'a/b/b', 'a//b', 'a//b', 'a//b', 'a//b', 'a//b', 'a//b', 'a//b', 'a//b']], + ['a/{b,cz{,}}/{d{,},ef}{,}', ['a/b/d', 'a/b/d', 'a/b/d', 'a/b/d', 'a/b/ef', 'a/b/ef', 'a/cz/d', 'a/cz/d', 'a/cz/d', 'a/cz/d', 'a/cz/ef', 'a/cz/ef', 'a/cz/d', 'a/cz/d', 'a/cz/d', 'a/cz/d', 'a/cz/ef', 'a/cz/ef']], + ['a/{b,cz}{,}/{d{,},ef}{,}', ['a/b/d', 'a/b/d', 'a/b/d', 'a/b/d', 'a/b/ef', 'a/b/ef', 'a/b/d', 'a/b/d', 'a/b/d', 'a/b/d', 'a/b/ef', 'a/b/ef', 'a/cz/d', 'a/cz/d', 'a/cz/d', 'a/cz/d', 'a/cz/ef', 'a/cz/ef', 'a/cz/d', 'a/cz/d', 'a/cz/d', 'a/cz/d', 'a/cz/ef', 'a/cz/ef']], + ['a/{b,c{,}}', ['a/b', 'a/c', 'a/c']], + ['a/{b,c{,}}/{,}', ['a/b/', 'a/b/', 'a/c/', 'a/c/', 'a/c/', 'a/c/']], + ['a/{b,c}/{,}', ['a/b/', 'a/b/', 'a/c/', 'a/c/']], + ['a/{b,c}{,}/d{,}', ['a/b/d', 'a/b/d', 'a/b/d', 'a/b/d', 'a/c/d', 'a/c/d', 'a/c/d', 'a/c/d']], + ['a/{b,c}{,}/{d,e{,}}', ['a/b/d', 'a/b/e', 'a/b/e', 'a/b/d', 'a/b/e', 'a/b/e', 'a/c/d', 'a/c/e', 'a/c/e', 'a/c/d', 'a/c/e', 'a/c/e']], + ['a/{b,c}{,}/{d,e}{,}', ['a/b/d', 'a/b/d', 'a/b/e', 'a/b/e', 'a/b/d', 'a/b/d', 'a/b/e', 'a/b/e', 'a/c/d', 'a/c/d', 'a/c/e', 'a/c/e', 'a/c/d', 'a/c/d', 'a/c/e', 'a/c/e']], + ['a/{b,c}{,}/{d{,},e}{,}', ['a/b/d', 'a/b/d', 'a/b/d', 'a/b/d', 'a/b/e', 'a/b/e', 'a/b/d', 'a/b/d', 'a/b/d', 'a/b/d', 'a/b/e', 'a/b/e', 'a/c/d', 'a/c/d', 'a/c/d', 'a/c/d', 'a/c/e', 'a/c/e', 'a/c/d', 'a/c/d', 'a/c/d', 'a/c/d', 'a/c/e', 'a/c/e']], + ['a/{c,d}/{x,y{,}}/e', ['a/c/x/e', 'a/c/y/e', 'a/c/y/e', 'a/d/x/e', 'a/d/y/e', 'a/d/y/e']], + ['a/{c,d}{,}/e', ['a/c/e', 'a/c/e', 'a/d/e', 'a/d/e']], + ['a{,,,,,}', ['a', 'a', 'a', 'a', 'a', 'a']], + ['a{,,,,,}{,}', ['a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a']], + ['a{,,,,,}{,,}', ['a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a']], + ['a{,,,,,}{,,}{,}', ['a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a']], + ['a{,,,,}', ['a', 'a', 'a', 'a', 'a']], + ['a{,,,}', ['a', 'a', 'a', 'a']], + ['a{,,}', ['a', 'a', 'a']], + ['a{,,}{,,}{,,}{,}/b', ['a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b', 'a/b']], + ['a{,,}{,}', ['a', 'a', 'a', 'a', 'a', 'a']], + ['a{,}', ['a', 'a']], + ['a{,}/{c,d}/e', ['a/c/e', 'a/d/e', 'a/c/e', 'a/d/e']], + ['a{,}b', ['ab', 'ab']], + ['a{,}{,}', ['a', 'a', 'a', 'a']], + ['a{,}{,}{,}', ['a', 'a', 'a', 'a', 'a', 'a', 'a', 'a']], + ['a{,}{,}{,}{,}', ['a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a']], + ['one/{a{,}{,}}/{b/c{,,}{,}{,,}{,}}/two', ['one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two', 'one/{a}/{b/c}/two']], + ['{,}', ['', '']], + ['{,}a/{,}', ['a/', 'a/', 'a/', 'a/']], + ['{,}{,}', ['', '', '', '']], + ['{a,b{,}{,}{,},c}d', ['ad', 'bd', 'bd', 'bd', 'bd', 'bd', 'bd', 'bd', 'bd', 'cd']], + ['{a,b{,}{,}{,}}', ['a', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b']], + ['{a{,,}b{,}}', ['{ab}', '{ab}', '{ab}', '{ab}', '{ab}', '{ab}']] + ]; + + patterns.forEach(pattern => { + it('should expand: ' + pattern[0], () => equal(pattern[0], pattern[1])); + }); +}); diff --git a/vendor/braces-backport/upstream-tests/test/readme.js b/vendor/braces-backport/upstream-tests/test/readme.js new file mode 100644 index 00000000..a3bc702e --- /dev/null +++ b/vendor/braces-backport/upstream-tests/test/readme.js @@ -0,0 +1,48 @@ +'use strict'; + +require('mocha'); +const assert = require('assert').strict; +const braces = require('..'); + +describe('Examples from README.md', () => { + describe('Brace Expansion vs. Compilation', () => { + it('Compiled', () => { + assert.deepEqual(braces('a/{x,y,z}/b'), ['a/(x|y|z)/b']); + assert.deepEqual(braces(['a/{01..20}/b', 'a/{1..5}/b']), [ + 'a/(0[1-9]|1[0-9]|20)/b', + 'a/([1-5])/b' + ]); + }); + + it('Expanded', () => { + assert.deepEqual(braces('a/{x,y,z}/b', { expand: true }), ['a/x/b', 'a/y/b', 'a/z/b']); + assert.deepEqual(braces.expand('{01..10}'), [ + '01', + '02', + '03', + '04', + '05', + '06', + '07', + '08', + '09', + '10' + ]); + }); + }); + + describe('Sequences', () => { + it('first set of examples', () => { + assert.deepEqual(braces.expand('{1..3}'), ['1', '2', '3']); + assert.deepEqual(braces.expand('a/{1..3}/b'), ['a/1/b', 'a/2/b', 'a/3/b']); + assert.deepEqual(braces('{a..c}', { expand: true }), ['a', 'b', 'c']); + assert.deepEqual(braces('foo/{a..c}', { expand: true }), ['foo/a', 'foo/b', 'foo/c']); + }); + + it('zero-padding examples', () => { + // supports zero-padded ranges + assert.deepEqual(braces('a/{01..03}/b'), ['a/(0[1-3])/b']); + assert.deepEqual(braces('a/{001..300}/b'), ['a/(00[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)/b']); + }); + }); +}); diff --git a/vendor/braces-backport/upstream-tests/test/regression.js b/vendor/braces-backport/upstream-tests/test/regression.js new file mode 100644 index 00000000..544044ac --- /dev/null +++ b/vendor/braces-backport/upstream-tests/test/regression.js @@ -0,0 +1,437 @@ +'use strict'; + +require('mocha'); +const assert = require('assert').strict; +const braces = require('..'); + +const equal = (input, expected, options) => { + assert.deepEqual(braces.expand(input, options), expected); +}; + +describe('braces tests from 1.8.5', () => { + it('braces', () => { + equal('ff{c,b,a}', ['ffc', 'ffb', 'ffa']); + equal('f{d,e,f}g', ['fdg', 'feg', 'ffg']); + equal('{l,n,m}xyz', ['lxyz', 'nxyz', 'mxyz']); + equal('{abc\\,d,ef}', ['abc,d', 'ef']); + equal('{abc}', ['{abc}']); + + equal('\\{a,b,c,d,e}', ['{a,b,c,d,e}']); + equal('{x,y,\\{a,b,c}}', ['x}', 'y}', '{a}', 'b}', 'c}']); + equal('{x\\,y,\\{abc\\},trie}', ['x,y', '{abc}', 'trie']); + + equal('/usr/{ucb/{ex,edit},lib/{ex,how_ex}}', ['/usr/ucb/ex', '/usr/ucb/edit', '/usr/lib/ex', '/usr/lib/how_ex']); + + equal('{}', ['{}']); + equal('{ }', ['{ }']); + equal('}', ['}']); + equal('{', ['{']); + equal('abcd{efgh', ['abcd{efgh']); + + equal('foo {1,2} bar', ['foo 1 bar', 'foo 2 bar']); + }); + + it('new sequence brace operators', () => { + equal('{1..10}', ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']); + equal('{0..10,braces}', ['0..10', 'braces']); + equal('{braces,{0..10}}', ['braces', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']); + equal('{{0..10},braces}', ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'braces']); + equal('x{{0..10},braces}y', ['x0y', 'x1y', 'x2y', 'x3y', 'x4y', 'x5y', 'x6y', 'x7y', 'x8y', 'x9y', 'x10y', 'xbracesy']); + }); + + it('ranges', () => { + equal('{3..3}', ['3']); + equal('x{3..3}y', ['x3y']); + equal('{10..1}', ['10', '9', '8', '7', '6', '5', '4', '3', '2', '1']); + equal('{10..1}y', ['10y', '9y', '8y', '7y', '6y', '5y', '4y', '3y', '2y', '1y']); + equal('x{10..1}y', ['x10y', 'x9y', 'x8y', 'x7y', 'x6y', 'x5y', 'x4y', 'x3y', 'x2y', 'x1y']); + equal('{a..f}', ['a', 'b', 'c', 'd', 'e', 'f']); + equal('{f..a}', ['f', 'e', 'd', 'c', 'b', 'a']); + + equal('{a..A}', ['a', '`', '_', '^', ']', '\\', '[', 'Z', 'Y', 'X', 'W', 'V', 'U', 'T', 'S', 'R', 'Q', 'P', 'O', 'N', 'M', 'L', 'K', 'J', 'I', 'H', 'G', 'F', 'E', 'D', 'C', 'B', 'A']); + equal('{A..a}', ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a']); + + equal('{f..f}', ['f']); + equal('0{1..9} {10..20}', ['01 10', '01 11', '01 12', '01 13', '01 14', '01 15', '01 16', '01 17', '01 18', '01 19', '01 20', '02 10', '02 11', '02 12', '02 13', '02 14', '02 15', '02 16', '02 17', '02 18', '02 19', '02 20', '03 10', '03 11', '03 12', '03 13', '03 14', '03 15', '03 16', '03 17', '03 18', '03 19', '03 20', '04 10', '04 11', '04 12', '04 13', '04 14', '04 15', '04 16', '04 17', '04 18', '04 19', '04 20', '05 10', '05 11', '05 12', '05 13', '05 14', '05 15', '05 16', '05 17', '05 18', '05 19', '05 20', '06 10', '06 11', '06 12', '06 13', '06 14', '06 15', '06 16', '06 17', '06 18', '06 19', '06 20', '07 10', '07 11', '07 12', '07 13', '07 14', '07 15', '07 16', '07 17', '07 18', '07 19', '07 20', '08 10', '08 11', '08 12', '08 13', '08 14', '08 15', '08 16', '08 17', '08 18', '08 19', '08 20', '09 10', '09 11', '09 12', '09 13', '09 14', '09 15', '09 16', '09 17', '09 18', '09 19', '09 20']); + }); + + it('mixes are incorrectly-formed brace expansions', () => { + // the first one is valid, but Bash fails on it + equal('{1..f}', ['1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f']); + equal('{f..1}', ['f', 'e', 'd', 'c', 'b', 'a', '`', '_', '^', ']', '\\', '[', 'Z', 'Y', 'X', 'W', 'V', 'U', 'T', 'S', 'R', 'Q', 'P', 'O', 'N', 'M', 'L', 'K', 'J', 'I', 'H', 'G', 'F', 'E', 'D', 'C', 'B', 'A', '@', '?', '>', '=', '<', ';', ':', '9', '8', '7', '6', '5', '4', '3', '2', '1']); + }); + + it('do negative numbers work?', () => { + equal('{-1..-10}', ['-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10']); + equal('{-20..0}', ['-20', '-19', '-18', '-17', '-16', '-15', '-14', '-13', '-12', '-11', '-10', '-9', '-8', '-7', '-6', '-5', '-4', '-3', '-2', '-1', '0']); + }); + + it('weirdly-formed brace expansions -- fixed in post-bash-3.1', () => { + equal('{-1..-10}', ['-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10']); + equal('{-20..0}', ['-20', '-19', '-18', '-17', '-16', '-15', '-14', '-13', '-12', '-11', '-10', '-9', '-8', '-7', '-6', '-5', '-4', '-3', '-2', '-1', '0']); + equal('a-{b{d,e}}-c', ['a-{bd}-c', 'a-{be}-c']); + + equal('a-{bdef-{g,i}-c', ['a-{bdef-g-c', 'a-{bdef-i-c']); + + equal('{"klklkl"}{1,2,3}', ['{klklkl}1', '{klklkl}2', '{klklkl}3']); + equal('{"x,x"}', ['{x,x}']); + }); + + it('numerical ranges with steps', () => { + equal('{1..10..2}', ['1', '3', '5', '7', '9']); + equal('{-1..-10..2}', ['-1', '-3', '-5', '-7', '-9']); + equal('{-1..-10..-2}', ['-1', '-3', '-5', '-7', '-9']); + + equal('{10..1..-2}', ['10', '8', '6', '4', '2']); + equal('{10..1..2}', ['10', '8', '6', '4', '2']); + + equal('{1..20..2}', ['1', '3', '5', '7', '9', '11', '13', '15', '17', '19']); + equal('{1..20..20}', ['1']); + + equal('{100..0..5}', ['100', '95', '90', '85', '80', '75', '70', '65', '60', '55', '50', '45', '40', '35', '30', '25', '20', '15', '10', '5', '0']); + equal('{100..0..-5}', ['100', '95', '90', '85', '80', '75', '70', '65', '60', '55', '50', '45', '40', '35', '30', '25', '20', '15', '10', '5', '0']); + }); + + it('alpha ranges with steps', () => { + equal('{a..z}', ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']); + equal('{a..z..2}', ['a', 'c', 'e', 'g', 'i', 'k', 'm', 'o', 'q', 's', 'u', 'w', 'y']); + equal('{z..a..-2}', ['z', 'x', 'v', 't', 'r', 'p', 'n', 'l', 'j', 'h', 'f', 'd', 'b']); + }); + + it('make sure brace expansion handles ints > 2**31 - 1 using intmax_t', () => { + equal('{2147483645..2147483649}', ['2147483645', '2147483646', '2147483647', '2147483648', '2147483649']); + }); + + it('unwanted zero-padding -- fixed post-bash-4.0', () => { + equal('{10..0..2}', ['10', '8', '6', '4', '2', '0']); + equal('{10..0..-2}', ['10', '8', '6', '4', '2', '0']); + equal('{-50..-0..5}', ['-50', '-45', '-40', '-35', '-30', '-25', '-20', '-15', '-10', '-5', '0']); + }); + + it('bad', () => { + equal('{1..10.f}', ['{1..10.f}']); + equal('{1..ff}', ['{1..ff}']); + equal('{1..10..ff}', ['{1..10..ff}']); + equal('{1.20..2}', ['{1.20..2}']); + equal('{1..20..f2}', ['{1..20..f2}']); + equal('{1..20..2f}', ['{1..20..2f}']); + equal('{1..2f..2}', ['{1..2f..2}']); + equal('{1..ff..2}', ['{1..ff..2}']); + equal('{1..ff}', ['{1..ff}']); + equal('{1..0f}', ['{1..0f}']); + equal('{1..10f}', ['{1..10f}']); + equal('{1..10.f}', ['{1..10.f}']); + equal('{1..10.f}', ['{1..10.f}']); + }); +}); + +describe('bash tests', () => { + describe('brace expansion', () => { + it('should return an empty array when no braces are found', () => { + equal('', []); + }); + + it('should expand emty sets', () => { + equal('a{,}', ['a', 'a']); + equal('{,}b', ['b', 'b']); + equal('a{,}b', ['ab', 'ab']); + equal('a{,}', ['a', 'a']); + equal('a{,}{,}', ['a', 'a', 'a', 'a']); + equal('a{,}{,}{,}', ['a', 'a', 'a', 'a', 'a', 'a', 'a', 'a']); + equal('{a,b{,}{,}{,}}', ['a', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b']); + equal('a{,}/{c,d}/e', ['a/c/e', 'a/d/e', 'a/c/e', 'a/d/e']); + equal('{a,b{,}{,}{,},c}d', ['ad', 'bd', 'bd', 'bd', 'bd', 'bd', 'bd', 'bd', 'bd', 'cd']); + }); + + it('should eliminate dupes in repeated strings', () => { + equal('a{,}', ['a'], { nodupes: true }); + equal('a{,}{,}', ['a'], { nodupes: true }); + equal('a{,}{,}{,}', ['a'], { nodupes: true }); + equal('{a,b{,}{,}{,}}', ['a', 'b'], { nodupes: true }); + equal('{a,b{,}{,}{,},c}d', ['ad', 'bd', 'cd'], { nodupes: true }); + equal('{a,b{,}{,}{,},c}d', ['ad', 'bd', 'cd'], { nodupes: true }); + }); + + it('should work with no braces', () => { + equal('abc', ['abc']); + }); + + it('should work with no commas', () => { + equal('a{b}c', ['a{b}c']); + }); + + it('should work with no commas in `bash` mode', () => { + equal('a{b}c', ['a{b}c']); + }); + + it('should handle spaces', () => { + equal('a{ ,c{d, },h}x', ['a x', 'acdx', 'ac x', 'ahx']); + equal('a{ ,c{d, },h} ', ['a ', 'acd ', 'ac ', 'ah ']); + + // see https://github.com/jonschlinkert/micromatch/issues/66 + equal('/Users/tobiasreich/Sites/aaa/bbb/ccc 2016/src/**/[^_]*.{html,ejs}', [ + '/Users/tobiasreich/Sites/aaa/bbb/ccc 2016/src/**/[^_]*.html', + '/Users/tobiasreich/Sites/aaa/bbb/ccc 2016/src/**/[^_]*.ejs' + ]); + }); + + it('should handle empty braces', () => { + equal('{ }', ['{ }']); + equal('{}', ['{}']); + equal('}', ['}']); + equal('{', ['{']); + equal('{,}', ['', '']); + }); + + it('should handle imbalanced braces', () => { + equal('a-{bdef-{g,i}-c', ['a-{bdef-g-c', 'a-{bdef-i-c']); + equal('abc{', ['abc{']); + equal('{abc{', ['{abc{']); + equal('{abc', ['{abc']); + equal('}abc', ['}abc']); + equal('ab{c', ['ab{c']); + equal('ab{c', ['ab{c']); + equal('{{a,b}', ['{a', '{b']); + equal('{a,b}}', ['a}', 'b}']); + equal('abcd{efgh', ['abcd{efgh']); + equal('a{b{c{d,e}f}g}h', ['a{b{cdf}g}h', 'a{b{cef}g}h']); + equal('f{x,y{{g,z}}h}', ['fx', 'fy{g}h', 'fy{z}h']); + equal('z{a,b},c}d', ['za,c}d', 'zb,c}d']); + equal('a{b{c{d,e}f{x,y{{g}h', ['a{b{cdf{x,y{{g}h', 'a{b{cef{x,y{{g}h']); + equal('f{x,y{{g}h', ['f{x,y{{g}h']); + equal('f{x,y{{g}}h', ['f{x,y{{g}}h']); + equal('a{b{c{d,e}f{x,y{}g}h', ['a{b{cdfxh', 'a{b{cdfy{}gh', 'a{b{cefxh', 'a{b{cefy{}gh']); + equal('f{x,y{}g}h', ['fxh', 'fy{}gh']); + equal('z{a,b{,c}d', ['z{a,bd', 'z{a,bcd']); + }); + + it('should handle invalid braces in `bash mode`:', () => { + equal('a{b{c{d,e}f}g}h', ['a{b{cdf}g}h', 'a{b{cef}g}h']); + equal('f{x,y{{g,z}}h}', ['fx', 'fy{g}h', 'fy{z}h']); + equal('z{a,b},c}d', ['za,c}d', 'zb,c}d']); + equal('a{b{c{d,e}f{x,y{{g}h', ['a{b{cdf{x,y{{g}h', 'a{b{cef{x,y{{g}h']); + equal('f{x,y{{g}h', ['f{x,y{{g}h']); + equal('f{x,y{{g}}h', ['f{x,y{{g}}h']); + }); + + it('should return invalid braces:', () => { + equal('{0..10,braces}', ['0..10', 'braces']); + }); + + it('should not expand quoted strings.', () => { + equal('{"x,x"}', ['{x,x}']); + equal('{"klklkl"}{1,2,3}', ['{klklkl}1', '{klklkl}2', '{klklkl}3']); + }); + + it('should work with one value', () => { + equal('a{b}c', ['a{b}c']); + equal('a/b/c{d}e', ['a/b/c{d}e']); + }); + + it('should work with one value in `bash` mode', () => { + equal('a{b}c', ['a{b}c']); + equal('a/b/c{d}e', ['a/b/c{d}e']); + }); + + it('should work with nested non-sets', () => { + equal('foo {1,2} bar', ['foo 1 bar', 'foo 2 bar']); + equal('{a-{b,c,d}}', ['{a-b}', '{a-c}', '{a-d}']); + equal('{a,{a-{b,c,d}}}', ['a', '{a-b}', '{a-c}', '{a-d}']); + }); + + it('should work with nested non-sets in `bash` mode', () => { + equal('{a-{b,c,d}}', ['{a-b}', '{a-c}', '{a-d}']); + equal('{a,{a-{b,c,d}}}', ['a', '{a-b}', '{a-c}', '{a-d}']); + }); + + it('should not expand dots with leading slashes (escaped or paths).', () => { + equal('a{b,c/*/../d}e', ['abe', 'ac/*/../de']); + equal('a{b,b,c/../b}d', ['abd', 'abd', 'ac/../bd']); + }); + + it('should work with commas.', () => { + equal('a{b,}c', ['abc', 'ac']); + equal('a{,b}c', ['ac', 'abc']); + }); + + it('should expand sets', () => { + equal('a/{x,y}/cde', ['a/x/cde', 'a/y/cde']); + equal('a/b/c/{x,y}', ['a/b/c/x', 'a/b/c/y']); + equal('ff{c,b,a}', ['ffc', 'ffb', 'ffa']); + equal('f{d,e,f}g', ['fdg', 'feg', 'ffg']); + equal('{l,n,m}xyz', ['lxyz', 'nxyz', 'mxyz']); + equal('{x,y,{abc},trie}', ['x', 'y', '{abc}', 'trie']); + }); + + it('should expand multiple sets', () => { + equal('a/{a,b}/{c,d}/e', ['a/a/c/e', 'a/a/d/e', 'a/b/c/e', 'a/b/d/e']); + equal('a{b,c}d{e,f}g', ['abdeg', 'abdfg', 'acdeg', 'acdfg']); + equal('a/{x,y}/c{d,e}f.{md,txt}', ['a/x/cdf.md', 'a/x/cdf.txt', 'a/x/cef.md', 'a/x/cef.txt', 'a/y/cdf.md', 'a/y/cdf.txt', 'a/y/cef.md', 'a/y/cef.txt']); + }); + + it('should expand nested sets', () => { + equal('a/{b,c,{d,e}}/g', ['a/b/g', 'a/c/g', 'a/d/g', 'a/e/g']); + equal('a/{a,b}/{c,d}/e', ['a/a/c/e', 'a/a/d/e', 'a/b/c/e', 'a/b/d/e']); + equal('{a,b}{{a,b},a,b}', ['aa', 'ab', 'aa', 'ab', 'ba', 'bb', 'ba', 'bb']); + equal('/usr/{ucb/{ex,edit},lib/{ex,how_ex}}', ['/usr/ucb/ex', '/usr/ucb/edit', '/usr/lib/ex', '/usr/lib/how_ex']); + equal('a{b,c{d,e}f}g', ['abg', 'acdfg', 'acefg']); + equal('a{{x,y},z}b', ['axb', 'ayb', 'azb']); + equal('f{x,y{g,z}}h', ['fxh', 'fygh', 'fyzh']); + equal('a{b,c{d,e},h}x/z', ['abx/z', 'acdx/z', 'acex/z', 'ahx/z']); + equal('a{b,c{d,e},h}x{y,z}', ['abxy', 'abxz', 'acdxy', 'acdxz', 'acexy', 'acexz', 'ahxy', 'ahxz']); + equal('a{b,c{d,e},{f,g}h}x{y,z}', ['abxy', 'abxz', 'acdxy', 'acdxz', 'acexy', 'acexz', 'afhxy', 'afhxz', 'aghxy', 'aghxz']); + equal('a-{b{d,e}}-c', ['a-{bd}-c', 'a-{be}-c']); + }); + + it('should expand with globs.', () => { + equal('a/b/{d,e}/*.js', ['a/b/d/*.js', 'a/b/e/*.js']); + equal('a/**/c/{d,e}/f*.js', ['a/**/c/d/f*.js', 'a/**/c/e/f*.js']); + equal('a/**/c/{d,e}/f*.{md,txt}', ['a/**/c/d/f*.md', 'a/**/c/d/f*.txt', 'a/**/c/e/f*.md', 'a/**/c/e/f*.txt']); + }); + + it('should expand with brackets.', () => { + equal('a/b/{d,e,[1-5]}/*.js', ['a/b/d/*.js', 'a/b/e/*.js', 'a/b/[1-5]/*.js']); + }); + }); + + describe('escaping:', () => { + it('should not expand strings with es6/bash-like variables.', () => { + equal('abc/${ddd}/xyz', ['abc/${ddd}/xyz']); + equal('a${b}c', ['a${b}c']); + equal('a/{${b},c}/d', ['a/${b}/d', 'a/c/d']); + equal('a${b,d}/{foo,bar}c', ['a${b,d}/fooc', 'a${b,d}/barc']); + }); + + it('should not expand escaped commas.', () => { + equal('a{b\\,c}d', ['a{b,c}d']); + equal('a{b\\,c\\,d}e', ['a{b,c,d}e']); + equal('{abc\\,def}', ['{abc,def}']); + equal('{abc\\,def,ghi}', ['abc,def', 'ghi']); + equal('a/{b,c}/{x\\,y}/d/e', ['a/b/{x,y}/d/e', 'a/c/{x,y}/d/e']); + }); + + it('should return sets with escaped commas in `bash` mode.', () => { + equal('a/{b,c}/{x\\,y}/d/e', ['a/b/{x,y}/d/e', 'a/c/{x,y}/d/e']); + }); + + it('should not expand escaped braces.', () => { + equal('{a,b\\}c,d}', ['a', 'b}c', 'd']); + equal('\\{a,b,c,d,e}', ['{a,b,c,d,e}']); + equal('a/{b,\\{a,b,c,d,e}/d', ['a/b/d', 'a/{a/d', 'a/b/d', 'a/c/d', 'a/d/d', 'a/e/d']); + equal('a/\\{b,c}/{d,e}/f', ['a/{b,c}/d/f', 'a/{b,c}/e/f']); + }); + + it('should not expand escaped braces or commas.', () => { + equal('{x\\,y,\\{abc\\},trie}', ['x,y', '{abc}', 'trie']); + }); + }); +}); + +describe('range expansion', () => { + it('should expand numerical ranges', () => { + equal('a{0..3}d', ['a0d', 'a1d', 'a2d', 'a3d']); + equal('x{10..1}y', ['x10y', 'x9y', 'x8y', 'x7y', 'x6y', 'x5y', 'x4y', 'x3y', 'x2y', 'x1y']); + equal('x{3..3}y', ['x3y']); + equal('{-1..-10}', ['-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10']); + equal('{-20..0}', ['-20', '-19', '-18', '-17', '-16', '-15', '-14', '-13', '-12', '-11', '-10', '-9', '-8', '-7', '-6', '-5', '-4', '-3', '-2', '-1', '0']); + equal('{1..10}', ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']); + equal('{1..3}', ['1', '2', '3']); + equal('{1..9}', ['1', '2', '3', '4', '5', '6', '7', '8', '9']); + equal('{3..3}', ['3']); + equal('{5..8}', ['5', '6', '7', '8']); + }); + + it('should expand alphabetical ranges', () => { + equal('0{a..d}0', ['0a0', '0b0', '0c0', '0d0']); + equal('a/{b..d}/e', ['a/b/e', 'a/c/e', 'a/d/e']); + equal('{a..A}', ['a', '`', '_', '^', ']', '\\', '[', 'Z', 'Y', 'X', 'W', 'V', 'U', 'T', 'S', 'R', 'Q', 'P', 'O', 'N', 'M', 'L', 'K', 'J', 'I', 'H', 'G', 'F', 'E', 'D', 'C', 'B', 'A']); + equal('{A..a}', ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a']); + equal('{a..e}', ['a', 'b', 'c', 'd', 'e']); + equal('{A..E}', ['A', 'B', 'C', 'D', 'E']); + equal('{a..f}', ['a', 'b', 'c', 'd', 'e', 'f']); + equal('{a..z}', ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']); + equal('{E..A}', ['E', 'D', 'C', 'B', 'A']); + equal('{f..a}', ['f', 'e', 'd', 'c', 'b', 'a']); + equal('{f..f}', ['f']); + }); + + it('should use steps with alphabetical ranges', () => { + equal('{a..e..2}', ['a', 'c', 'e']); + equal('{E..A..2}', ['E', 'C', 'A']); + }); + + it('should not try to expand ranges with decimals', () => { + equal('{1.1..2.1}', ['{1.1..2.1}']); + }); + + it('should expand negative ranges', () => { + equal('{z..a..-2}', ['z', 'x', 'v', 't', 'r', 'p', 'n', 'l', 'j', 'h', 'f', 'd', 'b']); + equal('{-10..-1}', ['-10', '-9', '-8', '-7', '-6', '-5', '-4', '-3', '-2', '-1']); + equal('{0..-5}', ['0', '-1', '-2', '-3', '-4', '-5']); + equal('{9..-4}', ['9', '8', '7', '6', '5', '4', '3', '2', '1', '0', '-1', '-2', '-3', '-4']); + }); + + it('should expand multiple ranges:', () => { + equal('a/{b..d}/e/{f..h}', ['a/b/e/f', 'a/b/e/g', 'a/b/e/h', 'a/c/e/f', 'a/c/e/g', 'a/c/e/h', 'a/d/e/f', 'a/d/e/g', 'a/d/e/h']); + }); + + it('should work with dots in file paths', () => { + equal('../{1..3}/../foo', ['../1/../foo', '../2/../foo', '../3/../foo']); + }); + + it('should expand ranges using steps:', () => { + equal('{-1..-10..-2}', ['-1', '-3', '-5', '-7', '-9']); + equal('{-1..-10..2}', ['-1', '-3', '-5', '-7', '-9']); + equal('{-50..-0..5}', ['-50', '-45', '-40', '-35', '-30', '-25', '-20', '-15', '-10', '-5', '0']); + equal('{1..10..2}', ['1', '3', '5', '7', '9']); + equal('{1..20..20}', ['1']); + equal('{1..20..2}', ['1', '3', '5', '7', '9', '11', '13', '15', '17', '19']); + equal('{10..0..-2}', ['10', '8', '6', '4', '2', '0']); + equal('{10..0..2}', ['10', '8', '6', '4', '2', '0']); + equal('{10..1..-2}', ['10', '8', '6', '4', '2']); + equal('{10..1..2}', ['10', '8', '6', '4', '2']); + equal('{10..1}', ['10', '9', '8', '7', '6', '5', '4', '3', '2', '1']); + equal('{10..1}y', ['10y', '9y', '8y', '7y', '6y', '5y', '4y', '3y', '2y', '1y']); + equal('{100..0..-5}', ['100', '95', '90', '85', '80', '75', '70', '65', '60', '55', '50', '45', '40', '35', '30', '25', '20', '15', '10', '5', '0']); + equal('{100..0..5}', ['100', '95', '90', '85', '80', '75', '70', '65', '60', '55', '50', '45', '40', '35', '30', '25', '20', '15', '10', '5', '0']); + equal('{a..z..2}', ['a', 'c', 'e', 'g', 'i', 'k', 'm', 'o', 'q', 's', 'u', 'w', 'y']); + equal('{1..10..1}', ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']); + equal('{1..10..2}', ['1', '3', '5', '7', '9']); + equal('{1..20..20}', ['1']); + equal('{1..20..2}', ['1', '3', '5', '7', '9', '11', '13', '15', '17', '19']); + equal('{10..1..-2}', ['10', '8', '6', '4', '2']); + equal('{10..1..2}', ['10', '8', '6', '4', '2']); + equal('{2..10..1}', ['2', '3', '4', '5', '6', '7', '8', '9', '10']); + equal('{2..10..2}', ['2', '4', '6', '8', '10']); + equal('{2..10..3}', ['2', '5', '8']); + }); + + it('should expand negative ranges using steps:', () => { + equal('{-1..-10..-2}', ['-1', '-3', '-5', '-7', '-9']); + equal('{-1..-10..2}', ['-1', '-3', '-5', '-7', '-9']); + equal('{-10..-2..2}', ['-10', '-8', '-6', '-4', '-2']); + equal('{-2..-10..1}', ['-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10']); + equal('{-2..-10..2}', ['-2', '-4', '-6', '-8', '-10']); + equal('{-2..-10..3}', ['-2', '-5', '-8']); + equal('{-9..9..3}', ['-9', '-6', '-3', '0', '3', '6', '9']); + }); + + it('should expand mixed ranges and sets:', () => { + equal('x{{0..10},braces}y', ['x0y', 'x1y', 'x2y', 'x3y', 'x4y', 'x5y', 'x6y', 'x7y', 'x8y', 'x9y', 'x10y', 'xbracesy']); + equal('{{0..10},braces}', ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'braces']); + equal('{2147483645..2147483649}', ['2147483645', '2147483646', '2147483647', '2147483648', '2147483649']); + }); + + it('should return invalid ranges:', () => { + equal('{1.20..2}', ['{1.20..2}']); + equal('{1..0f}', ['{1..0f}']); + equal('{1..10..ff}', ['{1..10..ff}']); + equal('{1..10.f}', ['{1..10.f}']); + equal('{1..10f}', ['{1..10f}']); + equal('{1..20..2f}', ['{1..20..2f}']); + equal('{1..20..f2}', ['{1..20..f2}']); + equal('{1..2f..2}', ['{1..2f..2}']); + equal('{1..ff..2}', ['{1..ff..2}']); + equal('{1..ff}', ['{1..ff}']); + }); +}); diff --git a/vendor/braces-backport/upstream/braces-3.0.3.tgz b/vendor/braces-backport/upstream/braces-3.0.3.tgz new file mode 100644 index 00000000..7ca6e9b7 Binary files /dev/null and b/vendor/braces-backport/upstream/braces-3.0.3.tgz differ