mirror of
https://github.com/hoverkraft-tech/compose-action.git
synced 2026-01-10 22:53:06 +08:00
upgrade: docker-compose to v2 (#30)
* upgrade: docker-compose - user docker compose instead * remove: yarn and clean format js file
This commit is contained in:
parent
5382748b79
commit
0645acf21a
10
main.js
10
main.js
@ -2,6 +2,12 @@ const core = require("@actions/core");
|
|||||||
const compose = require("docker-compose");
|
const compose = require("docker-compose");
|
||||||
const utils = require("./utils");
|
const utils = require("./utils");
|
||||||
|
|
||||||
|
// Use docker compose v2
|
||||||
|
// ref: https://github.com/PDMLab/docker-compose/tree/master#import-for-docker-compose-v2
|
||||||
|
// The migration of Docker was done with Docker Compose. Use the official plugin instead.
|
||||||
|
// ref: https://docs.docker.com/compose/migrate/
|
||||||
|
const composeV2 = compose.v2;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const composeFiles = utils.parseComposeFiles(
|
const composeFiles = utils.parseComposeFiles(
|
||||||
core.getMultilineInput("compose-file")
|
core.getMultilineInput("compose-file")
|
||||||
@ -21,8 +27,8 @@ try {
|
|||||||
|
|
||||||
const promise =
|
const promise =
|
||||||
services.length > 0
|
services.length > 0
|
||||||
? compose.upMany(services, options)
|
? composeV2.upMany(services, options)
|
||||||
: compose.upAll(options);
|
: composeV2.upAll(options);
|
||||||
|
|
||||||
promise
|
promise
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|||||||
1
node_modules/.bin/yarn
generated
vendored
Symbolic link
1
node_modules/.bin/yarn
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../yarn/bin/yarn.js
|
||||||
1
node_modules/.bin/yarnpkg
generated
vendored
Symbolic link
1
node_modules/.bin/yarnpkg
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../yarn/bin/yarn.js
|
||||||
1576
node_modules/.package-lock.json
generated
vendored
1576
node_modules/.package-lock.json
generated
vendored
File diff suppressed because it is too large
Load Diff
169
node_modules/.yarn-integrity
generated
vendored
Normal file
169
node_modules/.yarn-integrity
generated
vendored
Normal file
@ -0,0 +1,169 @@
|
|||||||
|
{
|
||||||
|
"systemParams": "darwin-x64-115",
|
||||||
|
"modulesFolders": [
|
||||||
|
"node_modules"
|
||||||
|
],
|
||||||
|
"flags": [],
|
||||||
|
"linkedModules": [],
|
||||||
|
"topLevelPatterns": [
|
||||||
|
"@actions/core@^1.8.2",
|
||||||
|
"@actions/github@^4.0.0",
|
||||||
|
"docker-compose@^0.24.0",
|
||||||
|
"eslint-config-prettier@^8.5.0",
|
||||||
|
"eslint-plugin-prettier@^4.2.1",
|
||||||
|
"eslint@^8.24.0",
|
||||||
|
"prettier@^2.7.1",
|
||||||
|
"yarn@^1.22.19"
|
||||||
|
],
|
||||||
|
"lockfileEntries": {
|
||||||
|
"@aashutoshrathi/word-wrap@^1.2.3": "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf",
|
||||||
|
"@actions/core@^1.8.2": "https://registry.yarnpkg.com/@actions/core/-/core-1.10.0.tgz#44551c3c71163949a2f06e94d9ca2157a0cfac4f",
|
||||||
|
"@actions/github@^4.0.0": "https://registry.yarnpkg.com/@actions/github/-/github-4.0.0.tgz#d520483151a2bf5d2dc9cd0f20f9ac3a2e458816",
|
||||||
|
"@actions/http-client@^1.0.8": "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.11.tgz#c58b12e9aa8b159ee39e7dd6cbd0e91d905633c0",
|
||||||
|
"@actions/http-client@^2.0.1": "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.1.0.tgz#b6d8c3934727d6a50d10d19f00a711a964599a9f",
|
||||||
|
"@eslint-community/eslint-utils@^4.2.0": "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59",
|
||||||
|
"@eslint-community/regexpp@^4.4.0": "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.1.tgz#cdd35dce4fa1a89a4fd42b1599eb35b3af408884",
|
||||||
|
"@eslint/eslintrc@^2.1.0": "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.0.tgz#82256f164cc9e0b59669efc19d57f8092706841d",
|
||||||
|
"@eslint/js@8.44.0": "https://registry.yarnpkg.com/@eslint/js/-/js-8.44.0.tgz#961a5903c74139390478bdc808bcde3fc45ab7af",
|
||||||
|
"@humanwhocodes/config-array@^0.11.10": "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2",
|
||||||
|
"@humanwhocodes/module-importer@^1.0.1": "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c",
|
||||||
|
"@humanwhocodes/object-schema@^1.2.1": "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45",
|
||||||
|
"@nodelib/fs.scandir@2.1.5": "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5",
|
||||||
|
"@nodelib/fs.stat@2.0.5": "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b",
|
||||||
|
"@nodelib/fs.walk@^1.2.8": "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a",
|
||||||
|
"@octokit/auth-token@^2.4.4": "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36",
|
||||||
|
"@octokit/core@^3.0.0": "https://registry.yarnpkg.com/@octokit/core/-/core-3.6.0.tgz#3376cb9f3008d9b3d110370d90e0a1fcd5fe6085",
|
||||||
|
"@octokit/endpoint@^6.0.1": "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658",
|
||||||
|
"@octokit/graphql@^4.5.8": "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3",
|
||||||
|
"@octokit/openapi-types@^12.11.0": "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-12.11.0.tgz#da5638d64f2b919bca89ce6602d059f1b52d3ef0",
|
||||||
|
"@octokit/plugin-paginate-rest@^2.2.3": "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz#7f12532797775640dbb8224da577da7dc210c87e",
|
||||||
|
"@octokit/plugin-rest-endpoint-methods@^4.0.0": "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.15.1.tgz#91a064bee99d0ffcef74a04357e1cf15c27d1cd0",
|
||||||
|
"@octokit/request-error@^2.0.5": "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677",
|
||||||
|
"@octokit/request-error@^2.1.0": "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677",
|
||||||
|
"@octokit/request@^5.6.0": "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0",
|
||||||
|
"@octokit/request@^5.6.3": "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0",
|
||||||
|
"@octokit/types@^6.0.3": "https://registry.yarnpkg.com/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04",
|
||||||
|
"@octokit/types@^6.13.0": "https://registry.yarnpkg.com/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04",
|
||||||
|
"@octokit/types@^6.16.1": "https://registry.yarnpkg.com/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04",
|
||||||
|
"@octokit/types@^6.40.0": "https://registry.yarnpkg.com/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04",
|
||||||
|
"acorn-jsx@^5.3.2": "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937",
|
||||||
|
"acorn@^8.9.0": "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5",
|
||||||
|
"ajv@^6.10.0": "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4",
|
||||||
|
"ajv@^6.12.4": "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4",
|
||||||
|
"ansi-regex@^5.0.1": "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304",
|
||||||
|
"ansi-styles@^4.1.0": "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937",
|
||||||
|
"argparse@^2.0.1": "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38",
|
||||||
|
"balanced-match@^1.0.0": "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee",
|
||||||
|
"before-after-hook@^2.2.0": "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c",
|
||||||
|
"brace-expansion@^1.1.7": "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
|
||||||
|
"callsites@^3.0.0": "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73",
|
||||||
|
"chalk@^4.0.0": "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01",
|
||||||
|
"color-convert@^2.0.1": "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3",
|
||||||
|
"color-name@~1.1.4": "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2",
|
||||||
|
"concat-map@0.0.1": "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b",
|
||||||
|
"cross-spawn@^7.0.2": "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6",
|
||||||
|
"debug@^4.1.1": "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865",
|
||||||
|
"debug@^4.3.2": "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865",
|
||||||
|
"deep-is@^0.1.3": "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831",
|
||||||
|
"deprecation@^2.0.0": "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919",
|
||||||
|
"deprecation@^2.3.1": "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919",
|
||||||
|
"docker-compose@^0.24.0": "https://registry.yarnpkg.com/docker-compose/-/docker-compose-0.24.1.tgz#09f9a2408395b8adf80feaacf65f6e2a4b119866",
|
||||||
|
"doctrine@^3.0.0": "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961",
|
||||||
|
"escape-string-regexp@^4.0.0": "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34",
|
||||||
|
"eslint-config-prettier@^8.5.0": "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348",
|
||||||
|
"eslint-plugin-prettier@^4.2.1": "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b",
|
||||||
|
"eslint-scope@^7.2.0": "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.0.tgz#f21ebdafda02352f103634b96dd47d9f81ca117b",
|
||||||
|
"eslint-visitor-keys@^3.3.0": "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994",
|
||||||
|
"eslint-visitor-keys@^3.4.1": "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994",
|
||||||
|
"eslint@^8.24.0": "https://registry.yarnpkg.com/eslint/-/eslint-8.44.0.tgz#51246e3889b259bbcd1d7d736a0c10add4f0e500",
|
||||||
|
"espree@^9.6.0": "https://registry.yarnpkg.com/espree/-/espree-9.6.0.tgz#80869754b1c6560f32e3b6929194a3fe07c5b82f",
|
||||||
|
"esquery@^1.4.2": "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b",
|
||||||
|
"esrecurse@^4.3.0": "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921",
|
||||||
|
"estraverse@^5.1.0": "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123",
|
||||||
|
"estraverse@^5.2.0": "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123",
|
||||||
|
"esutils@^2.0.2": "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64",
|
||||||
|
"fast-deep-equal@^3.1.1": "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525",
|
||||||
|
"fast-deep-equal@^3.1.3": "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525",
|
||||||
|
"fast-diff@^1.1.2": "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0",
|
||||||
|
"fast-json-stable-stringify@^2.0.0": "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633",
|
||||||
|
"fast-levenshtein@^2.0.6": "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917",
|
||||||
|
"fastq@^1.6.0": "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a",
|
||||||
|
"file-entry-cache@^6.0.1": "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027",
|
||||||
|
"find-up@^5.0.0": "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc",
|
||||||
|
"flat-cache@^3.0.4": "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11",
|
||||||
|
"flatted@^3.1.0": "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787",
|
||||||
|
"fs.realpath@^1.0.0": "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f",
|
||||||
|
"glob-parent@^6.0.2": "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3",
|
||||||
|
"glob@^7.1.3": "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b",
|
||||||
|
"globals@^13.19.0": "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82",
|
||||||
|
"graphemer@^1.4.0": "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6",
|
||||||
|
"has-flag@^4.0.0": "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b",
|
||||||
|
"ignore@^5.2.0": "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324",
|
||||||
|
"import-fresh@^3.0.0": "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b",
|
||||||
|
"import-fresh@^3.2.1": "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b",
|
||||||
|
"imurmurhash@^0.1.4": "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea",
|
||||||
|
"inflight@^1.0.4": "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9",
|
||||||
|
"inherits@2": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c",
|
||||||
|
"is-extglob@^2.1.1": "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2",
|
||||||
|
"is-glob@^4.0.0": "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084",
|
||||||
|
"is-glob@^4.0.3": "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084",
|
||||||
|
"is-path-inside@^3.0.3": "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283",
|
||||||
|
"is-plain-object@^5.0.0": "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344",
|
||||||
|
"isexe@^2.0.0": "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10",
|
||||||
|
"js-yaml@^4.1.0": "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602",
|
||||||
|
"json-schema-traverse@^0.4.1": "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660",
|
||||||
|
"json-stable-stringify-without-jsonify@^1.0.1": "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651",
|
||||||
|
"levn@^0.4.1": "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade",
|
||||||
|
"locate-path@^6.0.0": "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286",
|
||||||
|
"lodash.merge@^4.6.2": "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a",
|
||||||
|
"minimatch@^3.0.5": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b",
|
||||||
|
"minimatch@^3.1.1": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b",
|
||||||
|
"minimatch@^3.1.2": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b",
|
||||||
|
"ms@2.1.2": "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009",
|
||||||
|
"natural-compare@^1.4.0": "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7",
|
||||||
|
"node-fetch@^2.6.7": "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba",
|
||||||
|
"once@^1.3.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1",
|
||||||
|
"once@^1.4.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1",
|
||||||
|
"optionator@^0.9.3": "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64",
|
||||||
|
"p-limit@^3.0.2": "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b",
|
||||||
|
"p-locate@^5.0.0": "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834",
|
||||||
|
"parent-module@^1.0.0": "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2",
|
||||||
|
"path-exists@^4.0.0": "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3",
|
||||||
|
"path-is-absolute@^1.0.0": "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f",
|
||||||
|
"path-key@^3.1.0": "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375",
|
||||||
|
"prelude-ls@^1.2.1": "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396",
|
||||||
|
"prettier-linter-helpers@^1.0.0": "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b",
|
||||||
|
"prettier@^2.7.1": "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da",
|
||||||
|
"punycode@^2.1.0": "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f",
|
||||||
|
"queue-microtask@^1.2.2": "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243",
|
||||||
|
"resolve-from@^4.0.0": "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6",
|
||||||
|
"reusify@^1.0.4": "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76",
|
||||||
|
"rimraf@^3.0.2": "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a",
|
||||||
|
"run-parallel@^1.1.9": "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee",
|
||||||
|
"shebang-command@^2.0.0": "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea",
|
||||||
|
"shebang-regex@^3.0.0": "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172",
|
||||||
|
"strip-ansi@^6.0.1": "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9",
|
||||||
|
"strip-json-comments@^3.1.0": "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006",
|
||||||
|
"strip-json-comments@^3.1.1": "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006",
|
||||||
|
"supports-color@^7.1.0": "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da",
|
||||||
|
"text-table@^0.2.0": "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4",
|
||||||
|
"tr46@~0.0.3": "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a",
|
||||||
|
"tunnel@0.0.6": "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c",
|
||||||
|
"tunnel@^0.0.6": "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c",
|
||||||
|
"type-check@^0.4.0": "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1",
|
||||||
|
"type-check@~0.4.0": "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1",
|
||||||
|
"type-fest@^0.20.2": "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4",
|
||||||
|
"universal-user-agent@^6.0.0": "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee",
|
||||||
|
"uri-js@^4.2.2": "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e",
|
||||||
|
"uuid@^8.3.2": "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2",
|
||||||
|
"webidl-conversions@^3.0.0": "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871",
|
||||||
|
"whatwg-url@^5.0.0": "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d",
|
||||||
|
"which@^2.0.1": "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1",
|
||||||
|
"wrappy@1": "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f",
|
||||||
|
"yaml@^2.2.2": "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b",
|
||||||
|
"yarn@^1.22.19": "https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz#4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447",
|
||||||
|
"yocto-queue@^0.1.0": "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
|
||||||
|
},
|
||||||
|
"files": [],
|
||||||
|
"artifacts": {}
|
||||||
|
}
|
||||||
2
node_modules/word-wrap/LICENSE → node_modules/@aashutoshrathi/word-wrap/LICENSE
generated
vendored
2
node_modules/word-wrap/LICENSE → node_modules/@aashutoshrathi/word-wrap/LICENSE
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2014-2017, Jon Schlinkert
|
Copyright (c) 2014-2016, Jon Schlinkert
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
4
node_modules/word-wrap/README.md → node_modules/@aashutoshrathi/word-wrap/README.md
generated
vendored
4
node_modules/word-wrap/README.md → node_modules/@aashutoshrathi/word-wrap/README.md
generated
vendored
@ -50,7 +50,7 @@ wrap(str, {width: 60});
|
|||||||
|
|
||||||
Type: `String`
|
Type: `String`
|
||||||
|
|
||||||
Default: `` (two spaces)
|
Default: `` (none)
|
||||||
|
|
||||||
The string to use at the beginning of each line.
|
The string to use at the beginning of each line.
|
||||||
|
|
||||||
@ -179,4 +179,4 @@ Released under the [MIT License](LICENSE).
|
|||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 02, 2017._
|
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 02, 2017._
|
||||||
@ -16,7 +16,7 @@ declare namespace wrap {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The string to use at the beginning of each line.
|
* The string to use at the beginning of each line.
|
||||||
* @default ´ ´ (two spaces)
|
* @default ´´ (none)
|
||||||
*/
|
*/
|
||||||
indent?: string;
|
indent?: string;
|
||||||
|
|
||||||
@ -47,4 +47,4 @@ declare namespace wrap {
|
|||||||
*/
|
*/
|
||||||
cut?: boolean;
|
cut?: boolean;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
12
node_modules/word-wrap/index.js → node_modules/@aashutoshrathi/word-wrap/index.js
generated
vendored
12
node_modules/word-wrap/index.js → node_modules/@aashutoshrathi/word-wrap/index.js
generated
vendored
@ -1,10 +1,16 @@
|
|||||||
/*!
|
/*!
|
||||||
* word-wrap <https://github.com/jonschlinkert/word-wrap>
|
* word-wrap <https://github.com/jonschlinkert/word-wrap>
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
* Copyright (c) 2014-2023, Jon Schlinkert.
|
||||||
* Released under the MIT License.
|
* Released under the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
function trimTabAndSpaces(str) {
|
||||||
|
const lines = str.split('\n');
|
||||||
|
const trimmedLines = lines.map((line) => line.trimEnd());
|
||||||
|
return trimmedLines.join('\n');
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = function(str, options) {
|
module.exports = function(str, options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
if (str == null) {
|
if (str == null) {
|
||||||
@ -14,7 +20,7 @@ module.exports = function(str, options) {
|
|||||||
var width = options.width || 50;
|
var width = options.width || 50;
|
||||||
var indent = (typeof options.indent === 'string')
|
var indent = (typeof options.indent === 'string')
|
||||||
? options.indent
|
? options.indent
|
||||||
: ' ';
|
: '';
|
||||||
|
|
||||||
var newline = options.newline || '\n' + indent;
|
var newline = options.newline || '\n' + indent;
|
||||||
var escape = typeof options.escape === 'function'
|
var escape = typeof options.escape === 'function'
|
||||||
@ -36,7 +42,7 @@ module.exports = function(str, options) {
|
|||||||
}).join(newline);
|
}).join(newline);
|
||||||
|
|
||||||
if (options.trim === true) {
|
if (options.trim === true) {
|
||||||
result = result.replace(/[ \t]*$/gm, '');
|
result = trimTabAndSpaces(result);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "word-wrap",
|
"name": "@aashutoshrathi/word-wrap",
|
||||||
"description": "Wrap words to a specified length.",
|
"description": "Wrap words to a specified length.",
|
||||||
"version": "1.2.3",
|
"version": "1.2.6",
|
||||||
"homepage": "https://github.com/jonschlinkert/word-wrap",
|
"homepage": "https://github.com/aashutoshrathi/word-wrap",
|
||||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
|
"Aashutosh Rathi <aashutoshrathi@gmail.com>",
|
||||||
"Danilo Sampaio <danilo.sampaio@gmail.com> (localhost:8080)",
|
"Danilo Sampaio <danilo.sampaio@gmail.com> (localhost:8080)",
|
||||||
"Fede Ramirez <i@2fd.me> (https://2fd.github.io)",
|
"Fede Ramirez <i@2fd.me> (https://2fd.github.io)",
|
||||||
"Joe Hildebrand <joe-github@cursive.net> (https://twitter.com/hildjj)",
|
"Joe Hildebrand <joe-github@cursive.net> (https://twitter.com/hildjj)",
|
||||||
@ -14,9 +15,12 @@
|
|||||||
"Wolfgang Faust (http://www.linestarve.com)",
|
"Wolfgang Faust (http://www.linestarve.com)",
|
||||||
"Zach Hale <zachhale@gmail.com> (http://zachhale.com)"
|
"Zach Hale <zachhale@gmail.com> (http://zachhale.com)"
|
||||||
],
|
],
|
||||||
"repository": "jonschlinkert/word-wrap",
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/aashutoshrathi/word-wrap.git"
|
||||||
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/jonschlinkert/word-wrap/issues"
|
"url": "https://github.com/aashutoshrathi/word-wrap/issues"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"files": [
|
"files": [
|
||||||
@ -32,7 +36,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp-format-md": "^0.1.11",
|
"gulp-format-md": "^0.1.11",
|
||||||
"mocha": "^3.2.0"
|
"mocha": "^10.2.0"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"break",
|
"break",
|
||||||
1
node_modules/@actions/core/node_modules/.bin/uuid
generated
vendored
Symbolic link
1
node_modules/@actions/core/node_modules/.bin/uuid
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../uuid/dist/bin/uuid
|
||||||
@ -1,18 +1,11 @@
|
|||||||
|
# `@actions/http-client`
|
||||||
|
|
||||||
<p align="center">
|
A lightweight HTTP client optimized for building actions.
|
||||||
<img src="actions.png">
|
|
||||||
</p>
|
|
||||||
|
|
||||||
# Actions Http-Client
|
|
||||||
|
|
||||||
[](https://github.com/actions/http-client/actions)
|
|
||||||
|
|
||||||
A lightweight HTTP client optimized for use with actions, TypeScript with generics and async await.
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- HTTP client with TypeScript generics and async/await/Promises
|
- HTTP client with TypeScript generics and async/await/Promises
|
||||||
- Typings included so no need to acquire separately (great for intellisense and no versioning drift)
|
- Typings included!
|
||||||
- [Proxy support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners#using-a-proxy-server-with-self-hosted-runners) just works with actions and the runner
|
- [Proxy support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners#using-a-proxy-server-with-self-hosted-runners) just works with actions and the runner
|
||||||
- Targets ES2019 (runner runs actions with node 12+). Only supported on node 12+.
|
- Targets ES2019 (runner runs actions with node 12+). Only supported on node 12+.
|
||||||
- Basic, Bearer and PAT Support out of the box. Extensible handlers for others.
|
- Basic, Bearer and PAT Support out of the box. Extensible handlers for others.
|
||||||
@ -28,7 +21,7 @@ npm install @actions/http-client --save
|
|||||||
|
|
||||||
## Samples
|
## Samples
|
||||||
|
|
||||||
See the [HTTP](./__tests__) tests for detailed examples.
|
See the [tests](./__tests__) for detailed examples.
|
||||||
|
|
||||||
## Errors
|
## Errors
|
||||||
|
|
||||||
@ -39,13 +32,13 @@ The HTTP client does not throw unless truly exceptional.
|
|||||||
* A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body.
|
* A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body.
|
||||||
* Redirects (3xx) will be followed by default.
|
* Redirects (3xx) will be followed by default.
|
||||||
|
|
||||||
See [HTTP tests](./__tests__) for detailed examples.
|
See the [tests](./__tests__) for detailed examples.
|
||||||
|
|
||||||
## Debugging
|
## Debugging
|
||||||
|
|
||||||
To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible:
|
To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible:
|
||||||
|
|
||||||
```
|
```shell
|
||||||
export NODE_DEBUG=http
|
export NODE_DEBUG=http
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -63,17 +56,18 @@ We welcome PRs. Please create an issue and if applicable, a design before proce
|
|||||||
|
|
||||||
once:
|
once:
|
||||||
|
|
||||||
```bash
|
```
|
||||||
$ npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
To build:
|
To build:
|
||||||
|
|
||||||
```bash
|
```
|
||||||
$ npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
To run all tests:
|
To run all tests:
|
||||||
```bash
|
|
||||||
$ npm test
|
```
|
||||||
|
npm test
|
||||||
```
|
```
|
||||||
@ -26,6 +26,10 @@ function checkBypass(reqUrl) {
|
|||||||
if (!reqUrl.hostname) {
|
if (!reqUrl.hostname) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
const reqHost = reqUrl.hostname;
|
||||||
|
if (isLoopbackAddress(reqHost)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
|
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
|
||||||
if (!noProxy) {
|
if (!noProxy) {
|
||||||
return false;
|
return false;
|
||||||
@ -51,11 +55,22 @@ function checkBypass(reqUrl) {
|
|||||||
.split(',')
|
.split(',')
|
||||||
.map(x => x.trim().toUpperCase())
|
.map(x => x.trim().toUpperCase())
|
||||||
.filter(x => x)) {
|
.filter(x => x)) {
|
||||||
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
|
if (upperNoProxyItem === '*' ||
|
||||||
|
upperReqHosts.some(x => x === upperNoProxyItem ||
|
||||||
|
x.endsWith(`.${upperNoProxyItem}`) ||
|
||||||
|
(upperNoProxyItem.startsWith('.') &&
|
||||||
|
x.endsWith(`${upperNoProxyItem}`)))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
exports.checkBypass = checkBypass;
|
exports.checkBypass = checkBypass;
|
||||||
|
function isLoopbackAddress(host) {
|
||||||
|
const hostLower = host.toLowerCase();
|
||||||
|
return (hostLower === 'localhost' ||
|
||||||
|
hostLower.startsWith('127.') ||
|
||||||
|
hostLower.startsWith('[::1]') ||
|
||||||
|
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
|
||||||
|
}
|
||||||
//# sourceMappingURL=proxy.js.map
|
//# sourceMappingURL=proxy.js.map
|
||||||
1
node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,MAAW;IACrC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAA;IAE7C,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE;QACvB,OAAO,SAAS,CAAA;KACjB;IAED,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE;QACrB,IAAI,QAAQ,EAAE;YACZ,OAAO,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;SAChE;aAAM;YACL,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;SAC9D;IACH,CAAC,CAAC,EAAE,CAAA;IAEJ,IAAI,QAAQ,EAAE;QACZ,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAA;KACzB;SAAM;QACL,OAAO,SAAS,CAAA;KACjB;AACH,CAAC;AApBD,kCAoBC;AAED,SAAgB,WAAW,CAAC,MAAW;IACrC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;QACpB,OAAO,KAAK,CAAA;KACb;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAA;IAC/B,IAAI,iBAAiB,CAAC,OAAO,CAAC,EAAE;QAC9B,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAA;IACxE,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAA;KACb;IAED,6BAA6B;IAC7B,IAAI,OAA2B,CAAA;IAC/B,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;KAC9B;SAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,EAAE;QACtC,OAAO,GAAG,EAAE,CAAA;KACb;SAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE;QACvC,OAAO,GAAG,GAAG,CAAA;KACd;IAED,qDAAqD;IACrD,MAAM,aAAa,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;IACrD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,aAAa,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC,CAAA;KACrD;IAED,uCAAuC;IACvC,KAAK,MAAM,gBAAgB,IAAI,OAAO;SACnC,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;SAChC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACjB,IACE,gBAAgB,KAAK,GAAG;YACxB,aAAa,CAAC,IAAI,CAChB,CAAC,CAAC,EAAE,CACF,CAAC,KAAK,gBAAgB;gBACtB,CAAC,CAAC,QAAQ,CAAC,IAAI,gBAAgB,EAAE,CAAC;gBAClC,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG,CAAC;oBAC/B,CAAC,CAAC,QAAQ,CAAC,GAAG,gBAAgB,EAAE,CAAC,CAAC,CACvC,EACD;YACA,OAAO,IAAI,CAAA;SACZ;KACF;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAnDD,kCAmDC;AAED,SAAS,iBAAiB,CAAC,IAAY;IACrC,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;IACpC,OAAO,CACL,SAAS,KAAK,WAAW;QACzB,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC;QAC5B,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC;QAC7B,SAAS,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAC1C,CAAA;AACH,CAAC"}
|
||||||
48
node_modules/@actions/core/node_modules/@actions/http-client/package.json
generated
vendored
Normal file
48
node_modules/@actions/core/node_modules/@actions/http-client/package.json
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"name": "@actions/http-client",
|
||||||
|
"version": "2.1.0",
|
||||||
|
"description": "Actions Http Client",
|
||||||
|
"keywords": [
|
||||||
|
"github",
|
||||||
|
"actions",
|
||||||
|
"http"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/actions/toolkit/tree/main/packages/http-client",
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "lib/index.js",
|
||||||
|
"types": "lib/index.d.ts",
|
||||||
|
"directories": {
|
||||||
|
"lib": "lib",
|
||||||
|
"test": "__tests__"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"lib",
|
||||||
|
"!.DS_Store"
|
||||||
|
],
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/actions/toolkit.git",
|
||||||
|
"directory": "packages/http-client"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
||||||
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
|
"build": "tsc",
|
||||||
|
"format": "prettier --write **/*.ts",
|
||||||
|
"format-check": "prettier --check **/*.ts",
|
||||||
|
"tsc": "tsc"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/tunnel": "0.0.3",
|
||||||
|
"proxy": "^1.0.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tunnel": "^0.0.6"
|
||||||
|
}
|
||||||
|
}
|
||||||
39
node_modules/@actions/github/node_modules/@actions/http-client/package.json
generated
vendored
39
node_modules/@actions/github/node_modules/@actions/http-client/package.json
generated
vendored
@ -1,39 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@actions/http-client",
|
|
||||||
"version": "1.0.11",
|
|
||||||
"description": "Actions Http Client",
|
|
||||||
"main": "index.js",
|
|
||||||
"scripts": {
|
|
||||||
"build": "rm -Rf ./_out && tsc && cp package*.json ./_out && cp *.md ./_out && cp LICENSE ./_out && cp actions.png ./_out",
|
|
||||||
"test": "jest",
|
|
||||||
"format": "prettier --write *.ts && prettier --write **/*.ts",
|
|
||||||
"format-check": "prettier --check *.ts && prettier --check **/*.ts",
|
|
||||||
"audit-check": "npm audit --audit-level=moderate"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/actions/http-client.git"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"Actions",
|
|
||||||
"Http"
|
|
||||||
],
|
|
||||||
"author": "GitHub, Inc.",
|
|
||||||
"license": "MIT",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/actions/http-client/issues"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/actions/http-client#readme",
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/jest": "^25.1.4",
|
|
||||||
"@types/node": "^12.12.31",
|
|
||||||
"jest": "^25.1.0",
|
|
||||||
"prettier": "^2.0.4",
|
|
||||||
"proxy": "^1.0.1",
|
|
||||||
"ts-jest": "^25.2.1",
|
|
||||||
"typescript": "^3.8.3"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tunnel": "0.0.6"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
32
node_modules/@actions/http-client/README.md
generated
vendored
32
node_modules/@actions/http-client/README.md
generated
vendored
@ -1,11 +1,18 @@
|
|||||||
# `@actions/http-client`
|
|
||||||
|
|
||||||
A lightweight HTTP client optimized for building actions.
|
<p align="center">
|
||||||
|
<img src="actions.png">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# Actions Http-Client
|
||||||
|
|
||||||
|
[](https://github.com/actions/http-client/actions)
|
||||||
|
|
||||||
|
A lightweight HTTP client optimized for use with actions, TypeScript with generics and async await.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- HTTP client with TypeScript generics and async/await/Promises
|
- HTTP client with TypeScript generics and async/await/Promises
|
||||||
- Typings included!
|
- Typings included so no need to acquire separately (great for intellisense and no versioning drift)
|
||||||
- [Proxy support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners#using-a-proxy-server-with-self-hosted-runners) just works with actions and the runner
|
- [Proxy support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners#using-a-proxy-server-with-self-hosted-runners) just works with actions and the runner
|
||||||
- Targets ES2019 (runner runs actions with node 12+). Only supported on node 12+.
|
- Targets ES2019 (runner runs actions with node 12+). Only supported on node 12+.
|
||||||
- Basic, Bearer and PAT Support out of the box. Extensible handlers for others.
|
- Basic, Bearer and PAT Support out of the box. Extensible handlers for others.
|
||||||
@ -21,7 +28,7 @@ npm install @actions/http-client --save
|
|||||||
|
|
||||||
## Samples
|
## Samples
|
||||||
|
|
||||||
See the [tests](./__tests__) for detailed examples.
|
See the [HTTP](./__tests__) tests for detailed examples.
|
||||||
|
|
||||||
## Errors
|
## Errors
|
||||||
|
|
||||||
@ -32,13 +39,13 @@ The HTTP client does not throw unless truly exceptional.
|
|||||||
* A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body.
|
* A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body.
|
||||||
* Redirects (3xx) will be followed by default.
|
* Redirects (3xx) will be followed by default.
|
||||||
|
|
||||||
See the [tests](./__tests__) for detailed examples.
|
See [HTTP tests](./__tests__) for detailed examples.
|
||||||
|
|
||||||
## Debugging
|
## Debugging
|
||||||
|
|
||||||
To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible:
|
To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible:
|
||||||
|
|
||||||
```shell
|
```
|
||||||
export NODE_DEBUG=http
|
export NODE_DEBUG=http
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -56,18 +63,17 @@ We welcome PRs. Please create an issue and if applicable, a design before proce
|
|||||||
|
|
||||||
once:
|
once:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
npm install
|
$ npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
To build:
|
To build:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
npm run build
|
$ npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
To run all tests:
|
To run all tests:
|
||||||
|
```bash
|
||||||
```
|
$ npm test
|
||||||
npm test
|
|
||||||
```
|
```
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
1
node_modules/@actions/http-client/lib/proxy.js.map
generated
vendored
1
node_modules/@actions/http-client/lib/proxy.js.map
generated
vendored
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,MAAW;IACrC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAA;IAE7C,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE;QACvB,OAAO,SAAS,CAAA;KACjB;IAED,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE;QACrB,IAAI,QAAQ,EAAE;YACZ,OAAO,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;SAChE;aAAM;YACL,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;SAC9D;IACH,CAAC,CAAC,EAAE,CAAA;IAEJ,IAAI,QAAQ,EAAE;QACZ,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAA;KACzB;SAAM;QACL,OAAO,SAAS,CAAA;KACjB;AACH,CAAC;AApBD,kCAoBC;AAED,SAAgB,WAAW,CAAC,MAAW;IACrC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;QACpB,OAAO,KAAK,CAAA;KACb;IAED,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAA;IACxE,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAA;KACb;IAED,6BAA6B;IAC7B,IAAI,OAA2B,CAAA;IAC/B,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;KAC9B;SAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,EAAE;QACtC,OAAO,GAAG,EAAE,CAAA;KACb;SAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE;QACvC,OAAO,GAAG,GAAG,CAAA;KACd;IAED,qDAAqD;IACrD,MAAM,aAAa,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;IACrD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,aAAa,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC,CAAA;KACrD;IAED,uCAAuC;IACvC,KAAK,MAAM,gBAAgB,IAAI,OAAO;SACnC,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;SAChC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACjB,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,gBAAgB,CAAC,EAAE;YACnD,OAAO,IAAI,CAAA;SACZ;KACF;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AArCD,kCAqCC"}
|
|
||||||
59
node_modules/@actions/http-client/package.json
generated
vendored
59
node_modules/@actions/http-client/package.json
generated
vendored
@ -1,48 +1,39 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/http-client",
|
"name": "@actions/http-client",
|
||||||
"version": "2.0.1",
|
"version": "1.0.11",
|
||||||
"description": "Actions Http Client",
|
"description": "Actions Http Client",
|
||||||
"keywords": [
|
"main": "index.js",
|
||||||
"github",
|
"scripts": {
|
||||||
"actions",
|
"build": "rm -Rf ./_out && tsc && cp package*.json ./_out && cp *.md ./_out && cp LICENSE ./_out && cp actions.png ./_out",
|
||||||
"http"
|
"test": "jest",
|
||||||
],
|
"format": "prettier --write *.ts && prettier --write **/*.ts",
|
||||||
"homepage": "https://github.com/actions/toolkit/tree/main/packages/http-client",
|
"format-check": "prettier --check *.ts && prettier --check **/*.ts",
|
||||||
"license": "MIT",
|
"audit-check": "npm audit --audit-level=moderate"
|
||||||
"main": "lib/index.js",
|
|
||||||
"types": "lib/index.d.ts",
|
|
||||||
"directories": {
|
|
||||||
"lib": "lib",
|
|
||||||
"test": "__tests__"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"lib",
|
|
||||||
"!.DS_Store"
|
|
||||||
],
|
|
||||||
"publishConfig": {
|
|
||||||
"access": "public"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/actions/toolkit.git",
|
"url": "git+https://github.com/actions/http-client.git"
|
||||||
"directory": "packages/http-client"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
|
||||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
|
||||||
"build": "tsc",
|
|
||||||
"format": "prettier --write **/*.ts",
|
|
||||||
"format-check": "prettier --check **/*.ts",
|
|
||||||
"tsc": "tsc"
|
|
||||||
},
|
},
|
||||||
|
"keywords": [
|
||||||
|
"Actions",
|
||||||
|
"Http"
|
||||||
|
],
|
||||||
|
"author": "GitHub, Inc.",
|
||||||
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/http-client/issues"
|
||||||
},
|
},
|
||||||
|
"homepage": "https://github.com/actions/http-client#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/tunnel": "0.0.3",
|
"@types/jest": "^25.1.4",
|
||||||
"proxy": "^1.0.1"
|
"@types/node": "^12.12.31",
|
||||||
|
"jest": "^25.1.0",
|
||||||
|
"prettier": "^2.0.4",
|
||||||
|
"proxy": "^1.0.1",
|
||||||
|
"ts-jest": "^25.2.1",
|
||||||
|
"typescript": "^3.8.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tunnel": "^0.0.6"
|
"tunnel": "0.0.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
37
node_modules/@eslint-community/eslint-utils/README.md
generated
vendored
Normal file
37
node_modules/@eslint-community/eslint-utils/README.md
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# @eslint-community/eslint-utils
|
||||||
|
|
||||||
|
[](https://www.npmjs.com/package/@eslint-community/eslint-utils)
|
||||||
|
[](http://www.npmtrends.com/@eslint-community/eslint-utils)
|
||||||
|
[](https://github.com/eslint-community/eslint-utils/actions)
|
||||||
|
[](https://codecov.io/gh/eslint-community/eslint-utils)
|
||||||
|
|
||||||
|
## 🏁 Goal
|
||||||
|
|
||||||
|
This package provides utility functions and classes for make ESLint custom rules.
|
||||||
|
|
||||||
|
For examples:
|
||||||
|
|
||||||
|
- [`getStaticValue`](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue) evaluates static value on AST.
|
||||||
|
- [`ReferenceTracker`](https://eslint-community.github.io/eslint-utils/api/scope-utils.html#referencetracker-class) checks the members of modules/globals as handling assignments and destructuring.
|
||||||
|
|
||||||
|
## 📖 Usage
|
||||||
|
|
||||||
|
See [documentation](https://eslint-community.github.io/eslint-utils).
|
||||||
|
|
||||||
|
## 📰 Changelog
|
||||||
|
|
||||||
|
See [releases](https://github.com/eslint-community/eslint-utils/releases).
|
||||||
|
|
||||||
|
## ❤️ Contributing
|
||||||
|
|
||||||
|
Welcome contributing!
|
||||||
|
|
||||||
|
Please use GitHub's Issues/PRs.
|
||||||
|
|
||||||
|
### Development Tools
|
||||||
|
|
||||||
|
- `npm test` runs tests and measures coverage.
|
||||||
|
- `npm run clean` removes the coverage result of `npm test` command.
|
||||||
|
- `npm run coverage` shows the coverage result of the last `npm test` command.
|
||||||
|
- `npm run lint` runs ESLint.
|
||||||
|
- `npm run watch` runs tests on each file change.
|
||||||
136
node_modules/eslint-utils/index.js → node_modules/@eslint-community/eslint-utils/index.js
generated
vendored
136
node_modules/eslint-utils/index.js → node_modules/@eslint-community/eslint-utils/index.js
generated
vendored
@ -1,11 +1,8 @@
|
|||||||
/*! @author Toru Nagashima <https://github.com/mysticatea> */
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
Object.defineProperty(exports, '__esModule', { value: true });
|
Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
|
||||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
var eslintVisitorKeys = require('eslint-visitor-keys');
|
||||||
|
|
||||||
var evk = _interopDefault(require('eslint-visitor-keys'));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the innermost scope which contains a given location.
|
* Get the innermost scope which contains a given location.
|
||||||
@ -313,6 +310,24 @@ const builtinNames = Object.freeze(
|
|||||||
const callAllowed = new Set(
|
const callAllowed = new Set(
|
||||||
[
|
[
|
||||||
Array.isArray,
|
Array.isArray,
|
||||||
|
Array.of,
|
||||||
|
Array.prototype.at,
|
||||||
|
Array.prototype.concat,
|
||||||
|
Array.prototype.entries,
|
||||||
|
Array.prototype.every,
|
||||||
|
Array.prototype.filter,
|
||||||
|
Array.prototype.find,
|
||||||
|
Array.prototype.findIndex,
|
||||||
|
Array.prototype.flat,
|
||||||
|
Array.prototype.includes,
|
||||||
|
Array.prototype.indexOf,
|
||||||
|
Array.prototype.join,
|
||||||
|
Array.prototype.keys,
|
||||||
|
Array.prototype.lastIndexOf,
|
||||||
|
Array.prototype.slice,
|
||||||
|
Array.prototype.some,
|
||||||
|
Array.prototype.toString,
|
||||||
|
Array.prototype.values,
|
||||||
typeof BigInt === "function" ? BigInt : undefined,
|
typeof BigInt === "function" ? BigInt : undefined,
|
||||||
Boolean,
|
Boolean,
|
||||||
Date,
|
Date,
|
||||||
@ -325,7 +340,14 @@ const callAllowed = new Set(
|
|||||||
isFinite,
|
isFinite,
|
||||||
isNaN,
|
isNaN,
|
||||||
isPrototypeOf,
|
isPrototypeOf,
|
||||||
|
Map,
|
||||||
|
Map.prototype.entries,
|
||||||
|
Map.prototype.get,
|
||||||
|
Map.prototype.has,
|
||||||
|
Map.prototype.keys,
|
||||||
|
Map.prototype.values,
|
||||||
...Object.getOwnPropertyNames(Math)
|
...Object.getOwnPropertyNames(Math)
|
||||||
|
.filter((k) => k !== "random")
|
||||||
.map((k) => Math[k])
|
.map((k) => Math[k])
|
||||||
.filter((f) => typeof f === "function"),
|
.filter((f) => typeof f === "function"),
|
||||||
Number,
|
Number,
|
||||||
@ -333,6 +355,10 @@ const callAllowed = new Set(
|
|||||||
Number.isNaN,
|
Number.isNaN,
|
||||||
Number.parseFloat,
|
Number.parseFloat,
|
||||||
Number.parseInt,
|
Number.parseInt,
|
||||||
|
Number.prototype.toExponential,
|
||||||
|
Number.prototype.toFixed,
|
||||||
|
Number.prototype.toPrecision,
|
||||||
|
Number.prototype.toString,
|
||||||
Object,
|
Object,
|
||||||
Object.entries,
|
Object.entries,
|
||||||
Object.is,
|
Object.is,
|
||||||
@ -344,10 +370,39 @@ const callAllowed = new Set(
|
|||||||
parseFloat,
|
parseFloat,
|
||||||
parseInt,
|
parseInt,
|
||||||
RegExp,
|
RegExp,
|
||||||
|
Set,
|
||||||
|
Set.prototype.entries,
|
||||||
|
Set.prototype.has,
|
||||||
|
Set.prototype.keys,
|
||||||
|
Set.prototype.values,
|
||||||
String,
|
String,
|
||||||
String.fromCharCode,
|
String.fromCharCode,
|
||||||
String.fromCodePoint,
|
String.fromCodePoint,
|
||||||
String.raw,
|
String.raw,
|
||||||
|
String.prototype.at,
|
||||||
|
String.prototype.charAt,
|
||||||
|
String.prototype.charCodeAt,
|
||||||
|
String.prototype.codePointAt,
|
||||||
|
String.prototype.concat,
|
||||||
|
String.prototype.endsWith,
|
||||||
|
String.prototype.includes,
|
||||||
|
String.prototype.indexOf,
|
||||||
|
String.prototype.lastIndexOf,
|
||||||
|
String.prototype.normalize,
|
||||||
|
String.prototype.padEnd,
|
||||||
|
String.prototype.padStart,
|
||||||
|
String.prototype.slice,
|
||||||
|
String.prototype.startsWith,
|
||||||
|
String.prototype.substr,
|
||||||
|
String.prototype.substring,
|
||||||
|
String.prototype.toLowerCase,
|
||||||
|
String.prototype.toString,
|
||||||
|
String.prototype.toUpperCase,
|
||||||
|
String.prototype.trim,
|
||||||
|
String.prototype.trimEnd,
|
||||||
|
String.prototype.trimLeft,
|
||||||
|
String.prototype.trimRight,
|
||||||
|
String.prototype.trimStart,
|
||||||
Symbol.for,
|
Symbol.for,
|
||||||
Symbol.keyFor,
|
Symbol.keyFor,
|
||||||
unescape,
|
unescape,
|
||||||
@ -359,6 +414,26 @@ const callPassThrough = new Set([
|
|||||||
Object.seal,
|
Object.seal,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
/** @type {ReadonlyArray<readonly [Function, ReadonlySet<string>]>} */
|
||||||
|
const getterAllowed = [
|
||||||
|
[Map, new Set(["size"])],
|
||||||
|
[
|
||||||
|
RegExp,
|
||||||
|
new Set([
|
||||||
|
"dotAll",
|
||||||
|
"flags",
|
||||||
|
"global",
|
||||||
|
"hasIndices",
|
||||||
|
"ignoreCase",
|
||||||
|
"multiline",
|
||||||
|
"source",
|
||||||
|
"sticky",
|
||||||
|
"unicode",
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
[Set, new Set(["size"])],
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the property descriptor.
|
* Get the property descriptor.
|
||||||
* @param {object} object The object to get.
|
* @param {object} object The object to get.
|
||||||
@ -418,6 +493,23 @@ function getElementValues(nodeList, initialScope) {
|
|||||||
return valueList
|
return valueList
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the given variable is never written to after initialization.
|
||||||
|
* @param {import("eslint").Scope.Variable} variable
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
function isEffectivelyConst(variable) {
|
||||||
|
const refs = variable.references;
|
||||||
|
|
||||||
|
const inits = refs.filter((r) => r.init).length;
|
||||||
|
const reads = refs.filter((r) => r.isReadOnly()).length;
|
||||||
|
if (inits === 1 && reads + inits === refs.length) {
|
||||||
|
// there is only one init and all other references only read
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
const operations = Object.freeze({
|
const operations = Object.freeze({
|
||||||
ArrayExpression(node, initialScope) {
|
ArrayExpression(node, initialScope) {
|
||||||
const elements = getElementValues(node.elements, initialScope);
|
const elements = getElementValues(node.elements, initialScope);
|
||||||
@ -475,7 +567,7 @@ const operations = Object.freeze({
|
|||||||
case "%":
|
case "%":
|
||||||
return { value: left.value % right.value }
|
return { value: left.value % right.value }
|
||||||
case "**":
|
case "**":
|
||||||
return { value: Math.pow(left.value, right.value) }
|
return { value: left.value ** right.value }
|
||||||
case "|":
|
case "|":
|
||||||
return { value: left.value | right.value }
|
return { value: left.value | right.value }
|
||||||
case "^":
|
case "^":
|
||||||
@ -576,7 +668,9 @@ const operations = Object.freeze({
|
|||||||
const def = variable.defs[0];
|
const def = variable.defs[0];
|
||||||
if (
|
if (
|
||||||
def.parent &&
|
def.parent &&
|
||||||
def.parent.kind === "const" &&
|
def.type === "Variable" &&
|
||||||
|
(def.parent.kind === "const" ||
|
||||||
|
isEffectivelyConst(variable)) &&
|
||||||
// TODO(mysticatea): don't support destructuring here.
|
// TODO(mysticatea): don't support destructuring here.
|
||||||
def.node.id.type === "Identifier"
|
def.node.id.type === "Identifier"
|
||||||
) {
|
) {
|
||||||
@ -627,8 +721,19 @@ const operations = Object.freeze({
|
|||||||
}
|
}
|
||||||
const property = getStaticPropertyNameValue(node, initialScope);
|
const property = getStaticPropertyNameValue(node, initialScope);
|
||||||
|
|
||||||
if (property != null && !isGetter(object.value, property.value)) {
|
if (property != null) {
|
||||||
return { value: object.value[property.value] }
|
if (!isGetter(object.value, property.value)) {
|
||||||
|
return { value: object.value[property.value] }
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const [classFn, allowed] of getterAllowed) {
|
||||||
|
if (
|
||||||
|
object.value instanceof classFn &&
|
||||||
|
allowed.has(property.value)
|
||||||
|
) {
|
||||||
|
return { value: object.value[property.value] }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
@ -957,6 +1062,11 @@ function getFunctionNameWithKind(node, sourceCode) {
|
|||||||
parent.left.type === "Identifier"
|
parent.left.type === "Identifier"
|
||||||
) {
|
) {
|
||||||
tokens.push(`'${parent.left.name}'`);
|
tokens.push(`'${parent.left.name}'`);
|
||||||
|
} else if (
|
||||||
|
parent.type === "ExportDefaultDeclaration" &&
|
||||||
|
parent.declaration === node
|
||||||
|
) {
|
||||||
|
tokens.push("'default'");
|
||||||
}
|
}
|
||||||
|
|
||||||
return tokens.join(" ")
|
return tokens.join(" ")
|
||||||
@ -1010,7 +1120,7 @@ const visitor = Object.freeze(
|
|||||||
$visitChildren(node, options, visitorKeys) {
|
$visitChildren(node, options, visitorKeys) {
|
||||||
const { type } = node;
|
const { type } = node;
|
||||||
|
|
||||||
for (const key of visitorKeys[type] || evk.getKeys(node)) {
|
for (const key of visitorKeys[type] || eslintVisitorKeys.getKeys(node)) {
|
||||||
const value = node[key];
|
const value = node[key];
|
||||||
|
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
@ -1136,7 +1246,7 @@ const visitor = Object.freeze(
|
|||||||
* @param {object} [options] The option object.
|
* @param {object} [options] The option object.
|
||||||
* @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.
|
* @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.
|
||||||
* @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.
|
* @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.
|
||||||
* @param {object} [options.visitorKeys=evk.KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.
|
* @param {object} [options.visitorKeys=KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.
|
||||||
* @returns {boolean} `true` if the node has a certain side effect.
|
* @returns {boolean} `true` if the node has a certain side effect.
|
||||||
*/
|
*/
|
||||||
function hasSideEffect(
|
function hasSideEffect(
|
||||||
@ -1147,7 +1257,7 @@ function hasSideEffect(
|
|||||||
return visitor.$visit(
|
return visitor.$visit(
|
||||||
node,
|
node,
|
||||||
{ considerGetters, considerImplicitTypeConversion },
|
{ considerGetters, considerImplicitTypeConversion },
|
||||||
sourceCode.visitorKeys || evk.KEYS,
|
sourceCode.visitorKeys || eslintVisitorKeys.KEYS,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1245,6 +1355,8 @@ function isParenthesized(
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
node == null ||
|
node == null ||
|
||||||
|
// `Program` can't be parenthesized
|
||||||
|
node.parent == null ||
|
||||||
// `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`
|
// `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`
|
||||||
(node.parent.type === "CatchClause" && node.parent.param === node)
|
(node.parent.type === "CatchClause" && node.parent.param === node)
|
||||||
) {
|
) {
|
||||||
@ -1921,7 +2033,7 @@ exports.ESM = ESM;
|
|||||||
exports.PatternMatcher = PatternMatcher;
|
exports.PatternMatcher = PatternMatcher;
|
||||||
exports.READ = READ;
|
exports.READ = READ;
|
||||||
exports.ReferenceTracker = ReferenceTracker;
|
exports.ReferenceTracker = ReferenceTracker;
|
||||||
exports.default = index;
|
exports["default"] = index;
|
||||||
exports.findVariable = findVariable;
|
exports.findVariable = findVariable;
|
||||||
exports.getFunctionHeadLocation = getFunctionHeadLocation;
|
exports.getFunctionHeadLocation = getFunctionHeadLocation;
|
||||||
exports.getFunctionNameWithKind = getFunctionNameWithKind;
|
exports.getFunctionNameWithKind = getFunctionNameWithKind;
|
||||||
1
node_modules/@eslint-community/eslint-utils/index.js.map
generated
vendored
Normal file
1
node_modules/@eslint-community/eslint-utils/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
135
node_modules/eslint-utils/index.mjs → node_modules/@eslint-community/eslint-utils/index.mjs
generated
vendored
135
node_modules/eslint-utils/index.mjs → node_modules/@eslint-community/eslint-utils/index.mjs
generated
vendored
@ -1,5 +1,4 @@
|
|||||||
/*! @author Toru Nagashima <https://github.com/mysticatea> */
|
import { getKeys, KEYS } from 'eslint-visitor-keys';
|
||||||
import evk from 'eslint-visitor-keys';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the innermost scope which contains a given location.
|
* Get the innermost scope which contains a given location.
|
||||||
@ -307,6 +306,24 @@ const builtinNames = Object.freeze(
|
|||||||
const callAllowed = new Set(
|
const callAllowed = new Set(
|
||||||
[
|
[
|
||||||
Array.isArray,
|
Array.isArray,
|
||||||
|
Array.of,
|
||||||
|
Array.prototype.at,
|
||||||
|
Array.prototype.concat,
|
||||||
|
Array.prototype.entries,
|
||||||
|
Array.prototype.every,
|
||||||
|
Array.prototype.filter,
|
||||||
|
Array.prototype.find,
|
||||||
|
Array.prototype.findIndex,
|
||||||
|
Array.prototype.flat,
|
||||||
|
Array.prototype.includes,
|
||||||
|
Array.prototype.indexOf,
|
||||||
|
Array.prototype.join,
|
||||||
|
Array.prototype.keys,
|
||||||
|
Array.prototype.lastIndexOf,
|
||||||
|
Array.prototype.slice,
|
||||||
|
Array.prototype.some,
|
||||||
|
Array.prototype.toString,
|
||||||
|
Array.prototype.values,
|
||||||
typeof BigInt === "function" ? BigInt : undefined,
|
typeof BigInt === "function" ? BigInt : undefined,
|
||||||
Boolean,
|
Boolean,
|
||||||
Date,
|
Date,
|
||||||
@ -319,7 +336,14 @@ const callAllowed = new Set(
|
|||||||
isFinite,
|
isFinite,
|
||||||
isNaN,
|
isNaN,
|
||||||
isPrototypeOf,
|
isPrototypeOf,
|
||||||
|
Map,
|
||||||
|
Map.prototype.entries,
|
||||||
|
Map.prototype.get,
|
||||||
|
Map.prototype.has,
|
||||||
|
Map.prototype.keys,
|
||||||
|
Map.prototype.values,
|
||||||
...Object.getOwnPropertyNames(Math)
|
...Object.getOwnPropertyNames(Math)
|
||||||
|
.filter((k) => k !== "random")
|
||||||
.map((k) => Math[k])
|
.map((k) => Math[k])
|
||||||
.filter((f) => typeof f === "function"),
|
.filter((f) => typeof f === "function"),
|
||||||
Number,
|
Number,
|
||||||
@ -327,6 +351,10 @@ const callAllowed = new Set(
|
|||||||
Number.isNaN,
|
Number.isNaN,
|
||||||
Number.parseFloat,
|
Number.parseFloat,
|
||||||
Number.parseInt,
|
Number.parseInt,
|
||||||
|
Number.prototype.toExponential,
|
||||||
|
Number.prototype.toFixed,
|
||||||
|
Number.prototype.toPrecision,
|
||||||
|
Number.prototype.toString,
|
||||||
Object,
|
Object,
|
||||||
Object.entries,
|
Object.entries,
|
||||||
Object.is,
|
Object.is,
|
||||||
@ -338,10 +366,39 @@ const callAllowed = new Set(
|
|||||||
parseFloat,
|
parseFloat,
|
||||||
parseInt,
|
parseInt,
|
||||||
RegExp,
|
RegExp,
|
||||||
|
Set,
|
||||||
|
Set.prototype.entries,
|
||||||
|
Set.prototype.has,
|
||||||
|
Set.prototype.keys,
|
||||||
|
Set.prototype.values,
|
||||||
String,
|
String,
|
||||||
String.fromCharCode,
|
String.fromCharCode,
|
||||||
String.fromCodePoint,
|
String.fromCodePoint,
|
||||||
String.raw,
|
String.raw,
|
||||||
|
String.prototype.at,
|
||||||
|
String.prototype.charAt,
|
||||||
|
String.prototype.charCodeAt,
|
||||||
|
String.prototype.codePointAt,
|
||||||
|
String.prototype.concat,
|
||||||
|
String.prototype.endsWith,
|
||||||
|
String.prototype.includes,
|
||||||
|
String.prototype.indexOf,
|
||||||
|
String.prototype.lastIndexOf,
|
||||||
|
String.prototype.normalize,
|
||||||
|
String.prototype.padEnd,
|
||||||
|
String.prototype.padStart,
|
||||||
|
String.prototype.slice,
|
||||||
|
String.prototype.startsWith,
|
||||||
|
String.prototype.substr,
|
||||||
|
String.prototype.substring,
|
||||||
|
String.prototype.toLowerCase,
|
||||||
|
String.prototype.toString,
|
||||||
|
String.prototype.toUpperCase,
|
||||||
|
String.prototype.trim,
|
||||||
|
String.prototype.trimEnd,
|
||||||
|
String.prototype.trimLeft,
|
||||||
|
String.prototype.trimRight,
|
||||||
|
String.prototype.trimStart,
|
||||||
Symbol.for,
|
Symbol.for,
|
||||||
Symbol.keyFor,
|
Symbol.keyFor,
|
||||||
unescape,
|
unescape,
|
||||||
@ -353,6 +410,26 @@ const callPassThrough = new Set([
|
|||||||
Object.seal,
|
Object.seal,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
/** @type {ReadonlyArray<readonly [Function, ReadonlySet<string>]>} */
|
||||||
|
const getterAllowed = [
|
||||||
|
[Map, new Set(["size"])],
|
||||||
|
[
|
||||||
|
RegExp,
|
||||||
|
new Set([
|
||||||
|
"dotAll",
|
||||||
|
"flags",
|
||||||
|
"global",
|
||||||
|
"hasIndices",
|
||||||
|
"ignoreCase",
|
||||||
|
"multiline",
|
||||||
|
"source",
|
||||||
|
"sticky",
|
||||||
|
"unicode",
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
[Set, new Set(["size"])],
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the property descriptor.
|
* Get the property descriptor.
|
||||||
* @param {object} object The object to get.
|
* @param {object} object The object to get.
|
||||||
@ -412,6 +489,23 @@ function getElementValues(nodeList, initialScope) {
|
|||||||
return valueList
|
return valueList
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the given variable is never written to after initialization.
|
||||||
|
* @param {import("eslint").Scope.Variable} variable
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
function isEffectivelyConst(variable) {
|
||||||
|
const refs = variable.references;
|
||||||
|
|
||||||
|
const inits = refs.filter((r) => r.init).length;
|
||||||
|
const reads = refs.filter((r) => r.isReadOnly()).length;
|
||||||
|
if (inits === 1 && reads + inits === refs.length) {
|
||||||
|
// there is only one init and all other references only read
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
const operations = Object.freeze({
|
const operations = Object.freeze({
|
||||||
ArrayExpression(node, initialScope) {
|
ArrayExpression(node, initialScope) {
|
||||||
const elements = getElementValues(node.elements, initialScope);
|
const elements = getElementValues(node.elements, initialScope);
|
||||||
@ -469,7 +563,7 @@ const operations = Object.freeze({
|
|||||||
case "%":
|
case "%":
|
||||||
return { value: left.value % right.value }
|
return { value: left.value % right.value }
|
||||||
case "**":
|
case "**":
|
||||||
return { value: Math.pow(left.value, right.value) }
|
return { value: left.value ** right.value }
|
||||||
case "|":
|
case "|":
|
||||||
return { value: left.value | right.value }
|
return { value: left.value | right.value }
|
||||||
case "^":
|
case "^":
|
||||||
@ -570,7 +664,9 @@ const operations = Object.freeze({
|
|||||||
const def = variable.defs[0];
|
const def = variable.defs[0];
|
||||||
if (
|
if (
|
||||||
def.parent &&
|
def.parent &&
|
||||||
def.parent.kind === "const" &&
|
def.type === "Variable" &&
|
||||||
|
(def.parent.kind === "const" ||
|
||||||
|
isEffectivelyConst(variable)) &&
|
||||||
// TODO(mysticatea): don't support destructuring here.
|
// TODO(mysticatea): don't support destructuring here.
|
||||||
def.node.id.type === "Identifier"
|
def.node.id.type === "Identifier"
|
||||||
) {
|
) {
|
||||||
@ -621,8 +717,19 @@ const operations = Object.freeze({
|
|||||||
}
|
}
|
||||||
const property = getStaticPropertyNameValue(node, initialScope);
|
const property = getStaticPropertyNameValue(node, initialScope);
|
||||||
|
|
||||||
if (property != null && !isGetter(object.value, property.value)) {
|
if (property != null) {
|
||||||
return { value: object.value[property.value] }
|
if (!isGetter(object.value, property.value)) {
|
||||||
|
return { value: object.value[property.value] }
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const [classFn, allowed] of getterAllowed) {
|
||||||
|
if (
|
||||||
|
object.value instanceof classFn &&
|
||||||
|
allowed.has(property.value)
|
||||||
|
) {
|
||||||
|
return { value: object.value[property.value] }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
@ -951,6 +1058,11 @@ function getFunctionNameWithKind(node, sourceCode) {
|
|||||||
parent.left.type === "Identifier"
|
parent.left.type === "Identifier"
|
||||||
) {
|
) {
|
||||||
tokens.push(`'${parent.left.name}'`);
|
tokens.push(`'${parent.left.name}'`);
|
||||||
|
} else if (
|
||||||
|
parent.type === "ExportDefaultDeclaration" &&
|
||||||
|
parent.declaration === node
|
||||||
|
) {
|
||||||
|
tokens.push("'default'");
|
||||||
}
|
}
|
||||||
|
|
||||||
return tokens.join(" ")
|
return tokens.join(" ")
|
||||||
@ -1004,7 +1116,7 @@ const visitor = Object.freeze(
|
|||||||
$visitChildren(node, options, visitorKeys) {
|
$visitChildren(node, options, visitorKeys) {
|
||||||
const { type } = node;
|
const { type } = node;
|
||||||
|
|
||||||
for (const key of visitorKeys[type] || evk.getKeys(node)) {
|
for (const key of visitorKeys[type] || getKeys(node)) {
|
||||||
const value = node[key];
|
const value = node[key];
|
||||||
|
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
@ -1130,7 +1242,7 @@ const visitor = Object.freeze(
|
|||||||
* @param {object} [options] The option object.
|
* @param {object} [options] The option object.
|
||||||
* @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.
|
* @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.
|
||||||
* @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.
|
* @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.
|
||||||
* @param {object} [options.visitorKeys=evk.KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.
|
* @param {object} [options.visitorKeys=KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.
|
||||||
* @returns {boolean} `true` if the node has a certain side effect.
|
* @returns {boolean} `true` if the node has a certain side effect.
|
||||||
*/
|
*/
|
||||||
function hasSideEffect(
|
function hasSideEffect(
|
||||||
@ -1141,7 +1253,7 @@ function hasSideEffect(
|
|||||||
return visitor.$visit(
|
return visitor.$visit(
|
||||||
node,
|
node,
|
||||||
{ considerGetters, considerImplicitTypeConversion },
|
{ considerGetters, considerImplicitTypeConversion },
|
||||||
sourceCode.visitorKeys || evk.KEYS,
|
sourceCode.visitorKeys || KEYS,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1239,6 +1351,8 @@ function isParenthesized(
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
node == null ||
|
node == null ||
|
||||||
|
// `Program` can't be parenthesized
|
||||||
|
node.parent == null ||
|
||||||
// `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`
|
// `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`
|
||||||
(node.parent.type === "CatchClause" && node.parent.param === node)
|
(node.parent.type === "CatchClause" && node.parent.param === node)
|
||||||
) {
|
) {
|
||||||
@ -1909,6 +2023,5 @@ var index = {
|
|||||||
ReferenceTracker,
|
ReferenceTracker,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default index;
|
export { CALL, CONSTRUCT, ESM, PatternMatcher, READ, ReferenceTracker, index as default, findVariable, getFunctionHeadLocation, getFunctionNameWithKind, getInnermostScope, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isParenthesized, isSemicolonToken };
|
||||||
export { CALL, CONSTRUCT, ESM, PatternMatcher, READ, ReferenceTracker, findVariable, getFunctionHeadLocation, getFunctionNameWithKind, getInnermostScope, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isParenthesized, isSemicolonToken };
|
|
||||||
//# sourceMappingURL=index.mjs.map
|
//# sourceMappingURL=index.mjs.map
|
||||||
1
node_modules/@eslint-community/eslint-utils/index.mjs.map
generated
vendored
Normal file
1
node_modules/@eslint-community/eslint-utils/index.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/@eslint-community/eslint-utils/node_modules/.bin/eslint
generated
vendored
Symbolic link
1
node_modules/@eslint-community/eslint-utils/node_modules/.bin/eslint
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../eslint/bin/eslint.js
|
||||||
73
node_modules/@eslint-community/eslint-utils/package.json
generated
vendored
Normal file
73
node_modules/@eslint-community/eslint-utils/package.json
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
{
|
||||||
|
"name": "@eslint-community/eslint-utils",
|
||||||
|
"version": "4.4.0",
|
||||||
|
"description": "Utilities for ESLint plugins.",
|
||||||
|
"keywords": [
|
||||||
|
"eslint"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/eslint-community/eslint-utils#readme",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/eslint-community/eslint-utils/issues"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/eslint-community/eslint-utils"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "Toru Nagashima",
|
||||||
|
"sideEffects": false,
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"import": "./index.mjs",
|
||||||
|
"require": "./index.js"
|
||||||
|
},
|
||||||
|
"./package.json": "./package.json"
|
||||||
|
},
|
||||||
|
"main": "index",
|
||||||
|
"module": "index.mjs",
|
||||||
|
"files": [
|
||||||
|
"index.*"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"prebuild": "npm run -s clean",
|
||||||
|
"build": "rollup -c",
|
||||||
|
"clean": "rimraf .nyc_output coverage index.*",
|
||||||
|
"coverage": "opener ./coverage/lcov-report/index.html",
|
||||||
|
"docs:build": "vitepress build docs",
|
||||||
|
"docs:watch": "vitepress dev docs",
|
||||||
|
"format": "npm run -s format:prettier -- --write",
|
||||||
|
"format:prettier": "prettier .",
|
||||||
|
"format:check": "npm run -s format:prettier -- --check",
|
||||||
|
"lint": "eslint .",
|
||||||
|
"test": "c8 mocha --reporter dot \"test/*.mjs\"",
|
||||||
|
"preversion": "npm test && npm run -s build",
|
||||||
|
"postversion": "git push && git push --tags",
|
||||||
|
"prewatch": "npm run -s clean",
|
||||||
|
"watch": "warun \"{src,test}/**/*.mjs\" -- npm run -s test:mocha"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"eslint-visitor-keys": "^3.3.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@eslint-community/eslint-plugin-mysticatea": "^15.2.0",
|
||||||
|
"c8": "^7.12.0",
|
||||||
|
"dot-prop": "^6.0.1",
|
||||||
|
"eslint": "^8.28.0",
|
||||||
|
"mocha": "^9.2.2",
|
||||||
|
"npm-run-all": "^4.1.5",
|
||||||
|
"opener": "^1.5.2",
|
||||||
|
"prettier": "2.8.4",
|
||||||
|
"rimraf": "^3.0.2",
|
||||||
|
"rollup": "^2.79.1",
|
||||||
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||||
|
"semver": "^7.3.8",
|
||||||
|
"vitepress": "^1.0.0-alpha.40",
|
||||||
|
"warun": "^1.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
0
node_modules/regexpp/LICENSE → node_modules/@eslint-community/regexpp/LICENSE
generated
vendored
0
node_modules/regexpp/LICENSE → node_modules/@eslint-community/regexpp/LICENSE
generated
vendored
19
node_modules/regexpp/README.md → node_modules/@eslint-community/regexpp/README.md
generated
vendored
19
node_modules/regexpp/README.md → node_modules/@eslint-community/regexpp/README.md
generated
vendored
@ -1,20 +1,19 @@
|
|||||||
# regexpp
|
# @eslint-community/regexpp
|
||||||
|
|
||||||
[](https://www.npmjs.com/package/regexpp)
|
[](https://www.npmjs.com/package/@eslint-community/regexpp)
|
||||||
[](http://www.npmtrends.com/regexpp)
|
[](http://www.npmtrends.com/@eslint-community/regexpp)
|
||||||
[](https://github.com/mysticatea/regexpp/actions)
|
[](https://github.com/eslint-community/regexpp/actions)
|
||||||
[](https://codecov.io/gh/mysticatea/regexpp)
|
[](https://codecov.io/gh/eslint-community/regexpp)
|
||||||
[](https://david-dm.org/mysticatea/regexpp)
|
|
||||||
|
|
||||||
A regular expression parser for ECMAScript.
|
A regular expression parser for ECMAScript.
|
||||||
|
|
||||||
## 💿 Installation
|
## 💿 Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm install regexpp
|
$ npm install @eslint-community/regexpp
|
||||||
```
|
```
|
||||||
|
|
||||||
- require Node.js 8 or newer.
|
- require Node@^12.0.0 || ^14.0.0 || >=16.0.0.
|
||||||
|
|
||||||
## 📖 Usage
|
## 📖 Usage
|
||||||
|
|
||||||
@ -27,7 +26,7 @@ import {
|
|||||||
parseRegExpLiteral,
|
parseRegExpLiteral,
|
||||||
validateRegExpLiteral,
|
validateRegExpLiteral,
|
||||||
visitRegExpAST
|
visitRegExpAST
|
||||||
} from "regexpp"
|
} from "@eslint-community/regexpp"
|
||||||
```
|
```
|
||||||
|
|
||||||
### parseRegExpLiteral(source, options?)
|
### parseRegExpLiteral(source, options?)
|
||||||
@ -154,7 +153,7 @@ Validate a regular expression literal.
|
|||||||
|
|
||||||
## 📰 Changelog
|
## 📰 Changelog
|
||||||
|
|
||||||
- [GitHub Releases](https://github.com/mysticatea/regexpp/releases)
|
- [GitHub Releases](https://github.com/eslint-community/regexpp/releases)
|
||||||
|
|
||||||
## 🍻 Contributing
|
## 🍻 Contributing
|
||||||
|
|
||||||
781
node_modules/@eslint-community/regexpp/index.d.ts
generated
vendored
Normal file
781
node_modules/@eslint-community/regexpp/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,781 @@
|
|||||||
|
// Generated by dts-bundle v0.7.3
|
||||||
|
|
||||||
|
declare module "@eslint-community/regexpp" {
|
||||||
|
import * as AST from "@eslint-community/regexpp/ast";
|
||||||
|
import { RegExpParser } from "@eslint-community/regexpp/parser";
|
||||||
|
import { RegExpValidator } from "@eslint-community/regexpp/validator";
|
||||||
|
import { RegExpVisitor } from "@eslint-community/regexpp/visitor";
|
||||||
|
export { AST, RegExpParser, RegExpValidator };
|
||||||
|
/**
|
||||||
|
* Parse a given regular expression literal then make AST object.
|
||||||
|
* @param source The source code to parse.
|
||||||
|
* @param options The options to parse.
|
||||||
|
* @returns The AST of the regular expression.
|
||||||
|
*/
|
||||||
|
export function parseRegExpLiteral(
|
||||||
|
source: RegExp | string,
|
||||||
|
options?: RegExpParser.Options
|
||||||
|
): AST.RegExpLiteral;
|
||||||
|
/**
|
||||||
|
* Validate a given regular expression literal.
|
||||||
|
* @param source The source code to validate.
|
||||||
|
* @param options The options to validate.
|
||||||
|
*/
|
||||||
|
export function validateRegExpLiteral(
|
||||||
|
source: string,
|
||||||
|
options?: RegExpValidator.Options
|
||||||
|
): void;
|
||||||
|
export function visitRegExpAST(
|
||||||
|
node: AST.Node,
|
||||||
|
handlers: RegExpVisitor.Handlers
|
||||||
|
): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "@eslint-community/regexpp/ast" {
|
||||||
|
/**
|
||||||
|
* The type which includes all nodes.
|
||||||
|
*/
|
||||||
|
export type Node = BranchNode | LeafNode;
|
||||||
|
/**
|
||||||
|
* The type which includes all branch nodes.
|
||||||
|
*/
|
||||||
|
export type BranchNode =
|
||||||
|
| Alternative
|
||||||
|
| CapturingGroup
|
||||||
|
| CharacterClass
|
||||||
|
| CharacterClassRange
|
||||||
|
| Group
|
||||||
|
| LookaroundAssertion
|
||||||
|
| Pattern
|
||||||
|
| Quantifier
|
||||||
|
| RegExpLiteral;
|
||||||
|
/**
|
||||||
|
* The type which includes all leaf nodes.
|
||||||
|
*/
|
||||||
|
export type LeafNode =
|
||||||
|
| Backreference
|
||||||
|
| BoundaryAssertion
|
||||||
|
| Character
|
||||||
|
| CharacterSet
|
||||||
|
| Flags;
|
||||||
|
/**
|
||||||
|
* The type which includes all atom nodes.
|
||||||
|
*/
|
||||||
|
export type Element = Assertion | QuantifiableElement | Quantifier;
|
||||||
|
/**
|
||||||
|
* The type which includes all atom nodes that Quantifier node can have as children.
|
||||||
|
*/
|
||||||
|
export type QuantifiableElement =
|
||||||
|
| Backreference
|
||||||
|
| CapturingGroup
|
||||||
|
| Character
|
||||||
|
| CharacterClass
|
||||||
|
| CharacterSet
|
||||||
|
| Group
|
||||||
|
| LookaheadAssertion;
|
||||||
|
/**
|
||||||
|
* The type which includes all character class atom nodes.
|
||||||
|
*/
|
||||||
|
export type CharacterClassElement =
|
||||||
|
| Character
|
||||||
|
| CharacterClassRange
|
||||||
|
| EscapeCharacterSet
|
||||||
|
| UnicodePropertyCharacterSet;
|
||||||
|
/**
|
||||||
|
* The type which defines common properties for all node types.
|
||||||
|
*/
|
||||||
|
export interface NodeBase {
|
||||||
|
/** The node type. */
|
||||||
|
type: Node["type"];
|
||||||
|
/** The parent node. */
|
||||||
|
parent: Node["parent"];
|
||||||
|
/** The 0-based index that this node starts. */
|
||||||
|
start: number;
|
||||||
|
/** The 0-based index that this node ends. */
|
||||||
|
end: number;
|
||||||
|
/** The raw text of this node. */
|
||||||
|
raw: string;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The root node.
|
||||||
|
*/
|
||||||
|
export interface RegExpLiteral extends NodeBase {
|
||||||
|
type: "RegExpLiteral";
|
||||||
|
parent: null;
|
||||||
|
pattern: Pattern;
|
||||||
|
flags: Flags;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The pattern.
|
||||||
|
*/
|
||||||
|
export interface Pattern extends NodeBase {
|
||||||
|
type: "Pattern";
|
||||||
|
parent: RegExpLiteral | null;
|
||||||
|
alternatives: Alternative[];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The alternative.
|
||||||
|
* E.g. `a|b`
|
||||||
|
*/
|
||||||
|
export interface Alternative extends NodeBase {
|
||||||
|
type: "Alternative";
|
||||||
|
parent: CapturingGroup | Group | LookaroundAssertion | Pattern;
|
||||||
|
elements: Element[];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The uncapturing group.
|
||||||
|
* E.g. `(?:ab)`
|
||||||
|
*/
|
||||||
|
export interface Group extends NodeBase {
|
||||||
|
type: "Group";
|
||||||
|
parent: Alternative | Quantifier;
|
||||||
|
alternatives: Alternative[];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The capturing group.
|
||||||
|
* E.g. `(ab)`, `(?<name>ab)`
|
||||||
|
*/
|
||||||
|
export interface CapturingGroup extends NodeBase {
|
||||||
|
type: "CapturingGroup";
|
||||||
|
parent: Alternative | Quantifier;
|
||||||
|
name: string | null;
|
||||||
|
alternatives: Alternative[];
|
||||||
|
references: Backreference[];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The lookaround assertion.
|
||||||
|
*/
|
||||||
|
export type LookaroundAssertion = LookaheadAssertion | LookbehindAssertion;
|
||||||
|
/**
|
||||||
|
* The lookahead assertion.
|
||||||
|
* E.g. `(?=ab)`, `(?!ab)`
|
||||||
|
*/
|
||||||
|
export interface LookaheadAssertion extends NodeBase {
|
||||||
|
type: "Assertion";
|
||||||
|
parent: Alternative | Quantifier;
|
||||||
|
kind: "lookahead";
|
||||||
|
negate: boolean;
|
||||||
|
alternatives: Alternative[];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The lookbehind assertion.
|
||||||
|
* E.g. `(?<=ab)`, `(?<!ab)`
|
||||||
|
*/
|
||||||
|
export interface LookbehindAssertion extends NodeBase {
|
||||||
|
type: "Assertion";
|
||||||
|
parent: Alternative;
|
||||||
|
kind: "lookbehind";
|
||||||
|
negate: boolean;
|
||||||
|
alternatives: Alternative[];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The quantifier.
|
||||||
|
* E.g. `a?`, `a*`, `a+`, `a{1,2}`, `a??`, `a*?`, `a+?`, `a{1,2}?`
|
||||||
|
*/
|
||||||
|
export interface Quantifier extends NodeBase {
|
||||||
|
type: "Quantifier";
|
||||||
|
parent: Alternative;
|
||||||
|
min: number;
|
||||||
|
max: number;
|
||||||
|
greedy: boolean;
|
||||||
|
element: QuantifiableElement;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The character class.
|
||||||
|
* E.g. `[ab]`, `[^ab]`
|
||||||
|
*/
|
||||||
|
export interface CharacterClass extends NodeBase {
|
||||||
|
type: "CharacterClass";
|
||||||
|
parent: Alternative | Quantifier;
|
||||||
|
negate: boolean;
|
||||||
|
elements: CharacterClassElement[];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The character class.
|
||||||
|
* E.g. `[a-b]`
|
||||||
|
*/
|
||||||
|
export interface CharacterClassRange extends NodeBase {
|
||||||
|
type: "CharacterClassRange";
|
||||||
|
parent: CharacterClass;
|
||||||
|
min: Character;
|
||||||
|
max: Character;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The assertion.
|
||||||
|
*/
|
||||||
|
export type Assertion = BoundaryAssertion | LookaroundAssertion;
|
||||||
|
/**
|
||||||
|
* The boundary assertion.
|
||||||
|
*/
|
||||||
|
export type BoundaryAssertion = EdgeAssertion | WordBoundaryAssertion;
|
||||||
|
/**
|
||||||
|
* The edge boundary assertion.
|
||||||
|
* E.g. `^`, `$`
|
||||||
|
*/
|
||||||
|
export interface EdgeAssertion extends NodeBase {
|
||||||
|
type: "Assertion";
|
||||||
|
parent: Alternative | Quantifier;
|
||||||
|
kind: "end" | "start";
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The word bondary assertion.
|
||||||
|
* E.g. `\b`, `\B`
|
||||||
|
*/
|
||||||
|
export interface WordBoundaryAssertion extends NodeBase {
|
||||||
|
type: "Assertion";
|
||||||
|
parent: Alternative | Quantifier;
|
||||||
|
kind: "word";
|
||||||
|
negate: boolean;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The character set.
|
||||||
|
*/
|
||||||
|
export type CharacterSet =
|
||||||
|
| AnyCharacterSet
|
||||||
|
| EscapeCharacterSet
|
||||||
|
| UnicodePropertyCharacterSet;
|
||||||
|
/**
|
||||||
|
* The dot.
|
||||||
|
* E.g. `.`
|
||||||
|
*/
|
||||||
|
export interface AnyCharacterSet extends NodeBase {
|
||||||
|
type: "CharacterSet";
|
||||||
|
parent: Alternative | Quantifier;
|
||||||
|
kind: "any";
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The character class escape.
|
||||||
|
* E.g. `\d`, `\s`, `\w`, `\D`, `\S`, `\W`
|
||||||
|
*/
|
||||||
|
export interface EscapeCharacterSet extends NodeBase {
|
||||||
|
type: "CharacterSet";
|
||||||
|
parent: Alternative | CharacterClass | Quantifier;
|
||||||
|
kind: "digit" | "space" | "word";
|
||||||
|
negate: boolean;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The unicode property escape.
|
||||||
|
* E.g. `\p{ASCII}`, `\P{ASCII}`, `\p{Script=Hiragana}`
|
||||||
|
*/
|
||||||
|
export interface UnicodePropertyCharacterSet extends NodeBase {
|
||||||
|
type: "CharacterSet";
|
||||||
|
parent: Alternative | CharacterClass | Quantifier;
|
||||||
|
kind: "property";
|
||||||
|
key: string;
|
||||||
|
value: string | null;
|
||||||
|
negate: boolean;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The character.
|
||||||
|
* This includes escape sequences which mean a character.
|
||||||
|
* E.g. `a`, `あ`, `✿`, `\x65`, `\u0065`, `\u{65}`, `\/`
|
||||||
|
*/
|
||||||
|
export interface Character extends NodeBase {
|
||||||
|
type: "Character";
|
||||||
|
parent: Alternative | CharacterClass | CharacterClassRange | Quantifier;
|
||||||
|
value: number;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The backreference.
|
||||||
|
* E.g. `\1`, `\k<name>`
|
||||||
|
*/
|
||||||
|
export interface Backreference extends NodeBase {
|
||||||
|
type: "Backreference";
|
||||||
|
parent: Alternative | Quantifier;
|
||||||
|
ref: number | string;
|
||||||
|
resolved: CapturingGroup;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The flags.
|
||||||
|
*/
|
||||||
|
export interface Flags extends NodeBase {
|
||||||
|
type: "Flags";
|
||||||
|
parent: RegExpLiteral | null;
|
||||||
|
dotAll: boolean;
|
||||||
|
global: boolean;
|
||||||
|
hasIndices: boolean;
|
||||||
|
ignoreCase: boolean;
|
||||||
|
multiline: boolean;
|
||||||
|
sticky: boolean;
|
||||||
|
unicode: boolean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "@eslint-community/regexpp/parser" {
|
||||||
|
import type {
|
||||||
|
Flags,
|
||||||
|
RegExpLiteral,
|
||||||
|
Pattern,
|
||||||
|
} from "@eslint-community/regexpp/ast";
|
||||||
|
import type { EcmaVersion } from "@eslint-community/regexpp/ecma-versions";
|
||||||
|
export namespace RegExpParser {
|
||||||
|
/**
|
||||||
|
* The options for RegExpParser construction.
|
||||||
|
*/
|
||||||
|
interface Options {
|
||||||
|
/**
|
||||||
|
* The flag to disable Annex B syntax. Default is `false`.
|
||||||
|
*/
|
||||||
|
strict?: boolean;
|
||||||
|
/**
|
||||||
|
* ECMAScript version. Default is `2023`.
|
||||||
|
* - `2015` added `u` and `y` flags.
|
||||||
|
* - `2018` added `s` flag, Named Capturing Group, Lookbehind Assertion,
|
||||||
|
* and Unicode Property Escape.
|
||||||
|
* - `2019`, `2020`, and `2021` added more valid Unicode Property Escapes.
|
||||||
|
* - `2022` added `d` flag.
|
||||||
|
* - `2023` added more valid Unicode Property Escapes.
|
||||||
|
*/
|
||||||
|
ecmaVersion?: EcmaVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export class RegExpParser {
|
||||||
|
/**
|
||||||
|
* Initialize this parser.
|
||||||
|
* @param options The options of parser.
|
||||||
|
*/
|
||||||
|
constructor(options?: RegExpParser.Options);
|
||||||
|
/**
|
||||||
|
* Parse a regular expression literal. E.g. "/abc/g"
|
||||||
|
* @param source The source code to parse.
|
||||||
|
* @param start The start index in the source code.
|
||||||
|
* @param end The end index in the source code.
|
||||||
|
* @returns The AST of the given regular expression.
|
||||||
|
*/
|
||||||
|
parseLiteral(source: string, start?: number, end?: number): RegExpLiteral;
|
||||||
|
/**
|
||||||
|
* Parse a regular expression flags. E.g. "gim"
|
||||||
|
* @param source The source code to parse.
|
||||||
|
* @param start The start index in the source code.
|
||||||
|
* @param end The end index in the source code.
|
||||||
|
* @returns The AST of the given flags.
|
||||||
|
*/
|
||||||
|
parseFlags(source: string, start?: number, end?: number): Flags;
|
||||||
|
/**
|
||||||
|
* Parse a regular expression pattern. E.g. "abc"
|
||||||
|
* @param source The source code to parse.
|
||||||
|
* @param start The start index in the source code.
|
||||||
|
* @param end The end index in the source code.
|
||||||
|
* @param uFlag The flag to set unicode mode.
|
||||||
|
* @returns The AST of the given pattern.
|
||||||
|
*/
|
||||||
|
parsePattern(
|
||||||
|
source: string,
|
||||||
|
start?: number,
|
||||||
|
end?: number,
|
||||||
|
uFlag?: boolean
|
||||||
|
): Pattern;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "@eslint-community/regexpp/validator" {
|
||||||
|
import type { EcmaVersion } from "@eslint-community/regexpp/ecma-versions";
|
||||||
|
export namespace RegExpValidator {
|
||||||
|
/**
|
||||||
|
* The options for RegExpValidator construction.
|
||||||
|
*/
|
||||||
|
interface Options {
|
||||||
|
/**
|
||||||
|
* The flag to disable Annex B syntax. Default is `false`.
|
||||||
|
*/
|
||||||
|
strict?: boolean;
|
||||||
|
/**
|
||||||
|
* ECMAScript version. Default is `2023`.
|
||||||
|
* - `2015` added `u` and `y` flags.
|
||||||
|
* - `2018` added `s` flag, Named Capturing Group, Lookbehind Assertion,
|
||||||
|
* and Unicode Property Escape.
|
||||||
|
* - `2019`, `2020`, and `2021` added more valid Unicode Property Escapes.
|
||||||
|
* - `2022` added `d` flag.
|
||||||
|
* - `2023` added more valid Unicode Property Escapes.
|
||||||
|
*/
|
||||||
|
ecmaVersion?: EcmaVersion;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator entered a RegExp literal.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
*/
|
||||||
|
onLiteralEnter?: (start: number) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator left a RegExp literal.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
*/
|
||||||
|
onLiteralLeave?: (start: number, end: number) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator found flags.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param flags.global `g` flag.
|
||||||
|
* @param flags.ignoreCase `i` flag.
|
||||||
|
* @param flags.multiline `m` flag.
|
||||||
|
* @param flags.unicode `u` flag.
|
||||||
|
* @param flags.sticky `y` flag.
|
||||||
|
* @param flags.dotAll `s` flag.
|
||||||
|
* @param flags.hasIndices `d` flag.
|
||||||
|
*/
|
||||||
|
onRegExpFlags?: (
|
||||||
|
start: number,
|
||||||
|
end: number,
|
||||||
|
flags: {
|
||||||
|
global: boolean;
|
||||||
|
ignoreCase: boolean;
|
||||||
|
multiline: boolean;
|
||||||
|
unicode: boolean;
|
||||||
|
sticky: boolean;
|
||||||
|
dotAll: boolean;
|
||||||
|
hasIndices: boolean;
|
||||||
|
}
|
||||||
|
) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator found flags.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param global `g` flag.
|
||||||
|
* @param ignoreCase `i` flag.
|
||||||
|
* @param multiline `m` flag.
|
||||||
|
* @param unicode `u` flag.
|
||||||
|
* @param sticky `y` flag.
|
||||||
|
* @param dotAll `s` flag.
|
||||||
|
* @param hasIndices `d` flag.
|
||||||
|
*
|
||||||
|
* @deprecated Use `onRegExpFlags` instead.
|
||||||
|
*/
|
||||||
|
onFlags?: (
|
||||||
|
start: number,
|
||||||
|
end: number,
|
||||||
|
global: boolean,
|
||||||
|
ignoreCase: boolean,
|
||||||
|
multiline: boolean,
|
||||||
|
unicode: boolean,
|
||||||
|
sticky: boolean,
|
||||||
|
dotAll: boolean,
|
||||||
|
hasIndices: boolean
|
||||||
|
) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator entered a pattern.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
*/
|
||||||
|
onPatternEnter?: (start: number) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator left a pattern.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
*/
|
||||||
|
onPatternLeave?: (start: number, end: number) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator entered a disjunction.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
*/
|
||||||
|
onDisjunctionEnter?: (start: number) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator left a disjunction.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
*/
|
||||||
|
onDisjunctionLeave?: (start: number, end: number) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator entered an alternative.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param index The 0-based index of alternatives in a disjunction.
|
||||||
|
*/
|
||||||
|
onAlternativeEnter?: (start: number, index: number) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator left an alternative.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param index The 0-based index of alternatives in a disjunction.
|
||||||
|
*/
|
||||||
|
onAlternativeLeave?: (start: number, end: number, index: number) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator entered an uncapturing group.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
*/
|
||||||
|
onGroupEnter?: (start: number) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator left an uncapturing group.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
*/
|
||||||
|
onGroupLeave?: (start: number, end: number) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator entered a capturing group.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param name The group name.
|
||||||
|
*/
|
||||||
|
onCapturingGroupEnter?: (start: number, name: string | null) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator left a capturing group.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param name The group name.
|
||||||
|
*/
|
||||||
|
onCapturingGroupLeave?: (
|
||||||
|
start: number,
|
||||||
|
end: number,
|
||||||
|
name: string | null
|
||||||
|
) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator found a quantifier.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param min The minimum number of repeating.
|
||||||
|
* @param max The maximum number of repeating.
|
||||||
|
* @param greedy The flag to choose the longest matching.
|
||||||
|
*/
|
||||||
|
onQuantifier?: (
|
||||||
|
start: number,
|
||||||
|
end: number,
|
||||||
|
min: number,
|
||||||
|
max: number,
|
||||||
|
greedy: boolean
|
||||||
|
) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator entered a lookahead/lookbehind assertion.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param kind The kind of the assertion.
|
||||||
|
* @param negate The flag which represents that the assertion is negative.
|
||||||
|
*/
|
||||||
|
onLookaroundAssertionEnter?: (
|
||||||
|
start: number,
|
||||||
|
kind: "lookahead" | "lookbehind",
|
||||||
|
negate: boolean
|
||||||
|
) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator left a lookahead/lookbehind assertion.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param kind The kind of the assertion.
|
||||||
|
* @param negate The flag which represents that the assertion is negative.
|
||||||
|
*/
|
||||||
|
onLookaroundAssertionLeave?: (
|
||||||
|
start: number,
|
||||||
|
end: number,
|
||||||
|
kind: "lookahead" | "lookbehind",
|
||||||
|
negate: boolean
|
||||||
|
) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator found an edge boundary assertion.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param kind The kind of the assertion.
|
||||||
|
*/
|
||||||
|
onEdgeAssertion?: (
|
||||||
|
start: number,
|
||||||
|
end: number,
|
||||||
|
kind: "end" | "start"
|
||||||
|
) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator found a word boundary assertion.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param kind The kind of the assertion.
|
||||||
|
* @param negate The flag which represents that the assertion is negative.
|
||||||
|
*/
|
||||||
|
onWordBoundaryAssertion?: (
|
||||||
|
start: number,
|
||||||
|
end: number,
|
||||||
|
kind: "word",
|
||||||
|
negate: boolean
|
||||||
|
) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator found a dot.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param kind The kind of the character set.
|
||||||
|
*/
|
||||||
|
onAnyCharacterSet?: (start: number, end: number, kind: "any") => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator found a character set escape.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param kind The kind of the character set.
|
||||||
|
* @param negate The flag which represents that the character set is negative.
|
||||||
|
*/
|
||||||
|
onEscapeCharacterSet?: (
|
||||||
|
start: number,
|
||||||
|
end: number,
|
||||||
|
kind: "digit" | "space" | "word",
|
||||||
|
negate: boolean
|
||||||
|
) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator found a Unicode proerty escape.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param kind The kind of the character set.
|
||||||
|
* @param key The property name.
|
||||||
|
* @param value The property value.
|
||||||
|
* @param negate The flag which represents that the character set is negative.
|
||||||
|
*/
|
||||||
|
onUnicodePropertyCharacterSet?: (
|
||||||
|
start: number,
|
||||||
|
end: number,
|
||||||
|
kind: "property",
|
||||||
|
key: string,
|
||||||
|
value: string | null,
|
||||||
|
negate: boolean
|
||||||
|
) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator found a character.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param value The code point of the character.
|
||||||
|
*/
|
||||||
|
onCharacter?: (start: number, end: number, value: number) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator found a backreference.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param ref The key of the referred capturing group.
|
||||||
|
*/
|
||||||
|
onBackreference?: (
|
||||||
|
start: number,
|
||||||
|
end: number,
|
||||||
|
ref: number | string
|
||||||
|
) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator entered a character class.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param negate The flag which represents that the character class is negative.
|
||||||
|
*/
|
||||||
|
onCharacterClassEnter?: (start: number, negate: boolean) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator left a character class.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param negate The flag which represents that the character class is negative.
|
||||||
|
*/
|
||||||
|
onCharacterClassLeave?: (
|
||||||
|
start: number,
|
||||||
|
end: number,
|
||||||
|
negate: boolean
|
||||||
|
) => void;
|
||||||
|
/**
|
||||||
|
* A function that is called when the validator found a character class range.
|
||||||
|
* @param start The 0-based index of the first character.
|
||||||
|
* @param end The next 0-based index of the last character.
|
||||||
|
* @param min The minimum code point of the range.
|
||||||
|
* @param max The maximum code point of the range.
|
||||||
|
*/
|
||||||
|
onCharacterClassRange?: (
|
||||||
|
start: number,
|
||||||
|
end: number,
|
||||||
|
min: number,
|
||||||
|
max: number
|
||||||
|
) => void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The regular expression validator.
|
||||||
|
*/
|
||||||
|
export class RegExpValidator {
|
||||||
|
/**
|
||||||
|
* Initialize this validator.
|
||||||
|
* @param options The options of validator.
|
||||||
|
*/
|
||||||
|
constructor(options?: RegExpValidator.Options);
|
||||||
|
/**
|
||||||
|
* Validate a regular expression literal. E.g. "/abc/g"
|
||||||
|
* @param source The source code to validate.
|
||||||
|
* @param start The start index in the source code.
|
||||||
|
* @param end The end index in the source code.
|
||||||
|
*/
|
||||||
|
validateLiteral(source: string, start?: number, end?: number): void;
|
||||||
|
/**
|
||||||
|
* Validate a regular expression flags. E.g. "gim"
|
||||||
|
* @param source The source code to validate.
|
||||||
|
* @param start The start index in the source code.
|
||||||
|
* @param end The end index in the source code.
|
||||||
|
*/
|
||||||
|
validateFlags(source: string, start?: number, end?: number): void;
|
||||||
|
/**
|
||||||
|
* Validate a regular expression pattern. E.g. "abc"
|
||||||
|
* @param source The source code to validate.
|
||||||
|
* @param start The start index in the source code.
|
||||||
|
* @param end The end index in the source code.
|
||||||
|
* @param uFlag The flag to set unicode mode.
|
||||||
|
*/
|
||||||
|
validatePattern(
|
||||||
|
source: string,
|
||||||
|
start?: number,
|
||||||
|
end?: number,
|
||||||
|
uFlag?: boolean
|
||||||
|
): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "@eslint-community/regexpp/visitor" {
|
||||||
|
import type {
|
||||||
|
Alternative,
|
||||||
|
Assertion,
|
||||||
|
Backreference,
|
||||||
|
CapturingGroup,
|
||||||
|
Character,
|
||||||
|
CharacterClass,
|
||||||
|
CharacterClassRange,
|
||||||
|
CharacterSet,
|
||||||
|
Flags,
|
||||||
|
Group,
|
||||||
|
Node,
|
||||||
|
Pattern,
|
||||||
|
Quantifier,
|
||||||
|
RegExpLiteral,
|
||||||
|
} from "@eslint-community/regexpp/ast";
|
||||||
|
/**
|
||||||
|
* The visitor to walk on AST.
|
||||||
|
*/
|
||||||
|
export class RegExpVisitor {
|
||||||
|
/**
|
||||||
|
* Initialize this visitor.
|
||||||
|
* @param handlers Callbacks for each node.
|
||||||
|
*/
|
||||||
|
constructor(handlers: RegExpVisitor.Handlers);
|
||||||
|
/**
|
||||||
|
* Visit a given node and descendant nodes.
|
||||||
|
* @param node The root node to visit tree.
|
||||||
|
*/
|
||||||
|
visit(node: Node): void;
|
||||||
|
}
|
||||||
|
export namespace RegExpVisitor {
|
||||||
|
interface Handlers {
|
||||||
|
onAlternativeEnter?: (node: Alternative) => void;
|
||||||
|
onAlternativeLeave?: (node: Alternative) => void;
|
||||||
|
onAssertionEnter?: (node: Assertion) => void;
|
||||||
|
onAssertionLeave?: (node: Assertion) => void;
|
||||||
|
onBackreferenceEnter?: (node: Backreference) => void;
|
||||||
|
onBackreferenceLeave?: (node: Backreference) => void;
|
||||||
|
onCapturingGroupEnter?: (node: CapturingGroup) => void;
|
||||||
|
onCapturingGroupLeave?: (node: CapturingGroup) => void;
|
||||||
|
onCharacterEnter?: (node: Character) => void;
|
||||||
|
onCharacterLeave?: (node: Character) => void;
|
||||||
|
onCharacterClassEnter?: (node: CharacterClass) => void;
|
||||||
|
onCharacterClassLeave?: (node: CharacterClass) => void;
|
||||||
|
onCharacterClassRangeEnter?: (node: CharacterClassRange) => void;
|
||||||
|
onCharacterClassRangeLeave?: (node: CharacterClassRange) => void;
|
||||||
|
onCharacterSetEnter?: (node: CharacterSet) => void;
|
||||||
|
onCharacterSetLeave?: (node: CharacterSet) => void;
|
||||||
|
onFlagsEnter?: (node: Flags) => void;
|
||||||
|
onFlagsLeave?: (node: Flags) => void;
|
||||||
|
onGroupEnter?: (node: Group) => void;
|
||||||
|
onGroupLeave?: (node: Group) => void;
|
||||||
|
onPatternEnter?: (node: Pattern) => void;
|
||||||
|
onPatternLeave?: (node: Pattern) => void;
|
||||||
|
onQuantifierEnter?: (node: Quantifier) => void;
|
||||||
|
onQuantifierLeave?: (node: Quantifier) => void;
|
||||||
|
onRegExpLiteralEnter?: (node: RegExpLiteral) => void;
|
||||||
|
onRegExpLiteralLeave?: (node: RegExpLiteral) => void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "@eslint-community/regexpp/ecma-versions" {
|
||||||
|
export type EcmaVersion =
|
||||||
|
| 5
|
||||||
|
| 2015
|
||||||
|
| 2016
|
||||||
|
| 2017
|
||||||
|
| 2018
|
||||||
|
| 2019
|
||||||
|
| 2020
|
||||||
|
| 2021
|
||||||
|
| 2022
|
||||||
|
| 2023;
|
||||||
|
}
|
||||||
564
node_modules/regexpp/index.js → node_modules/@eslint-community/regexpp/index.js
generated
vendored
564
node_modules/regexpp/index.js → node_modules/@eslint-community/regexpp/index.js
generated
vendored
File diff suppressed because it is too large
Load Diff
1
node_modules/@eslint-community/regexpp/index.js.map
generated
vendored
Normal file
1
node_modules/@eslint-community/regexpp/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
564
node_modules/regexpp/index.mjs → node_modules/@eslint-community/regexpp/index.mjs
generated
vendored
564
node_modules/regexpp/index.mjs → node_modules/@eslint-community/regexpp/index.mjs
generated
vendored
File diff suppressed because it is too large
Load Diff
1
node_modules/@eslint-community/regexpp/index.mjs.map
generated
vendored
Normal file
1
node_modules/@eslint-community/regexpp/index.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
131
node_modules/regexpp/package.json → node_modules/@eslint-community/regexpp/package.json
generated
vendored
131
node_modules/regexpp/package.json → node_modules/@eslint-community/regexpp/package.json
generated
vendored
@ -1,67 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "regexpp",
|
"name": "@eslint-community/regexpp",
|
||||||
"version": "3.2.0",
|
"version": "4.5.1",
|
||||||
"description": "Regular expression parser for ECMAScript.",
|
"description": "Regular expression parser for ECMAScript.",
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
},
|
|
||||||
"main": "index",
|
|
||||||
"files": [
|
|
||||||
"index.*"
|
|
||||||
],
|
|
||||||
"exports": {
|
|
||||||
".": {
|
|
||||||
"import": "./index.mjs",
|
|
||||||
"default": "./index.js"
|
|
||||||
},
|
|
||||||
"./package.json": "./package.json"
|
|
||||||
},
|
|
||||||
"dependencies": {},
|
|
||||||
"devDependencies": {
|
|
||||||
"@mysticatea/eslint-plugin": "^11.0.0",
|
|
||||||
"@types/eslint": "^4.16.2",
|
|
||||||
"@types/jsdom": "^12.2.4",
|
|
||||||
"@types/mocha": "^5.2.2",
|
|
||||||
"@types/node": "^12.6.8",
|
|
||||||
"codecov": "^3.5.0",
|
|
||||||
"dts-bundle": "^0.7.3",
|
|
||||||
"eslint": "^6.1.0",
|
|
||||||
"jsdom": "^15.1.1",
|
|
||||||
"mocha": "^6.2.0",
|
|
||||||
"npm-run-all": "^4.1.5",
|
|
||||||
"nyc": "^14.1.1",
|
|
||||||
"rimraf": "^2.6.2",
|
|
||||||
"rollup": "^1.17.0",
|
|
||||||
"rollup-plugin-node-resolve": "^5.2.0",
|
|
||||||
"rollup-plugin-sourcemaps": "^0.4.2",
|
|
||||||
"ts-node": "^8.3.0",
|
|
||||||
"typescript": "^3.5.3"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"prebuild": "npm run -s clean",
|
|
||||||
"build": "run-s build:*",
|
|
||||||
"build:tsc": "tsc --module es2015",
|
|
||||||
"build:rollup": "rollup -c",
|
|
||||||
"build:dts": "dts-bundle --name regexpp --main .temp/index.d.ts --out ../index.d.ts",
|
|
||||||
"clean": "rimraf .temp index.*",
|
|
||||||
"codecov": "nyc report -r lcovonly && codecov -t ${CODECOV_TOKEN} --disable=gcov",
|
|
||||||
"lint": "eslint scripts src test --ext .ts",
|
|
||||||
"pretest": "run-s build lint",
|
|
||||||
"test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000",
|
|
||||||
"update:test": "ts-node scripts/update-fixtures.ts",
|
|
||||||
"update:unicode": "run-s update:unicode:*",
|
|
||||||
"update:unicode:ids": "ts-node scripts/update-unicode-ids.ts",
|
|
||||||
"update:unicode:props": "ts-node scripts/update-unicode-properties.ts",
|
|
||||||
"preversion": "npm test",
|
|
||||||
"version": "npm run -s build",
|
|
||||||
"postversion": "git push && git push --tags",
|
|
||||||
"prewatch": "npm run -s clean",
|
|
||||||
"watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/mysticatea/regexpp.git"
|
|
||||||
},
|
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"regexp",
|
"regexp",
|
||||||
"regular",
|
"regular",
|
||||||
@ -79,13 +19,70 @@
|
|||||||
"es2018",
|
"es2018",
|
||||||
"es2019",
|
"es2019",
|
||||||
"es2020",
|
"es2020",
|
||||||
|
"es2021",
|
||||||
"annexB"
|
"annexB"
|
||||||
],
|
],
|
||||||
"author": "Toru Nagashima (https://github.com/mysticatea)",
|
"homepage": "https://github.com/eslint-community/regexpp#readme",
|
||||||
"license": "MIT",
|
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/mysticatea/regexpp/issues"
|
"url": "https://github.com/eslint-community/regexpp/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/mysticatea/regexpp#readme",
|
"repository": {
|
||||||
"funding": "https://github.com/sponsors/mysticatea"
|
"type": "git",
|
||||||
|
"url": "https://github.com/eslint-community/regexpp"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "Toru Nagashima",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": "./index.d.ts",
|
||||||
|
"import": "./index.mjs",
|
||||||
|
"default": "./index.js"
|
||||||
|
},
|
||||||
|
"./package.json": "./package.json"
|
||||||
|
},
|
||||||
|
"main": "index",
|
||||||
|
"files": [
|
||||||
|
"index.*"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"prebuild": "npm run -s clean",
|
||||||
|
"build": "run-s build:*",
|
||||||
|
"build:tsc": "tsc --module es2015",
|
||||||
|
"build:rollup": "rollup -c",
|
||||||
|
"build:dts": "npm run -s build:tsc -- --removeComments false && dts-bundle --name @eslint-community/regexpp --main .temp/index.d.ts --out ../index.d.ts && prettier --write index.d.ts",
|
||||||
|
"clean": "rimraf .temp index.*",
|
||||||
|
"lint": "eslint . --ext .ts",
|
||||||
|
"test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000",
|
||||||
|
"update:test": "ts-node scripts/update-fixtures.ts",
|
||||||
|
"update:unicode": "run-s update:unicode:*",
|
||||||
|
"update:unicode:ids": "ts-node scripts/update-unicode-ids.ts",
|
||||||
|
"update:unicode:props": "ts-node scripts/update-unicode-properties.ts",
|
||||||
|
"preversion": "npm test && npm run -s build",
|
||||||
|
"postversion": "git push && git push --tags",
|
||||||
|
"prewatch": "npm run -s clean",
|
||||||
|
"watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl"
|
||||||
|
},
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"@eslint-community/eslint-plugin-mysticatea": "^15.3.0",
|
||||||
|
"@rollup/plugin-node-resolve": "^14.1.0",
|
||||||
|
"@types/eslint": "^8.4.10",
|
||||||
|
"@types/jsdom": "^16.2.15",
|
||||||
|
"@types/mocha": "^9.1.1",
|
||||||
|
"@types/node": "^12.20.55",
|
||||||
|
"dts-bundle": "^0.7.3",
|
||||||
|
"eslint": "^8.31.0",
|
||||||
|
"jsdom": "^19.0.0",
|
||||||
|
"mocha": "^9.2.2",
|
||||||
|
"npm-run-all": "^4.1.5",
|
||||||
|
"nyc": "^14.1.1",
|
||||||
|
"rimraf": "^3.0.2",
|
||||||
|
"rollup": "^2.79.1",
|
||||||
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||||
|
"ts-node": "^10.9.1",
|
||||||
|
"typescript": "~5.0.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
29
node_modules/@eslint/eslintrc/README.md
generated
vendored
29
node_modules/@eslint/eslintrc/README.md
generated
vendored
@ -1,8 +1,8 @@
|
|||||||
# ESLintRC Library
|
# ESLintRC Library
|
||||||
|
|
||||||
This repository contains the legacy ESLintRC configuration file format for ESLint.
|
This repository contains the legacy ESLintRC configuration file format for ESLint. This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs.
|
||||||
|
|
||||||
**Note:** This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs.
|
**Note:** This package is frozen except for critical bug fixes as ESLint moves to a new config system.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@ -16,36 +16,43 @@ npm install @eslint/eslintrc --save-dev
|
|||||||
yarn add @eslint/eslintrc -D
|
yarn add @eslint/eslintrc -D
|
||||||
```
|
```
|
||||||
|
|
||||||
## Future Usage
|
## Usage
|
||||||
|
|
||||||
**Note:** This package is not intended for public use at this time. The following is an example of how it will be used in the future.
|
|
||||||
|
|
||||||
The primary class in this package is `FlatCompat`, which is a utility to translate ESLintRC-style configs into flat configs. Here's how you use it inside of your `eslint.config.js` file:
|
The primary class in this package is `FlatCompat`, which is a utility to translate ESLintRC-style configs into flat configs. Here's how you use it inside of your `eslint.config.js` file:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { FlatCompat } from "@eslint/eslintrc";
|
import { FlatCompat } from "@eslint/eslintrc";
|
||||||
|
import js from "@eslint/js";
|
||||||
|
import path from "path";
|
||||||
|
import { fileURLToPath } from "url";
|
||||||
|
|
||||||
|
// mimic CommonJS variables -- not needed if using CommonJS
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = path.dirname(__filename);
|
||||||
|
|
||||||
const compat = new FlatCompat({
|
const compat = new FlatCompat({
|
||||||
baseDirectory: __dirname, // optional; default: process.cwd()
|
baseDirectory: __dirname, // optional; default: process.cwd()
|
||||||
resolvePluginsRelativeTo: __dirname // optional
|
resolvePluginsRelativeTo: __dirname, // optional
|
||||||
|
recommendedConfig: js.configs.recommended, // optional
|
||||||
|
allConfig: js.configs.all, // optional
|
||||||
});
|
});
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
|
|
||||||
// mimic ESLintRC-style extends
|
// mimic ESLintRC-style extends
|
||||||
compat.extends("standard", "example"),
|
...compat.extends("standard", "example"),
|
||||||
|
|
||||||
// mimic environments
|
// mimic environments
|
||||||
compat.env({
|
...compat.env({
|
||||||
es2020: true,
|
es2020: true,
|
||||||
node: true
|
node: true
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// mimic plugins
|
// mimic plugins
|
||||||
compat.plugins("airbnb", "react"),
|
...compat.plugins("airbnb", "react"),
|
||||||
|
|
||||||
// translate an entire config
|
// translate an entire config
|
||||||
compat.config({
|
...compat.config({
|
||||||
plugins: ["airbnb", "react"],
|
plugins: ["airbnb", "react"],
|
||||||
extends: "standard",
|
extends: "standard",
|
||||||
env: {
|
env: {
|
||||||
|
|||||||
12
node_modules/@eslint/eslintrc/conf/environments.js
generated
vendored
12
node_modules/@eslint/eslintrc/conf/environments.js
generated
vendored
@ -114,6 +114,18 @@ export default new Map(Object.entries({
|
|||||||
ecmaVersion: 13
|
ecmaVersion: 13
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
es2023: {
|
||||||
|
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 14
|
||||||
|
}
|
||||||
|
},
|
||||||
|
es2024: {
|
||||||
|
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 15
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// Platforms
|
// Platforms
|
||||||
browser: {
|
browser: {
|
||||||
|
|||||||
12
node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs
generated
vendored
12
node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs
generated
vendored
@ -575,6 +575,18 @@ var environments = new Map(Object.entries({
|
|||||||
ecmaVersion: 13
|
ecmaVersion: 13
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
es2023: {
|
||||||
|
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 14
|
||||||
|
}
|
||||||
|
},
|
||||||
|
es2024: {
|
||||||
|
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 15
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// Platforms
|
// Platforms
|
||||||
browser: {
|
browser: {
|
||||||
|
|||||||
2
node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map
generated
vendored
2
node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map
generated
vendored
File diff suppressed because one or more lines are too long
54
node_modules/@eslint/eslintrc/dist/eslintrc.cjs
generated
vendored
54
node_modules/@eslint/eslintrc/dist/eslintrc.cjs
generated
vendored
@ -1807,6 +1807,18 @@ var environments = new Map(Object.entries({
|
|||||||
ecmaVersion: 13
|
ecmaVersion: 13
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
es2023: {
|
||||||
|
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 14
|
||||||
|
}
|
||||||
|
},
|
||||||
|
es2024: {
|
||||||
|
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 15
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// Platforms
|
// Platforms
|
||||||
browser: {
|
browser: {
|
||||||
@ -3706,8 +3718,7 @@ class CascadingConfigArrayFactory {
|
|||||||
configArrayFactory,
|
configArrayFactory,
|
||||||
cwd,
|
cwd,
|
||||||
rulePaths,
|
rulePaths,
|
||||||
loadRules,
|
loadRules
|
||||||
resolver
|
|
||||||
}),
|
}),
|
||||||
baseConfigData,
|
baseConfigData,
|
||||||
cliConfigArray: createCLIConfigArray({
|
cliConfigArray: createCLIConfigArray({
|
||||||
@ -4027,17 +4038,6 @@ function translateESLintRC(eslintrcConfig, {
|
|||||||
const languageOptionsKeysToCopy = ["globals", "parser", "parserOptions"];
|
const languageOptionsKeysToCopy = ["globals", "parser", "parserOptions"];
|
||||||
const linterOptionsKeysToCopy = ["noInlineConfig", "reportUnusedDisableDirectives"];
|
const linterOptionsKeysToCopy = ["noInlineConfig", "reportUnusedDisableDirectives"];
|
||||||
|
|
||||||
// check for special settings for eslint:all and eslint:recommended:
|
|
||||||
if (eslintrcConfig.settings) {
|
|
||||||
if (eslintrcConfig.settings["eslint:all"] === true) {
|
|
||||||
return ["eslint:all"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (eslintrcConfig.settings["eslint:recommended"] === true) {
|
|
||||||
return ["eslint:recommended"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// copy over simple translations
|
// copy over simple translations
|
||||||
for (const key of keysToCopy) {
|
for (const key of keysToCopy) {
|
||||||
if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") {
|
if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") {
|
||||||
@ -4189,15 +4189,31 @@ class FlatCompat {
|
|||||||
|
|
||||||
constructor({
|
constructor({
|
||||||
baseDirectory = process.cwd(),
|
baseDirectory = process.cwd(),
|
||||||
resolvePluginsRelativeTo = baseDirectory
|
resolvePluginsRelativeTo = baseDirectory,
|
||||||
|
recommendedConfig,
|
||||||
|
allConfig
|
||||||
} = {}) {
|
} = {}) {
|
||||||
this.baseDirectory = baseDirectory;
|
this.baseDirectory = baseDirectory;
|
||||||
this.resolvePluginsRelativeTo = resolvePluginsRelativeTo;
|
this.resolvePluginsRelativeTo = resolvePluginsRelativeTo;
|
||||||
this[cafactory] = new ConfigArrayFactory({
|
this[cafactory] = new ConfigArrayFactory({
|
||||||
cwd: baseDirectory,
|
cwd: baseDirectory,
|
||||||
resolvePluginsRelativeTo,
|
resolvePluginsRelativeTo,
|
||||||
getEslintAllConfig: () => ({ settings: { "eslint:all": true } }),
|
getEslintAllConfig: () => {
|
||||||
getEslintRecommendedConfig: () => ({ settings: { "eslint:recommended": true } })
|
|
||||||
|
if (!allConfig) {
|
||||||
|
throw new TypeError("Missing parameter 'allConfig' in FlatCompat constructor.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return allConfig;
|
||||||
|
},
|
||||||
|
getEslintRecommendedConfig: () => {
|
||||||
|
|
||||||
|
if (!recommendedConfig) {
|
||||||
|
throw new TypeError("Missing parameter 'recommendedConfig' in FlatCompat constructor.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return recommendedConfig;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4247,7 +4263,7 @@ class FlatCompat {
|
|||||||
/**
|
/**
|
||||||
* Translates the `env` section of an ESLintRC-style config.
|
* Translates the `env` section of an ESLintRC-style config.
|
||||||
* @param {Object} envConfig The `env` section of an ESLintRC config.
|
* @param {Object} envConfig The `env` section of an ESLintRC config.
|
||||||
* @returns {Object} A flag-config object representing the environments.
|
* @returns {Object[]} An array of flag-config objects representing the environments.
|
||||||
*/
|
*/
|
||||||
env(envConfig) {
|
env(envConfig) {
|
||||||
return this.config({
|
return this.config({
|
||||||
@ -4258,7 +4274,7 @@ class FlatCompat {
|
|||||||
/**
|
/**
|
||||||
* Translates the `extends` section of an ESLintRC-style config.
|
* Translates the `extends` section of an ESLintRC-style config.
|
||||||
* @param {...string} configsToExtend The names of the configs to load.
|
* @param {...string} configsToExtend The names of the configs to load.
|
||||||
* @returns {Object} A flag-config object representing the config.
|
* @returns {Object[]} An array of flag-config objects representing the config.
|
||||||
*/
|
*/
|
||||||
extends(...configsToExtend) {
|
extends(...configsToExtend) {
|
||||||
return this.config({
|
return this.config({
|
||||||
@ -4269,7 +4285,7 @@ class FlatCompat {
|
|||||||
/**
|
/**
|
||||||
* Translates the `plugins` section of an ESLintRC-style config.
|
* Translates the `plugins` section of an ESLintRC-style config.
|
||||||
* @param {...string} plugins The names of the plugins to load.
|
* @param {...string} plugins The names of the plugins to load.
|
||||||
* @returns {Object} A flag-config object representing the plugins.
|
* @returns {Object[]} An array of flag-config objects representing the plugins.
|
||||||
*/
|
*/
|
||||||
plugins(...plugins) {
|
plugins(...plugins) {
|
||||||
return this.config({
|
return this.config({
|
||||||
|
|||||||
2
node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map
generated
vendored
2
node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map
generated
vendored
File diff suppressed because one or more lines are too long
3
node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js
generated
vendored
3
node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js
generated
vendored
@ -250,8 +250,7 @@ class CascadingConfigArrayFactory {
|
|||||||
configArrayFactory,
|
configArrayFactory,
|
||||||
cwd,
|
cwd,
|
||||||
rulePaths,
|
rulePaths,
|
||||||
loadRules,
|
loadRules
|
||||||
resolver
|
|
||||||
}),
|
}),
|
||||||
baseConfigData,
|
baseConfigData,
|
||||||
cliConfigArray: createCLIConfigArray({
|
cliConfigArray: createCLIConfigArray({
|
||||||
|
|||||||
39
node_modules/@eslint/eslintrc/lib/flat-compat.js
generated
vendored
39
node_modules/@eslint/eslintrc/lib/flat-compat.js
generated
vendored
@ -53,17 +53,6 @@ function translateESLintRC(eslintrcConfig, {
|
|||||||
const languageOptionsKeysToCopy = ["globals", "parser", "parserOptions"];
|
const languageOptionsKeysToCopy = ["globals", "parser", "parserOptions"];
|
||||||
const linterOptionsKeysToCopy = ["noInlineConfig", "reportUnusedDisableDirectives"];
|
const linterOptionsKeysToCopy = ["noInlineConfig", "reportUnusedDisableDirectives"];
|
||||||
|
|
||||||
// check for special settings for eslint:all and eslint:recommended:
|
|
||||||
if (eslintrcConfig.settings) {
|
|
||||||
if (eslintrcConfig.settings["eslint:all"] === true) {
|
|
||||||
return ["eslint:all"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (eslintrcConfig.settings["eslint:recommended"] === true) {
|
|
||||||
return ["eslint:recommended"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// copy over simple translations
|
// copy over simple translations
|
||||||
for (const key of keysToCopy) {
|
for (const key of keysToCopy) {
|
||||||
if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") {
|
if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") {
|
||||||
@ -215,15 +204,31 @@ class FlatCompat {
|
|||||||
|
|
||||||
constructor({
|
constructor({
|
||||||
baseDirectory = process.cwd(),
|
baseDirectory = process.cwd(),
|
||||||
resolvePluginsRelativeTo = baseDirectory
|
resolvePluginsRelativeTo = baseDirectory,
|
||||||
|
recommendedConfig,
|
||||||
|
allConfig
|
||||||
} = {}) {
|
} = {}) {
|
||||||
this.baseDirectory = baseDirectory;
|
this.baseDirectory = baseDirectory;
|
||||||
this.resolvePluginsRelativeTo = resolvePluginsRelativeTo;
|
this.resolvePluginsRelativeTo = resolvePluginsRelativeTo;
|
||||||
this[cafactory] = new ConfigArrayFactory({
|
this[cafactory] = new ConfigArrayFactory({
|
||||||
cwd: baseDirectory,
|
cwd: baseDirectory,
|
||||||
resolvePluginsRelativeTo,
|
resolvePluginsRelativeTo,
|
||||||
getEslintAllConfig: () => ({ settings: { "eslint:all": true } }),
|
getEslintAllConfig: () => {
|
||||||
getEslintRecommendedConfig: () => ({ settings: { "eslint:recommended": true } })
|
|
||||||
|
if (!allConfig) {
|
||||||
|
throw new TypeError("Missing parameter 'allConfig' in FlatCompat constructor.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return allConfig;
|
||||||
|
},
|
||||||
|
getEslintRecommendedConfig: () => {
|
||||||
|
|
||||||
|
if (!recommendedConfig) {
|
||||||
|
throw new TypeError("Missing parameter 'recommendedConfig' in FlatCompat constructor.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return recommendedConfig;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,7 +278,7 @@ class FlatCompat {
|
|||||||
/**
|
/**
|
||||||
* Translates the `env` section of an ESLintRC-style config.
|
* Translates the `env` section of an ESLintRC-style config.
|
||||||
* @param {Object} envConfig The `env` section of an ESLintRC config.
|
* @param {Object} envConfig The `env` section of an ESLintRC config.
|
||||||
* @returns {Object} A flag-config object representing the environments.
|
* @returns {Object[]} An array of flag-config objects representing the environments.
|
||||||
*/
|
*/
|
||||||
env(envConfig) {
|
env(envConfig) {
|
||||||
return this.config({
|
return this.config({
|
||||||
@ -284,7 +289,7 @@ class FlatCompat {
|
|||||||
/**
|
/**
|
||||||
* Translates the `extends` section of an ESLintRC-style config.
|
* Translates the `extends` section of an ESLintRC-style config.
|
||||||
* @param {...string} configsToExtend The names of the configs to load.
|
* @param {...string} configsToExtend The names of the configs to load.
|
||||||
* @returns {Object} A flag-config object representing the config.
|
* @returns {Object[]} An array of flag-config objects representing the config.
|
||||||
*/
|
*/
|
||||||
extends(...configsToExtend) {
|
extends(...configsToExtend) {
|
||||||
return this.config({
|
return this.config({
|
||||||
@ -295,7 +300,7 @@ class FlatCompat {
|
|||||||
/**
|
/**
|
||||||
* Translates the `plugins` section of an ESLintRC-style config.
|
* Translates the `plugins` section of an ESLintRC-style config.
|
||||||
* @param {...string} plugins The names of the plugins to load.
|
* @param {...string} plugins The names of the plugins to load.
|
||||||
* @returns {Object} A flag-config object representing the plugins.
|
* @returns {Object[]} An array of flag-config objects representing the plugins.
|
||||||
*/
|
*/
|
||||||
plugins(...plugins) {
|
plugins(...plugins) {
|
||||||
return this.config({
|
return this.config({
|
||||||
|
|||||||
1
node_modules/@eslint/eslintrc/node_modules/.bin/js-yaml
generated
vendored
Symbolic link
1
node_modules/@eslint/eslintrc/node_modules/.bin/js-yaml
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../js-yaml/bin/js-yaml.js
|
||||||
6
node_modules/@eslint/eslintrc/package.json
generated
vendored
6
node_modules/@eslint/eslintrc/package.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@eslint/eslintrc",
|
"name": "@eslint/eslintrc",
|
||||||
"version": "1.3.2",
|
"version": "2.1.0",
|
||||||
"description": "The legacy ESLintRC config file format for ESLint",
|
"description": "The legacy ESLintRC config file format for ESLint",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/eslintrc.cjs",
|
"main": "./dist/eslintrc.cjs",
|
||||||
@ -68,8 +68,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ajv": "^6.12.4",
|
"ajv": "^6.12.4",
|
||||||
"debug": "^4.3.2",
|
"debug": "^4.3.2",
|
||||||
"espree": "^9.4.0",
|
"espree": "^9.6.0",
|
||||||
"globals": "^13.15.0",
|
"globals": "^13.19.0",
|
||||||
"ignore": "^5.2.0",
|
"ignore": "^5.2.0",
|
||||||
"import-fresh": "^3.2.1",
|
"import-fresh": "^3.2.1",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
|
|||||||
4
node_modules/is-number/LICENSE → node_modules/@eslint/js/LICENSE
generated
vendored
4
node_modules/is-number/LICENSE → node_modules/@eslint/js/LICENSE
generated
vendored
@ -1,6 +1,4 @@
|
|||||||
The MIT License (MIT)
|
Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
|
||||||
|
|
||||||
Copyright (c) 2014-present, Jon Schlinkert.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
57
node_modules/@eslint/js/README.md
generated
vendored
Normal file
57
node_modules/@eslint/js/README.md
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
[](https://www.npmjs.com/package/@eslint/js)
|
||||||
|
|
||||||
|
# ESLint JavaScript Plugin
|
||||||
|
|
||||||
|
[Website](https://eslint.org) | [Configure ESLint](https://eslint.org/docs/latest/use/configure) | [Rules](https://eslint.org/docs/rules/) | [Contributing](https://eslint.org/docs/latest/contribute) | [Twitter](https://twitter.com/geteslint) | [Chatroom](https://eslint.org/chat)
|
||||||
|
|
||||||
|
The beginnings of separating out JavaScript-specific functionality from ESLint.
|
||||||
|
|
||||||
|
Right now, this plugin contains two configurations:
|
||||||
|
|
||||||
|
* `recommended` - enables the rules recommended by the ESLint team (the replacement for `"eslint:recommended"`)
|
||||||
|
* `all` - enables all ESLint rules (the replacement for `"eslint:all"`)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm install @eslint/js -D
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Use in your `eslint.config.js` file anytime you want to extend one of the configs:
|
||||||
|
|
||||||
|
```js
|
||||||
|
import js from "@eslint/js";
|
||||||
|
|
||||||
|
export default [
|
||||||
|
|
||||||
|
// apply recommended rules to JS files
|
||||||
|
{
|
||||||
|
files: ["**/*.js"],
|
||||||
|
rules: js.configs.recommended.rules
|
||||||
|
},
|
||||||
|
|
||||||
|
// apply recommended rules to JS files with an override
|
||||||
|
{
|
||||||
|
files: ["**/*.js"],
|
||||||
|
rules: {
|
||||||
|
...js.configs.recommended.rules,
|
||||||
|
"no-unused-vars": "warn"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// apply all rules to JS files
|
||||||
|
{
|
||||||
|
files: ["**/*.js"],
|
||||||
|
rules: {
|
||||||
|
...js.configs.all.rules,
|
||||||
|
"no-unused-vars": "warn"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT
|
||||||
31
node_modules/@eslint/js/package.json
generated
vendored
Normal file
31
node_modules/@eslint/js/package.json
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"name": "@eslint/js",
|
||||||
|
"version": "8.44.0",
|
||||||
|
"description": "ESLint JavaScript language implementation",
|
||||||
|
"main": "./src/index.js",
|
||||||
|
"scripts": {},
|
||||||
|
"files": [
|
||||||
|
"LICENSE",
|
||||||
|
"README.md",
|
||||||
|
"src"
|
||||||
|
],
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/eslint/eslint.git",
|
||||||
|
"directory": "packages/js"
|
||||||
|
},
|
||||||
|
"homepage": "https://eslint.org",
|
||||||
|
"bugs": "https://github.com/eslint/eslint/issues/",
|
||||||
|
"keywords": [
|
||||||
|
"javascript",
|
||||||
|
"eslint-plugin",
|
||||||
|
"eslint"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
279
node_modules/@eslint/js/src/configs/eslint-all.js
generated
vendored
Normal file
279
node_modules/@eslint/js/src/configs/eslint-all.js
generated
vendored
Normal file
@ -0,0 +1,279 @@
|
|||||||
|
/*
|
||||||
|
* WARNING: This file is autogenerated using the tools/update-eslint-all.js
|
||||||
|
* script. Do not edit manually.
|
||||||
|
*/
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/* eslint quote-props: off -- autogenerated so don't lint */
|
||||||
|
|
||||||
|
module.exports = Object.freeze({
|
||||||
|
"rules": {
|
||||||
|
"accessor-pairs": "error",
|
||||||
|
"array-bracket-newline": "error",
|
||||||
|
"array-bracket-spacing": "error",
|
||||||
|
"array-callback-return": "error",
|
||||||
|
"array-element-newline": "error",
|
||||||
|
"arrow-body-style": "error",
|
||||||
|
"arrow-parens": "error",
|
||||||
|
"arrow-spacing": "error",
|
||||||
|
"block-scoped-var": "error",
|
||||||
|
"block-spacing": "error",
|
||||||
|
"brace-style": "error",
|
||||||
|
"camelcase": "error",
|
||||||
|
"capitalized-comments": "error",
|
||||||
|
"class-methods-use-this": "error",
|
||||||
|
"comma-dangle": "error",
|
||||||
|
"comma-spacing": "error",
|
||||||
|
"comma-style": "error",
|
||||||
|
"complexity": "error",
|
||||||
|
"computed-property-spacing": "error",
|
||||||
|
"consistent-return": "error",
|
||||||
|
"consistent-this": "error",
|
||||||
|
"constructor-super": "error",
|
||||||
|
"curly": "error",
|
||||||
|
"default-case": "error",
|
||||||
|
"default-case-last": "error",
|
||||||
|
"default-param-last": "error",
|
||||||
|
"dot-location": "error",
|
||||||
|
"dot-notation": "error",
|
||||||
|
"eol-last": "error",
|
||||||
|
"eqeqeq": "error",
|
||||||
|
"for-direction": "error",
|
||||||
|
"func-call-spacing": "error",
|
||||||
|
"func-name-matching": "error",
|
||||||
|
"func-names": "error",
|
||||||
|
"func-style": "error",
|
||||||
|
"function-call-argument-newline": "error",
|
||||||
|
"function-paren-newline": "error",
|
||||||
|
"generator-star-spacing": "error",
|
||||||
|
"getter-return": "error",
|
||||||
|
"grouped-accessor-pairs": "error",
|
||||||
|
"guard-for-in": "error",
|
||||||
|
"id-denylist": "error",
|
||||||
|
"id-length": "error",
|
||||||
|
"id-match": "error",
|
||||||
|
"implicit-arrow-linebreak": "error",
|
||||||
|
"indent": "error",
|
||||||
|
"init-declarations": "error",
|
||||||
|
"jsx-quotes": "error",
|
||||||
|
"key-spacing": "error",
|
||||||
|
"keyword-spacing": "error",
|
||||||
|
"line-comment-position": "error",
|
||||||
|
"linebreak-style": "error",
|
||||||
|
"lines-around-comment": "error",
|
||||||
|
"lines-between-class-members": "error",
|
||||||
|
"logical-assignment-operators": "error",
|
||||||
|
"max-classes-per-file": "error",
|
||||||
|
"max-depth": "error",
|
||||||
|
"max-len": "error",
|
||||||
|
"max-lines": "error",
|
||||||
|
"max-lines-per-function": "error",
|
||||||
|
"max-nested-callbacks": "error",
|
||||||
|
"max-params": "error",
|
||||||
|
"max-statements": "error",
|
||||||
|
"max-statements-per-line": "error",
|
||||||
|
"multiline-comment-style": "error",
|
||||||
|
"multiline-ternary": "error",
|
||||||
|
"new-cap": "error",
|
||||||
|
"new-parens": "error",
|
||||||
|
"newline-per-chained-call": "error",
|
||||||
|
"no-alert": "error",
|
||||||
|
"no-array-constructor": "error",
|
||||||
|
"no-async-promise-executor": "error",
|
||||||
|
"no-await-in-loop": "error",
|
||||||
|
"no-bitwise": "error",
|
||||||
|
"no-caller": "error",
|
||||||
|
"no-case-declarations": "error",
|
||||||
|
"no-class-assign": "error",
|
||||||
|
"no-compare-neg-zero": "error",
|
||||||
|
"no-cond-assign": "error",
|
||||||
|
"no-confusing-arrow": "error",
|
||||||
|
"no-console": "error",
|
||||||
|
"no-const-assign": "error",
|
||||||
|
"no-constant-binary-expression": "error",
|
||||||
|
"no-constant-condition": "error",
|
||||||
|
"no-constructor-return": "error",
|
||||||
|
"no-continue": "error",
|
||||||
|
"no-control-regex": "error",
|
||||||
|
"no-debugger": "error",
|
||||||
|
"no-delete-var": "error",
|
||||||
|
"no-div-regex": "error",
|
||||||
|
"no-dupe-args": "error",
|
||||||
|
"no-dupe-class-members": "error",
|
||||||
|
"no-dupe-else-if": "error",
|
||||||
|
"no-dupe-keys": "error",
|
||||||
|
"no-duplicate-case": "error",
|
||||||
|
"no-duplicate-imports": "error",
|
||||||
|
"no-else-return": "error",
|
||||||
|
"no-empty": "error",
|
||||||
|
"no-empty-character-class": "error",
|
||||||
|
"no-empty-function": "error",
|
||||||
|
"no-empty-pattern": "error",
|
||||||
|
"no-empty-static-block": "error",
|
||||||
|
"no-eq-null": "error",
|
||||||
|
"no-eval": "error",
|
||||||
|
"no-ex-assign": "error",
|
||||||
|
"no-extend-native": "error",
|
||||||
|
"no-extra-bind": "error",
|
||||||
|
"no-extra-boolean-cast": "error",
|
||||||
|
"no-extra-label": "error",
|
||||||
|
"no-extra-parens": "error",
|
||||||
|
"no-extra-semi": "error",
|
||||||
|
"no-fallthrough": "error",
|
||||||
|
"no-floating-decimal": "error",
|
||||||
|
"no-func-assign": "error",
|
||||||
|
"no-global-assign": "error",
|
||||||
|
"no-implicit-coercion": "error",
|
||||||
|
"no-implicit-globals": "error",
|
||||||
|
"no-implied-eval": "error",
|
||||||
|
"no-import-assign": "error",
|
||||||
|
"no-inline-comments": "error",
|
||||||
|
"no-inner-declarations": "error",
|
||||||
|
"no-invalid-regexp": "error",
|
||||||
|
"no-invalid-this": "error",
|
||||||
|
"no-irregular-whitespace": "error",
|
||||||
|
"no-iterator": "error",
|
||||||
|
"no-label-var": "error",
|
||||||
|
"no-labels": "error",
|
||||||
|
"no-lone-blocks": "error",
|
||||||
|
"no-lonely-if": "error",
|
||||||
|
"no-loop-func": "error",
|
||||||
|
"no-loss-of-precision": "error",
|
||||||
|
"no-magic-numbers": "error",
|
||||||
|
"no-misleading-character-class": "error",
|
||||||
|
"no-mixed-operators": "error",
|
||||||
|
"no-mixed-spaces-and-tabs": "error",
|
||||||
|
"no-multi-assign": "error",
|
||||||
|
"no-multi-spaces": "error",
|
||||||
|
"no-multi-str": "error",
|
||||||
|
"no-multiple-empty-lines": "error",
|
||||||
|
"no-negated-condition": "error",
|
||||||
|
"no-nested-ternary": "error",
|
||||||
|
"no-new": "error",
|
||||||
|
"no-new-func": "error",
|
||||||
|
"no-new-native-nonconstructor": "error",
|
||||||
|
"no-new-object": "error",
|
||||||
|
"no-new-symbol": "error",
|
||||||
|
"no-new-wrappers": "error",
|
||||||
|
"no-nonoctal-decimal-escape": "error",
|
||||||
|
"no-obj-calls": "error",
|
||||||
|
"no-octal": "error",
|
||||||
|
"no-octal-escape": "error",
|
||||||
|
"no-param-reassign": "error",
|
||||||
|
"no-plusplus": "error",
|
||||||
|
"no-promise-executor-return": "error",
|
||||||
|
"no-proto": "error",
|
||||||
|
"no-prototype-builtins": "error",
|
||||||
|
"no-redeclare": "error",
|
||||||
|
"no-regex-spaces": "error",
|
||||||
|
"no-restricted-exports": "error",
|
||||||
|
"no-restricted-globals": "error",
|
||||||
|
"no-restricted-imports": "error",
|
||||||
|
"no-restricted-properties": "error",
|
||||||
|
"no-restricted-syntax": "error",
|
||||||
|
"no-return-assign": "error",
|
||||||
|
"no-return-await": "error",
|
||||||
|
"no-script-url": "error",
|
||||||
|
"no-self-assign": "error",
|
||||||
|
"no-self-compare": "error",
|
||||||
|
"no-sequences": "error",
|
||||||
|
"no-setter-return": "error",
|
||||||
|
"no-shadow": "error",
|
||||||
|
"no-shadow-restricted-names": "error",
|
||||||
|
"no-sparse-arrays": "error",
|
||||||
|
"no-tabs": "error",
|
||||||
|
"no-template-curly-in-string": "error",
|
||||||
|
"no-ternary": "error",
|
||||||
|
"no-this-before-super": "error",
|
||||||
|
"no-throw-literal": "error",
|
||||||
|
"no-trailing-spaces": "error",
|
||||||
|
"no-undef": "error",
|
||||||
|
"no-undef-init": "error",
|
||||||
|
"no-undefined": "error",
|
||||||
|
"no-underscore-dangle": "error",
|
||||||
|
"no-unexpected-multiline": "error",
|
||||||
|
"no-unmodified-loop-condition": "error",
|
||||||
|
"no-unneeded-ternary": "error",
|
||||||
|
"no-unreachable": "error",
|
||||||
|
"no-unreachable-loop": "error",
|
||||||
|
"no-unsafe-finally": "error",
|
||||||
|
"no-unsafe-negation": "error",
|
||||||
|
"no-unsafe-optional-chaining": "error",
|
||||||
|
"no-unused-expressions": "error",
|
||||||
|
"no-unused-labels": "error",
|
||||||
|
"no-unused-private-class-members": "error",
|
||||||
|
"no-unused-vars": "error",
|
||||||
|
"no-use-before-define": "error",
|
||||||
|
"no-useless-backreference": "error",
|
||||||
|
"no-useless-call": "error",
|
||||||
|
"no-useless-catch": "error",
|
||||||
|
"no-useless-computed-key": "error",
|
||||||
|
"no-useless-concat": "error",
|
||||||
|
"no-useless-constructor": "error",
|
||||||
|
"no-useless-escape": "error",
|
||||||
|
"no-useless-rename": "error",
|
||||||
|
"no-useless-return": "error",
|
||||||
|
"no-var": "error",
|
||||||
|
"no-void": "error",
|
||||||
|
"no-warning-comments": "error",
|
||||||
|
"no-whitespace-before-property": "error",
|
||||||
|
"no-with": "error",
|
||||||
|
"nonblock-statement-body-position": "error",
|
||||||
|
"object-curly-newline": "error",
|
||||||
|
"object-curly-spacing": "error",
|
||||||
|
"object-property-newline": "error",
|
||||||
|
"object-shorthand": "error",
|
||||||
|
"one-var": "error",
|
||||||
|
"one-var-declaration-per-line": "error",
|
||||||
|
"operator-assignment": "error",
|
||||||
|
"operator-linebreak": "error",
|
||||||
|
"padded-blocks": "error",
|
||||||
|
"padding-line-between-statements": "error",
|
||||||
|
"prefer-arrow-callback": "error",
|
||||||
|
"prefer-const": "error",
|
||||||
|
"prefer-destructuring": "error",
|
||||||
|
"prefer-exponentiation-operator": "error",
|
||||||
|
"prefer-named-capture-group": "error",
|
||||||
|
"prefer-numeric-literals": "error",
|
||||||
|
"prefer-object-has-own": "error",
|
||||||
|
"prefer-object-spread": "error",
|
||||||
|
"prefer-promise-reject-errors": "error",
|
||||||
|
"prefer-regex-literals": "error",
|
||||||
|
"prefer-rest-params": "error",
|
||||||
|
"prefer-spread": "error",
|
||||||
|
"prefer-template": "error",
|
||||||
|
"quote-props": "error",
|
||||||
|
"quotes": "error",
|
||||||
|
"radix": "error",
|
||||||
|
"require-atomic-updates": "error",
|
||||||
|
"require-await": "error",
|
||||||
|
"require-unicode-regexp": "error",
|
||||||
|
"require-yield": "error",
|
||||||
|
"rest-spread-spacing": "error",
|
||||||
|
"semi": "error",
|
||||||
|
"semi-spacing": "error",
|
||||||
|
"semi-style": "error",
|
||||||
|
"sort-imports": "error",
|
||||||
|
"sort-keys": "error",
|
||||||
|
"sort-vars": "error",
|
||||||
|
"space-before-blocks": "error",
|
||||||
|
"space-before-function-paren": "error",
|
||||||
|
"space-in-parens": "error",
|
||||||
|
"space-infix-ops": "error",
|
||||||
|
"space-unary-ops": "error",
|
||||||
|
"spaced-comment": "error",
|
||||||
|
"strict": "error",
|
||||||
|
"switch-colon-spacing": "error",
|
||||||
|
"symbol-description": "error",
|
||||||
|
"template-curly-spacing": "error",
|
||||||
|
"template-tag-spacing": "error",
|
||||||
|
"unicode-bom": "error",
|
||||||
|
"use-isnan": "error",
|
||||||
|
"valid-typeof": "error",
|
||||||
|
"vars-on-top": "error",
|
||||||
|
"wrap-iife": "error",
|
||||||
|
"wrap-regex": "error",
|
||||||
|
"yield-star-spacing": "error",
|
||||||
|
"yoda": "error"
|
||||||
|
}
|
||||||
|
});
|
||||||
@ -9,8 +9,8 @@
|
|||||||
/* eslint sort-keys: ["error", "asc"] -- Long, so make more readable */
|
/* eslint sort-keys: ["error", "asc"] -- Long, so make more readable */
|
||||||
|
|
||||||
/** @type {import("../lib/shared/types").ConfigData} */
|
/** @type {import("../lib/shared/types").ConfigData} */
|
||||||
module.exports = {
|
module.exports = Object.freeze({
|
||||||
rules: {
|
rules: Object.freeze({
|
||||||
"constructor-super": "error",
|
"constructor-super": "error",
|
||||||
"for-direction": "error",
|
"for-direction": "error",
|
||||||
"getter-return": "error",
|
"getter-return": "error",
|
||||||
@ -72,5 +72,5 @@ module.exports = {
|
|||||||
"require-yield": "error",
|
"require-yield": "error",
|
||||||
"use-isnan": "error",
|
"use-isnan": "error",
|
||||||
"valid-typeof": "error"
|
"valid-typeof": "error"
|
||||||
}
|
})
|
||||||
};
|
});
|
||||||
17
node_modules/@eslint/js/src/index.js
generated
vendored
Normal file
17
node_modules/@eslint/js/src/index.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* @fileoverview Main package entrypoint.
|
||||||
|
* @author Nicholas C. Zakas
|
||||||
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// Public Interface
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
configs: {
|
||||||
|
all: require("./configs/eslint-all"),
|
||||||
|
recommended: require("./configs/eslint-recommended")
|
||||||
|
}
|
||||||
|
};
|
||||||
128
node_modules/@humanwhocodes/config-array/CHANGELOG.md
generated
vendored
128
node_modules/@humanwhocodes/config-array/CHANGELOG.md
generated
vendored
@ -1,128 +0,0 @@
|
|||||||
# Changelog
|
|
||||||
|
|
||||||
## [0.10.7](https://github.com/humanwhocodes/config-array/compare/v0.10.6...v0.10.7) (2022-09-29)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* Cache negated patterns separately ([fef617b](https://github.com/humanwhocodes/config-array/commit/fef617b6999f9a4b5871d4525c82c4181bc96fb7))
|
|
||||||
|
|
||||||
## [0.10.6](https://github.com/humanwhocodes/config-array/compare/v0.10.5...v0.10.6) (2022-09-28)
|
|
||||||
|
|
||||||
|
|
||||||
### Performance Improvements
|
|
||||||
|
|
||||||
* Cache Minimatch instances ([5cf9af7](https://github.com/humanwhocodes/config-array/commit/5cf9af7ecaf227d2106be0cebd92d7f5148867e6))
|
|
||||||
|
|
||||||
## [0.10.5](https://github.com/humanwhocodes/config-array/compare/v0.10.4...v0.10.5) (2022-09-21)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* Improve caching to improve performance ([#50](https://github.com/humanwhocodes/config-array/issues/50)) ([8a7e8ab](https://github.com/humanwhocodes/config-array/commit/8a7e8ab499bcbb10d7cbdd676197fc686966a64e))
|
|
||||||
|
|
||||||
### [0.10.4](https://www.github.com/humanwhocodes/config-array/compare/v0.10.3...v0.10.4) (2022-07-29)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* Global ignores only when no other keys ([1f6b6ae](https://www.github.com/humanwhocodes/config-array/commit/1f6b6ae89152c1ebe118f55e7ea05c37e7c960dc))
|
|
||||||
* Re-introduce ignores fixes ([b3ec560](https://www.github.com/humanwhocodes/config-array/commit/b3ec560c485bec2f7420fd63a939448b49a073e3))
|
|
||||||
|
|
||||||
### [0.10.3](https://www.github.com/humanwhocodes/config-array/compare/v0.10.2...v0.10.3) (2022-07-20)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* Ensure preprocess method has correct 'this' value. ([f86933a](https://www.github.com/humanwhocodes/config-array/commit/f86933a072e5a4069bab2c1ce284dedf0efa715d))
|
|
||||||
|
|
||||||
### [0.10.2](https://www.github.com/humanwhocodes/config-array/compare/v0.10.1...v0.10.2) (2022-03-18)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* Files outside of basePath should be ignored ([fc4d7b2](https://www.github.com/humanwhocodes/config-array/commit/fc4d7b2e851959ab9ab84305f6c78c52e9cc2c3c))
|
|
||||||
|
|
||||||
### [0.10.1](https://www.github.com/humanwhocodes/config-array/compare/v0.10.0...v0.10.1) (2022-03-03)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* Explicit matching is required against files field ([ab4e428](https://www.github.com/humanwhocodes/config-array/commit/ab4e4282ecea994ef88d273dc47aa24bf3c6972e))
|
|
||||||
|
|
||||||
## [0.10.0](https://www.github.com/humanwhocodes/config-array/compare/v0.9.5...v0.10.0) (2022-03-01)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* Add isExplicitMatch() method ([9ecd90e](https://www.github.com/humanwhocodes/config-array/commit/9ecd90e2a3e984633f535daa4da3cbfb96964fdd))
|
|
||||||
|
|
||||||
### [0.9.5](https://www.github.com/humanwhocodes/config-array/compare/v0.9.4...v0.9.5) (2022-02-23)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* Ensure dot directories are matched correctly ([6e8d180](https://www.github.com/humanwhocodes/config-array/commit/6e8d180f43cedf3c2072d8a1229470e9fafabf5b))
|
|
||||||
* preprocessConfig should have correct 'this' value ([9641540](https://www.github.com/humanwhocodes/config-array/commit/96415402cf0012ccf8e4af6c7b934dfc1a058986))
|
|
||||||
|
|
||||||
### [0.9.4](https://www.github.com/humanwhocodes/config-array/compare/v0.9.3...v0.9.4) (2022-01-27)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* Negated patterns to work when files match ([398c811](https://www.github.com/humanwhocodes/config-array/commit/398c8119d359493dc7b82b40df4d92ea6528375f))
|
|
||||||
|
|
||||||
### [0.9.3](https://www.github.com/humanwhocodes/config-array/compare/v0.9.2...v0.9.3) (2022-01-26)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* Make negated ignore patterns work like gitignore ([4ee8e99](https://www.github.com/humanwhocodes/config-array/commit/4ee8e998436e2c4538b06476e0bead8a44fe5a1b))
|
|
||||||
|
|
||||||
### [0.9.2](https://www.github.com/humanwhocodes/config-array/compare/v0.9.1...v0.9.2) (2021-11-02)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* Object merging error by upgrading object-schema ([377d06d](https://www.github.com/humanwhocodes/config-array/commit/377d06d2a44d781b0bec70b3389c48b3d5a63f94))
|
|
||||||
|
|
||||||
### [0.9.1](https://www.github.com/humanwhocodes/config-array/compare/v0.9.0...v0.9.1) (2021-10-05)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* Properly build package for release ([168155f](https://www.github.com/humanwhocodes/config-array/commit/168155f3fed91ab35566c452efd28debf8ec2b85))
|
|
||||||
|
|
||||||
## [0.9.0](https://www.github.com/humanwhocodes/config-array/compare/v0.8.0...v0.9.0) (2021-10-04)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* getConfig() now returns undefined when no configs match. ([a563b82](https://www.github.com/humanwhocodes/config-array/commit/a563b8255d4eb2bb7745314e3f00ef53792b343f))
|
|
||||||
|
|
||||||
## [0.8.0](https://www.github.com/humanwhocodes/config-array/compare/v0.7.0...v0.8.0) (2021-10-01)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* Add isIgnored() method ([343e5a0](https://www.github.com/humanwhocodes/config-array/commit/343e5a0a9e32028bfc6c0bf1ec0c6badf74f47f9))
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* Ensure global ignores are honored ([343e5a0](https://www.github.com/humanwhocodes/config-array/commit/343e5a0a9e32028bfc6c0bf1ec0c6badf74f47f9))
|
|
||||||
|
|
||||||
## [0.7.0](https://www.github.com/humanwhocodes/config-array/compare/v0.6.0...v0.7.0) (2021-09-24)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* Only object configs by default ([5645f24](https://www.github.com/humanwhocodes/config-array/commit/5645f241b2412a3263a02ef9e3a9bd19cc86035d))
|
|
||||||
|
|
||||||
## [0.6.0](https://www.github.com/humanwhocodes/config-array/compare/v0.5.0...v0.6.0) (2021-04-20)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* Add the normalizeSync() method ([3e347f9](https://www.github.com/humanwhocodes/config-array/commit/3e347f9d77c5ca2b15995e75ff7bc4fb96b7d66e))
|
|
||||||
* Allow async config functions ([a9def0f](https://www.github.com/humanwhocodes/config-array/commit/a9def0faf579c223349dfe08d2486756840538c3))
|
|
||||||
34
node_modules/@humanwhocodes/config-array/README.md
generated
vendored
34
node_modules/@humanwhocodes/config-array/README.md
generated
vendored
@ -288,7 +288,39 @@ A few things to keep in mind:
|
|||||||
* You must pass in the absolute filename to get a config for.
|
* You must pass in the absolute filename to get a config for.
|
||||||
* The returned config object never has `files`, `ignores`, or `name` properties; the only properties on the object will be the other configuration options specified.
|
* The returned config object never has `files`, `ignores`, or `name` properties; the only properties on the object will be the other configuration options specified.
|
||||||
* The config array caches configs, so subsequent calls to `getConfig()` with the same filename will return in a fast lookup rather than another calculation.
|
* The config array caches configs, so subsequent calls to `getConfig()` with the same filename will return in a fast lookup rather than another calculation.
|
||||||
* A config will only be generated if the filename matches an entry in a `files` key. A config will not be generated without matching a `files` key (configs without a `files` key are only applied when another config with a `files` key is applied; configs without `files` are never applied on their own).
|
* A config will only be generated if the filename matches an entry in a `files` key. A config will not be generated without matching a `files` key (configs without a `files` key are only applied when another config with a `files` key is applied; configs without `files` are never applied on their own). Any config with a `files` key entry ending with `/**` or `/*` will only be applied if another entry in the same `files` key matches or another config matches.
|
||||||
|
|
||||||
|
## Determining Ignored Paths
|
||||||
|
|
||||||
|
You can determine if a file is ignored by using the `isFileIgnored()` method and passing in the absolute path of any file, as in this example:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const ignored = configs.isFileIgnored('/foo/bar/baz.txt');
|
||||||
|
```
|
||||||
|
|
||||||
|
A file is considered ignored if any of the following is true:
|
||||||
|
|
||||||
|
* **It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/a.js` is considered ignored.
|
||||||
|
* **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/baz/a.js` is considered ignored.
|
||||||
|
* **It matches an ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
|
||||||
|
* **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
|
||||||
|
* **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored.
|
||||||
|
|
||||||
|
For directories, use the `isDirectoryIgnored()` method and pass in the absolute path of any directory, as in this example:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const ignored = configs.isDirectoryIgnored('/foo/bar/');
|
||||||
|
```
|
||||||
|
|
||||||
|
A directory is considered ignored if any of the following is true:
|
||||||
|
|
||||||
|
* **It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/baz` is considered ignored.
|
||||||
|
* **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/bar/baz/a.js` is considered ignored.
|
||||||
|
* **It matches and ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
|
||||||
|
* **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
|
||||||
|
* **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored.
|
||||||
|
|
||||||
|
**Important:** A pattern such as `foo/**` means that `foo` and `foo/` are *not* ignored whereas `foo/bar` is ignored. If you want to ignore `foo` and all of its subdirectories, use the pattern `foo` or `foo/` in `ignores`.
|
||||||
|
|
||||||
## Caching Mechanisms
|
## Caching Mechanisms
|
||||||
|
|
||||||
|
|||||||
321
node_modules/@humanwhocodes/config-array/api.js
generated
vendored
321
node_modules/@humanwhocodes/config-array/api.js
generated
vendored
@ -1,12 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
Object.defineProperty(exports, '__esModule', { value: true });
|
var path = require('path');
|
||||||
|
var minimatch = require('minimatch');
|
||||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
var createDebug = require('debug');
|
||||||
|
|
||||||
var path = _interopDefault(require('path'));
|
|
||||||
var minimatch = _interopDefault(require('minimatch'));
|
|
||||||
var createDebug = _interopDefault(require('debug'));
|
|
||||||
var objectSchema = require('@humanwhocodes/object-schema');
|
var objectSchema = require('@humanwhocodes/object-schema');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -124,6 +120,18 @@ function isString(value) {
|
|||||||
return typeof value === 'string';
|
return typeof value === 'string';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asserts that the files key of a config object is a nonempty array.
|
||||||
|
* @param {object} config The config object to check.
|
||||||
|
* @returns {void}
|
||||||
|
* @throws {TypeError} If the files key isn't a nonempty array.
|
||||||
|
*/
|
||||||
|
function assertNonEmptyFilesArray(config) {
|
||||||
|
if (!Array.isArray(config.files) || config.files.length === 0) {
|
||||||
|
throw new TypeError('The files key must be a non-empty array.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper around minimatch that caches minimatch patterns for
|
* Wrapper around minimatch that caches minimatch patterns for
|
||||||
* faster matching speed over multiple file path evaluations.
|
* faster matching speed over multiple file path evaluations.
|
||||||
@ -132,7 +140,7 @@ function isString(value) {
|
|||||||
* @param {object} options The minimatch options to use.
|
* @param {object} options The minimatch options to use.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
function doMatch(filepath, pattern, options) {
|
function doMatch(filepath, pattern, options = {}) {
|
||||||
|
|
||||||
let cache = minimatchCache;
|
let cache = minimatchCache;
|
||||||
|
|
||||||
@ -143,7 +151,7 @@ function doMatch(filepath, pattern, options) {
|
|||||||
let matcher = cache.get(pattern);
|
let matcher = cache.get(pattern);
|
||||||
|
|
||||||
if (!matcher) {
|
if (!matcher) {
|
||||||
matcher = new Minimatch(pattern, options);
|
matcher = new Minimatch(pattern, Object.assign({}, MINIMATCH_OPTIONS, options));
|
||||||
cache.set(pattern, matcher);
|
cache.set(pattern, matcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,59 +268,74 @@ function normalizeSync(items, context, extraConfigTypes) {
|
|||||||
* @param {string} relativeFilePath The relative path of the file to check.
|
* @param {string} relativeFilePath The relative path of the file to check.
|
||||||
* @returns {boolean} True if the path should be ignored and false if not.
|
* @returns {boolean} True if the path should be ignored and false if not.
|
||||||
*/
|
*/
|
||||||
function shouldIgnoreFilePath(ignores, filePath, relativeFilePath) {
|
function shouldIgnorePath(ignores, filePath, relativeFilePath) {
|
||||||
|
|
||||||
// all files outside of the basePath are ignored
|
// all files outside of the basePath are ignored
|
||||||
if (relativeFilePath.startsWith('..')) {
|
if (relativeFilePath.startsWith('..')) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let shouldIgnore = false;
|
return ignores.reduce((ignored, matcher) => {
|
||||||
|
|
||||||
for (const matcher of ignores) {
|
if (!ignored) {
|
||||||
|
|
||||||
if (typeof matcher === 'function') {
|
if (typeof matcher === 'function') {
|
||||||
shouldIgnore = shouldIgnore || matcher(filePath);
|
return matcher(filePath);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If there's a negated pattern, that means anything matching
|
|
||||||
* must NOT be ignored. To do that, we need to use the `flipNegate`
|
|
||||||
* option for minimatch to check if the filepath matches the
|
|
||||||
* pattern specified after the !, and if that result is true,
|
|
||||||
* then we return false immediately because this file should
|
|
||||||
* never be ignored.
|
|
||||||
*/
|
|
||||||
if (matcher.startsWith('!')) {
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The file must already be ignored in order to apply a negated
|
|
||||||
* pattern, because negated patterns simply remove files that
|
|
||||||
* would already be ignored.
|
|
||||||
*/
|
|
||||||
if (shouldIgnore &&
|
|
||||||
doMatch(relativeFilePath, matcher, {
|
|
||||||
...MINIMATCH_OPTIONS,
|
|
||||||
flipNegate: true
|
|
||||||
})) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
shouldIgnore = shouldIgnore || doMatch(relativeFilePath, matcher, MINIMATCH_OPTIONS);
|
// don't check negated patterns because we're not ignored yet
|
||||||
|
if (!matcher.startsWith('!')) {
|
||||||
|
return doMatch(relativeFilePath, matcher);
|
||||||
|
}
|
||||||
|
|
||||||
|
// otherwise we're still not ignored
|
||||||
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
// only need to check negated patterns because we're ignored
|
||||||
|
if (typeof matcher === 'string' && matcher.startsWith('!')) {
|
||||||
|
return !doMatch(relativeFilePath, matcher, {
|
||||||
|
flipNegate: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return ignored;
|
||||||
|
|
||||||
|
}, false);
|
||||||
|
|
||||||
return shouldIgnore;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if a given file path is matched by a config based on
|
||||||
|
* `ignores` only.
|
||||||
|
* @param {string} filePath The absolute file path to check.
|
||||||
|
* @param {string} basePath The base path for the config.
|
||||||
|
* @param {Object} config The config object to check.
|
||||||
|
* @returns {boolean} True if the file path is matched by the config,
|
||||||
|
* false if not.
|
||||||
|
*/
|
||||||
|
function pathMatchesIgnores(filePath, basePath, config) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For both files and ignores, functions are passed the absolute
|
||||||
|
* file path while strings are compared against the relative
|
||||||
|
* file path.
|
||||||
|
*/
|
||||||
|
const relativeFilePath = path.relative(basePath, filePath);
|
||||||
|
|
||||||
|
return Object.keys(config).length > 1 &&
|
||||||
|
!shouldIgnorePath(config.ignores, filePath, relativeFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if a given file path is matched by a config. If the config
|
* Determines if a given file path is matched by a config. If the config
|
||||||
* has no `files` field, then it matches; otherwise, if a `files` field
|
* has no `files` field, then it matches; otherwise, if a `files` field
|
||||||
* is present then we match the globs in `files` and exclude any globs in
|
* is present then we match the globs in `files` and exclude any globs in
|
||||||
* `ignores`.
|
* `ignores`.
|
||||||
* @param {string} filePath The absolute file path to check.
|
* @param {string} filePath The absolute file path to check.
|
||||||
|
* @param {string} basePath The base path for the config.
|
||||||
* @param {Object} config The config object to check.
|
* @param {Object} config The config object to check.
|
||||||
* @returns {boolean} True if the file path is matched by the config,
|
* @returns {boolean} True if the file path is matched by the config,
|
||||||
* false if not.
|
* false if not.
|
||||||
@ -327,15 +350,13 @@ function pathMatches(filePath, basePath, config) {
|
|||||||
const relativeFilePath = path.relative(basePath, filePath);
|
const relativeFilePath = path.relative(basePath, filePath);
|
||||||
|
|
||||||
// if files isn't an array, throw an error
|
// if files isn't an array, throw an error
|
||||||
if (!Array.isArray(config.files) || config.files.length === 0) {
|
assertNonEmptyFilesArray(config);
|
||||||
throw new TypeError('The files key must be a non-empty array.');
|
|
||||||
}
|
|
||||||
|
|
||||||
// match both strings and functions
|
// match both strings and functions
|
||||||
const match = pattern => {
|
const match = pattern => {
|
||||||
|
|
||||||
if (isString(pattern)) {
|
if (isString(pattern)) {
|
||||||
return doMatch(relativeFilePath, pattern, MINIMATCH_OPTIONS);
|
return doMatch(relativeFilePath, pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof pattern === 'function') {
|
if (typeof pattern === 'function') {
|
||||||
@ -359,7 +380,7 @@ function pathMatches(filePath, basePath, config) {
|
|||||||
* if there are any files to ignore.
|
* if there are any files to ignore.
|
||||||
*/
|
*/
|
||||||
if (filePathMatchesPattern && config.ignores) {
|
if (filePathMatchesPattern && config.ignores) {
|
||||||
filePathMatchesPattern = !shouldIgnoreFilePath(config.ignores, filePath, relativeFilePath);
|
filePathMatchesPattern = !shouldIgnorePath(config.ignores, filePath, relativeFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
return filePathMatchesPattern;
|
return filePathMatchesPattern;
|
||||||
@ -429,11 +450,11 @@ class ConfigArray extends Array {
|
|||||||
* @param {Array<string>} [options.configTypes] List of config types supported.
|
* @param {Array<string>} [options.configTypes] List of config types supported.
|
||||||
*/
|
*/
|
||||||
constructor(configs, {
|
constructor(configs, {
|
||||||
basePath = '',
|
basePath = '',
|
||||||
normalized = false,
|
normalized = false,
|
||||||
schema: customSchema,
|
schema: customSchema,
|
||||||
extraConfigTypes = []
|
extraConfigTypes = []
|
||||||
} = {}
|
} = {}
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@ -482,7 +503,10 @@ class ConfigArray extends Array {
|
|||||||
|
|
||||||
// init cache
|
// init cache
|
||||||
dataCache.set(this, {
|
dataCache.set(this, {
|
||||||
explicitMatches: new Map()
|
explicitMatches: new Map(),
|
||||||
|
directoryMatches: new Map(),
|
||||||
|
files: undefined,
|
||||||
|
ignores: undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
// load the configs into this array
|
// load the configs into this array
|
||||||
@ -572,7 +596,38 @@ class ConfigArray extends Array {
|
|||||||
* are additional keys, then ignores act like exclusions.
|
* are additional keys, then ignores act like exclusions.
|
||||||
*/
|
*/
|
||||||
if (config.ignores && Object.keys(config).length === 1) {
|
if (config.ignores && Object.keys(config).length === 1) {
|
||||||
result.push(...config.ignores);
|
|
||||||
|
/*
|
||||||
|
* If there are directory ignores, then we need to double up
|
||||||
|
* the patterns to be ignored. For instance, `foo` will also
|
||||||
|
* need `foo/**` in order to account for subdirectories.
|
||||||
|
*/
|
||||||
|
config.ignores.forEach(ignore => {
|
||||||
|
|
||||||
|
result.push(ignore);
|
||||||
|
|
||||||
|
if (typeof ignore === 'string') {
|
||||||
|
|
||||||
|
// unignoring files won't work unless we unignore directories too
|
||||||
|
if (ignore.startsWith('!')) {
|
||||||
|
|
||||||
|
if (ignore.endsWith('/**')) {
|
||||||
|
result.push(ignore.slice(0, ignore.length - 3));
|
||||||
|
} else if (ignore.endsWith('/*')) {
|
||||||
|
result.push(ignore.slice(0, ignore.length - 2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// directories should work with or without a trailing slash
|
||||||
|
if (ignore.endsWith('/')) {
|
||||||
|
result.push(ignore.slice(0, ignore.length - 1));
|
||||||
|
result.push(ignore + '**');
|
||||||
|
} else if (!ignore.endsWith('*')) {
|
||||||
|
result.push(ignore + '/**');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -680,7 +735,7 @@ class ConfigArray extends Array {
|
|||||||
// TODO: Maybe move elsewhere? Maybe combine with getConfig() logic?
|
// TODO: Maybe move elsewhere? Maybe combine with getConfig() logic?
|
||||||
const relativeFilePath = path.relative(this.basePath, filePath);
|
const relativeFilePath = path.relative(this.basePath, filePath);
|
||||||
|
|
||||||
if (shouldIgnoreFilePath(this.ignores, filePath, relativeFilePath)) {
|
if (shouldIgnorePath(this.ignores, filePath, relativeFilePath)) {
|
||||||
debug(`Ignoring ${filePath}`);
|
debug(`Ignoring ${filePath}`);
|
||||||
|
|
||||||
// cache and return result
|
// cache and return result
|
||||||
@ -726,11 +781,20 @@ class ConfigArray extends Array {
|
|||||||
|
|
||||||
// next check to see if the file should be ignored
|
// next check to see if the file should be ignored
|
||||||
|
|
||||||
|
// check if this should be ignored due to its directory
|
||||||
|
if (this.isDirectoryIgnored(path.dirname(filePath))) {
|
||||||
|
debug(`Ignoring ${filePath} based on directory pattern`);
|
||||||
|
|
||||||
|
// cache and return result - finalConfig is undefined at this point
|
||||||
|
cache.set(filePath, finalConfig);
|
||||||
|
return finalConfig;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Maybe move elsewhere?
|
// TODO: Maybe move elsewhere?
|
||||||
const relativeFilePath = path.relative(this.basePath, filePath);
|
const relativeFilePath = path.relative(this.basePath, filePath);
|
||||||
|
|
||||||
if (shouldIgnoreFilePath(this.ignores, filePath, relativeFilePath)) {
|
if (shouldIgnorePath(this.ignores, filePath, relativeFilePath)) {
|
||||||
debug(`Ignoring ${filePath}`);
|
debug(`Ignoring ${filePath} based on file pattern`);
|
||||||
|
|
||||||
// cache and return result - finalConfig is undefined at this point
|
// cache and return result - finalConfig is undefined at this point
|
||||||
cache.set(filePath, finalConfig);
|
cache.set(filePath, finalConfig);
|
||||||
@ -741,15 +805,82 @@ class ConfigArray extends Array {
|
|||||||
|
|
||||||
const matchingConfigIndices = [];
|
const matchingConfigIndices = [];
|
||||||
let matchFound = false;
|
let matchFound = false;
|
||||||
|
const universalPattern = /\/\*{1,2}$/;
|
||||||
|
|
||||||
this.forEach((config, index) => {
|
this.forEach((config, index) => {
|
||||||
|
|
||||||
if (!config.files) {
|
if (!config.files) {
|
||||||
debug(`Universal config found for ${filePath}`);
|
|
||||||
matchingConfigIndices.push(index);
|
if (!config.ignores) {
|
||||||
|
debug(`Anonymous universal config found for ${filePath}`);
|
||||||
|
matchingConfigIndices.push(index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pathMatchesIgnores(filePath, this.basePath, config)) {
|
||||||
|
debug(`Matching config found for ${filePath} (based on ignores: ${config.ignores})`);
|
||||||
|
matchingConfigIndices.push(index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
debug(`Skipped config found for ${filePath} (based on ignores: ${config.ignores})`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assertNonEmptyFilesArray(config);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If a config has a files pattern ending in /** or /*, and the
|
||||||
|
* filePath only matches those patterns, then the config is only
|
||||||
|
* applied if there is another config where the filePath matches
|
||||||
|
* a file with a specific extensions such as *.js.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const universalFiles = config.files.filter(
|
||||||
|
pattern => universalPattern.test(pattern)
|
||||||
|
);
|
||||||
|
|
||||||
|
// universal patterns were found so we need to check the config twice
|
||||||
|
if (universalFiles.length) {
|
||||||
|
|
||||||
|
debug('Universal files patterns found. Checking carefully.');
|
||||||
|
|
||||||
|
const nonUniversalFiles = config.files.filter(
|
||||||
|
pattern => !universalPattern.test(pattern)
|
||||||
|
);
|
||||||
|
|
||||||
|
// check that the config matches without the non-universal files first
|
||||||
|
if (
|
||||||
|
nonUniversalFiles.length &&
|
||||||
|
pathMatches(
|
||||||
|
filePath, this.basePath,
|
||||||
|
{ files: nonUniversalFiles, ignores: config.ignores }
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
debug(`Matching config found for ${filePath}`);
|
||||||
|
matchingConfigIndices.push(index);
|
||||||
|
matchFound = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if there wasn't a match then check if it matches with universal files
|
||||||
|
if (
|
||||||
|
universalFiles.length &&
|
||||||
|
pathMatches(
|
||||||
|
filePath, this.basePath,
|
||||||
|
{ files: universalFiles, ignores: config.ignores }
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
debug(`Matching config found for ${filePath}`);
|
||||||
|
matchingConfigIndices.push(index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if we make here, then there was no match
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// the normal case
|
||||||
if (pathMatches(filePath, this.basePath, config)) {
|
if (pathMatches(filePath, this.basePath, config)) {
|
||||||
debug(`Matching config found for ${filePath}`);
|
debug(`Matching config found for ${filePath}`);
|
||||||
matchingConfigIndices.push(index);
|
matchingConfigIndices.push(index);
|
||||||
@ -797,11 +928,83 @@ class ConfigArray extends Array {
|
|||||||
* Determines if the given filepath is ignored based on the configs.
|
* Determines if the given filepath is ignored based on the configs.
|
||||||
* @param {string} filePath The complete path of a file to check.
|
* @param {string} filePath The complete path of a file to check.
|
||||||
* @returns {boolean} True if the path is ignored, false if not.
|
* @returns {boolean} True if the path is ignored, false if not.
|
||||||
|
* @deprecated Use `isFileIgnored` instead.
|
||||||
*/
|
*/
|
||||||
isIgnored(filePath) {
|
isIgnored(filePath) {
|
||||||
|
return this.isFileIgnored(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if the given filepath is ignored based on the configs.
|
||||||
|
* @param {string} filePath The complete path of a file to check.
|
||||||
|
* @returns {boolean} True if the path is ignored, false if not.
|
||||||
|
*/
|
||||||
|
isFileIgnored(filePath) {
|
||||||
return this.getConfig(filePath) === undefined;
|
return this.getConfig(filePath) === undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if the given directory is ignored based on the configs.
|
||||||
|
* This checks only default `ignores` that don't have `files` in the
|
||||||
|
* same config. A pattern such as `/foo` be considered to ignore the directory
|
||||||
|
* while a pattern such as `/foo/**` is not considered to ignore the
|
||||||
|
* directory because it is matching files.
|
||||||
|
* @param {string} directoryPath The complete path of a directory to check.
|
||||||
|
* @returns {boolean} True if the directory is ignored, false if not. Will
|
||||||
|
* return true for any directory that is not inside of `basePath`.
|
||||||
|
* @throws {Error} When the `ConfigArray` is not normalized.
|
||||||
|
*/
|
||||||
|
isDirectoryIgnored(directoryPath) {
|
||||||
|
|
||||||
|
assertNormalized(this);
|
||||||
|
|
||||||
|
const relativeDirectoryPath = path.relative(this.basePath, directoryPath)
|
||||||
|
.replace(/\\/g, '/');
|
||||||
|
|
||||||
|
if (relativeDirectoryPath.startsWith('..')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// first check the cache
|
||||||
|
const cache = dataCache.get(this).directoryMatches;
|
||||||
|
|
||||||
|
if (cache.has(relativeDirectoryPath)) {
|
||||||
|
return cache.get(relativeDirectoryPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
const directoryParts = relativeDirectoryPath.split('/');
|
||||||
|
let relativeDirectoryToCheck = '';
|
||||||
|
let result = false;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* In order to get the correct gitignore-style ignores, where an
|
||||||
|
* ignored parent directory cannot have any descendants unignored,
|
||||||
|
* we need to check every directory starting at the parent all
|
||||||
|
* the way down to the actual requested directory.
|
||||||
|
*
|
||||||
|
* We aggressively cache all of this info to make sure we don't
|
||||||
|
* have to recalculate everything for every call.
|
||||||
|
*/
|
||||||
|
do {
|
||||||
|
|
||||||
|
relativeDirectoryToCheck += directoryParts.shift() + '/';
|
||||||
|
|
||||||
|
result = shouldIgnorePath(
|
||||||
|
this.ignores,
|
||||||
|
path.join(this.basePath, relativeDirectoryToCheck),
|
||||||
|
relativeDirectoryToCheck
|
||||||
|
);
|
||||||
|
|
||||||
|
cache.set(relativeDirectoryToCheck, result);
|
||||||
|
|
||||||
|
} while (!result && directoryParts.length);
|
||||||
|
|
||||||
|
// also cache the result for the requested path
|
||||||
|
cache.set(relativeDirectoryPath, result);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.ConfigArray = ConfigArray;
|
exports.ConfigArray = ConfigArray;
|
||||||
|
|||||||
13
node_modules/@humanwhocodes/config-array/package.json
generated
vendored
13
node_modules/@humanwhocodes/config-array/package.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@humanwhocodes/config-array",
|
"name": "@humanwhocodes/config-array",
|
||||||
"version": "0.10.7",
|
"version": "0.11.10",
|
||||||
"description": "Glob-based configuration matching.",
|
"description": "Glob-based configuration matching.",
|
||||||
"author": "Nicholas C. Zakas",
|
"author": "Nicholas C. Zakas",
|
||||||
"main": "api.js",
|
"main": "api.js",
|
||||||
@ -19,6 +19,7 @@
|
|||||||
"build": "rollup -c",
|
"build": "rollup -c",
|
||||||
"format": "nitpik",
|
"format": "nitpik",
|
||||||
"lint": "eslint *.config.js src/*.js tests/*.js",
|
"lint": "eslint *.config.js src/*.js tests/*.js",
|
||||||
|
"lint:fix": "eslint --fix *.config.js src/*.js tests/*.js",
|
||||||
"prepublish": "npm run build",
|
"prepublish": "npm run build",
|
||||||
"test:coverage": "nyc --include src/*.js npm run test",
|
"test:coverage": "nyc --include src/*.js npm run test",
|
||||||
"test": "mocha -r esm tests/ --recursive"
|
"test": "mocha -r esm tests/ --recursive"
|
||||||
@ -43,18 +44,18 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@humanwhocodes/object-schema": "^1.2.1",
|
"@humanwhocodes/object-schema": "^1.2.1",
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"minimatch": "^3.0.4"
|
"minimatch": "^3.0.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nitpik/javascript": "0.4.0",
|
"@nitpik/javascript": "0.4.0",
|
||||||
"@nitpik/node": "0.0.5",
|
"@nitpik/node": "0.0.5",
|
||||||
"chai": "4.2.0",
|
"chai": "4.3.7",
|
||||||
"eslint": "8.24.0",
|
"eslint": "8.41.0",
|
||||||
"esm": "3.2.25",
|
"esm": "3.2.25",
|
||||||
"lint-staged": "13.0.3",
|
"lint-staged": "13.2.2",
|
||||||
"mocha": "6.2.3",
|
"mocha": "6.2.3",
|
||||||
"nyc": "14.1.1",
|
"nyc": "14.1.1",
|
||||||
"rollup": "1.16.6",
|
"rollup": "3.20.4",
|
||||||
"yorkie": "2.0.0"
|
"yorkie": "2.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
201
node_modules/@humanwhocodes/gitignore-to-minimatch/LICENSE
generated
vendored
201
node_modules/@humanwhocodes/gitignore-to-minimatch/LICENSE
generated
vendored
@ -1,201 +0,0 @@
|
|||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
78
node_modules/@humanwhocodes/gitignore-to-minimatch/README.md
generated
vendored
78
node_modules/@humanwhocodes/gitignore-to-minimatch/README.md
generated
vendored
@ -1,78 +0,0 @@
|
|||||||
# Gitignore to Minimatch Utility
|
|
||||||
|
|
||||||
by [Nicholas C. Zakas](https://humanwhocodes.com)
|
|
||||||
|
|
||||||
If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate).
|
|
||||||
|
|
||||||
## Description
|
|
||||||
|
|
||||||
A function that converts a [gitignore](https://git-scm.com/docs/gitignore#_pattern_format) pattern into a [minimatch](https://github.com/isaacs/minimatch) pattern. There are subtle differences between these two formats, and depending on the utilities you're using, you may need one or the other.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
### Node.js
|
|
||||||
|
|
||||||
Install using [npm][npm] or [yarn][yarn]:
|
|
||||||
|
|
||||||
```
|
|
||||||
npm install @humanwhocodes/gitignore-to-minimatch --save
|
|
||||||
|
|
||||||
# or
|
|
||||||
|
|
||||||
yarn add @humanwhocodes/gitignore-to-minimatch
|
|
||||||
```
|
|
||||||
|
|
||||||
Import into your Node.js project:
|
|
||||||
|
|
||||||
```js
|
|
||||||
// CommonJS
|
|
||||||
const { gitignoreToMinimatch } = require("@humanwhocodes/gitignore-to-minimatch");
|
|
||||||
|
|
||||||
// ESM
|
|
||||||
import { gitignoreToMinimatch } from "@humanwhocodes/gitignore-to-minimatch";
|
|
||||||
```
|
|
||||||
|
|
||||||
### Deno
|
|
||||||
|
|
||||||
Import into your Deno project:
|
|
||||||
|
|
||||||
```js
|
|
||||||
import { gitignoreToMinimatch } from "https://cdn.skypack.dev/@humanwhocodes/gitignore-to-minimatch?dts";
|
|
||||||
```
|
|
||||||
|
|
||||||
### Browser
|
|
||||||
|
|
||||||
It's recommended to import the minified version to save bandwidth:
|
|
||||||
|
|
||||||
```js
|
|
||||||
import { gitignoreToMinimatch } from "https://cdn.skypack.dev/@humanwhocodes/gitignore-to-minimatch?min";
|
|
||||||
```
|
|
||||||
|
|
||||||
However, you can also import the unminified version for debugging purposes:
|
|
||||||
|
|
||||||
```js
|
|
||||||
import { gitignoreToMinimatch } from "https://cdn.skypack.dev/@humanwhocodes/gitignore-to-minimatch";
|
|
||||||
```
|
|
||||||
|
|
||||||
## API
|
|
||||||
|
|
||||||
After importing, call `gitignoreToMinimatch` with a string argument, like this:
|
|
||||||
|
|
||||||
```js
|
|
||||||
const minimatchPattern = gitignoreToMinimatch("foo");
|
|
||||||
console.log(minimatchPattern); // "**/foo"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Developer Setup
|
|
||||||
|
|
||||||
1. Fork the repository
|
|
||||||
2. Clone your fork
|
|
||||||
3. Run `npm install` to setup dependencies
|
|
||||||
4. Run `npm test` to run tests
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
Apache 2.0
|
|
||||||
|
|
||||||
[npm]: https://npmjs.com/
|
|
||||||
[yarn]: https://yarnpkg.com/
|
|
||||||
71
node_modules/@humanwhocodes/gitignore-to-minimatch/dist/gitignore-to-minimatch.cjs
generated
vendored
71
node_modules/@humanwhocodes/gitignore-to-minimatch/dist/gitignore-to-minimatch.cjs
generated
vendored
@ -1,71 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
Object.defineProperty(exports, '__esModule', { value: true });
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @fileoverview Utility to convert gitignore patterns to minimatch.
|
|
||||||
* @author Nicholas C. Zakas
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts a gitignore pattern to a minimatch pattern.
|
|
||||||
* @param {string} pattern The gitignore pattern to convert.
|
|
||||||
* @returns {string} A minimatch pattern equivalent to `pattern`.
|
|
||||||
*/
|
|
||||||
function gitignoreToMinimatch(pattern) {
|
|
||||||
|
|
||||||
if (typeof pattern !== "string") {
|
|
||||||
throw new TypeError("Argument must be a string.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Special case: Empty string
|
|
||||||
if (!pattern) {
|
|
||||||
return pattern;
|
|
||||||
}
|
|
||||||
|
|
||||||
// strip off negation to make life easier
|
|
||||||
const negated = pattern.startsWith("!");
|
|
||||||
let patternToTest = negated ? pattern.slice(1) : pattern;
|
|
||||||
let result = patternToTest;
|
|
||||||
let leadingSlash = false;
|
|
||||||
|
|
||||||
// strip off leading slash
|
|
||||||
if (patternToTest[0] === "/") {
|
|
||||||
leadingSlash = true;
|
|
||||||
result = patternToTest.slice(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// For the most part, the first character determines what to do
|
|
||||||
switch (result[0]) {
|
|
||||||
|
|
||||||
case "*":
|
|
||||||
if (patternToTest[1] !== "*") {
|
|
||||||
result = "**/" + result;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
if (!leadingSlash && !result.includes("/") || result.endsWith("/")) {
|
|
||||||
result = "**/" + result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// no further changes if the pattern ends with a wildcard
|
|
||||||
if (result.endsWith("*") || result.endsWith("?")) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// differentiate between filenames and directory names
|
|
||||||
if (!/\.[a-z\d_-]+$/.test(result)) {
|
|
||||||
if (!result.endsWith("/")) {
|
|
||||||
result += "/";
|
|
||||||
}
|
|
||||||
|
|
||||||
result += "**";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return negated ? "!" + result : result;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.gitignoreToMinimatch = gitignoreToMinimatch;
|
|
||||||
10
node_modules/@humanwhocodes/gitignore-to-minimatch/dist/gitignore-to-minimatch.d.ts
generated
vendored
10
node_modules/@humanwhocodes/gitignore-to-minimatch/dist/gitignore-to-minimatch.d.ts
generated
vendored
@ -1,10 +0,0 @@
|
|||||||
/**
|
|
||||||
* @fileoverview Utility to convert gitignore patterns to minimatch.
|
|
||||||
* @author Nicholas C. Zakas
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Converts a gitignore pattern to a minimatch pattern.
|
|
||||||
* @param {string} pattern The gitignore pattern to convert.
|
|
||||||
* @returns {string} A minimatch pattern equivalent to `pattern`.
|
|
||||||
*/
|
|
||||||
export function gitignoreToMinimatch(pattern: string): string;
|
|
||||||
67
node_modules/@humanwhocodes/gitignore-to-minimatch/dist/gitignore-to-minimatch.js
generated
vendored
67
node_modules/@humanwhocodes/gitignore-to-minimatch/dist/gitignore-to-minimatch.js
generated
vendored
@ -1,67 +0,0 @@
|
|||||||
/**
|
|
||||||
* @fileoverview Utility to convert gitignore patterns to minimatch.
|
|
||||||
* @author Nicholas C. Zakas
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts a gitignore pattern to a minimatch pattern.
|
|
||||||
* @param {string} pattern The gitignore pattern to convert.
|
|
||||||
* @returns {string} A minimatch pattern equivalent to `pattern`.
|
|
||||||
*/
|
|
||||||
function gitignoreToMinimatch(pattern) {
|
|
||||||
|
|
||||||
if (typeof pattern !== "string") {
|
|
||||||
throw new TypeError("Argument must be a string.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Special case: Empty string
|
|
||||||
if (!pattern) {
|
|
||||||
return pattern;
|
|
||||||
}
|
|
||||||
|
|
||||||
// strip off negation to make life easier
|
|
||||||
const negated = pattern.startsWith("!");
|
|
||||||
let patternToTest = negated ? pattern.slice(1) : pattern;
|
|
||||||
let result = patternToTest;
|
|
||||||
let leadingSlash = false;
|
|
||||||
|
|
||||||
// strip off leading slash
|
|
||||||
if (patternToTest[0] === "/") {
|
|
||||||
leadingSlash = true;
|
|
||||||
result = patternToTest.slice(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// For the most part, the first character determines what to do
|
|
||||||
switch (result[0]) {
|
|
||||||
|
|
||||||
case "*":
|
|
||||||
if (patternToTest[1] !== "*") {
|
|
||||||
result = "**/" + result;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
if (!leadingSlash && !result.includes("/") || result.endsWith("/")) {
|
|
||||||
result = "**/" + result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// no further changes if the pattern ends with a wildcard
|
|
||||||
if (result.endsWith("*") || result.endsWith("?")) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// differentiate between filenames and directory names
|
|
||||||
if (!/\.[a-z\d_-]+$/.test(result)) {
|
|
||||||
if (!result.endsWith("/")) {
|
|
||||||
result += "/";
|
|
||||||
}
|
|
||||||
|
|
||||||
result += "**";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return negated ? "!" + result : result;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export { gitignoreToMinimatch };
|
|
||||||
61
node_modules/@humanwhocodes/gitignore-to-minimatch/package.json
generated
vendored
61
node_modules/@humanwhocodes/gitignore-to-minimatch/package.json
generated
vendored
@ -1,61 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@humanwhocodes/gitignore-to-minimatch",
|
|
||||||
"version": "1.0.2",
|
|
||||||
"description": "Utility to convert gitignore patterns to minimatch patterns",
|
|
||||||
"type": "module",
|
|
||||||
"main": "dist/gitignore-to-minimatch.cjs",
|
|
||||||
"module": "dist/gitignore-to-minimatch.js",
|
|
||||||
"types": "dist/gitignore-to-minimatch.d.ts",
|
|
||||||
"exports": {
|
|
||||||
"require": "./dist/gitignore-to-minimatch.cjs",
|
|
||||||
"import": "./dist/gitignore-to-minimatch.js"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"dist"
|
|
||||||
],
|
|
||||||
"publishConfig": {
|
|
||||||
"access": "public"
|
|
||||||
},
|
|
||||||
"gitHooks": {
|
|
||||||
"pre-commit": "lint-staged"
|
|
||||||
},
|
|
||||||
"lint-staged": {
|
|
||||||
"*.js": [
|
|
||||||
"eslint --fix"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/nzakas"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"build": "rollup -c && tsc",
|
|
||||||
"prepare": "npm run build",
|
|
||||||
"lint": "eslint src/ tests/",
|
|
||||||
"lint:fix": "eslint src/ tests/",
|
|
||||||
"pretest": "npm run build",
|
|
||||||
"test:unit": "mocha tests/gitignore-to-minimatch.test.js",
|
|
||||||
"test:build": "node tests/pkg.test.cjs && node tests/pkg.test.mjs",
|
|
||||||
"test": "npm run test:unit && npm run test:build"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/humanwhocodes/gitignore-to-minimatch.git"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"gitignore",
|
|
||||||
"minimatch",
|
|
||||||
"glob"
|
|
||||||
],
|
|
||||||
"author": "Nicholas C. Zaks",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"devDependencies": {
|
|
||||||
"chai": "^4.3.4",
|
|
||||||
"eslint": "^7.32.0",
|
|
||||||
"lint-staged": "^10.4.0",
|
|
||||||
"mocha": "^9.0.3",
|
|
||||||
"rollup": "^1.20.3",
|
|
||||||
"typescript": "^4.0.3",
|
|
||||||
"yorkie": "^2.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
1
node_modules/acorn-jsx/node_modules/.bin/acorn
generated
vendored
Symbolic link
1
node_modules/acorn-jsx/node_modules/.bin/acorn
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../acorn/bin/acorn
|
||||||
34
node_modules/acorn/CHANGELOG.md
generated
vendored
34
node_modules/acorn/CHANGELOG.md
generated
vendored
@ -1,3 +1,37 @@
|
|||||||
|
## 8.10.0 (2023-07-05)
|
||||||
|
|
||||||
|
### New features
|
||||||
|
|
||||||
|
Add a `checkPrivateFields` option that disables strict checking of private property use.
|
||||||
|
|
||||||
|
## 8.9.0 (2023-06-16)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Forbid dynamic import after `new`, even when part of a member expression.
|
||||||
|
|
||||||
|
### New features
|
||||||
|
|
||||||
|
Add Unicode properties for ES2023.
|
||||||
|
|
||||||
|
Add support for the `v` flag to regular expressions.
|
||||||
|
|
||||||
|
## 8.8.2 (2023-01-23)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Fix a bug that caused `allowHashBang` to be set to false when not provided, even with `ecmaVersion >= 14`.
|
||||||
|
|
||||||
|
Fix an exception when passing no option object to `parse` or `new Parser`.
|
||||||
|
|
||||||
|
Fix incorrect parse error on `if (0) let\n[astral identifier char]`.
|
||||||
|
|
||||||
|
## 8.8.1 (2022-10-24)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Make type for `Comment` compatible with estree types.
|
||||||
|
|
||||||
## 8.8.0 (2022-07-21)
|
## 8.8.0 (2022-07-21)
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|||||||
13
node_modules/acorn/README.md
generated
vendored
13
node_modules/acorn/README.md
generated
vendored
@ -96,10 +96,11 @@ required):
|
|||||||
(when `sourceType` is not `"module"`).
|
(when `sourceType` is not `"module"`).
|
||||||
|
|
||||||
- **allowAwaitOutsideFunction**: If `false`, `await` expressions can
|
- **allowAwaitOutsideFunction**: If `false`, `await` expressions can
|
||||||
only appear inside `async` functions. Defaults to `true` for
|
only appear inside `async` functions. Defaults to `true` in modules
|
||||||
`ecmaVersion` 2022 and later, `false` for lower versions. Setting this option to
|
for `ecmaVersion` 2022 and later, `false` for lower versions.
|
||||||
`true` allows to have top-level `await` expressions. They are
|
Setting this option to `true` allows to have top-level `await`
|
||||||
still not allowed in non-`async` functions, though.
|
expressions. They are still not allowed in non-`async` functions,
|
||||||
|
though.
|
||||||
|
|
||||||
- **allowSuperOutsideMethod**: By default, `super` outside a method
|
- **allowSuperOutsideMethod**: By default, `super` outside a method
|
||||||
raises an error. Set this to `true` to accept such code.
|
raises an error. Set this to `true` to accept such code.
|
||||||
@ -108,6 +109,10 @@ required):
|
|||||||
characters `#!` (as in a shellscript), the first line will be
|
characters `#!` (as in a shellscript), the first line will be
|
||||||
treated as a comment. Defaults to true when `ecmaVersion` >= 2023.
|
treated as a comment. Defaults to true when `ecmaVersion` >= 2023.
|
||||||
|
|
||||||
|
- **checkPrivateFields**: By default, the parser will verify that
|
||||||
|
private properties are only used in places where they are valid and
|
||||||
|
have been declared. Set this to false to turn such checks off.
|
||||||
|
|
||||||
- **locations**: When `true`, each node has a `loc` object attached
|
- **locations**: When `true`, each node has a `loc` object attached
|
||||||
with `start` and `end` subobjects, each of which contains the
|
with `start` and `end` subobjects, each of which contains the
|
||||||
one-based line and zero-based column numbers in `{line, column}`
|
one-based line and zero-based column numbers in `{line, column}`
|
||||||
|
|||||||
26
node_modules/acorn/dist/acorn.d.mts
generated
vendored
Normal file
26
node_modules/acorn/dist/acorn.d.mts
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
export {
|
||||||
|
Node,
|
||||||
|
Parser,
|
||||||
|
Position,
|
||||||
|
SourceLocation,
|
||||||
|
TokContext,
|
||||||
|
Token,
|
||||||
|
TokenType,
|
||||||
|
defaultOptions,
|
||||||
|
getLineInfo,
|
||||||
|
isIdentifierChar,
|
||||||
|
isIdentifierStart,
|
||||||
|
isNewLine,
|
||||||
|
lineBreak,
|
||||||
|
lineBreakG,
|
||||||
|
parse,
|
||||||
|
parseExpressionAt,
|
||||||
|
tokContexts,
|
||||||
|
tokTypes,
|
||||||
|
tokenizer,
|
||||||
|
version,
|
||||||
|
AbstractToken,
|
||||||
|
Comment,
|
||||||
|
Options,
|
||||||
|
ecmaVersion,
|
||||||
|
} from "./acorn.js";
|
||||||
44
node_modules/acorn/dist/acorn.d.ts
generated
vendored
44
node_modules/acorn/dist/acorn.d.ts
generated
vendored
@ -11,7 +11,7 @@ declare namespace acorn {
|
|||||||
[Symbol.iterator](): Iterator<Token>
|
[Symbol.iterator](): Iterator<Token>
|
||||||
}
|
}
|
||||||
|
|
||||||
type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 'latest'
|
type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 'latest'
|
||||||
|
|
||||||
interface Options {
|
interface Options {
|
||||||
ecmaVersion: ecmaVersion
|
ecmaVersion: ecmaVersion
|
||||||
@ -224,7 +224,7 @@ declare namespace acorn {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface Comment extends AbstractToken {
|
interface Comment extends AbstractToken {
|
||||||
type: string
|
type: 'Line' | 'Block'
|
||||||
value: string
|
value: string
|
||||||
start: number
|
start: number
|
||||||
end: number
|
end: number
|
||||||
@ -249,4 +249,44 @@ declare namespace acorn {
|
|||||||
const lineBreakG: RegExp
|
const lineBreakG: RegExp
|
||||||
|
|
||||||
const version: string
|
const version: string
|
||||||
|
|
||||||
|
const nonASCIIwhitespace: RegExp
|
||||||
|
|
||||||
|
const keywordTypes: {
|
||||||
|
_break: TokenType
|
||||||
|
_case: TokenType
|
||||||
|
_catch: TokenType
|
||||||
|
_continue: TokenType
|
||||||
|
_debugger: TokenType
|
||||||
|
_default: TokenType
|
||||||
|
_do: TokenType
|
||||||
|
_else: TokenType
|
||||||
|
_finally: TokenType
|
||||||
|
_for: TokenType
|
||||||
|
_function: TokenType
|
||||||
|
_if: TokenType
|
||||||
|
_return: TokenType
|
||||||
|
_switch: TokenType
|
||||||
|
_throw: TokenType
|
||||||
|
_try: TokenType
|
||||||
|
_var: TokenType
|
||||||
|
_const: TokenType
|
||||||
|
_while: TokenType
|
||||||
|
_with: TokenType
|
||||||
|
_new: TokenType
|
||||||
|
_this: TokenType
|
||||||
|
_super: TokenType
|
||||||
|
_class: TokenType
|
||||||
|
_extends: TokenType
|
||||||
|
_export: TokenType
|
||||||
|
_import: TokenType
|
||||||
|
_null: TokenType
|
||||||
|
_true: TokenType
|
||||||
|
_false: TokenType
|
||||||
|
_in: TokenType
|
||||||
|
_instanceof: TokenType
|
||||||
|
_typeof: TokenType
|
||||||
|
_void: TokenType
|
||||||
|
_delete: TokenType
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
705
node_modules/acorn/dist/acorn.js
generated
vendored
705
node_modules/acorn/dist/acorn.js
generated
vendored
File diff suppressed because it is too large
Load Diff
703
node_modules/acorn/dist/acorn.mjs
generated
vendored
703
node_modules/acorn/dist/acorn.mjs
generated
vendored
File diff suppressed because it is too large
Load Diff
2
node_modules/acorn/dist/acorn.mjs.d.ts
generated
vendored
2
node_modules/acorn/dist/acorn.mjs.d.ts
generated
vendored
@ -1,2 +0,0 @@
|
|||||||
import * as acorn from "./acorn";
|
|
||||||
export = acorn;
|
|
||||||
7
node_modules/acorn/dist/bin.js
generated
vendored
7
node_modules/acorn/dist/bin.js
generated
vendored
@ -4,8 +4,7 @@ var path = require('path');
|
|||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var acorn = require('./acorn.js');
|
var acorn = require('./acorn.js');
|
||||||
|
|
||||||
function _interopNamespace(e) {
|
function _interopNamespaceDefault(e) {
|
||||||
if (e && e.__esModule) return e;
|
|
||||||
var n = Object.create(null);
|
var n = Object.create(null);
|
||||||
if (e) {
|
if (e) {
|
||||||
Object.keys(e).forEach(function (k) {
|
Object.keys(e).forEach(function (k) {
|
||||||
@ -18,11 +17,11 @@ function _interopNamespace(e) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
n["default"] = e;
|
n.default = e;
|
||||||
return Object.freeze(n);
|
return Object.freeze(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
var acorn__namespace = /*#__PURE__*/_interopNamespace(acorn);
|
var acorn__namespace = /*#__PURE__*/_interopNamespaceDefault(acorn);
|
||||||
|
|
||||||
var inputFilePaths = [], forceFileName = false, fileMode = false, silent = false, compact = false, tokenize = false;
|
var inputFilePaths = [], forceFileName = false, fileMode = false, silent = false, compact = false, tokenize = false;
|
||||||
var options = {};
|
var options = {};
|
||||||
|
|||||||
2
node_modules/acorn/package.json
generated
vendored
2
node_modules/acorn/package.json
generated
vendored
@ -16,7 +16,7 @@
|
|||||||
],
|
],
|
||||||
"./package.json": "./package.json"
|
"./package.json": "./package.json"
|
||||||
},
|
},
|
||||||
"version": "8.8.0",
|
"version": "8.10.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
},
|
},
|
||||||
|
|||||||
25
node_modules/array-union/index.d.ts
generated
vendored
25
node_modules/array-union/index.d.ts
generated
vendored
@ -1,25 +0,0 @@
|
|||||||
/**
|
|
||||||
Create an array of unique values, in order, from the input arrays.
|
|
||||||
|
|
||||||
@example
|
|
||||||
```
|
|
||||||
import arrayUnion = require('array-union');
|
|
||||||
|
|
||||||
arrayUnion([1, 1, 2, 3], [2, 3]);
|
|
||||||
//=> [1, 2, 3]
|
|
||||||
|
|
||||||
arrayUnion(['foo', 'foo', 'bar']);
|
|
||||||
//=> ['foo', 'bar']
|
|
||||||
|
|
||||||
arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']);
|
|
||||||
//=> ['🐱', '🦄', '🐻', '🌈']
|
|
||||||
|
|
||||||
arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']);
|
|
||||||
//=> ['🐱', '🦄', '🐻', '🐶', '🌈']
|
|
||||||
```
|
|
||||||
*/
|
|
||||||
declare function arrayUnion<ArgumentsType extends readonly unknown[]>(
|
|
||||||
...arguments: readonly ArgumentsType[]
|
|
||||||
): ArgumentsType;
|
|
||||||
|
|
||||||
export = arrayUnion;
|
|
||||||
5
node_modules/array-union/index.js
generated
vendored
5
node_modules/array-union/index.js
generated
vendored
@ -1,5 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
module.exports = (...arguments_) => {
|
|
||||||
return [...new Set([].concat(...arguments_))];
|
|
||||||
};
|
|
||||||
38
node_modules/array-union/package.json
generated
vendored
38
node_modules/array-union/package.json
generated
vendored
@ -1,38 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "array-union",
|
|
||||||
"version": "2.1.0",
|
|
||||||
"description": "Create an array of unique values, in order, from the input arrays",
|
|
||||||
"license": "MIT",
|
|
||||||
"repository": "sindresorhus/array-union",
|
|
||||||
"author": {
|
|
||||||
"name": "Sindre Sorhus",
|
|
||||||
"email": "sindresorhus@gmail.com",
|
|
||||||
"url": "sindresorhus.com"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"test": "xo && ava && tsd"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"index.js",
|
|
||||||
"index.d.ts"
|
|
||||||
],
|
|
||||||
"keywords": [
|
|
||||||
"array",
|
|
||||||
"set",
|
|
||||||
"uniq",
|
|
||||||
"unique",
|
|
||||||
"duplicate",
|
|
||||||
"remove",
|
|
||||||
"union",
|
|
||||||
"combine",
|
|
||||||
"merge"
|
|
||||||
],
|
|
||||||
"devDependencies": {
|
|
||||||
"ava": "^1.4.1",
|
|
||||||
"tsd": "^0.7.2",
|
|
||||||
"xo": "^0.24.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
34
node_modules/array-union/readme.md
generated
vendored
34
node_modules/array-union/readme.md
generated
vendored
@ -1,34 +0,0 @@
|
|||||||
# array-union [](https://travis-ci.org/sindresorhus/array-union)
|
|
||||||
|
|
||||||
> Create an array of unique values, in order, from the input arrays
|
|
||||||
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
```
|
|
||||||
$ npm install array-union
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
```js
|
|
||||||
const arrayUnion = require('array-union');
|
|
||||||
|
|
||||||
arrayUnion([1, 1, 2, 3], [2, 3]);
|
|
||||||
//=> [1, 2, 3]
|
|
||||||
|
|
||||||
arrayUnion(['foo', 'foo', 'bar']);
|
|
||||||
//=> ['foo', 'bar']
|
|
||||||
|
|
||||||
arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']);
|
|
||||||
//=> ['🐱', '🦄', '🐻', '🌈']
|
|
||||||
|
|
||||||
arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']);
|
|
||||||
//=> ['🐱', '🦄', '🐻', '🐶', '🌈']
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
|
||||||
184
node_modules/braces/CHANGELOG.md
generated
vendored
184
node_modules/braces/CHANGELOG.md
generated
vendored
@ -1,184 +0,0 @@
|
|||||||
# Release history
|
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary><strong>Guiding Principles</strong></summary>
|
|
||||||
|
|
||||||
- Changelogs are for humans, not machines.
|
|
||||||
- There should be an entry for every single version.
|
|
||||||
- The same types of changes should be grouped.
|
|
||||||
- Versions and sections should be linkable.
|
|
||||||
- The latest version comes first.
|
|
||||||
- The release date of each versions is displayed.
|
|
||||||
- Mention whether you follow Semantic Versioning.
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary><strong>Types of changes</strong></summary>
|
|
||||||
|
|
||||||
Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_):
|
|
||||||
|
|
||||||
- `Added` for new features.
|
|
||||||
- `Changed` for changes in existing functionality.
|
|
||||||
- `Deprecated` for soon-to-be removed features.
|
|
||||||
- `Removed` for now removed features.
|
|
||||||
- `Fixed` for any bug fixes.
|
|
||||||
- `Security` in case of vulnerabilities.
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
## [3.0.0] - 2018-04-08
|
|
||||||
|
|
||||||
v3.0 is a complete refactor, resulting in a faster, smaller codebase, with fewer deps, and a more accurate parser and compiler.
|
|
||||||
|
|
||||||
**Breaking Changes**
|
|
||||||
|
|
||||||
- The undocumented `.makeRe` method was removed
|
|
||||||
|
|
||||||
**Non-breaking changes**
|
|
||||||
|
|
||||||
- Caching was removed
|
|
||||||
|
|
||||||
## [2.3.2] - 2018-04-08
|
|
||||||
|
|
||||||
- start refactoring
|
|
||||||
- cover sets
|
|
||||||
- better range handling
|
|
||||||
|
|
||||||
## [2.3.1] - 2018-02-17
|
|
||||||
|
|
||||||
- Remove unnecessary escape in Regex. (#14)
|
|
||||||
|
|
||||||
## [2.3.0] - 2017-10-19
|
|
||||||
|
|
||||||
- minor code reorganization
|
|
||||||
- optimize regex
|
|
||||||
- expose `maxLength` option
|
|
||||||
|
|
||||||
## [2.2.1] - 2017-05-30
|
|
||||||
|
|
||||||
- don't condense when braces contain extglobs
|
|
||||||
|
|
||||||
## [2.2.0] - 2017-05-28
|
|
||||||
|
|
||||||
- ensure word boundaries are preserved
|
|
||||||
- fixes edge case where extglob characters precede a brace pattern
|
|
||||||
|
|
||||||
## [2.1.1] - 2017-04-27
|
|
||||||
|
|
||||||
- use snapdragon-node
|
|
||||||
- handle edge case
|
|
||||||
- optimizations, lint
|
|
||||||
|
|
||||||
## [2.0.4] - 2017-04-11
|
|
||||||
|
|
||||||
- pass opts to compiler
|
|
||||||
- minor optimization in create method
|
|
||||||
- re-write parser handlers to remove negation regex
|
|
||||||
|
|
||||||
## [2.0.3] - 2016-12-10
|
|
||||||
|
|
||||||
- use split-string
|
|
||||||
- clear queue at the end
|
|
||||||
- adds sequences example
|
|
||||||
- add unit tests
|
|
||||||
|
|
||||||
## [2.0.2] - 2016-10-21
|
|
||||||
|
|
||||||
- fix comma handling in nested extglobs
|
|
||||||
|
|
||||||
## [2.0.1] - 2016-10-20
|
|
||||||
|
|
||||||
- add comments
|
|
||||||
- more tests, ensure quotes are stripped
|
|
||||||
|
|
||||||
## [2.0.0] - 2016-10-19
|
|
||||||
|
|
||||||
- don't expand braces inside character classes
|
|
||||||
- add quantifier pattern
|
|
||||||
|
|
||||||
## [1.8.5] - 2016-05-21
|
|
||||||
|
|
||||||
- Refactor (#10)
|
|
||||||
|
|
||||||
## [1.8.4] - 2016-04-20
|
|
||||||
|
|
||||||
- fixes https://github.com/jonschlinkert/micromatch/issues/66
|
|
||||||
|
|
||||||
## [1.8.0] - 2015-03-18
|
|
||||||
|
|
||||||
- adds exponent examples, tests
|
|
||||||
- fixes the first example in https://github.com/jonschlinkert/micromatch/issues/38
|
|
||||||
|
|
||||||
## [1.6.0] - 2015-01-30
|
|
||||||
|
|
||||||
- optimizations, `bash` mode:
|
|
||||||
- improve path escaping
|
|
||||||
|
|
||||||
## [1.5.0] - 2015-01-28
|
|
||||||
|
|
||||||
- Merge pull request #5 from eush77/lib-files
|
|
||||||
|
|
||||||
## [1.4.0] - 2015-01-24
|
|
||||||
|
|
||||||
- add extglob tests
|
|
||||||
- externalize exponent function
|
|
||||||
- better whitespace handling
|
|
||||||
|
|
||||||
## [1.3.0] - 2015-01-24
|
|
||||||
|
|
||||||
- make regex patterns explicity
|
|
||||||
|
|
||||||
## [1.1.0] - 2015-01-11
|
|
||||||
|
|
||||||
- don't create a match group with `makeRe`
|
|
||||||
|
|
||||||
## [1.0.0] - 2014-12-23
|
|
||||||
|
|
||||||
- Merge commit '97b05f5544f8348736a8efaecf5c32bbe3e2ad6e'
|
|
||||||
- support empty brace syntax
|
|
||||||
- better bash coverage
|
|
||||||
- better support for regex strings
|
|
||||||
|
|
||||||
## [0.1.4] - 2014-11-14
|
|
||||||
|
|
||||||
- improve recognition of bad args, recognize mismatched argument types
|
|
||||||
- support escaping
|
|
||||||
- remove pathname-expansion
|
|
||||||
- support whitespace in patterns
|
|
||||||
|
|
||||||
## [0.1.0]
|
|
||||||
|
|
||||||
- first commit
|
|
||||||
|
|
||||||
[2.3.2]: https://github.com/micromatch/braces/compare/2.3.1...2.3.2
|
|
||||||
[2.3.1]: https://github.com/micromatch/braces/compare/2.3.0...2.3.1
|
|
||||||
[2.3.0]: https://github.com/micromatch/braces/compare/2.2.1...2.3.0
|
|
||||||
[2.2.1]: https://github.com/micromatch/braces/compare/2.2.0...2.2.1
|
|
||||||
[2.2.0]: https://github.com/micromatch/braces/compare/2.1.1...2.2.0
|
|
||||||
[2.1.1]: https://github.com/micromatch/braces/compare/2.1.0...2.1.1
|
|
||||||
[2.1.0]: https://github.com/micromatch/braces/compare/2.0.4...2.1.0
|
|
||||||
[2.0.4]: https://github.com/micromatch/braces/compare/2.0.3...2.0.4
|
|
||||||
[2.0.3]: https://github.com/micromatch/braces/compare/2.0.2...2.0.3
|
|
||||||
[2.0.2]: https://github.com/micromatch/braces/compare/2.0.1...2.0.2
|
|
||||||
[2.0.1]: https://github.com/micromatch/braces/compare/2.0.0...2.0.1
|
|
||||||
[2.0.0]: https://github.com/micromatch/braces/compare/1.8.5...2.0.0
|
|
||||||
[1.8.5]: https://github.com/micromatch/braces/compare/1.8.4...1.8.5
|
|
||||||
[1.8.4]: https://github.com/micromatch/braces/compare/1.8.0...1.8.4
|
|
||||||
[1.8.0]: https://github.com/micromatch/braces/compare/1.6.0...1.8.0
|
|
||||||
[1.6.0]: https://github.com/micromatch/braces/compare/1.5.0...1.6.0
|
|
||||||
[1.5.0]: https://github.com/micromatch/braces/compare/1.4.0...1.5.0
|
|
||||||
[1.4.0]: https://github.com/micromatch/braces/compare/1.3.0...1.4.0
|
|
||||||
[1.3.0]: https://github.com/micromatch/braces/compare/1.2.0...1.3.0
|
|
||||||
[1.2.0]: https://github.com/micromatch/braces/compare/1.1.0...1.2.0
|
|
||||||
[1.1.0]: https://github.com/micromatch/braces/compare/1.0.0...1.1.0
|
|
||||||
[1.0.0]: https://github.com/micromatch/braces/compare/0.1.4...1.0.0
|
|
||||||
[0.1.4]: https://github.com/micromatch/braces/compare/0.1.0...0.1.4
|
|
||||||
|
|
||||||
[Unreleased]: https://github.com/micromatch/braces/compare/0.1.0...HEAD
|
|
||||||
[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog
|
|
||||||
21
node_modules/braces/LICENSE
generated
vendored
21
node_modules/braces/LICENSE
generated
vendored
@ -1,21 +0,0 @@
|
|||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2014-2018, 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.
|
|
||||||
593
node_modules/braces/README.md
generated
vendored
593
node_modules/braces/README.md
generated
vendored
@ -1,593 +0,0 @@
|
|||||||
# braces [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [](https://www.npmjs.com/package/braces) [](https://npmjs.org/package/braces) [](https://npmjs.org/package/braces) [](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**: `65,536`
|
|
||||||
|
|
||||||
**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.unescape
|
|
||||||
|
|
||||||
**Type**: `Boolean`
|
|
||||||
|
|
||||||
**Default**: `undefined`
|
|
||||||
|
|
||||||
**Description**: 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
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary><strong>More about brace expansion</strong> (click to expand)</summary>
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
## 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
|
|
||||||
# range (expanded)
|
|
||||||
braces x 29,040 ops/sec ±3.69% (91 runs sampled))
|
|
||||||
minimatch x 4,735 ops/sec ±1.28% (90 runs sampled)
|
|
||||||
|
|
||||||
# range (optimized for regex)
|
|
||||||
braces x 382,878 ops/sec ±0.56% (94 runs sampled)
|
|
||||||
minimatch x 1,040 ops/sec ±0.44% (93 runs sampled)
|
|
||||||
|
|
||||||
# nested ranges (expanded)
|
|
||||||
braces x 19,744 ops/sec ±2.27% (92 runs sampled))
|
|
||||||
minimatch x 4,579 ops/sec ±0.50% (93 runs sampled)
|
|
||||||
|
|
||||||
# nested ranges (optimized for regex)
|
|
||||||
braces x 246,019 ops/sec ±2.02% (93 runs sampled)
|
|
||||||
minimatch x 1,028 ops/sec ±0.39% (94 runs sampled)
|
|
||||||
|
|
||||||
# set (expanded)
|
|
||||||
braces x 138,641 ops/sec ±0.53% (95 runs sampled)
|
|
||||||
minimatch x 219,582 ops/sec ±0.98% (94 runs sampled)
|
|
||||||
|
|
||||||
# set (optimized for regex)
|
|
||||||
braces x 388,408 ops/sec ±0.41% (95 runs sampled)
|
|
||||||
minimatch x 44,724 ops/sec ±0.91% (89 runs sampled)
|
|
||||||
|
|
||||||
# nested sets (expanded)
|
|
||||||
braces x 84,966 ops/sec ±0.48% (94 runs sampled)
|
|
||||||
minimatch x 140,720 ops/sec ±0.37% (95 runs sampled)
|
|
||||||
|
|
||||||
# nested sets (optimized for regex)
|
|
||||||
braces x 263,340 ops/sec ±2.06% (92 runs sampled)
|
|
||||||
minimatch x 28,714 ops/sec ±0.40% (90 runs sampled)
|
|
||||||
```
|
|
||||||
|
|
||||||
## About
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary><strong>Contributing</strong></summary>
|
|
||||||
|
|
||||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary><strong>Running Tests</strong></summary>
|
|
||||||
|
|
||||||
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
|
|
||||||
```
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary><strong>Building docs</strong></summary>
|
|
||||||
|
|
||||||
_(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
|
|
||||||
```
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### 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._
|
|
||||||
170
node_modules/braces/index.js
generated
vendored
170
node_modules/braces/index.js
generated
vendored
@ -1,170 +0,0 @@
|
|||||||
'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 (let pattern of input) {
|
|
||||||
let 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;
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user