Merge pull request #1774 from github/dependabot/npm_and_yarn/npm-a34e423e98
Bump the npm group with 21 updates
This commit is contained in:
commit
c5526174a5
3948 changed files with 647345 additions and 442023 deletions
2
lib/api-client.js
generated
2
lib/api-client.js
generated
|
|
@ -37,7 +37,7 @@ var DisallowedAPIVersionReason;
|
|||
(function (DisallowedAPIVersionReason) {
|
||||
DisallowedAPIVersionReason[DisallowedAPIVersionReason["ACTION_TOO_OLD"] = 0] = "ACTION_TOO_OLD";
|
||||
DisallowedAPIVersionReason[DisallowedAPIVersionReason["ACTION_TOO_NEW"] = 1] = "ACTION_TOO_NEW";
|
||||
})(DisallowedAPIVersionReason = exports.DisallowedAPIVersionReason || (exports.DisallowedAPIVersionReason = {}));
|
||||
})(DisallowedAPIVersionReason || (exports.DisallowedAPIVersionReason = DisallowedAPIVersionReason = {}));
|
||||
function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) {
|
||||
const auth = (allowExternal && apiDetails.externalRepoAuth) || apiDetails.auth;
|
||||
const retryingOctokit = githubUtils.GitHub.plugin(retry.retry);
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uEAAyD;AACzD,6DAA+C;AAC/C,0EAAgD;AAEhD,iDAAoE;AACpE,6CAA+B;AAC/B,iCAA4D;AAE5D,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IACpC,+FAAc,CAAA;IACd,+FAAc,CAAA;AAChB,CAAC,EAHW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAGrC;AAiBD,SAAS,0BAA0B,CACjC,UAAoC,EACpC,EAAE,aAAa,GAAG,KAAK,EAAE,GAAG,EAAE;IAE9B,MAAM,IAAI,GACR,CAAC,aAAa,IAAI,UAAU,CAAC,gBAAgB,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC;IACpE,MAAM,eAAe,GAAG,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pC,IAAI,mBAAmB,KAAK,SAAS,EAAE;QACrC,mBAAmB,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAC;KACpE;IACD,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AALD,4CAKC"}
|
||||
4
lib/config-utils.js
generated
4
lib/config-utils.js
generated
|
|
@ -408,7 +408,7 @@ exports.getUnknownLanguagesError = getUnknownLanguagesError;
|
|||
*/
|
||||
async function getLanguagesInRepo(repository, logger) {
|
||||
logger.debug(`GitHub repo ${repository.owner} ${repository.repo}`);
|
||||
const response = await api.getApiClient().repos.listLanguages({
|
||||
const response = await api.getApiClient().rest.repos.listLanguages({
|
||||
owner: repository.owner,
|
||||
repo: repository.repo,
|
||||
});
|
||||
|
|
@ -1013,7 +1013,7 @@ async function getRemoteConfig(configFile, apiDetails) {
|
|||
}
|
||||
const response = await api
|
||||
.getApiClientWithExternalAuth(apiDetails)
|
||||
.repos.getContent({
|
||||
.rest.repos.getContent({
|
||||
owner: pieces.groups.owner,
|
||||
repo: pieces.groups.repo,
|
||||
path: pieces.groups.path,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
4
lib/config-utils.test.js
generated
4
lib/config-utils.test.js
generated
|
|
@ -63,7 +63,7 @@ function mockGetContents(content) {
|
|||
data: content,
|
||||
};
|
||||
const spyGetContents = sinon
|
||||
.stub(client.repos, "getContent")
|
||||
.stub(client.rest.repos, "getContent")
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
.resolves(response);
|
||||
sinon.stub(api, "getApiClient").value(() => client);
|
||||
|
|
@ -80,7 +80,7 @@ function mockListLanguages(languages) {
|
|||
response.data[language] = 123;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
sinon.stub(client.repos, "listLanguages").resolves(response);
|
||||
sinon.stub(client.rest.repos, "listLanguages").resolves(response);
|
||||
sinon.stub(api, "getApiClient").value(() => client);
|
||||
}
|
||||
(0, ava_1.default)("load empty config", async (t) => {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
2
lib/environment.js
generated
2
lib/environment.js
generated
|
|
@ -51,5 +51,5 @@ var EnvVar;
|
|||
* rather that the init action.
|
||||
*/
|
||||
EnvVar["WORKFLOW_STARTED_AT"] = "CODEQL_WORKFLOW_STARTED_AT";
|
||||
})(EnvVar = exports.EnvVar || (exports.EnvVar = {}));
|
||||
})(EnvVar || (exports.EnvVar = EnvVar = {}));
|
||||
//# sourceMappingURL=environment.js.map
|
||||
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":";;;AAAA,IAAY,MA8DX;AA9DD,WAAY,MAAM;IAChB,oEAAoE;IACpE,+FAAqF,CAAA;IAErF,2EAA2E;IAC3E,qEAA2D,CAAA;IAE3D;;;OAGG;IACH,yFAA+E,CAAA;IAE/E;;;;OAIG;IACH,yEAA+D,CAAA;IAE/D;;;OAGG;IACH,6DAAmD,CAAA;IAEnD;;;OAGG;IACH,uEAA6D,CAAA;IAE7D;;;OAGG;IACH,mEAAyD,CAAA;IAEzD,6CAA6C;IAC7C,uCAA6B,CAAA;IAE7B,mEAAyD,CAAA;IAEzD,mFAAmF;IACnF,6FAAmF,CAAA;IAEnF,kFAAkF;IAClF,+CAAqC,CAAA;IAErC,mEAAyD,CAAA;IAEzD,kEAAkE;IAClE,2CAAiC,CAAA;IAEjC;;;;;;OAMG;IACH,4DAAkD,CAAA;AACpD,CAAC,EA9DW,MAAM,GAAN,cAAM,KAAN,cAAM,QA8DjB"}
|
||||
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":";;;AAAA,IAAY,MA8DX;AA9DD,WAAY,MAAM;IAChB,oEAAoE;IACpE,+FAAqF,CAAA;IAErF,2EAA2E;IAC3E,qEAA2D,CAAA;IAE3D;;;OAGG;IACH,yFAA+E,CAAA;IAE/E;;;;OAIG;IACH,yEAA+D,CAAA;IAE/D;;;OAGG;IACH,6DAAmD,CAAA;IAEnD;;;OAGG;IACH,uEAA6D,CAAA;IAE7D;;;OAGG;IACH,mEAAyD,CAAA;IAEzD,6CAA6C;IAC7C,uCAA6B,CAAA;IAE7B,mEAAyD,CAAA;IAEzD,mFAAmF;IACnF,6FAAmF,CAAA;IAEnF,kFAAkF;IAClF,+CAAqC,CAAA;IAErC,mEAAyD,CAAA;IAEzD,kEAAkE;IAClE,2CAAiC,CAAA;IAEjC;;;;;;OAMG;IACH,4DAAkD,CAAA;AACpD,CAAC,EA9DW,MAAM,sBAAN,MAAM,QA8DjB"}
|
||||
4
lib/feature-flags.js
generated
4
lib/feature-flags.js
generated
|
|
@ -44,7 +44,7 @@ var Feature;
|
|||
Feature["QaTelemetryEnabled"] = "qa_telemetry_enabled";
|
||||
Feature["ScalingReservedRam"] = "scaling_reserved_ram";
|
||||
Feature["UploadFailedSarifEnabled"] = "upload_failed_sarif_enabled";
|
||||
})(Feature = exports.Feature || (exports.Feature = {}));
|
||||
})(Feature || (exports.Feature = Feature = {}));
|
||||
exports.featureConfig = {
|
||||
[Feature.DisableKotlinAnalysisEnabled]: {
|
||||
envVar: "CODEQL_DISABLE_KOTLIN_ANALYSIS",
|
||||
|
|
@ -311,7 +311,7 @@ class GitHubFeatureFlags {
|
|||
this.logger.warning("This run of the CodeQL Action does not have permission to access Code Scanning API endpoints. " +
|
||||
"As a result, it will not be opted into any experimental features. " +
|
||||
"This could be because the Action is running on a pull request from a fork. If not, " +
|
||||
`please ensure the Action has the 'security-events: write' permission. Details: ${e}`);
|
||||
`please ensure the Action has the 'security-events: write' permission. Details: ${e.message}`);
|
||||
this.hasAccessedRemoteFeatureFlags = false;
|
||||
return {};
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
2
lib/init.js
generated
2
lib/init.js
generated
|
|
@ -39,7 +39,7 @@ var ToolsSource;
|
|||
ToolsSource["Local"] = "LOCAL";
|
||||
ToolsSource["Toolcache"] = "TOOLCACHE";
|
||||
ToolsSource["Download"] = "DOWNLOAD";
|
||||
})(ToolsSource = exports.ToolsSource || (exports.ToolsSource = {}));
|
||||
})(ToolsSource || (exports.ToolsSource = ToolsSource = {}));
|
||||
async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger) {
|
||||
logger.startGroup("Setup CodeQL tools");
|
||||
const { codeql, toolsDownloadDurationMs, toolsSource, toolsVersion } = await (0, codeql_1.setupCodeQL)(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger, true);
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,yEAA2D;AAC3D,kEAAoD;AAEpD,gEAAkD;AAElD,qCAA+C;AAC/C,4DAA8C;AAI9C,mDAAwE;AACxE,6CAA+B;AAE/B,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,sCAAuB,CAAA;IACvB,oCAAqB,CAAA;AACvB,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AAEM,KAAK,UAAU,UAAU,CAC9B,UAA8B,EAC9B,UAA4B,EAC5B,OAAe,EACf,OAA2B,EAC3B,iBAA2C,EAC3C,MAAc;IAOd,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,WAAW,EAAE,YAAY,EAAE,GAClE,MAAM,IAAA,oBAAW,EACf,UAAU,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,MAAM,EACN,IAAI,CACL,CAAC;IACJ,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;IAC5B,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,uBAAuB,EAA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,MAAM,CAAC,QAAQ,EAAE,CAAC;AACpB,CAAC;AAzCD,8CAyCC"}
|
||||
2
lib/languages.js
generated
2
lib/languages.js
generated
|
|
@ -12,7 +12,7 @@ var Language;
|
|||
Language["python"] = "python";
|
||||
Language["ruby"] = "ruby";
|
||||
Language["swift"] = "swift";
|
||||
})(Language = exports.Language || (exports.Language = {}));
|
||||
})(Language || (exports.Language = Language = {}));
|
||||
// Additional names for languages
|
||||
exports.LANGUAGE_ALIASES = {
|
||||
c: Language.cpp,
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"languages.js","sourceRoot":"","sources":["../src/languages.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AACxC,IAAY,QASX;AATD,WAAY,QAAQ;IAClB,6BAAiB,CAAA;IACjB,uBAAW,CAAA;IACX,qBAAS,CAAA;IACT,yBAAa,CAAA;IACb,qCAAyB,CAAA;IACzB,6BAAiB,CAAA;IACjB,yBAAa,CAAA;IACb,2BAAe,CAAA;AACjB,CAAC,EATW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QASnB;AAED,iCAAiC;AACpB,QAAA,gBAAgB,GAAiC;IAC5D,CAAC,EAAE,QAAQ,CAAC,GAAG;IACf,KAAK,EAAE,QAAQ,CAAC,GAAG;IACnB,IAAI,EAAE,QAAQ,CAAC,MAAM;IACrB,MAAM,EAAE,QAAQ,CAAC,IAAI;IACrB,UAAU,EAAE,QAAQ,CAAC,UAAU;CAChC,CAAC;AAIF,SAAgB,YAAY,CAAC,IAAqB;IAChD,OAAO,wBAAgB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AACxC,CAAC;AAFD,oCAEC;AAED;;;;;;;;;GASG;AACH,SAAgB,aAAa,CAAC,QAAgB;IAC5C,0BAA0B;IAC1B,QAAQ,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAEzC,6BAA6B;IAC7B,IAAI,QAAQ,IAAI,QAAQ,EAAE;QACxB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AC,QAAgB;IAC5C,0BAA0B;IAC1B,QAAQ,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAEzC,6BAA6B;IAC7B,IAAI,QAAQ,IAAI,QAAQ,EAAE;QACxB,OAAO,QAAoB,CAAC;KAC7B;IAED,iEAAiE;IACjE,oCAAoC;IACpC,IAAI,QAAQ,IAAI,wBAAgB,EAAE;QAChC,OAAO,QAAQ,CAAC;KACjB;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAhBD,sCAgBC;AAED,SAAgB,gBAAgB,CAAC,QAAkB;IACjD,OAAO;QACL,QAAQ,CAAC,GAAG;QACZ,QAAQ,CAAC,MAAM;QACf,QAAQ,CAAC,EAAE;QACX,QAAQ,CAAC,IAAI;QACb,QAAQ,CAAC,KAAK;KACf,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACvB,CAAC;AARD,4CAQC;AAED,SAAgB,iBAAiB,CAAC,QAAkB;IAClD,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC;AAFD,8CAEC"}
|
||||
4
lib/setup-codeql.js
generated
4
lib/setup-codeql.js
generated
|
|
@ -91,7 +91,7 @@ async function tryFindCliVersionDotcomOnly(tagName, logger) {
|
|||
logger.debug(`Fetching the GitHub Release for the CodeQL bundle tagged ${tagName}.`);
|
||||
const apiClient = api.getApiClient();
|
||||
const codeQLActionRepository = getCodeQLActionRepository(logger);
|
||||
const release = await apiClient.repos.getReleaseByTag({
|
||||
const release = await apiClient.rest.repos.getReleaseByTag({
|
||||
owner: codeQLActionRepository.split("/")[0],
|
||||
repo: codeQLActionRepository.split("/")[1],
|
||||
tag: tagName,
|
||||
|
|
@ -153,7 +153,7 @@ async function getCodeQLBundleDownloadURL(tagName, apiDetails, variant, logger)
|
|||
}
|
||||
const [repositoryOwner, repositoryName] = repository.split("/");
|
||||
try {
|
||||
const release = await api.getApiClient().repos.getReleaseByTag({
|
||||
const release = await api.getApiClient().rest.repos.getReleaseByTag({
|
||||
owner: repositoryOwner,
|
||||
repo: repositoryName,
|
||||
tag: tagName,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
6
lib/testing-utils.js
generated
6
lib/testing-utils.js
generated
|
|
@ -178,8 +178,10 @@ function mockLanguagesInRepo(languages) {
|
|||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
mockClient.returns({
|
||||
repos: {
|
||||
listLanguages,
|
||||
rest: {
|
||||
repos: {
|
||||
listLanguages,
|
||||
},
|
||||
},
|
||||
});
|
||||
return listLanguages;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
6
lib/util.js
generated
6
lib/util.js
generated
|
|
@ -270,7 +270,7 @@ var GitHubVariant;
|
|||
GitHubVariant[GitHubVariant["GHES"] = 1] = "GHES";
|
||||
GitHubVariant[GitHubVariant["GHAE"] = 2] = "GHAE";
|
||||
GitHubVariant[GitHubVariant["GHE_DOTCOM"] = 3] = "GHE_DOTCOM";
|
||||
})(GitHubVariant = exports.GitHubVariant || (exports.GitHubVariant = {}));
|
||||
})(GitHubVariant || (exports.GitHubVariant = GitHubVariant = {}));
|
||||
async function getGitHubVersion(apiDetails) {
|
||||
// We can avoid making an API request in the standard dotcom case
|
||||
if (parseGitHubUrl(apiDetails.url) === exports.GITHUB_DOTCOM_URL) {
|
||||
|
|
@ -279,7 +279,7 @@ async function getGitHubVersion(apiDetails) {
|
|||
// Doesn't strictly have to be the meta endpoint as we're only
|
||||
// using the response headers which are available on every request.
|
||||
const apiClient = (0, api_client_1.getApiClient)();
|
||||
const response = await apiClient.meta.get();
|
||||
const response = await apiClient.rest.meta.get();
|
||||
// This happens on dotcom, although we expect to have already returned in that
|
||||
// case. This can also serve as a fallback in cases we haven't foreseen.
|
||||
if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === undefined) {
|
||||
|
|
@ -314,7 +314,7 @@ var DisallowedAPIVersionReason;
|
|||
(function (DisallowedAPIVersionReason) {
|
||||
DisallowedAPIVersionReason[DisallowedAPIVersionReason["ACTION_TOO_OLD"] = 0] = "ACTION_TOO_OLD";
|
||||
DisallowedAPIVersionReason[DisallowedAPIVersionReason["ACTION_TOO_NEW"] = 1] = "ACTION_TOO_NEW";
|
||||
})(DisallowedAPIVersionReason = exports.DisallowedAPIVersionReason || (exports.DisallowedAPIVersionReason = {}));
|
||||
})(DisallowedAPIVersionReason || (exports.DisallowedAPIVersionReason = DisallowedAPIVersionReason = {}));
|
||||
function apiVersionInRange(version, minimumVersion, maximumVersion) {
|
||||
if (!semver.satisfies(version, `>=${minimumVersion}`)) {
|
||||
return DisallowedAPIVersionReason.ACTION_TOO_NEW;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
2
lib/util.test.js
generated
2
lib/util.test.js
generated
|
|
@ -155,7 +155,7 @@ function mockGetMetaVersionHeader(versionHeader) {
|
|||
},
|
||||
};
|
||||
const spyGetContents = sinon
|
||||
.stub(client.meta, "get")
|
||||
.stub(client.rest.meta, "get")
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
.resolves(response);
|
||||
sinon.stub(api, "getApiClient").value(() => client);
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
1
node_modules/.bin/is-inside-container
generated
vendored
Symbolic link
1
node_modules/.bin/is-inside-container
generated
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../is-inside-container/cli.js
|
||||
1723
node_modules/.package-lock.json
generated
vendored
1723
node_modules/.package-lock.json
generated
vendored
File diff suppressed because it is too large
Load diff
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)
|
||||
|
||||
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
|
||||
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`
|
||||
|
||||
Default: `` (two spaces)
|
||||
Default: `` (none)
|
||||
|
||||
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.
|
||||
* @default ´ ´ (two spaces)
|
||||
* @default ´´ (none)
|
||||
*/
|
||||
indent?: string;
|
||||
|
||||
|
|
@ -47,4 +47,4 @@ declare namespace wrap {
|
|||
*/
|
||||
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>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Copyright (c) 2014-2023, Jon Schlinkert.
|
||||
* 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) {
|
||||
options = options || {};
|
||||
if (str == null) {
|
||||
|
|
@ -14,7 +20,7 @@ module.exports = function(str, options) {
|
|||
var width = options.width || 50;
|
||||
var indent = (typeof options.indent === 'string')
|
||||
? options.indent
|
||||
: ' ';
|
||||
: '';
|
||||
|
||||
var newline = options.newline || '\n' + indent;
|
||||
var escape = typeof options.escape === 'function'
|
||||
|
|
@ -36,7 +42,7 @@ module.exports = function(str, options) {
|
|||
}).join(newline);
|
||||
|
||||
if (options.trim === true) {
|
||||
result = result.replace(/[ \t]*$/gm, '');
|
||||
result = trimTabAndSpaces(result);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
{
|
||||
"name": "word-wrap",
|
||||
"name": "@aashutoshrathi/word-wrap",
|
||||
"description": "Wrap words to a specified length.",
|
||||
"version": "1.2.3",
|
||||
"homepage": "https://github.com/jonschlinkert/word-wrap",
|
||||
"version": "1.2.6",
|
||||
"homepage": "https://github.com/aashutoshrathi/word-wrap",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"contributors": [
|
||||
"Aashutosh Rathi <aashutoshrathi@gmail.com>",
|
||||
"Danilo Sampaio <danilo.sampaio@gmail.com> (localhost:8080)",
|
||||
"Fede Ramirez <i@2fd.me> (https://2fd.github.io)",
|
||||
"Joe Hildebrand <joe-github@cursive.net> (https://twitter.com/hildjj)",
|
||||
|
|
@ -14,9 +15,12 @@
|
|||
"Wolfgang Faust (http://www.linestarve.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": {
|
||||
"url": "https://github.com/jonschlinkert/word-wrap/issues"
|
||||
"url": "https://github.com/aashutoshrathi/word-wrap/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
|
|
@ -32,7 +36,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"gulp-format-md": "^0.1.11",
|
||||
"mocha": "^3.2.0"
|
||||
"mocha": "^10.2.0"
|
||||
},
|
||||
"keywords": [
|
||||
"break",
|
||||
7
node_modules/@actions/artifact/lib/internal/download-http-client.js
generated
vendored
7
node_modules/@actions/artifact/lib/internal/download-http-client.js
generated
vendored
|
|
@ -172,6 +172,13 @@ class DownloadHttpClient {
|
|||
};
|
||||
const resetDestinationStream = (fileDownloadPath) => __awaiter(this, void 0, void 0, function* () {
|
||||
destinationStream.close();
|
||||
// await until file is created at downloadpath; node15 and up fs.createWriteStream had not created a file yet
|
||||
yield new Promise(resolve => {
|
||||
destinationStream.on('close', resolve);
|
||||
if (destinationStream.writableFinished) {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
yield utils_1.rmFile(fileDownloadPath);
|
||||
destinationStream = fs.createWriteStream(fileDownloadPath);
|
||||
});
|
||||
|
|
|
|||
2
node_modules/@actions/artifact/lib/internal/download-http-client.js.map
generated
vendored
2
node_modules/@actions/artifact/lib/internal/download-http-client.js.map
generated
vendored
File diff suppressed because one or more lines are too long
4
node_modules/@actions/artifact/package.json
generated
vendored
4
node_modules/@actions/artifact/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@actions/artifact",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"preview": true,
|
||||
"description": "Actions artifact lib",
|
||||
"keywords": [
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
"url": "https://github.com/actions/toolkit/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/core": "^1.9.1",
|
||||
"@actions/http-client": "^2.0.1",
|
||||
"tmp": "^0.2.1",
|
||||
"tmp-promise": "^3.0.2"
|
||||
|
|
|
|||
9
node_modules/@actions/github/LICENSE.md
generated
vendored
Normal file
9
node_modules/@actions/github/LICENSE.md
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
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.
|
||||
17
node_modules/@actions/github/README.md
generated
vendored
17
node_modules/@actions/github/README.md
generated
vendored
|
|
@ -22,7 +22,7 @@ async function run() {
|
|||
// You can also pass in additional options as a second parameter to getOctokit
|
||||
// const octokit = github.getOctokit(myToken, {userAgent: "MyActionVersion1"});
|
||||
|
||||
const { data: pullRequest } = await octokit.pulls.get({
|
||||
const { data: pullRequest } = await octokit.rest.pulls.get({
|
||||
owner: 'octokit',
|
||||
repo: 'rest.js',
|
||||
pull_number: 123,
|
||||
|
|
@ -50,7 +50,7 @@ const github = require('@actions/github');
|
|||
|
||||
const context = github.context;
|
||||
|
||||
const newIssue = await octokit.issues.create({
|
||||
const newIssue = await octokit.rest.issues.create({
|
||||
...context.repo,
|
||||
title: 'New issue!',
|
||||
body: 'Hello Universe!'
|
||||
|
|
@ -59,18 +59,19 @@ const newIssue = await octokit.issues.create({
|
|||
|
||||
## Webhook payload typescript definitions
|
||||
|
||||
The npm module `@octokit/webhooks` provides type definitions for the response payloads. You can cast the payload to these types for better type information.
|
||||
The npm module `@octokit/webhooks-definitions` provides type definitions for the response payloads. You can cast the payload to these types for better type information.
|
||||
|
||||
First, install the npm module `npm install @octokit/webhooks`
|
||||
First, install the npm module `npm install @octokit/webhooks-definitions`
|
||||
|
||||
Then, assert the type based on the eventName
|
||||
```ts
|
||||
import * as core from '@actions/core'
|
||||
import * as github from '@actions/github'
|
||||
import * as Webhooks from '@octokit/webhooks'
|
||||
import {PushEvent} from '@octokit/webhooks-definitions/schema'
|
||||
|
||||
if (github.context.eventName === 'push') {
|
||||
const pushPayload = github.context.payload as Webhooks.WebhookPayloadPush
|
||||
core.info(`The head commit is: ${pushPayload.head}`)
|
||||
const pushPayload = github.context.payload as PushEvent
|
||||
core.info(`The head commit is: ${pushPayload.head_commit}`)
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -90,7 +91,7 @@ const octokit = GitHub.plugin(enterpriseServer220Admin)
|
|||
const myToken = core.getInput('myToken');
|
||||
const myOctokit = new octokit(getOctokitOptions(token))
|
||||
// Create a new user
|
||||
myOctokit.enterpriseAdmin.createUser({
|
||||
myOctokit.rest.enterpriseAdmin.createUser({
|
||||
login: "testuser",
|
||||
email: "testuser@test.com",
|
||||
});
|
||||
|
|
|
|||
3
node_modules/@actions/github/lib/context.d.ts
generated
vendored
3
node_modules/@actions/github/lib/context.d.ts
generated
vendored
|
|
@ -13,6 +13,9 @@ export declare class Context {
|
|||
job: string;
|
||||
runNumber: number;
|
||||
runId: number;
|
||||
apiUrl: string;
|
||||
serverUrl: string;
|
||||
graphqlUrl: string;
|
||||
/**
|
||||
* Hydrate the context from the environment
|
||||
*/
|
||||
|
|
|
|||
4
node_modules/@actions/github/lib/context.js
generated
vendored
4
node_modules/@actions/github/lib/context.js
generated
vendored
|
|
@ -8,6 +8,7 @@ class Context {
|
|||
* Hydrate the context from the environment
|
||||
*/
|
||||
constructor() {
|
||||
var _a, _b, _c;
|
||||
this.payload = {};
|
||||
if (process.env.GITHUB_EVENT_PATH) {
|
||||
if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
|
||||
|
|
@ -27,6 +28,9 @@ class Context {
|
|||
this.job = process.env.GITHUB_JOB;
|
||||
this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
|
||||
this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
|
||||
this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
|
||||
this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
|
||||
this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
|
||||
}
|
||||
get issue() {
|
||||
const payload = this.payload;
|
||||
|
|
|
|||
2
node_modules/@actions/github/lib/context.js.map
generated
vendored
2
node_modules/@actions/github/lib/context.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;AAEA,2BAA2C;AAC3C,2BAAsB;AAEtB,MAAa,OAAO;IAgBlB;;OAEG;IACH;QACE,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;YACjC,IAAI,eAAU,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;gBAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CACvB,iBAAY,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAC,CAChE,CAAA;aACF;iBAAM;gBACL,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAA;gBAC1C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,IAAI,kBAAkB,QAAG,EAAE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AK,CACb,kFAAkF,CACnF,CAAA;IACH,CAAC;CACF;AA3ED,0BA2EC"}
|
||||
4
node_modules/@actions/github/lib/github.d.ts
generated
vendored
4
node_modules/@actions/github/lib/github.d.ts
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
import * as Context from './context';
|
||||
import { GitHub } from './utils';
|
||||
import { OctokitOptions } from '@octokit/core/dist-types/types';
|
||||
import { OctokitOptions, OctokitPlugin } from '@octokit/core/dist-types/types';
|
||||
export declare const context: Context.Context;
|
||||
/**
|
||||
* Returns a hydrated octokit ready to use for GitHub Actions
|
||||
|
|
@ -8,4 +8,4 @@ export declare const context: Context.Context;
|
|||
* @param token the repo PAT or GITHUB_TOKEN
|
||||
* @param options other options to set
|
||||
*/
|
||||
export declare function getOctokit(token: string, options?: OctokitOptions): InstanceType<typeof GitHub>;
|
||||
export declare function getOctokit(token: string, options?: OctokitOptions, ...additionalPlugins: OctokitPlugin[]): InstanceType<typeof GitHub>;
|
||||
|
|
|
|||
7
node_modules/@actions/github/lib/github.js
generated
vendored
7
node_modules/@actions/github/lib/github.js
generated
vendored
|
|
@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
|
|
@ -29,8 +29,9 @@ exports.context = new Context.Context();
|
|||
* @param token the repo PAT or GITHUB_TOKEN
|
||||
* @param options other options to set
|
||||
*/
|
||||
function getOctokit(token, options) {
|
||||
return new utils_1.GitHub(utils_1.getOctokitOptions(token, options));
|
||||
function getOctokit(token, options, ...additionalPlugins) {
|
||||
const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
|
||||
return new GitHubWithPlugins(utils_1.getOctokitOptions(token, options));
|
||||
}
|
||||
exports.getOctokit = getOctokit;
|
||||
//# sourceMappingURL=github.js.map
|
||||
2
node_modules/@actions/github/lib/github.js.map
generated
vendored
2
node_modules/@actions/github/lib/github.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"github.js","sourceRoot":"","sources":["../src/github.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAoC;AACpC,mCAAiD;AAKpC,QAAA,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,CAAA;AAE5C;;;;;GAKG;AACH,SAAgB,UAAU,CACxB,KAAa,EACb,OAAwB;IAExB,OAAO,IAAI,cAAM,CAAC,yBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;AACtD,CAAC;AALD,gCAKC"}
|
||||
{"version":3,"file":"github.js","sourceRoot":"","sources":["../src/github.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAoC;AACpC,mCAAiD;AAKpC,QAAA,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,CAAA;AAE5C;;;;;GAKG;AACH,SAAgB,UAAU,CACxB,KAAa,EACb,OAAwB,EACxB,GAAG,iBAAkC;IAErC,MAAM,iBAAiB,GAAG,cAAM,CAAC,MAAM,CAAC,GAAG,iBAAiB,CAAC,CAAA;IAC7D,OAAO,IAAI,iBAAiB,CAAC,yBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;AACjE,CAAC;AAPD,gCAOC"}
|
||||
2
node_modules/@actions/github/lib/internal/utils.js
generated
vendored
2
node_modules/@actions/github/lib/internal/utils.js
generated
vendored
|
|
@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
|
|
|
|||
10
node_modules/@actions/github/lib/utils.d.ts
generated
vendored
10
node_modules/@actions/github/lib/utils.d.ts
generated
vendored
|
|
@ -2,14 +2,8 @@ import * as Context from './context';
|
|||
import { Octokit } from '@octokit/core';
|
||||
import { OctokitOptions } from '@octokit/core/dist-types/types';
|
||||
export declare const context: Context.Context;
|
||||
export declare const GitHub: (new (...args: any[]) => {
|
||||
[x: string]: any;
|
||||
}) & {
|
||||
new (...args: any[]): {
|
||||
[x: string]: any;
|
||||
};
|
||||
plugins: any[];
|
||||
} & typeof Octokit & import("@octokit/core/dist-types/types").Constructor<import("@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types").RestEndpointMethods & {
|
||||
export declare const defaults: OctokitOptions;
|
||||
export declare const GitHub: typeof Octokit & import("@octokit/core/dist-types/types").Constructor<import("@octokit/plugin-rest-endpoint-methods/dist-types/types").Api & {
|
||||
paginate: import("@octokit/plugin-paginate-rest").PaginateInterface;
|
||||
}>;
|
||||
/**
|
||||
|
|
|
|||
8
node_modules/@actions/github/lib/utils.js
generated
vendored
8
node_modules/@actions/github/lib/utils.js
generated
vendored
|
|
@ -14,12 +14,12 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getOctokitOptions = exports.GitHub = exports.context = void 0;
|
||||
exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
|
||||
const Context = __importStar(require("./context"));
|
||||
const Utils = __importStar(require("./internal/utils"));
|
||||
// octokit + plugins
|
||||
|
|
@ -28,13 +28,13 @@ const plugin_rest_endpoint_methods_1 = require("@octokit/plugin-rest-endpoint-me
|
|||
const plugin_paginate_rest_1 = require("@octokit/plugin-paginate-rest");
|
||||
exports.context = new Context.Context();
|
||||
const baseUrl = Utils.getApiBaseUrl();
|
||||
const defaults = {
|
||||
exports.defaults = {
|
||||
baseUrl,
|
||||
request: {
|
||||
agent: Utils.getProxyAgent(baseUrl)
|
||||
}
|
||||
};
|
||||
exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(defaults);
|
||||
exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
|
||||
/**
|
||||
* Convience function to correctly format Octokit Options to pass into the constructor.
|
||||
*
|
||||
|
|
|
|||
2
node_modules/@actions/github/lib/utils.js.map
generated
vendored
2
node_modules/@actions/github/lib/utils.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAoC;AACpC,wDAAyC;AAEzC,oBAAoB;AACpB,wCAAqC;AAErC,wFAAyE;AACzE,wEAA0D;AAE7C,QAAA,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,CAAA;AAE5C,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,EAAE,CAAA;AACrC,MAAM,QAAQ,GAAG;IACf,OAAO;IACP,OAAO,EAAE;QACP,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC;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AAM,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IAC7C,IAAI,IAAI,EAAE;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;KACjB;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAbD,8CAaC"}
|
||||
21
node_modules/@actions/github/node_modules/@actions/http-client/LICENSE
generated
vendored
21
node_modules/@actions/github/node_modules/@actions/http-client/LICENSE
generated
vendored
|
|
@ -1,21 +0,0 @@
|
|||
Actions Http Client for Node.js
|
||||
|
||||
Copyright (c) GitHub, Inc.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
MIT License
|
||||
|
||||
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.
|
||||
79
node_modules/@actions/github/node_modules/@actions/http-client/README.md
generated
vendored
79
node_modules/@actions/github/node_modules/@actions/http-client/README.md
generated
vendored
|
|
@ -1,79 +0,0 @@
|
|||
|
||||
<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
|
||||
|
||||
- HTTP client with TypeScript generics and async/await/Promises
|
||||
- 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
|
||||
- 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.
|
||||
- Redirects supported
|
||||
|
||||
Features and releases [here](./RELEASES.md)
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
npm install @actions/http-client --save
|
||||
```
|
||||
|
||||
## Samples
|
||||
|
||||
See the [HTTP](./__tests__) tests for detailed examples.
|
||||
|
||||
## Errors
|
||||
|
||||
### HTTP
|
||||
|
||||
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.
|
||||
* Redirects (3xx) will be followed by default.
|
||||
|
||||
See [HTTP tests](./__tests__) for detailed examples.
|
||||
|
||||
## Debugging
|
||||
|
||||
To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible:
|
||||
|
||||
```
|
||||
export NODE_DEBUG=http
|
||||
```
|
||||
|
||||
## Node support
|
||||
|
||||
The http-client is built using the latest LTS version of Node 12. It may work on previous node LTS versions but it's tested and officially supported on Node12+.
|
||||
|
||||
## Support and Versioning
|
||||
|
||||
We follow semver and will hold compatibility between major versions and increment the minor version with new features and capabilities (while holding compat).
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome PRs. Please create an issue and if applicable, a design before proceeding with code.
|
||||
|
||||
once:
|
||||
|
||||
```bash
|
||||
$ npm install
|
||||
```
|
||||
|
||||
To build:
|
||||
|
||||
```bash
|
||||
$ npm run build
|
||||
```
|
||||
|
||||
To run all tests:
|
||||
```bash
|
||||
$ npm test
|
||||
```
|
||||
26
node_modules/@actions/github/node_modules/@actions/http-client/RELEASES.md
generated
vendored
26
node_modules/@actions/github/node_modules/@actions/http-client/RELEASES.md
generated
vendored
|
|
@ -1,26 +0,0 @@
|
|||
## Releases
|
||||
|
||||
## 1.0.10
|
||||
|
||||
Contains a bug fix where proxy is defined without a user and password. see [PR here](https://github.com/actions/http-client/pull/42)
|
||||
|
||||
## 1.0.9
|
||||
Throw HttpClientError instead of a generic Error from the \<verb>Json() helper methods when the server responds with a non-successful status code.
|
||||
|
||||
## 1.0.8
|
||||
Fixed security issue where a redirect (e.g. 302) to another domain would pass headers. The fix was to strip the authorization header if the hostname was different. More [details in PR #27](https://github.com/actions/http-client/pull/27)
|
||||
|
||||
## 1.0.7
|
||||
Update NPM dependencies and add 429 to the list of HttpCodes
|
||||
|
||||
## 1.0.6
|
||||
Automatically sends Content-Type and Accept application/json headers for \<verb>Json() helper methods if not set in the client or parameters.
|
||||
|
||||
## 1.0.5
|
||||
Adds \<verb>Json() helper methods for json over http scenarios.
|
||||
|
||||
## 1.0.4
|
||||
Started to add \<verb>Json() helper methods. Do not use this release for that. Use >= 1.0.5 since there was an issue with types.
|
||||
|
||||
## 1.0.1 to 1.0.3
|
||||
Adds proxy support.
|
||||
BIN
node_modules/@actions/github/node_modules/@actions/http-client/actions.png
generated
vendored
BIN
node_modules/@actions/github/node_modules/@actions/http-client/actions.png
generated
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 33 KiB |
23
node_modules/@actions/github/node_modules/@actions/http-client/auth.d.ts
generated
vendored
23
node_modules/@actions/github/node_modules/@actions/http-client/auth.d.ts
generated
vendored
|
|
@ -1,23 +0,0 @@
|
|||
import ifm = require('./interfaces');
|
||||
export declare class BasicCredentialHandler implements ifm.IRequestHandler {
|
||||
username: string;
|
||||
password: string;
|
||||
constructor(username: string, password: string);
|
||||
prepareRequest(options: any): void;
|
||||
canHandleAuthentication(response: ifm.IHttpClientResponse): boolean;
|
||||
handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise<ifm.IHttpClientResponse>;
|
||||
}
|
||||
export declare class BearerCredentialHandler implements ifm.IRequestHandler {
|
||||
token: string;
|
||||
constructor(token: string);
|
||||
prepareRequest(options: any): void;
|
||||
canHandleAuthentication(response: ifm.IHttpClientResponse): boolean;
|
||||
handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise<ifm.IHttpClientResponse>;
|
||||
}
|
||||
export declare class PersonalAccessTokenCredentialHandler implements ifm.IRequestHandler {
|
||||
token: string;
|
||||
constructor(token: string);
|
||||
prepareRequest(options: any): void;
|
||||
canHandleAuthentication(response: ifm.IHttpClientResponse): boolean;
|
||||
handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise<ifm.IHttpClientResponse>;
|
||||
}
|
||||
58
node_modules/@actions/github/node_modules/@actions/http-client/auth.js
generated
vendored
58
node_modules/@actions/github/node_modules/@actions/http-client/auth.js
generated
vendored
|
|
@ -1,58 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class BasicCredentialHandler {
|
||||
constructor(username, password) {
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
}
|
||||
prepareRequest(options) {
|
||||
options.headers['Authorization'] =
|
||||
'Basic ' +
|
||||
Buffer.from(this.username + ':' + this.password).toString('base64');
|
||||
}
|
||||
// This handler cannot handle 401
|
||||
canHandleAuthentication(response) {
|
||||
return false;
|
||||
}
|
||||
handleAuthentication(httpClient, requestInfo, objs) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
exports.BasicCredentialHandler = BasicCredentialHandler;
|
||||
class BearerCredentialHandler {
|
||||
constructor(token) {
|
||||
this.token = token;
|
||||
}
|
||||
// currently implements pre-authorization
|
||||
// TODO: support preAuth = false where it hooks on 401
|
||||
prepareRequest(options) {
|
||||
options.headers['Authorization'] = 'Bearer ' + this.token;
|
||||
}
|
||||
// This handler cannot handle 401
|
||||
canHandleAuthentication(response) {
|
||||
return false;
|
||||
}
|
||||
handleAuthentication(httpClient, requestInfo, objs) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
exports.BearerCredentialHandler = BearerCredentialHandler;
|
||||
class PersonalAccessTokenCredentialHandler {
|
||||
constructor(token) {
|
||||
this.token = token;
|
||||
}
|
||||
// currently implements pre-authorization
|
||||
// TODO: support preAuth = false where it hooks on 401
|
||||
prepareRequest(options) {
|
||||
options.headers['Authorization'] =
|
||||
'Basic ' + Buffer.from('PAT:' + this.token).toString('base64');
|
||||
}
|
||||
// This handler cannot handle 401
|
||||
canHandleAuthentication(response) {
|
||||
return false;
|
||||
}
|
||||
handleAuthentication(httpClient, requestInfo, objs) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
|
||||
124
node_modules/@actions/github/node_modules/@actions/http-client/index.d.ts
generated
vendored
124
node_modules/@actions/github/node_modules/@actions/http-client/index.d.ts
generated
vendored
|
|
@ -1,124 +0,0 @@
|
|||
/// <reference types="node" />
|
||||
import http = require('http');
|
||||
import ifm = require('./interfaces');
|
||||
export declare enum HttpCodes {
|
||||
OK = 200,
|
||||
MultipleChoices = 300,
|
||||
MovedPermanently = 301,
|
||||
ResourceMoved = 302,
|
||||
SeeOther = 303,
|
||||
NotModified = 304,
|
||||
UseProxy = 305,
|
||||
SwitchProxy = 306,
|
||||
TemporaryRedirect = 307,
|
||||
PermanentRedirect = 308,
|
||||
BadRequest = 400,
|
||||
Unauthorized = 401,
|
||||
PaymentRequired = 402,
|
||||
Forbidden = 403,
|
||||
NotFound = 404,
|
||||
MethodNotAllowed = 405,
|
||||
NotAcceptable = 406,
|
||||
ProxyAuthenticationRequired = 407,
|
||||
RequestTimeout = 408,
|
||||
Conflict = 409,
|
||||
Gone = 410,
|
||||
TooManyRequests = 429,
|
||||
InternalServerError = 500,
|
||||
NotImplemented = 501,
|
||||
BadGateway = 502,
|
||||
ServiceUnavailable = 503,
|
||||
GatewayTimeout = 504
|
||||
}
|
||||
export declare enum Headers {
|
||||
Accept = "accept",
|
||||
ContentType = "content-type"
|
||||
}
|
||||
export declare enum MediaTypes {
|
||||
ApplicationJson = "application/json"
|
||||
}
|
||||
/**
|
||||
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
|
||||
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||
*/
|
||||
export declare function getProxyUrl(serverUrl: string): string;
|
||||
export declare class HttpClientError extends Error {
|
||||
constructor(message: string, statusCode: number);
|
||||
statusCode: number;
|
||||
result?: any;
|
||||
}
|
||||
export declare class HttpClientResponse implements ifm.IHttpClientResponse {
|
||||
constructor(message: http.IncomingMessage);
|
||||
message: http.IncomingMessage;
|
||||
readBody(): Promise<string>;
|
||||
}
|
||||
export declare function isHttps(requestUrl: string): boolean;
|
||||
export declare class HttpClient {
|
||||
userAgent: string | undefined;
|
||||
handlers: ifm.IRequestHandler[];
|
||||
requestOptions: ifm.IRequestOptions;
|
||||
private _ignoreSslError;
|
||||
private _socketTimeout;
|
||||
private _allowRedirects;
|
||||
private _allowRedirectDowngrade;
|
||||
private _maxRedirects;
|
||||
private _allowRetries;
|
||||
private _maxRetries;
|
||||
private _agent;
|
||||
private _proxyAgent;
|
||||
private _keepAlive;
|
||||
private _disposed;
|
||||
constructor(userAgent?: string, handlers?: ifm.IRequestHandler[], requestOptions?: ifm.IRequestOptions);
|
||||
options(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
get(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
del(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
post(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
patch(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
put(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
head(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
/**
|
||||
* Gets a typed object from an endpoint
|
||||
* Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
|
||||
*/
|
||||
getJson<T>(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.ITypedResponse<T>>;
|
||||
postJson<T>(requestUrl: string, obj: any, additionalHeaders?: ifm.IHeaders): Promise<ifm.ITypedResponse<T>>;
|
||||
putJson<T>(requestUrl: string, obj: any, additionalHeaders?: ifm.IHeaders): Promise<ifm.ITypedResponse<T>>;
|
||||
patchJson<T>(requestUrl: string, obj: any, additionalHeaders?: ifm.IHeaders): Promise<ifm.ITypedResponse<T>>;
|
||||
/**
|
||||
* Makes a raw http request.
|
||||
* All other methods such as get, post, patch, and request ultimately call this.
|
||||
* Prefer get, del, post and patch
|
||||
*/
|
||||
request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||
/**
|
||||
* Needs to be called if keepAlive is set to true in request options.
|
||||
*/
|
||||
dispose(): void;
|
||||
/**
|
||||
* Raw request.
|
||||
* @param info
|
||||
* @param data
|
||||
*/
|
||||
requestRaw(info: ifm.IRequestInfo, data: string | NodeJS.ReadableStream): Promise<ifm.IHttpClientResponse>;
|
||||
/**
|
||||
* Raw request with callback.
|
||||
* @param info
|
||||
* @param data
|
||||
* @param onResult
|
||||
*/
|
||||
requestRawWithCallback(info: ifm.IRequestInfo, data: string | NodeJS.ReadableStream, onResult: (err: any, res: ifm.IHttpClientResponse) => void): void;
|
||||
/**
|
||||
* Gets an http agent. This function is useful when you need an http agent that handles
|
||||
* routing through a proxy server - depending upon the url and proxy environment variables.
|
||||
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||
*/
|
||||
getAgent(serverUrl: string): http.Agent;
|
||||
private _prepareRequest;
|
||||
private _mergeHeaders;
|
||||
private _getExistingOrDefaultHeader;
|
||||
private _getAgent;
|
||||
private _performExponentialBackoff;
|
||||
private static dateTimeDeserializer;
|
||||
private _processResponse;
|
||||
}
|
||||
537
node_modules/@actions/github/node_modules/@actions/http-client/index.js
generated
vendored
537
node_modules/@actions/github/node_modules/@actions/http-client/index.js
generated
vendored
|
|
@ -1,537 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const http = require("http");
|
||||
const https = require("https");
|
||||
const pm = require("./proxy");
|
||||
let tunnel;
|
||||
var HttpCodes;
|
||||
(function (HttpCodes) {
|
||||
HttpCodes[HttpCodes["OK"] = 200] = "OK";
|
||||
HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
|
||||
HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
|
||||
HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
|
||||
HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
|
||||
HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
|
||||
HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
|
||||
HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
|
||||
HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
|
||||
HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
|
||||
HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
|
||||
HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
|
||||
HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
|
||||
HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
|
||||
HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
|
||||
HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
|
||||
HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
|
||||
HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
|
||||
HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
|
||||
HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
|
||||
HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
|
||||
HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
|
||||
HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
|
||||
HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
|
||||
HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
|
||||
HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
|
||||
HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
|
||||
})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
|
||||
var Headers;
|
||||
(function (Headers) {
|
||||
Headers["Accept"] = "accept";
|
||||
Headers["ContentType"] = "content-type";
|
||||
})(Headers = exports.Headers || (exports.Headers = {}));
|
||||
var MediaTypes;
|
||||
(function (MediaTypes) {
|
||||
MediaTypes["ApplicationJson"] = "application/json";
|
||||
})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
|
||||
/**
|
||||
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
|
||||
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||
*/
|
||||
function getProxyUrl(serverUrl) {
|
||||
let proxyUrl = pm.getProxyUrl(new URL(serverUrl));
|
||||
return proxyUrl ? proxyUrl.href : '';
|
||||
}
|
||||
exports.getProxyUrl = getProxyUrl;
|
||||
const HttpRedirectCodes = [
|
||||
HttpCodes.MovedPermanently,
|
||||
HttpCodes.ResourceMoved,
|
||||
HttpCodes.SeeOther,
|
||||
HttpCodes.TemporaryRedirect,
|
||||
HttpCodes.PermanentRedirect
|
||||
];
|
||||
const HttpResponseRetryCodes = [
|
||||
HttpCodes.BadGateway,
|
||||
HttpCodes.ServiceUnavailable,
|
||||
HttpCodes.GatewayTimeout
|
||||
];
|
||||
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
|
||||
const ExponentialBackoffCeiling = 10;
|
||||
const ExponentialBackoffTimeSlice = 5;
|
||||
class HttpClientError extends Error {
|
||||
constructor(message, statusCode) {
|
||||
super(message);
|
||||
this.name = 'HttpClientError';
|
||||
this.statusCode = statusCode;
|
||||
Object.setPrototypeOf(this, HttpClientError.prototype);
|
||||
}
|
||||
}
|
||||
exports.HttpClientError = HttpClientError;
|
||||
class HttpClientResponse {
|
||||
constructor(message) {
|
||||
this.message = message;
|
||||
}
|
||||
readBody() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let output = Buffer.alloc(0);
|
||||
this.message.on('data', (chunk) => {
|
||||
output = Buffer.concat([output, chunk]);
|
||||
});
|
||||
this.message.on('end', () => {
|
||||
resolve(output.toString());
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.HttpClientResponse = HttpClientResponse;
|
||||
function isHttps(requestUrl) {
|
||||
let parsedUrl = new URL(requestUrl);
|
||||
return parsedUrl.protocol === 'https:';
|
||||
}
|
||||
exports.isHttps = isHttps;
|
||||
class HttpClient {
|
||||
constructor(userAgent, handlers, requestOptions) {
|
||||
this._ignoreSslError = false;
|
||||
this._allowRedirects = true;
|
||||
this._allowRedirectDowngrade = false;
|
||||
this._maxRedirects = 50;
|
||||
this._allowRetries = false;
|
||||
this._maxRetries = 1;
|
||||
this._keepAlive = false;
|
||||
this._disposed = false;
|
||||
this.userAgent = userAgent;
|
||||
this.handlers = handlers || [];
|
||||
this.requestOptions = requestOptions;
|
||||
if (requestOptions) {
|
||||
if (requestOptions.ignoreSslError != null) {
|
||||
this._ignoreSslError = requestOptions.ignoreSslError;
|
||||
}
|
||||
this._socketTimeout = requestOptions.socketTimeout;
|
||||
if (requestOptions.allowRedirects != null) {
|
||||
this._allowRedirects = requestOptions.allowRedirects;
|
||||
}
|
||||
if (requestOptions.allowRedirectDowngrade != null) {
|
||||
this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
|
||||
}
|
||||
if (requestOptions.maxRedirects != null) {
|
||||
this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
|
||||
}
|
||||
if (requestOptions.keepAlive != null) {
|
||||
this._keepAlive = requestOptions.keepAlive;
|
||||
}
|
||||
if (requestOptions.allowRetries != null) {
|
||||
this._allowRetries = requestOptions.allowRetries;
|
||||
}
|
||||
if (requestOptions.maxRetries != null) {
|
||||
this._maxRetries = requestOptions.maxRetries;
|
||||
}
|
||||
}
|
||||
}
|
||||
options(requestUrl, additionalHeaders) {
|
||||
return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
|
||||
}
|
||||
get(requestUrl, additionalHeaders) {
|
||||
return this.request('GET', requestUrl, null, additionalHeaders || {});
|
||||
}
|
||||
del(requestUrl, additionalHeaders) {
|
||||
return this.request('DELETE', requestUrl, null, additionalHeaders || {});
|
||||
}
|
||||
post(requestUrl, data, additionalHeaders) {
|
||||
return this.request('POST', requestUrl, data, additionalHeaders || {});
|
||||
}
|
||||
patch(requestUrl, data, additionalHeaders) {
|
||||
return this.request('PATCH', requestUrl, data, additionalHeaders || {});
|
||||
}
|
||||
put(requestUrl, data, additionalHeaders) {
|
||||
return this.request('PUT', requestUrl, data, additionalHeaders || {});
|
||||
}
|
||||
head(requestUrl, additionalHeaders) {
|
||||
return this.request('HEAD', requestUrl, null, additionalHeaders || {});
|
||||
}
|
||||
sendStream(verb, requestUrl, stream, additionalHeaders) {
|
||||
return this.request(verb, requestUrl, stream, additionalHeaders);
|
||||
}
|
||||
/**
|
||||
* Gets a typed object from an endpoint
|
||||
* Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
|
||||
*/
|
||||
async getJson(requestUrl, additionalHeaders = {}) {
|
||||
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||
let res = await this.get(requestUrl, additionalHeaders);
|
||||
return this._processResponse(res, this.requestOptions);
|
||||
}
|
||||
async postJson(requestUrl, obj, additionalHeaders = {}) {
|
||||
let data = JSON.stringify(obj, null, 2);
|
||||
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
||||
let res = await this.post(requestUrl, data, additionalHeaders);
|
||||
return this._processResponse(res, this.requestOptions);
|
||||
}
|
||||
async putJson(requestUrl, obj, additionalHeaders = {}) {
|
||||
let data = JSON.stringify(obj, null, 2);
|
||||
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
||||
let res = await this.put(requestUrl, data, additionalHeaders);
|
||||
return this._processResponse(res, this.requestOptions);
|
||||
}
|
||||
async patchJson(requestUrl, obj, additionalHeaders = {}) {
|
||||
let data = JSON.stringify(obj, null, 2);
|
||||
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
||||
let res = await this.patch(requestUrl, data, additionalHeaders);
|
||||
return this._processResponse(res, this.requestOptions);
|
||||
}
|
||||
/**
|
||||
* Makes a raw http request.
|
||||
* All other methods such as get, post, patch, and request ultimately call this.
|
||||
* Prefer get, del, post and patch
|
||||
*/
|
||||
async request(verb, requestUrl, data, headers) {
|
||||
if (this._disposed) {
|
||||
throw new Error('Client has already been disposed.');
|
||||
}
|
||||
let parsedUrl = new URL(requestUrl);
|
||||
let info = this._prepareRequest(verb, parsedUrl, headers);
|
||||
// Only perform retries on reads since writes may not be idempotent.
|
||||
let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
|
||||
? this._maxRetries + 1
|
||||
: 1;
|
||||
let numTries = 0;
|
||||
let response;
|
||||
while (numTries < maxTries) {
|
||||
response = await this.requestRaw(info, data);
|
||||
// Check if it's an authentication challenge
|
||||
if (response &&
|
||||
response.message &&
|
||||
response.message.statusCode === HttpCodes.Unauthorized) {
|
||||
let authenticationHandler;
|
||||
for (let i = 0; i < this.handlers.length; i++) {
|
||||
if (this.handlers[i].canHandleAuthentication(response)) {
|
||||
authenticationHandler = this.handlers[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (authenticationHandler) {
|
||||
return authenticationHandler.handleAuthentication(this, info, data);
|
||||
}
|
||||
else {
|
||||
// We have received an unauthorized response but have no handlers to handle it.
|
||||
// Let the response return to the caller.
|
||||
return response;
|
||||
}
|
||||
}
|
||||
let redirectsRemaining = this._maxRedirects;
|
||||
while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
|
||||
this._allowRedirects &&
|
||||
redirectsRemaining > 0) {
|
||||
const redirectUrl = response.message.headers['location'];
|
||||
if (!redirectUrl) {
|
||||
// if there's no location to redirect to, we won't
|
||||
break;
|
||||
}
|
||||
let parsedRedirectUrl = new URL(redirectUrl);
|
||||
if (parsedUrl.protocol == 'https:' &&
|
||||
parsedUrl.protocol != parsedRedirectUrl.protocol &&
|
||||
!this._allowRedirectDowngrade) {
|
||||
throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
|
||||
}
|
||||
// we need to finish reading the response before reassigning response
|
||||
// which will leak the open socket.
|
||||
await response.readBody();
|
||||
// strip authorization header if redirected to a different hostname
|
||||
if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
|
||||
for (let header in headers) {
|
||||
// header names are case insensitive
|
||||
if (header.toLowerCase() === 'authorization') {
|
||||
delete headers[header];
|
||||
}
|
||||
}
|
||||
}
|
||||
// let's make the request with the new redirectUrl
|
||||
info = this._prepareRequest(verb, parsedRedirectUrl, headers);
|
||||
response = await this.requestRaw(info, data);
|
||||
redirectsRemaining--;
|
||||
}
|
||||
if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
|
||||
// If not a retry code, return immediately instead of retrying
|
||||
return response;
|
||||
}
|
||||
numTries += 1;
|
||||
if (numTries < maxTries) {
|
||||
await response.readBody();
|
||||
await this._performExponentialBackoff(numTries);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
/**
|
||||
* Needs to be called if keepAlive is set to true in request options.
|
||||
*/
|
||||
dispose() {
|
||||
if (this._agent) {
|
||||
this._agent.destroy();
|
||||
}
|
||||
this._disposed = true;
|
||||
}
|
||||
/**
|
||||
* Raw request.
|
||||
* @param info
|
||||
* @param data
|
||||
*/
|
||||
requestRaw(info, data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let callbackForResult = function (err, res) {
|
||||
if (err) {
|
||||
reject(err);
|
||||
}
|
||||
resolve(res);
|
||||
};
|
||||
this.requestRawWithCallback(info, data, callbackForResult);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Raw request with callback.
|
||||
* @param info
|
||||
* @param data
|
||||
* @param onResult
|
||||
*/
|
||||
requestRawWithCallback(info, data, onResult) {
|
||||
let socket;
|
||||
if (typeof data === 'string') {
|
||||
info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
|
||||
}
|
||||
let callbackCalled = false;
|
||||
let handleResult = (err, res) => {
|
||||
if (!callbackCalled) {
|
||||
callbackCalled = true;
|
||||
onResult(err, res);
|
||||
}
|
||||
};
|
||||
let req = info.httpModule.request(info.options, (msg) => {
|
||||
let res = new HttpClientResponse(msg);
|
||||
handleResult(null, res);
|
||||
});
|
||||
req.on('socket', sock => {
|
||||
socket = sock;
|
||||
});
|
||||
// If we ever get disconnected, we want the socket to timeout eventually
|
||||
req.setTimeout(this._socketTimeout || 3 * 60000, () => {
|
||||
if (socket) {
|
||||
socket.end();
|
||||
}
|
||||
handleResult(new Error('Request timeout: ' + info.options.path), null);
|
||||
});
|
||||
req.on('error', function (err) {
|
||||
// err has statusCode property
|
||||
// res should have headers
|
||||
handleResult(err, null);
|
||||
});
|
||||
if (data && typeof data === 'string') {
|
||||
req.write(data, 'utf8');
|
||||
}
|
||||
if (data && typeof data !== 'string') {
|
||||
data.on('close', function () {
|
||||
req.end();
|
||||
});
|
||||
data.pipe(req);
|
||||
}
|
||||
else {
|
||||
req.end();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Gets an http agent. This function is useful when you need an http agent that handles
|
||||
* routing through a proxy server - depending upon the url and proxy environment variables.
|
||||
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||
*/
|
||||
getAgent(serverUrl) {
|
||||
let parsedUrl = new URL(serverUrl);
|
||||
return this._getAgent(parsedUrl);
|
||||
}
|
||||
_prepareRequest(method, requestUrl, headers) {
|
||||
const info = {};
|
||||
info.parsedUrl = requestUrl;
|
||||
const usingSsl = info.parsedUrl.protocol === 'https:';
|
||||
info.httpModule = usingSsl ? https : http;
|
||||
const defaultPort = usingSsl ? 443 : 80;
|
||||
info.options = {};
|
||||
info.options.host = info.parsedUrl.hostname;
|
||||
info.options.port = info.parsedUrl.port
|
||||
? parseInt(info.parsedUrl.port)
|
||||
: defaultPort;
|
||||
info.options.path =
|
||||
(info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
|
||||
info.options.method = method;
|
||||
info.options.headers = this._mergeHeaders(headers);
|
||||
if (this.userAgent != null) {
|
||||
info.options.headers['user-agent'] = this.userAgent;
|
||||
}
|
||||
info.options.agent = this._getAgent(info.parsedUrl);
|
||||
// gives handlers an opportunity to participate
|
||||
if (this.handlers) {
|
||||
this.handlers.forEach(handler => {
|
||||
handler.prepareRequest(info.options);
|
||||
});
|
||||
}
|
||||
return info;
|
||||
}
|
||||
_mergeHeaders(headers) {
|
||||
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
|
||||
if (this.requestOptions && this.requestOptions.headers) {
|
||||
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
|
||||
}
|
||||
return lowercaseKeys(headers || {});
|
||||
}
|
||||
_getExistingOrDefaultHeader(additionalHeaders, header, _default) {
|
||||
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
|
||||
let clientHeader;
|
||||
if (this.requestOptions && this.requestOptions.headers) {
|
||||
clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
|
||||
}
|
||||
return additionalHeaders[header] || clientHeader || _default;
|
||||
}
|
||||
_getAgent(parsedUrl) {
|
||||
let agent;
|
||||
let proxyUrl = pm.getProxyUrl(parsedUrl);
|
||||
let useProxy = proxyUrl && proxyUrl.hostname;
|
||||
if (this._keepAlive && useProxy) {
|
||||
agent = this._proxyAgent;
|
||||
}
|
||||
if (this._keepAlive && !useProxy) {
|
||||
agent = this._agent;
|
||||
}
|
||||
// if agent is already assigned use that agent.
|
||||
if (!!agent) {
|
||||
return agent;
|
||||
}
|
||||
const usingSsl = parsedUrl.protocol === 'https:';
|
||||
let maxSockets = 100;
|
||||
if (!!this.requestOptions) {
|
||||
maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
|
||||
}
|
||||
if (useProxy) {
|
||||
// If using proxy, need tunnel
|
||||
if (!tunnel) {
|
||||
tunnel = require('tunnel');
|
||||
}
|
||||
const agentOptions = {
|
||||
maxSockets: maxSockets,
|
||||
keepAlive: this._keepAlive,
|
||||
proxy: {
|
||||
...((proxyUrl.username || proxyUrl.password) && {
|
||||
proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
|
||||
}),
|
||||
host: proxyUrl.hostname,
|
||||
port: proxyUrl.port
|
||||
}
|
||||
};
|
||||
let tunnelAgent;
|
||||
const overHttps = proxyUrl.protocol === 'https:';
|
||||
if (usingSsl) {
|
||||
tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
|
||||
}
|
||||
else {
|
||||
tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
|
||||
}
|
||||
agent = tunnelAgent(agentOptions);
|
||||
this._proxyAgent = agent;
|
||||
}
|
||||
// if reusing agent across request and tunneling agent isn't assigned create a new agent
|
||||
if (this._keepAlive && !agent) {
|
||||
const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
|
||||
agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
|
||||
this._agent = agent;
|
||||
}
|
||||
// if not using private agent and tunnel agent isn't setup then use global agent
|
||||
if (!agent) {
|
||||
agent = usingSsl ? https.globalAgent : http.globalAgent;
|
||||
}
|
||||
if (usingSsl && this._ignoreSslError) {
|
||||
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
|
||||
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
|
||||
// we have to cast it to any and change it directly
|
||||
agent.options = Object.assign(agent.options || {}, {
|
||||
rejectUnauthorized: false
|
||||
});
|
||||
}
|
||||
return agent;
|
||||
}
|
||||
_performExponentialBackoff(retryNumber) {
|
||||
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
|
||||
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
|
||||
return new Promise(resolve => setTimeout(() => resolve(), ms));
|
||||
}
|
||||
static dateTimeDeserializer(key, value) {
|
||||
if (typeof value === 'string') {
|
||||
let a = new Date(value);
|
||||
if (!isNaN(a.valueOf())) {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
async _processResponse(res, options) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const statusCode = res.message.statusCode;
|
||||
const response = {
|
||||
statusCode: statusCode,
|
||||
result: null,
|
||||
headers: {}
|
||||
};
|
||||
// not found leads to null obj returned
|
||||
if (statusCode == HttpCodes.NotFound) {
|
||||
resolve(response);
|
||||
}
|
||||
let obj;
|
||||
let contents;
|
||||
// get the result from the body
|
||||
try {
|
||||
contents = await res.readBody();
|
||||
if (contents && contents.length > 0) {
|
||||
if (options && options.deserializeDates) {
|
||||
obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
|
||||
}
|
||||
else {
|
||||
obj = JSON.parse(contents);
|
||||
}
|
||||
response.result = obj;
|
||||
}
|
||||
response.headers = res.message.headers;
|
||||
}
|
||||
catch (err) {
|
||||
// Invalid resource (contents not json); leaving result obj null
|
||||
}
|
||||
// note that 3xx redirects are handled by the http layer.
|
||||
if (statusCode > 299) {
|
||||
let msg;
|
||||
// if exception/error in body, attempt to get better error
|
||||
if (obj && obj.message) {
|
||||
msg = obj.message;
|
||||
}
|
||||
else if (contents && contents.length > 0) {
|
||||
// it may be the case that the exception is in the body message as string
|
||||
msg = contents;
|
||||
}
|
||||
else {
|
||||
msg = 'Failed request: (' + statusCode + ')';
|
||||
}
|
||||
let err = new HttpClientError(msg, statusCode);
|
||||
err.result = response.result;
|
||||
reject(err);
|
||||
}
|
||||
else {
|
||||
resolve(response);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.HttpClient = HttpClient;
|
||||
49
node_modules/@actions/github/node_modules/@actions/http-client/interfaces.d.ts
generated
vendored
49
node_modules/@actions/github/node_modules/@actions/http-client/interfaces.d.ts
generated
vendored
|
|
@ -1,49 +0,0 @@
|
|||
/// <reference types="node" />
|
||||
import http = require('http');
|
||||
export interface IHeaders {
|
||||
[key: string]: any;
|
||||
}
|
||||
export interface IHttpClient {
|
||||
options(requestUrl: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||
get(requestUrl: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||
del(requestUrl: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||
post(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||
patch(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||
put(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||
sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||
request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: IHeaders): Promise<IHttpClientResponse>;
|
||||
requestRaw(info: IRequestInfo, data: string | NodeJS.ReadableStream): Promise<IHttpClientResponse>;
|
||||
requestRawWithCallback(info: IRequestInfo, data: string | NodeJS.ReadableStream, onResult: (err: any, res: IHttpClientResponse) => void): void;
|
||||
}
|
||||
export interface IRequestHandler {
|
||||
prepareRequest(options: http.RequestOptions): void;
|
||||
canHandleAuthentication(response: IHttpClientResponse): boolean;
|
||||
handleAuthentication(httpClient: IHttpClient, requestInfo: IRequestInfo, objs: any): Promise<IHttpClientResponse>;
|
||||
}
|
||||
export interface IHttpClientResponse {
|
||||
message: http.IncomingMessage;
|
||||
readBody(): Promise<string>;
|
||||
}
|
||||
export interface IRequestInfo {
|
||||
options: http.RequestOptions;
|
||||
parsedUrl: URL;
|
||||
httpModule: any;
|
||||
}
|
||||
export interface IRequestOptions {
|
||||
headers?: IHeaders;
|
||||
socketTimeout?: number;
|
||||
ignoreSslError?: boolean;
|
||||
allowRedirects?: boolean;
|
||||
allowRedirectDowngrade?: boolean;
|
||||
maxRedirects?: number;
|
||||
maxSockets?: number;
|
||||
keepAlive?: boolean;
|
||||
deserializeDates?: boolean;
|
||||
allowRetries?: boolean;
|
||||
maxRetries?: number;
|
||||
}
|
||||
export interface ITypedResponse<T> {
|
||||
statusCode: number;
|
||||
result: T | null;
|
||||
headers: Object;
|
||||
}
|
||||
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"
|
||||
}
|
||||
}
|
||||
2
node_modules/@actions/github/node_modules/@actions/http-client/proxy.d.ts
generated
vendored
2
node_modules/@actions/github/node_modules/@actions/http-client/proxy.d.ts
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
export declare function getProxyUrl(reqUrl: URL): URL | undefined;
|
||||
export declare function checkBypass(reqUrl: URL): boolean;
|
||||
57
node_modules/@actions/github/node_modules/@actions/http-client/proxy.js
generated
vendored
57
node_modules/@actions/github/node_modules/@actions/http-client/proxy.js
generated
vendored
|
|
@ -1,57 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function getProxyUrl(reqUrl) {
|
||||
let usingSsl = reqUrl.protocol === 'https:';
|
||||
let proxyUrl;
|
||||
if (checkBypass(reqUrl)) {
|
||||
return proxyUrl;
|
||||
}
|
||||
let proxyVar;
|
||||
if (usingSsl) {
|
||||
proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
|
||||
}
|
||||
else {
|
||||
proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
|
||||
}
|
||||
if (proxyVar) {
|
||||
proxyUrl = new URL(proxyVar);
|
||||
}
|
||||
return proxyUrl;
|
||||
}
|
||||
exports.getProxyUrl = getProxyUrl;
|
||||
function checkBypass(reqUrl) {
|
||||
if (!reqUrl.hostname) {
|
||||
return false;
|
||||
}
|
||||
let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
|
||||
if (!noProxy) {
|
||||
return false;
|
||||
}
|
||||
// Determine the request port
|
||||
let reqPort;
|
||||
if (reqUrl.port) {
|
||||
reqPort = Number(reqUrl.port);
|
||||
}
|
||||
else if (reqUrl.protocol === 'http:') {
|
||||
reqPort = 80;
|
||||
}
|
||||
else if (reqUrl.protocol === 'https:') {
|
||||
reqPort = 443;
|
||||
}
|
||||
// Format the request hostname and hostname with port
|
||||
let upperReqHosts = [reqUrl.hostname.toUpperCase()];
|
||||
if (typeof reqPort === 'number') {
|
||||
upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
|
||||
}
|
||||
// Compare request host against noproxy
|
||||
for (let upperNoProxyItem of noProxy
|
||||
.split(',')
|
||||
.map(x => x.trim().toUpperCase())
|
||||
.filter(x => x)) {
|
||||
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
exports.checkBypass = checkBypass;
|
||||
17
node_modules/@actions/github/package.json
generated
vendored
17
node_modules/@actions/github/package.json
generated
vendored
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@actions/github",
|
||||
"version": "4.0.0",
|
||||
"version": "5.1.1",
|
||||
"description": "Actions github lib",
|
||||
"keywords": [
|
||||
"github",
|
||||
"actions"
|
||||
],
|
||||
"homepage": "https://github.com/actions/toolkit/tree/master/packages/github",
|
||||
"homepage": "https://github.com/actions/toolkit/tree/main/packages/github",
|
||||
"license": "MIT",
|
||||
"main": "lib/github.js",
|
||||
"types": "lib/github.d.ts",
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
"directory": "packages/github"
|
||||
},
|
||||
"scripts": {
|
||||
"audit-moderate": "npm install && npm audit --audit-level=moderate",
|
||||
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
||||
"test": "jest",
|
||||
"build": "tsc",
|
||||
"format": "prettier --write **/*.ts",
|
||||
|
|
@ -38,13 +38,12 @@
|
|||
"url": "https://github.com/actions/toolkit/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/http-client": "^1.0.8",
|
||||
"@octokit/core": "^3.0.0",
|
||||
"@octokit/plugin-paginate-rest": "^2.2.3",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^4.0.0"
|
||||
"@actions/http-client": "^2.0.1",
|
||||
"@octokit/core": "^3.6.0",
|
||||
"@octokit/plugin-paginate-rest": "^2.17.0",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^5.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jest": "^25.1.0",
|
||||
"proxy": "^1.0.1"
|
||||
"proxy": "^1.0.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
node_modules/@actions/io/lib/io-util.d.ts
generated
vendored
4
node_modules/@actions/io/lib/io-util.d.ts
generated
vendored
|
|
@ -1,7 +1,9 @@
|
|||
/// <reference types="node" />
|
||||
import * as fs from 'fs';
|
||||
export declare const chmod: typeof fs.promises.chmod, copyFile: typeof fs.promises.copyFile, lstat: typeof fs.promises.lstat, mkdir: typeof fs.promises.mkdir, readdir: typeof fs.promises.readdir, readlink: typeof fs.promises.readlink, rename: typeof fs.promises.rename, rmdir: typeof fs.promises.rmdir, stat: typeof fs.promises.stat, symlink: typeof fs.promises.symlink, unlink: typeof fs.promises.unlink;
|
||||
export declare const chmod: typeof fs.promises.chmod, copyFile: typeof fs.promises.copyFile, lstat: typeof fs.promises.lstat, mkdir: typeof fs.promises.mkdir, open: typeof fs.promises.open, readdir: typeof fs.promises.readdir, readlink: typeof fs.promises.readlink, rename: typeof fs.promises.rename, rm: typeof fs.promises.rm, rmdir: typeof fs.promises.rmdir, stat: typeof fs.promises.stat, symlink: typeof fs.promises.symlink, unlink: typeof fs.promises.unlink;
|
||||
export declare const IS_WINDOWS: boolean;
|
||||
export declare const UV_FS_O_EXLOCK = 268435456;
|
||||
export declare const READONLY: number;
|
||||
export declare function exists(fsPath: string): Promise<boolean>;
|
||||
export declare function isDirectory(fsPath: string, useStat?: boolean): Promise<boolean>;
|
||||
/**
|
||||
|
|
|
|||
10
node_modules/@actions/io/lib/io-util.js
generated
vendored
10
node_modules/@actions/io/lib/io-util.js
generated
vendored
|
|
@ -29,11 +29,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
};
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
|
||||
exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
|
||||
const fs = __importStar(require("fs"));
|
||||
const path = __importStar(require("path"));
|
||||
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
|
||||
_a = fs.promises
|
||||
// export const {open} = 'fs'
|
||||
, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
|
||||
// export const {open} = 'fs'
|
||||
exports.IS_WINDOWS = process.platform === 'win32';
|
||||
// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
|
||||
exports.UV_FS_O_EXLOCK = 0x10000000;
|
||||
exports.READONLY = fs.constants.O_RDONLY;
|
||||
function exists(fsPath) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
|
|
|
|||
2
node_modules/@actions/io/lib/io-util.js.map
generated
vendored
2
node_modules/@actions/io/lib/io-util.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"io-util.js","sourceRoot":"","sources":["../src/io-util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,2CAA4B;AAEf,KAYT,EAAE,CAAC,QAAQ,EAXb,aAAK,aACL,gBAAQ,gBACR,aAAK,aACL,aAAK,aACL,eAAO,eACP,gBAAQ,gBACR,cAAM,cACN,aAAK,aACL,YA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BAAgB,CAAC,KAAK,CAAC,EAAE;wBAC3B,OAAO,QAAQ,CAAA;qBAChB;iBACF;aACF;SACF;QAED,OAAO,EAAE,CAAA;IACX,CAAC;CAAA;AA5ED,oDA4EC;AAED,SAAS,mBAAmB,CAAC,CAAS;IACpC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;IACX,IAAI,kBAAU,EAAE;QACd,6BAA6B;QAC7B,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAE1B,2BAA2B;QAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;KACjC;IAED,2BAA2B;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjC,CAAC;AAED,qCAAqC;AACrC,6BAA6B;AAC7B,6BAA6B;AAC7B,SAAS,gBAAgB,CAAC,KAAe;IACvC,OAAO,CACL,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC;QACpB,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC;QACxD,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAC1D,CAAA;AACH,CAAC;AAED,qCAAqC;AACrC,SAAgB,UAAU;;IACxB,aAAO,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,mCAAI,SAAS,CAAA;AAC5C,CAAC;AAFD,gCAEC"}
|
||||
64
node_modules/@actions/io/lib/io.js
generated
vendored
64
node_modules/@actions/io/lib/io.js
generated
vendored
|
|
@ -30,12 +30,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
|
||||
const assert_1 = require("assert");
|
||||
const childProcess = __importStar(require("child_process"));
|
||||
const path = __importStar(require("path"));
|
||||
const util_1 = require("util");
|
||||
const ioUtil = __importStar(require("./io-util"));
|
||||
const exec = util_1.promisify(childProcess.exec);
|
||||
const execFile = util_1.promisify(childProcess.execFile);
|
||||
/**
|
||||
* Copies a file or folder.
|
||||
* Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
|
||||
|
|
@ -116,61 +112,23 @@ exports.mv = mv;
|
|||
function rmRF(inputPath) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (ioUtil.IS_WINDOWS) {
|
||||
// Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
|
||||
// program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
|
||||
// Check for invalid characters
|
||||
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
|
||||
if (/[*"<>|]/.test(inputPath)) {
|
||||
throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
|
||||
}
|
||||
try {
|
||||
const cmdPath = ioUtil.getCmdPath();
|
||||
if (yield ioUtil.isDirectory(inputPath, true)) {
|
||||
yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
|
||||
env: { inputPath }
|
||||
});
|
||||
}
|
||||
else {
|
||||
yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
|
||||
env: { inputPath }
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
// if you try to delete a file that doesn't exist, desired result is achieved
|
||||
// other errors are valid
|
||||
if (err.code !== 'ENOENT')
|
||||
throw err;
|
||||
}
|
||||
// Shelling out fails to remove a symlink folder with missing source, this unlink catches that
|
||||
try {
|
||||
yield ioUtil.unlink(inputPath);
|
||||
}
|
||||
catch (err) {
|
||||
// if you try to delete a file that doesn't exist, desired result is achieved
|
||||
// other errors are valid
|
||||
if (err.code !== 'ENOENT')
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
else {
|
||||
let isDir = false;
|
||||
try {
|
||||
isDir = yield ioUtil.isDirectory(inputPath);
|
||||
}
|
||||
catch (err) {
|
||||
// if you try to delete a file that doesn't exist, desired result is achieved
|
||||
// other errors are valid
|
||||
if (err.code !== 'ENOENT')
|
||||
throw err;
|
||||
return;
|
||||
}
|
||||
if (isDir) {
|
||||
yield execFile(`rm`, [`-rf`, `${inputPath}`]);
|
||||
}
|
||||
else {
|
||||
yield ioUtil.unlink(inputPath);
|
||||
}
|
||||
try {
|
||||
// note if path does not exist, error is silent
|
||||
yield ioUtil.rm(inputPath, {
|
||||
force: true,
|
||||
maxRetries: 3,
|
||||
recursive: true,
|
||||
retryDelay: 300
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
throw new Error(`File was unable to be removed ${err}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
2
node_modules/@actions/io/lib/io.js.map
generated
vendored
2
node_modules/@actions/io/lib/io.js.map
generated
vendored
File diff suppressed because one or more lines are too long
2
node_modules/@actions/io/package.json
generated
vendored
2
node_modules/@actions/io/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@actions/io",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"description": "Actions io lib",
|
||||
"keywords": [
|
||||
"github",
|
||||
|
|
|
|||
175
node_modules/@ava/typescript/index.js
generated
vendored
175
node_modules/@ava/typescript/index.js
generated
vendored
|
|
@ -68,8 +68,14 @@ const configProperties = {
|
|||
},
|
||||
};
|
||||
|
||||
const changeInterpretations = Object.freeze(Object.assign(Object.create(null), {
|
||||
unspecified: 0,
|
||||
ignoreCompiled: 1,
|
||||
waitForOutOfBandCompilation: 2,
|
||||
}));
|
||||
|
||||
export default function typescriptProvider({negotiateProtocol}) {
|
||||
const protocol = negotiateProtocol(['ava-3.2'], {version: pkg.version});
|
||||
const protocol = negotiateProtocol(['ava-6', 'ava-3.2'], {version: pkg.version});
|
||||
if (protocol === null) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -94,7 +100,145 @@ export default function typescriptProvider({negotiateProtocol}) {
|
|||
]);
|
||||
const testFileExtension = new RegExp(`\\.(${extensions.map(ext => escapeStringRegexp(ext)).join('|')})$`);
|
||||
|
||||
const watchMode = protocol.identifier === 'ava-3.2'
|
||||
? {
|
||||
ignoreChange(filePath) {
|
||||
if (!testFileExtension.test(filePath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return rewritePaths.some(([from]) => filePath.startsWith(from));
|
||||
},
|
||||
|
||||
resolveTestFile(testfile) { // Used under AVA 3.2 protocol by legacy watcher implementation.
|
||||
if (!testFileExtension.test(testfile)) {
|
||||
return testfile;
|
||||
}
|
||||
|
||||
const rewrite = rewritePaths.find(([from]) => testfile.startsWith(from));
|
||||
if (rewrite === undefined) {
|
||||
return testfile;
|
||||
}
|
||||
|
||||
const [from, to] = rewrite;
|
||||
let newExtension = '.js';
|
||||
if (testfile.endsWith('.cts')) {
|
||||
newExtension = '.cjs';
|
||||
} else if (testfile.endsWith('.mts')) {
|
||||
newExtension = '.mjs';
|
||||
}
|
||||
|
||||
return `${to}${testfile.slice(from.length)}`.replace(testFileExtension, newExtension);
|
||||
},
|
||||
}
|
||||
: {
|
||||
changeInterpretations,
|
||||
interpretChange(filePath) {
|
||||
if (config.compile === false) {
|
||||
for (const [from] of rewritePaths) {
|
||||
if (testFileExtension.test(filePath) && filePath.startsWith(from)) {
|
||||
return changeInterpretations.waitForOutOfBandCompilation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (config.compile === 'tsc') {
|
||||
for (const [, to] of rewritePaths) {
|
||||
if (filePath.startsWith(to)) {
|
||||
return changeInterpretations.ignoreCompiled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return changeInterpretations.unspecified;
|
||||
},
|
||||
|
||||
resolvePossibleOutOfBandCompilationSources(filePath) {
|
||||
if (config.compile !== false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Only recognize .cjs, .mjs and .js files.
|
||||
if (!/\.(c|m)?js$/.test(filePath)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (const [from, to] of rewritePaths) {
|
||||
if (!filePath.startsWith(to)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const rewritten = `${from}${filePath.slice(to.length)}`;
|
||||
const possibleExtensions = [];
|
||||
|
||||
if (filePath.endsWith('.cjs')) {
|
||||
if (extensions.includes('cjs')) {
|
||||
possibleExtensions.push({replace: /\.cjs$/, extension: 'cjs'});
|
||||
}
|
||||
|
||||
if (extensions.includes('cts')) {
|
||||
possibleExtensions.push({replace: /\.cjs$/, extension: 'cts'});
|
||||
}
|
||||
|
||||
if (possibleExtensions.length === 0) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (filePath.endsWith('.mjs')) {
|
||||
if (extensions.includes('mjs')) {
|
||||
possibleExtensions.push({replace: /\.mjs$/, extension: 'mjs'});
|
||||
}
|
||||
|
||||
if (extensions.includes('mts')) {
|
||||
possibleExtensions.push({replace: /\.mjs$/, extension: 'mts'});
|
||||
}
|
||||
|
||||
if (possibleExtensions.length === 0) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (filePath.endsWith('.js')) {
|
||||
if (extensions.includes('js')) {
|
||||
possibleExtensions.push({replace: /\.js$/, extension: 'js'});
|
||||
}
|
||||
|
||||
if (extensions.includes('ts')) {
|
||||
possibleExtensions.push({replace: /\.js$/, extension: 'ts'});
|
||||
}
|
||||
|
||||
if (extensions.includes('tsx')) {
|
||||
possibleExtensions.push({replace: /\.js$/, extension: 'tsx'});
|
||||
}
|
||||
|
||||
if (possibleExtensions.length === 0) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
const possibleDeletedFiles = [];
|
||||
for (const {replace, extension} of possibleExtensions) {
|
||||
const possibleFilePath = rewritten.replace(replace, `.${extension}`);
|
||||
|
||||
// Pick the first file path that exists.
|
||||
if (fs.existsSync(possibleFilePath)) {
|
||||
return [possibleFilePath];
|
||||
}
|
||||
|
||||
possibleDeletedFiles.push(possibleFilePath);
|
||||
}
|
||||
|
||||
return possibleDeletedFiles;
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
};
|
||||
|
||||
return {
|
||||
...watchMode,
|
||||
|
||||
async compile() {
|
||||
if (compile === 'tsc') {
|
||||
await compileTypeScript(protocol.projectDir);
|
||||
|
|
@ -110,35 +254,6 @@ export default function typescriptProvider({negotiateProtocol}) {
|
|||
return [...extensions];
|
||||
},
|
||||
|
||||
ignoreChange(filePath) {
|
||||
if (!testFileExtension.test(filePath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return rewritePaths.some(([from]) => filePath.startsWith(from));
|
||||
},
|
||||
|
||||
resolveTestFile(testfile) { // Used under AVA 3.2 protocol by legacy watcher implementation.
|
||||
if (!testFileExtension.test(testfile)) {
|
||||
return testfile;
|
||||
}
|
||||
|
||||
const rewrite = rewritePaths.find(([from]) => testfile.startsWith(from));
|
||||
if (rewrite === undefined) {
|
||||
return testfile;
|
||||
}
|
||||
|
||||
const [from, to] = rewrite;
|
||||
let newExtension = '.js';
|
||||
if (testfile.endsWith('.cts')) {
|
||||
newExtension = '.cjs';
|
||||
} else if (testfile.endsWith('.mts')) {
|
||||
newExtension = '.mjs';
|
||||
}
|
||||
|
||||
return `${to}${testfile.slice(from.length)}`.replace(testFileExtension, newExtension);
|
||||
},
|
||||
|
||||
updateGlobs({filePatterns, ignoredByWatcherPatterns}) {
|
||||
return {
|
||||
filePatterns: [
|
||||
|
|
|
|||
14
node_modules/@ava/typescript/package.json
generated
vendored
14
node_modules/@ava/typescript/package.json
generated
vendored
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"name": "@ava/typescript",
|
||||
"version": "4.0.0",
|
||||
"version": "4.1.0",
|
||||
"description": "TypeScript provider for AVA",
|
||||
"engines": {
|
||||
"node": ">=14.19 <15 || >=16.15 <17 || >=18"
|
||||
"node": "^14.19 || ^16.15 || ^18 || ^20"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"escape-string-regexp": "^5.0.0",
|
||||
"execa": "^7.1.0"
|
||||
"execa": "^7.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^5.2.0",
|
||||
"c8": "^7.13.0",
|
||||
"ava": "^5.3.1",
|
||||
"c8": "^8.0.0",
|
||||
"del": "^7.0.0",
|
||||
"typescript": "^4.9.5",
|
||||
"xo": "^0.53.1"
|
||||
"typescript": "^5.1.3",
|
||||
"xo": "^0.54.2"
|
||||
},
|
||||
"c8": {
|
||||
"reporter": [
|
||||
|
|
|
|||
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';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var evk = _interopDefault(require('eslint-visitor-keys'));
|
||||
var eslintVisitorKeys = require('eslint-visitor-keys');
|
||||
|
||||
/**
|
||||
* Get the innermost scope which contains a given location.
|
||||
|
|
@ -313,6 +310,24 @@ const builtinNames = Object.freeze(
|
|||
const callAllowed = new Set(
|
||||
[
|
||||
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,
|
||||
Boolean,
|
||||
Date,
|
||||
|
|
@ -325,7 +340,14 @@ const callAllowed = new Set(
|
|||
isFinite,
|
||||
isNaN,
|
||||
isPrototypeOf,
|
||||
Map,
|
||||
Map.prototype.entries,
|
||||
Map.prototype.get,
|
||||
Map.prototype.has,
|
||||
Map.prototype.keys,
|
||||
Map.prototype.values,
|
||||
...Object.getOwnPropertyNames(Math)
|
||||
.filter((k) => k !== "random")
|
||||
.map((k) => Math[k])
|
||||
.filter((f) => typeof f === "function"),
|
||||
Number,
|
||||
|
|
@ -333,6 +355,10 @@ const callAllowed = new Set(
|
|||
Number.isNaN,
|
||||
Number.parseFloat,
|
||||
Number.parseInt,
|
||||
Number.prototype.toExponential,
|
||||
Number.prototype.toFixed,
|
||||
Number.prototype.toPrecision,
|
||||
Number.prototype.toString,
|
||||
Object,
|
||||
Object.entries,
|
||||
Object.is,
|
||||
|
|
@ -344,10 +370,39 @@ const callAllowed = new Set(
|
|||
parseFloat,
|
||||
parseInt,
|
||||
RegExp,
|
||||
Set,
|
||||
Set.prototype.entries,
|
||||
Set.prototype.has,
|
||||
Set.prototype.keys,
|
||||
Set.prototype.values,
|
||||
String,
|
||||
String.fromCharCode,
|
||||
String.fromCodePoint,
|
||||
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.keyFor,
|
||||
unescape,
|
||||
|
|
@ -359,6 +414,26 @@ const callPassThrough = new Set([
|
|||
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.
|
||||
* @param {object} object The object to get.
|
||||
|
|
@ -418,6 +493,23 @@ function getElementValues(nodeList, initialScope) {
|
|||
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({
|
||||
ArrayExpression(node, initialScope) {
|
||||
const elements = getElementValues(node.elements, initialScope);
|
||||
|
|
@ -475,7 +567,7 @@ const operations = Object.freeze({
|
|||
case "%":
|
||||
return { value: left.value % right.value }
|
||||
case "**":
|
||||
return { value: Math.pow(left.value, right.value) }
|
||||
return { value: left.value ** right.value }
|
||||
case "|":
|
||||
return { value: left.value | right.value }
|
||||
case "^":
|
||||
|
|
@ -576,7 +668,9 @@ const operations = Object.freeze({
|
|||
const def = variable.defs[0];
|
||||
if (
|
||||
def.parent &&
|
||||
def.parent.kind === "const" &&
|
||||
def.type === "Variable" &&
|
||||
(def.parent.kind === "const" ||
|
||||
isEffectivelyConst(variable)) &&
|
||||
// TODO(mysticatea): don't support destructuring here.
|
||||
def.node.id.type === "Identifier"
|
||||
) {
|
||||
|
|
@ -627,8 +721,19 @@ const operations = Object.freeze({
|
|||
}
|
||||
const property = getStaticPropertyNameValue(node, initialScope);
|
||||
|
||||
if (property != null && !isGetter(object.value, property.value)) {
|
||||
return { value: object.value[property.value] }
|
||||
if (property != null) {
|
||||
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
|
||||
|
|
@ -957,6 +1062,11 @@ function getFunctionNameWithKind(node, sourceCode) {
|
|||
parent.left.type === "Identifier"
|
||||
) {
|
||||
tokens.push(`'${parent.left.name}'`);
|
||||
} else if (
|
||||
parent.type === "ExportDefaultDeclaration" &&
|
||||
parent.declaration === node
|
||||
) {
|
||||
tokens.push("'default'");
|
||||
}
|
||||
|
||||
return tokens.join(" ")
|
||||
|
|
@ -1010,7 +1120,7 @@ const visitor = Object.freeze(
|
|||
$visitChildren(node, options, visitorKeys) {
|
||||
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];
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
|
|
@ -1136,7 +1246,7 @@ const visitor = Object.freeze(
|
|||
* @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.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.
|
||||
*/
|
||||
function hasSideEffect(
|
||||
|
|
@ -1147,7 +1257,7 @@ function hasSideEffect(
|
|||
return visitor.$visit(
|
||||
node,
|
||||
{ considerGetters, considerImplicitTypeConversion },
|
||||
sourceCode.visitorKeys || evk.KEYS,
|
||||
sourceCode.visitorKeys || eslintVisitorKeys.KEYS,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -1245,6 +1355,8 @@ function isParenthesized(
|
|||
|
||||
if (
|
||||
node == null ||
|
||||
// `Program` can't be parenthesized
|
||||
node.parent == null ||
|
||||
// `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`
|
||||
(node.parent.type === "CatchClause" && node.parent.param === node)
|
||||
) {
|
||||
|
|
@ -1921,7 +2033,7 @@ exports.ESM = ESM;
|
|||
exports.PatternMatcher = PatternMatcher;
|
||||
exports.READ = READ;
|
||||
exports.ReferenceTracker = ReferenceTracker;
|
||||
exports.default = index;
|
||||
exports["default"] = index;
|
||||
exports.findVariable = findVariable;
|
||||
exports.getFunctionHeadLocation = getFunctionHeadLocation;
|
||||
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 evk from 'eslint-visitor-keys';
|
||||
import { getKeys, KEYS } from 'eslint-visitor-keys';
|
||||
|
||||
/**
|
||||
* Get the innermost scope which contains a given location.
|
||||
|
|
@ -307,6 +306,24 @@ const builtinNames = Object.freeze(
|
|||
const callAllowed = new Set(
|
||||
[
|
||||
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,
|
||||
Boolean,
|
||||
Date,
|
||||
|
|
@ -319,7 +336,14 @@ const callAllowed = new Set(
|
|||
isFinite,
|
||||
isNaN,
|
||||
isPrototypeOf,
|
||||
Map,
|
||||
Map.prototype.entries,
|
||||
Map.prototype.get,
|
||||
Map.prototype.has,
|
||||
Map.prototype.keys,
|
||||
Map.prototype.values,
|
||||
...Object.getOwnPropertyNames(Math)
|
||||
.filter((k) => k !== "random")
|
||||
.map((k) => Math[k])
|
||||
.filter((f) => typeof f === "function"),
|
||||
Number,
|
||||
|
|
@ -327,6 +351,10 @@ const callAllowed = new Set(
|
|||
Number.isNaN,
|
||||
Number.parseFloat,
|
||||
Number.parseInt,
|
||||
Number.prototype.toExponential,
|
||||
Number.prototype.toFixed,
|
||||
Number.prototype.toPrecision,
|
||||
Number.prototype.toString,
|
||||
Object,
|
||||
Object.entries,
|
||||
Object.is,
|
||||
|
|
@ -338,10 +366,39 @@ const callAllowed = new Set(
|
|||
parseFloat,
|
||||
parseInt,
|
||||
RegExp,
|
||||
Set,
|
||||
Set.prototype.entries,
|
||||
Set.prototype.has,
|
||||
Set.prototype.keys,
|
||||
Set.prototype.values,
|
||||
String,
|
||||
String.fromCharCode,
|
||||
String.fromCodePoint,
|
||||
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.keyFor,
|
||||
unescape,
|
||||
|
|
@ -353,6 +410,26 @@ const callPassThrough = new Set([
|
|||
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.
|
||||
* @param {object} object The object to get.
|
||||
|
|
@ -412,6 +489,23 @@ function getElementValues(nodeList, initialScope) {
|
|||
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({
|
||||
ArrayExpression(node, initialScope) {
|
||||
const elements = getElementValues(node.elements, initialScope);
|
||||
|
|
@ -469,7 +563,7 @@ const operations = Object.freeze({
|
|||
case "%":
|
||||
return { value: left.value % right.value }
|
||||
case "**":
|
||||
return { value: Math.pow(left.value, right.value) }
|
||||
return { value: left.value ** right.value }
|
||||
case "|":
|
||||
return { value: left.value | right.value }
|
||||
case "^":
|
||||
|
|
@ -570,7 +664,9 @@ const operations = Object.freeze({
|
|||
const def = variable.defs[0];
|
||||
if (
|
||||
def.parent &&
|
||||
def.parent.kind === "const" &&
|
||||
def.type === "Variable" &&
|
||||
(def.parent.kind === "const" ||
|
||||
isEffectivelyConst(variable)) &&
|
||||
// TODO(mysticatea): don't support destructuring here.
|
||||
def.node.id.type === "Identifier"
|
||||
) {
|
||||
|
|
@ -621,8 +717,19 @@ const operations = Object.freeze({
|
|||
}
|
||||
const property = getStaticPropertyNameValue(node, initialScope);
|
||||
|
||||
if (property != null && !isGetter(object.value, property.value)) {
|
||||
return { value: object.value[property.value] }
|
||||
if (property != null) {
|
||||
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
|
||||
|
|
@ -951,6 +1058,11 @@ function getFunctionNameWithKind(node, sourceCode) {
|
|||
parent.left.type === "Identifier"
|
||||
) {
|
||||
tokens.push(`'${parent.left.name}'`);
|
||||
} else if (
|
||||
parent.type === "ExportDefaultDeclaration" &&
|
||||
parent.declaration === node
|
||||
) {
|
||||
tokens.push("'default'");
|
||||
}
|
||||
|
||||
return tokens.join(" ")
|
||||
|
|
@ -1004,7 +1116,7 @@ const visitor = Object.freeze(
|
|||
$visitChildren(node, options, visitorKeys) {
|
||||
const { type } = node;
|
||||
|
||||
for (const key of visitorKeys[type] || evk.getKeys(node)) {
|
||||
for (const key of visitorKeys[type] || getKeys(node)) {
|
||||
const value = node[key];
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
|
|
@ -1130,7 +1242,7 @@ const visitor = Object.freeze(
|
|||
* @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.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.
|
||||
*/
|
||||
function hasSideEffect(
|
||||
|
|
@ -1141,7 +1253,7 @@ function hasSideEffect(
|
|||
return visitor.$visit(
|
||||
node,
|
||||
{ considerGetters, considerImplicitTypeConversion },
|
||||
sourceCode.visitorKeys || evk.KEYS,
|
||||
sourceCode.visitorKeys || KEYS,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -1239,6 +1351,8 @@ function isParenthesized(
|
|||
|
||||
if (
|
||||
node == null ||
|
||||
// `Program` can't be parenthesized
|
||||
node.parent == null ||
|
||||
// `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`
|
||||
(node.parent.type === "CatchClause" && node.parent.param === node)
|
||||
) {
|
||||
|
|
@ -1909,6 +2023,5 @@ var index = {
|
|||
ReferenceTracker,
|
||||
};
|
||||
|
||||
export default index;
|
||||
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 };
|
||||
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 };
|
||||
//# 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
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)
|
||||
[](http://www.npmtrends.com/regexpp)
|
||||
[](https://github.com/mysticatea/regexpp/actions)
|
||||
[](https://codecov.io/gh/mysticatea/regexpp)
|
||||
[](https://david-dm.org/mysticatea/regexpp)
|
||||
[](https://www.npmjs.com/package/@eslint-community/regexpp)
|
||||
[](http://www.npmtrends.com/@eslint-community/regexpp)
|
||||
[](https://github.com/eslint-community/regexpp/actions)
|
||||
[](https://codecov.io/gh/eslint-community/regexpp)
|
||||
|
||||
A regular expression parser for ECMAScript.
|
||||
|
||||
## 💿 Installation
|
||||
|
||||
```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
|
||||
|
||||
|
|
@ -27,7 +26,7 @@ import {
|
|||
parseRegExpLiteral,
|
||||
validateRegExpLiteral,
|
||||
visitRegExpAST
|
||||
} from "regexpp"
|
||||
} from "@eslint-community/regexpp"
|
||||
```
|
||||
|
||||
### parseRegExpLiteral(source, options?)
|
||||
|
|
@ -154,7 +153,7 @@ Validate a regular expression literal.
|
|||
|
||||
## 📰 Changelog
|
||||
|
||||
- [GitHub Releases](https://github.com/mysticatea/regexpp/releases)
|
||||
- [GitHub Releases](https://github.com/eslint-community/regexpp/releases)
|
||||
|
||||
## 🍻 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",
|
||||
"version": "3.2.0",
|
||||
"name": "@eslint-community/regexpp",
|
||||
"version": "4.5.1",
|
||||
"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": [
|
||||
"regexp",
|
||||
"regular",
|
||||
|
|
@ -79,13 +19,70 @@
|
|||
"es2018",
|
||||
"es2019",
|
||||
"es2020",
|
||||
"es2021",
|
||||
"annexB"
|
||||
],
|
||||
"author": "Toru Nagashima (https://github.com/mysticatea)",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/eslint-community/regexpp#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/mysticatea/regexpp/issues"
|
||||
"url": "https://github.com/eslint-community/regexpp/issues"
|
||||
},
|
||||
"homepage": "https://github.com/mysticatea/regexpp#readme",
|
||||
"funding": "https://github.com/sponsors/mysticatea"
|
||||
"repository": {
|
||||
"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"
|
||||
}
|
||||
}
|
||||
7
node_modules/@eslint/eslintrc/README.md
generated
vendored
7
node_modules/@eslint/eslintrc/README.md
generated
vendored
|
|
@ -22,6 +22,7 @@ The primary class in this package is `FlatCompat`, which is a utility to transla
|
|||
|
||||
```js
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
import js from "@eslint/js";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
|
|
@ -30,8 +31,10 @@ const __filename = fileURLToPath(import.meta.url);
|
|||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname, // optional; default: process.cwd()
|
||||
resolvePluginsRelativeTo: __dirname // optional
|
||||
baseDirectory: __dirname, // optional; default: process.cwd()
|
||||
resolvePluginsRelativeTo: __dirname, // optional
|
||||
recommendedConfig: js.configs.recommended, // optional
|
||||
allConfig: js.configs.all, // optional
|
||||
});
|
||||
|
||||
export default [
|
||||
|
|
|
|||
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
|
||||
}
|
||||
},
|
||||
es2023: {
|
||||
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
||||
parserOptions: {
|
||||
ecmaVersion: 14
|
||||
}
|
||||
},
|
||||
es2024: {
|
||||
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
||||
parserOptions: {
|
||||
ecmaVersion: 15
|
||||
}
|
||||
},
|
||||
|
||||
// Platforms
|
||||
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
|
||||
}
|
||||
},
|
||||
es2023: {
|
||||
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
||||
parserOptions: {
|
||||
ecmaVersion: 14
|
||||
}
|
||||
},
|
||||
es2024: {
|
||||
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
||||
parserOptions: {
|
||||
ecmaVersion: 15
|
||||
}
|
||||
},
|
||||
|
||||
// Platforms
|
||||
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
45
node_modules/@eslint/eslintrc/dist/eslintrc.cjs
generated
vendored
45
node_modules/@eslint/eslintrc/dist/eslintrc.cjs
generated
vendored
|
|
@ -1807,6 +1807,18 @@ var environments = new Map(Object.entries({
|
|||
ecmaVersion: 13
|
||||
}
|
||||
},
|
||||
es2023: {
|
||||
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
||||
parserOptions: {
|
||||
ecmaVersion: 14
|
||||
}
|
||||
},
|
||||
es2024: {
|
||||
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
||||
parserOptions: {
|
||||
ecmaVersion: 15
|
||||
}
|
||||
},
|
||||
|
||||
// Platforms
|
||||
browser: {
|
||||
|
|
@ -4026,17 +4038,6 @@ function translateESLintRC(eslintrcConfig, {
|
|||
const languageOptionsKeysToCopy = ["globals", "parser", "parserOptions"];
|
||||
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
|
||||
for (const key of keysToCopy) {
|
||||
if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") {
|
||||
|
|
@ -4188,15 +4189,31 @@ class FlatCompat {
|
|||
|
||||
constructor({
|
||||
baseDirectory = process.cwd(),
|
||||
resolvePluginsRelativeTo = baseDirectory
|
||||
resolvePluginsRelativeTo = baseDirectory,
|
||||
recommendedConfig,
|
||||
allConfig
|
||||
} = {}) {
|
||||
this.baseDirectory = baseDirectory;
|
||||
this.resolvePluginsRelativeTo = resolvePluginsRelativeTo;
|
||||
this[cafactory] = new ConfigArrayFactory({
|
||||
cwd: baseDirectory,
|
||||
resolvePluginsRelativeTo,
|
||||
getEslintAllConfig: () => ({ settings: { "eslint:all": true } }),
|
||||
getEslintRecommendedConfig: () => ({ settings: { "eslint:recommended": true } })
|
||||
getEslintAllConfig: () => {
|
||||
|
||||
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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
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
33
node_modules/@eslint/eslintrc/lib/flat-compat.js
generated
vendored
33
node_modules/@eslint/eslintrc/lib/flat-compat.js
generated
vendored
|
|
@ -53,17 +53,6 @@ function translateESLintRC(eslintrcConfig, {
|
|||
const languageOptionsKeysToCopy = ["globals", "parser", "parserOptions"];
|
||||
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
|
||||
for (const key of keysToCopy) {
|
||||
if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") {
|
||||
|
|
@ -215,15 +204,31 @@ class FlatCompat {
|
|||
|
||||
constructor({
|
||||
baseDirectory = process.cwd(),
|
||||
resolvePluginsRelativeTo = baseDirectory
|
||||
resolvePluginsRelativeTo = baseDirectory,
|
||||
recommendedConfig,
|
||||
allConfig
|
||||
} = {}) {
|
||||
this.baseDirectory = baseDirectory;
|
||||
this.resolvePluginsRelativeTo = resolvePluginsRelativeTo;
|
||||
this[cafactory] = new ConfigArrayFactory({
|
||||
cwd: baseDirectory,
|
||||
resolvePluginsRelativeTo,
|
||||
getEslintAllConfig: () => ({ settings: { "eslint:all": true } }),
|
||||
getEslintRecommendedConfig: () => ({ settings: { "eslint:recommended": true } })
|
||||
getEslintAllConfig: () => {
|
||||
|
||||
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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
4
node_modules/@eslint/eslintrc/package.json
generated
vendored
4
node_modules/@eslint/eslintrc/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@eslint/eslintrc",
|
||||
"version": "1.4.1",
|
||||
"version": "2.1.0",
|
||||
"description": "The legacy ESLintRC config file format for ESLint",
|
||||
"type": "module",
|
||||
"main": "./dist/eslintrc.cjs",
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
"dependencies": {
|
||||
"ajv": "^6.12.4",
|
||||
"debug": "^4.3.2",
|
||||
"espree": "^9.4.0",
|
||||
"espree": "^9.6.0",
|
||||
"globals": "^13.19.0",
|
||||
"ignore": "^5.2.0",
|
||||
"import-fresh": "^3.2.1",
|
||||
|
|
|
|||
19
node_modules/@eslint/js/LICENSE
generated
vendored
Normal file
19
node_modules/@eslint/js/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
|
||||
|
||||
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.
|
||||
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 */
|
||||
|
||||
/** @type {import("../lib/shared/types").ConfigData} */
|
||||
module.exports = {
|
||||
rules: {
|
||||
module.exports = Object.freeze({
|
||||
rules: Object.freeze({
|
||||
"constructor-super": "error",
|
||||
"for-direction": "error",
|
||||
"getter-return": "error",
|
||||
|
|
@ -72,5 +72,5 @@ module.exports = {
|
|||
"require-yield": "error",
|
||||
"use-isnan": "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")
|
||||
}
|
||||
};
|
||||
198
node_modules/@humanwhocodes/config-array/CHANGELOG.md
generated
vendored
198
node_modules/@humanwhocodes/config-array/CHANGELOG.md
generated
vendored
|
|
@ -1,198 +0,0 @@
|
|||
# Changelog
|
||||
|
||||
## [0.11.8](https://github.com/humanwhocodes/config-array/compare/v0.11.7...v0.11.8) (2022-12-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Ensure gitignore-style directory ignores ([#74](https://github.com/humanwhocodes/config-array/issues/74)) ([8e17f4a](https://github.com/humanwhocodes/config-array/commit/8e17f4a7378cb0b417e1103d60ef397b26d2f917))
|
||||
|
||||
## [0.11.7](https://github.com/humanwhocodes/config-array/compare/v0.11.6...v0.11.7) (2022-10-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** Update minimatch to secure version ([3219294](https://github.com/humanwhocodes/config-array/commit/3219294bf9170c500ee9e212b59e17ef205b7c3c))
|
||||
|
||||
## [0.11.6](https://github.com/humanwhocodes/config-array/compare/v0.11.5...v0.11.6) (2022-10-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Only apply universal patterns if others match. ([e69c8fd](https://github.com/humanwhocodes/config-array/commit/e69c8fdbb7696b406821bc723b86b4c5304c4260))
|
||||
|
||||
## [0.11.5](https://github.com/humanwhocodes/config-array/compare/v0.11.4...v0.11.5) (2022-10-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Unignoring of directories should work ([e1c9dcd](https://github.com/humanwhocodes/config-array/commit/e1c9dcd05534619effe258596191ea9dc5bb37af))
|
||||
|
||||
## [0.11.4](https://github.com/humanwhocodes/config-array/compare/v0.11.3...v0.11.4) (2022-10-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Ensure subdirectories of ignored directories are ignored ([0df450e](https://github.com/humanwhocodes/config-array/commit/0df450eabeb595ae22fe680ce3320dc47edb1e66))
|
||||
|
||||
## [0.11.3](https://github.com/humanwhocodes/config-array/compare/v0.11.2...v0.11.3) (2022-10-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Ensure directories can be unignored. ([206404c](https://github.com/humanwhocodes/config-array/commit/206404c490d354a4f39ef9b4a6d0ceaec119abc5))
|
||||
|
||||
## [0.11.2](https://github.com/humanwhocodes/config-array/compare/v0.11.1...v0.11.2) (2022-10-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Error conditions for isDirectoryIgnored ([0bd81f5](https://github.com/humanwhocodes/config-array/commit/0bd81f53b7c217d561f70709057c7d77f17e8c6d))
|
||||
* isDirectoryIgnored should match on relative path. ([3d1eaf6](https://github.com/humanwhocodes/config-array/commit/3d1eaf6389056215e27793cde9c2954c01c78df8))
|
||||
* isFileIgnored should call isDirectoryIgnored ([270d359](https://github.com/humanwhocodes/config-array/commit/270d359295f376edb0c73905f62a848284d34053))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* Cache isDirectoryIgnored calls ([c5e6720](https://github.com/humanwhocodes/config-array/commit/c5e67208618e253c08bd320efeae4b1f63641e63))
|
||||
|
||||
## [0.11.1](https://github.com/humanwhocodes/config-array/compare/v0.11.0...v0.11.1) (2022-09-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* isDirectoryIgnored should not test negated patterns ([f6cdb68](https://github.com/humanwhocodes/config-array/commit/f6cdb688784901970fda72eb688eb1a00c44b09a))
|
||||
|
||||
## [0.11.0](https://github.com/humanwhocodes/config-array/compare/v0.10.7...v0.11.0) (2022-09-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Add isDirectoryIgnored; deprecated isIgnored ([e6942f2](https://github.com/humanwhocodes/config-array/commit/e6942f2ce075007d39f23530593b7adb19178a52))
|
||||
|
||||
## [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))
|
||||
50
node_modules/@humanwhocodes/config-array/api.js
generated
vendored
50
node_modules/@humanwhocodes/config-array/api.js
generated
vendored
|
|
@ -1,12 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var path = _interopDefault(require('path'));
|
||||
var minimatch = _interopDefault(require('minimatch'));
|
||||
var createDebug = _interopDefault(require('debug'));
|
||||
var path = require('path');
|
||||
var minimatch = require('minimatch');
|
||||
var createDebug = require('debug');
|
||||
var objectSchema = require('@humanwhocodes/object-schema');
|
||||
|
||||
/**
|
||||
|
|
@ -310,12 +306,36 @@ function shouldIgnorePath(ignores, filePath, relativeFilePath) {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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
|
||||
* `ignores`.
|
||||
* @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.
|
||||
|
|
@ -790,8 +810,20 @@ class ConfigArray extends Array {
|
|||
this.forEach((config, index) => {
|
||||
|
||||
if (!config.files) {
|
||||
debug(`Anonymous 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;
|
||||
}
|
||||
|
||||
|
|
|
|||
8
node_modules/@humanwhocodes/config-array/package.json
generated
vendored
8
node_modules/@humanwhocodes/config-array/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@humanwhocodes/config-array",
|
||||
"version": "0.11.8",
|
||||
"version": "0.11.10",
|
||||
"description": "Glob-based configuration matching.",
|
||||
"author": "Nicholas C. Zakas",
|
||||
"main": "api.js",
|
||||
|
|
@ -50,12 +50,12 @@
|
|||
"@nitpik/javascript": "0.4.0",
|
||||
"@nitpik/node": "0.0.5",
|
||||
"chai": "4.3.7",
|
||||
"eslint": "8.29.0",
|
||||
"eslint": "8.41.0",
|
||||
"esm": "3.2.25",
|
||||
"lint-staged": "13.1.0",
|
||||
"lint-staged": "13.2.2",
|
||||
"mocha": "6.2.3",
|
||||
"nyc": "14.1.1",
|
||||
"rollup": "1.16.6",
|
||||
"rollup": "3.20.4",
|
||||
"yorkie": "2.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
46
node_modules/@octokit/auth-token/README.md
generated
vendored
46
node_modules/@octokit/auth-token/README.md
generated
vendored
|
|
@ -33,11 +33,11 @@ It is useful if you want to support multiple authentication strategies, as it’
|
|||
Browsers
|
||||
</th><td width=100%>
|
||||
|
||||
Load `@octokit/auth-token` directly from [cdn.pika.dev](https://cdn.pika.dev)
|
||||
Load `@octokit/auth-token` directly from [cdn.skypack.dev](https://cdn.skypack.dev)
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { createTokenAuth } from "https://cdn.pika.dev/@octokit/auth-token";
|
||||
import { createTokenAuth } from "https://cdn.skypack.dev/@octokit/auth-token";
|
||||
</script>
|
||||
```
|
||||
|
||||
|
|
@ -58,12 +58,13 @@ const { createTokenAuth } = require("@octokit/auth-token");
|
|||
</table>
|
||||
|
||||
```js
|
||||
const auth = createTokenAuth("1234567890abcdef1234567890abcdef12345678");
|
||||
const auth = createTokenAuth("ghp_PersonalAccessToken01245678900000000");
|
||||
const authentication = await auth();
|
||||
// {
|
||||
// type: 'token',
|
||||
// token: '1234567890abcdef1234567890abcdef12345678',
|
||||
// token: 'ghp_PersonalAccessToken01245678900000000',
|
||||
// tokenType: 'oauth'
|
||||
// }
|
||||
```
|
||||
|
||||
## `createTokenAuth(token) options`
|
||||
|
|
@ -72,17 +73,36 @@ The `createTokenAuth` method accepts a single argument of type string, which is
|
|||
|
||||
- [Personal access token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line)
|
||||
- [OAuth access token](https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/)
|
||||
- Installation access token ([GitHub App Installation](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation))
|
||||
- [GITHUB_TOKEN provided to GitHub Actions](https://developer.github.com/actions/creating-github-actions/accessing-the-runtime-environment/#environment-variables)
|
||||
- Installation access token ([server-to-server](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation))
|
||||
- User authentication for installation ([user-to-server](https://docs.github.com/en/developers/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps))
|
||||
|
||||
Examples
|
||||
|
||||
```js
|
||||
// Personal access token or OAuth access token
|
||||
createTokenAuth("1234567890abcdef1234567890abcdef12345678");
|
||||
createTokenAuth("ghp_PersonalAccessToken01245678900000000");
|
||||
// {
|
||||
// type: 'token',
|
||||
// token: 'ghp_PersonalAccessToken01245678900000000',
|
||||
// tokenType: 'oauth'
|
||||
// }
|
||||
|
||||
// Installation access token or GitHub Action token
|
||||
createTokenAuth("v1.d3d433526f780fbcc3129004e2731b3904ad0b86");
|
||||
createTokenAuth("ghs_InstallallationOrActionToken00000000");
|
||||
// {
|
||||
// type: 'token',
|
||||
// token: 'ghs_InstallallationOrActionToken00000000',
|
||||
// tokenType: 'installation'
|
||||
// }
|
||||
|
||||
// Installation access token or GitHub Action token
|
||||
createTokenAuth("ghu_InstallationUserToServer000000000000");
|
||||
// {
|
||||
// type: 'token',
|
||||
// token: 'ghu_InstallationUserToServer000000000000',
|
||||
// tokenType: 'user-to-server'
|
||||
// }
|
||||
```
|
||||
|
||||
## `auth()`
|
||||
|
|
@ -136,7 +156,7 @@ The `auth()` method has no options. It returns a promise which resolves with the
|
|||
<code>string</code>
|
||||
</th>
|
||||
<td>
|
||||
Can be either <code>"oauth"</code> for personal access tokens and OAuth tokens, or <code>"installation"</code> for installation access tokens (includes <code>GITHUB_TOKEN</code> provided to GitHub Actions)
|
||||
Can be either <code>"oauth"</code> for personal access tokens and OAuth tokens, <code>"installation"</code> for installation access tokens (includes <code>GITHUB_TOKEN</code> provided to GitHub Actions), <code>"app"</code> for a GitHub App JSON Web Token, or <code>"user-to-server"</code> for a user authentication token through an app installation.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
@ -180,7 +200,7 @@ Here is a list of things you can do to retrieve further information
|
|||
Note that this does not work for installations. There is no way to retrieve permissions based on an installation access tokens.
|
||||
|
||||
```js
|
||||
const TOKEN = "1234567890abcdef1234567890abcdef12345678";
|
||||
const TOKEN = "ghp_PersonalAccessToken01245678900000000";
|
||||
|
||||
const auth = createTokenAuth(TOKEN);
|
||||
const authentication = await auth();
|
||||
|
|
@ -202,7 +222,7 @@ if (scopes.length) {
|
|||
### Find out if token is a personal access token or if it belongs to an OAuth app
|
||||
|
||||
```js
|
||||
const TOKEN = "1234567890abcdef1234567890abcdef12345678";
|
||||
const TOKEN = "ghp_PersonalAccessToken01245678900000000";
|
||||
|
||||
const auth = createTokenAuth(TOKEN);
|
||||
const authentication = await auth();
|
||||
|
|
@ -226,12 +246,12 @@ if (clientId) {
|
|||
Note that the `permissions` key is not set when authenticated using an installation access token.
|
||||
|
||||
```js
|
||||
const TOKEN = "1234567890abcdef1234567890abcdef12345678";
|
||||
const TOKEN = "ghp_PersonalAccessToken01245678900000000";
|
||||
|
||||
const auth = createTokenAuth(TOKEN);
|
||||
const authentication = await auth();
|
||||
|
||||
const response = await request("GET /repos/:owner/:repo", {
|
||||
const response = await request("GET /repos/{owner}/{repo}", {
|
||||
owner: 'octocat',
|
||||
repo: 'hello-world'
|
||||
headers: authentication.headers
|
||||
|
|
@ -252,7 +272,7 @@ Both OAuth and installation access tokens can be used for git operations. Howeve
|
|||
This example is using the [`execa`](https://github.com/sindresorhus/execa) package to run a `git push` command.
|
||||
|
||||
```js
|
||||
const TOKEN = "1234567890abcdef1234567890abcdef12345678";
|
||||
const TOKEN = "ghp_PersonalAccessToken01245678900000000";
|
||||
|
||||
const auth = createTokenAuth(TOKEN);
|
||||
const { token, tokenType } = await auth();
|
||||
|
|
|
|||
8
node_modules/@octokit/auth-token/dist-node/index.js
generated
vendored
8
node_modules/@octokit/auth-token/dist-node/index.js
generated
vendored
|
|
@ -2,8 +2,14 @@
|
|||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
const REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
|
||||
const REGEX_IS_INSTALLATION = /^ghs_/;
|
||||
const REGEX_IS_USER_TO_SERVER = /^ghu_/;
|
||||
async function auth(token) {
|
||||
const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
|
||||
const isApp = token.split(/\./).length === 3;
|
||||
const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
|
||||
const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
|
||||
const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
|
||||
return {
|
||||
type: "token",
|
||||
token: token,
|
||||
|
|
|
|||
2
node_modules/@octokit/auth-token/dist-node/index.js.map
generated
vendored
2
node_modules/@octokit/auth-token/dist-node/index.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sources":["../dist-src/auth.js","../dist-src/with-authorization-prefix.js","../dist-src/hook.js","../dist-src/index.js"],"sourcesContent":["export async function auth(token) {\n const tokenType = token.split(/\\./).length === 3\n ? \"app\"\n : /^v\\d+\\./.test(token)\n ? \"installation\"\n : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n","/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nexport function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n return `token ${token}`;\n}\n","import { withAuthorizationPrefix } from \"./with-authorization-prefix\";\nexport async function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n","import { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nexport const createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n"],"names":["auth","token","tokenType","split","length","test","type","withAuthorizationPrefix","hook","request","route","parameters","endpoint","merge","headers","authorization","createTokenAuth","Error","replace","Object","assign","bind"],"mappings":";;;;AAAO,eAAeA,IAAf,CAAoBC,KAApB,EAA2B;AAC9B,QAAMC,SAAS,GAAGD,KAAK,CAACE,KAAN,CAAY,IAAZ,EAAkBC,MAAlB,KAA6B,CAA7B,GACZ,KADY,GAEZ,UAAUC,IAAV,CAAeJ,KAAf,IACI,cADJ,GAEI,OAJV;AAKA,SAAO;AACHK,IAAAA,IAAI,EAAE,OADH;AAEHL,IAAAA,KAAK,EAAEA,KAFJ;AAGHC,IAAAA;AAHG,GAAP;AAKH;;ACXD;;;;;AAKA,AAAO,SAASK,uBAAT,CAAiCN,KAAjC,EAAwC;AAC3C,MAAIA,KAAK,CAACE,KAAN,CAAY,IAAZ,EAAkBC,MAAlB,KAA6B,CAAjC,EAAoC;AAChC,WAAQ,UAASH,KAAM,EAAvB;AACH;;AACD,SAAQ,SAAQA,KAAM,EAAtB;AACH;;ACTM,eAAeO,IAAf,CAAoBP,KAApB,EAA2BQ,OAA3B,EAAoCC,KAApC,EAA2CC,UAA3C,EAAuD;AAC1D,QAAMC,QAAQ,GAAGH,OAAO,CAACG,QAAR,CAAiBC,KAAjB,CAAuBH,KAAvB,EAA8BC,UAA9B,CAAjB;AACAC,EAAAA,QAAQ,CAACE,OAAT,CAAiBC,aAAjB,GAAiCR,uBAAuB,CAACN,KAAD,CAAxD;AACA,SAAOQ,OAAO,CAACG,QAAD,CAAd;AACH;;MCHYI,eAAe,GAAG,SAASA,eAAT,CAAyBf,KAAzB,EAAgC;AAC3D,MAAI,CAACA,KAAL,EAAY;AACR,UAAM,IAAIgB,KAAJ,CAAU,0DAAV,CAAN;AACH;;AACD,MAAI,OAAOhB,KAAP,KAAiB,QAArB,EAA+B;AAC3B,UAAM,IAAIgB,KAAJ,CAAU,uEAAV,CAAN;AACH;;AACDhB,EAAAA,KAAK,GAAGA,KAAK,CAACiB,OAAN,CAAc,oBAAd,EAAoC,EAApC,CAAR;AACA,SAAOC,MAAM,CAACC,MAAP,CAAcpB,IAAI,CAACqB,IAAL,CAAU,IAAV,EAAgBpB,KAAhB,CAAd,EAAsC;AACzCO,IAAAA,IAAI,EAAEA,IAAI,CAACa,IAAL,CAAU,IAAV,EAAgBpB,KAAhB;AADmC,GAAtC,CAAP;AAGH,CAXM;;;;"}
|
||||
{"version":3,"file":"index.js","sources":["../dist-src/auth.js","../dist-src/with-authorization-prefix.js","../dist-src/hook.js","../dist-src/index.js"],"sourcesContent":["const REGEX_IS_INSTALLATION_LEGACY = /^v1\\./;\nconst REGEX_IS_INSTALLATION = /^ghs_/;\nconst REGEX_IS_USER_TO_SERVER = /^ghu_/;\nexport async function auth(token) {\n const isApp = token.split(/\\./).length === 3;\n const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) ||\n REGEX_IS_INSTALLATION.test(token);\n const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);\n const tokenType = isApp\n ? \"app\"\n : isInstallation\n ? \"installation\"\n : isUserToServer\n ? \"user-to-server\"\n : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType,\n };\n}\n","/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nexport function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n return `token ${token}`;\n}\n","import { withAuthorizationPrefix } from \"./with-authorization-prefix\";\nexport async function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n","import { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nexport const createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token),\n });\n};\n"],"names":["REGEX_IS_INSTALLATION_LEGACY","REGEX_IS_INSTALLATION","REGEX_IS_USER_TO_SERVER","auth","token","isApp","split","length","isInstallation","test","isUserToServer","tokenType","type","withAuthorizationPrefix","hook","request","route","parameters","endpoint","merge","headers","authorization","createTokenAuth","Error","replace","Object","assign","bind"],"mappings":";;;;AAAA,MAAMA,4BAA4B,GAAG,OAArC;AACA,MAAMC,qBAAqB,GAAG,OAA9B;AACA,MAAMC,uBAAuB,GAAG,OAAhC;AACO,eAAeC,IAAf,CAAoBC,KAApB,EAA2B;AAC9B,QAAMC,KAAK,GAAGD,KAAK,CAACE,KAAN,CAAY,IAAZ,EAAkBC,MAAlB,KAA6B,CAA3C;AACA,QAAMC,cAAc,GAAGR,4BAA4B,CAACS,IAA7B,CAAkCL,KAAlC,KACnBH,qBAAqB,CAACQ,IAAtB,CAA2BL,KAA3B,CADJ;AAEA,QAAMM,cAAc,GAAGR,uBAAuB,CAACO,IAAxB,CAA6BL,KAA7B,CAAvB;AACA,QAAMO,SAAS,GAAGN,KAAK,GACjB,KADiB,GAEjBG,cAAc,GACV,cADU,GAEVE,cAAc,GACV,gBADU,GAEV,OANd;AAOA,SAAO;AACHE,IAAAA,IAAI,EAAE,OADH;AAEHR,IAAAA,KAAK,EAAEA,KAFJ;AAGHO,IAAAA;AAHG,GAAP;AAKH;;ACpBD;AACA;AACA;AACA;AACA;AACA,AAAO,SAASE,uBAAT,CAAiCT,KAAjC,EAAwC;AAC3C,MAAIA,KAAK,CAACE,KAAN,CAAY,IAAZ,EAAkBC,MAAlB,KAA6B,CAAjC,EAAoC;AAChC,WAAQ,UAASH,KAAM,EAAvB;AACH;;AACD,SAAQ,SAAQA,KAAM,EAAtB;AACH;;ACTM,eAAeU,IAAf,CAAoBV,KAApB,EAA2BW,OAA3B,EAAoCC,KAApC,EAA2CC,UAA3C,EAAuD;AAC1D,QAAMC,QAAQ,GAAGH,OAAO,CAACG,QAAR,CAAiBC,KAAjB,CAAuBH,KAAvB,EAA8BC,UAA9B,CAAjB;AACAC,EAAAA,QAAQ,CAACE,OAAT,CAAiBC,aAAjB,GAAiCR,uBAAuB,CAACT,KAAD,CAAxD;AACA,SAAOW,OAAO,CAACG,QAAD,CAAd;AACH;;MCHYI,eAAe,GAAG,SAASA,eAAT,CAAyBlB,KAAzB,EAAgC;AAC3D,MAAI,CAACA,KAAL,EAAY;AACR,UAAM,IAAImB,KAAJ,CAAU,0DAAV,CAAN;AACH;;AACD,MAAI,OAAOnB,KAAP,KAAiB,QAArB,EAA+B;AAC3B,UAAM,IAAImB,KAAJ,CAAU,uEAAV,CAAN;AACH;;AACDnB,EAAAA,KAAK,GAAGA,KAAK,CAACoB,OAAN,CAAc,oBAAd,EAAoC,EAApC,CAAR;AACA,SAAOC,MAAM,CAACC,MAAP,CAAcvB,IAAI,CAACwB,IAAL,CAAU,IAAV,EAAgBvB,KAAhB,CAAd,EAAsC;AACzCU,IAAAA,IAAI,EAAEA,IAAI,CAACa,IAAL,CAAU,IAAV,EAAgBvB,KAAhB;AADmC,GAAtC,CAAP;AAGH,CAXM;;;;"}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue