Merge pull request #2317 from github/update-v3.25.7-a095bf2a1
Merge main into releases/v3
This commit is contained in:
commit
f079b84933
266 changed files with 12067 additions and 16976 deletions
16
.github/workflows/__multi-language-autodetect.yml
generated
vendored
16
.github/workflows/__multi-language-autodetect.yml
generated
vendored
|
|
@ -28,36 +28,20 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: stable-20230403
|
||||
- os: macos-12
|
||||
version: stable-20230403
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.13.5
|
||||
- os: macos-12
|
||||
version: stable-v2.13.5
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.14.6
|
||||
- os: macos-12
|
||||
version: stable-v2.14.6
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.15.5
|
||||
- os: macos-latest
|
||||
version: stable-v2.15.5
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.16.6
|
||||
- os: macos-latest
|
||||
version: stable-v2.16.6
|
||||
- os: ubuntu-latest
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
version: nightly-latest
|
||||
name: Multi-language repository
|
||||
|
|
|
|||
16
.github/workflows/__scaling-reserved-ram.yml
generated
vendored
16
.github/workflows/__scaling-reserved-ram.yml
generated
vendored
|
|
@ -28,36 +28,20 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: stable-20230403
|
||||
- os: macos-12
|
||||
version: stable-20230403
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.13.5
|
||||
- os: macos-12
|
||||
version: stable-v2.13.5
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.14.6
|
||||
- os: macos-12
|
||||
version: stable-v2.14.6
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.15.5
|
||||
- os: macos-latest
|
||||
version: stable-v2.15.5
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.16.6
|
||||
- os: macos-latest
|
||||
version: stable-v2.16.6
|
||||
- os: ubuntu-latest
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
version: nightly-latest
|
||||
name: Scaling reserved RAM
|
||||
|
|
|
|||
6
.github/workflows/__swift-custom-build.yml
generated
vendored
6
.github/workflows/__swift-custom-build.yml
generated
vendored
|
|
@ -28,16 +28,10 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
version: nightly-latest
|
||||
name: Swift analysis using a custom build command
|
||||
|
|
|
|||
21
.github/workflows/__unset-environment.yml
generated
vendored
21
.github/workflows/__unset-environment.yml
generated
vendored
|
|
@ -28,21 +28,17 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: stable-20230403
|
||||
- os: ubuntu-latest
|
||||
version: stable-v2.13.5
|
||||
- os: ubuntu-latest
|
||||
- os: macos-12
|
||||
version: stable-v2.14.6
|
||||
- os: ubuntu-latest
|
||||
- os: macos-latest
|
||||
version: stable-v2.15.5
|
||||
- os: ubuntu-latest
|
||||
- os: macos-latest
|
||||
version: stable-v2.16.6
|
||||
- os: ubuntu-latest
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
- os: macos-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
- os: macos-latest
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: nightly-latest
|
||||
name: Test unsetting environment variables
|
||||
permissions:
|
||||
|
|
@ -79,6 +75,9 @@ jobs:
|
|||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '>=1.21.0'
|
||||
- name: Build code
|
||||
shell: bash
|
||||
# Disable Kotlin analysis while it's incompatible with Kotlin 1.8, until we find a
|
||||
|
|
|
|||
11
.github/workflows/debug-artifacts.yml
vendored
11
.github/workflows/debug-artifacts.yml
vendored
|
|
@ -25,9 +25,10 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
version:
|
||||
- stable-20230403
|
||||
- stable-v2.13.5
|
||||
- stable-v2.14.6
|
||||
# TODO: Once CLI v2.17.4 is available and the platform is switched back to ubuntu,
|
||||
# stable-20230403, stable-v2.13.5, and stable-v2.14.6 can be added back to this matrix,
|
||||
# and the VERSIONS variable in the bash script below.
|
||||
# Prior to CLI v2.15.1, ARM runners were not supported by the build tracer.
|
||||
- stable-v2.15.5
|
||||
- stable-v2.16.6
|
||||
- default
|
||||
|
|
@ -37,7 +38,7 @@ jobs:
|
|||
env:
|
||||
CODEQL_ACTION_TEST_MODE: true
|
||||
timeout-minutes: 45
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: macos-latest # TODO: Switch back to ubuntu for `nightly-latest` and `latest` once CLI v2.17.4 is available.
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
|
|
@ -75,7 +76,7 @@ jobs:
|
|||
- name: Check expected artifacts exist
|
||||
shell: bash
|
||||
run: |
|
||||
VERSIONS="stable-20230403 stable-v2.13.5 stable-v2.14.6 stable-v2.15.5 stable-v2.16.6 default latest nightly-latest"
|
||||
VERSIONS="stable-v2.15.5 stable-v2.16.6 default latest nightly-latest"
|
||||
LANGUAGES="cpp csharp go java javascript python"
|
||||
for version in $VERSIONS; do
|
||||
pushd "./my-debug-artifacts-${version//./}"
|
||||
|
|
|
|||
2
.github/workflows/update-bundle.yml
vendored
2
.github/workflows/update-bundle.yml
vendored
|
|
@ -54,7 +54,7 @@ jobs:
|
|||
cli_version=$(jq -r '.cliVersion' src/defaults.json)
|
||||
pr_url=$(gh pr create \
|
||||
--title "Update default bundle to $cli_version" \
|
||||
--body "This pull request updates the default CodeQL bundle, as used with \`tools: latest\` and on GHES, to $cli_version." \
|
||||
--body "This pull request updates the default CodeQL bundle, as used with \`tools: linked\` and on GHES, to $cli_version." \
|
||||
--assignee "$GITHUB_ACTOR" \
|
||||
--draft \
|
||||
)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
|
|||
|
||||
Note that the only difference between `v2` and `v3` of the CodeQL Action is the node version they support, with `v3` running on node 20 while we continue to release `v2` to support running on node 16. For example `3.22.11` was the first `v3` release and is functionally identical to `2.22.11`. This approach ensures an easy way to track exactly which features are included in different versions, indicated by the minor and patch version numbers.
|
||||
|
||||
## 3.25.7 - 31 May 2024
|
||||
|
||||
- We are rolling out a feature in May/June 2024 that will reduce the Actions cache usage of the Action by keeping only the newest TRAP cache for each language. [#2306](https://github.com/github/codeql-action/pull/2306)
|
||||
|
||||
## 3.25.6 - 20 May 2024
|
||||
|
||||
- Update default CodeQL bundle version to 2.17.3. [#2295](https://github.com/github/codeql-action/pull/2295)
|
||||
|
|
|
|||
3
lib/actions-util.js
generated
3
lib/actions-util.js
generated
|
|
@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getFileType = exports.FileCmdNotFoundError = exports.getWorkflowRunAttempt = exports.getWorkflowRunID = exports.getUploadValue = exports.printDebugLogs = exports.isAnalyzingDefaultBranch = exports.getRelativeScriptPath = exports.isRunningLocalAction = exports.getWorkflowEventName = exports.getActionVersion = exports.getRef = exports.determineMergeBaseCommitOid = exports.getCommitOid = exports.getTemporaryDirectory = exports.getOptionalInput = exports.getRequiredInput = void 0;
|
||||
exports.getFileType = exports.FileCmdNotFoundError = exports.getWorkflowRunAttempt = exports.getWorkflowRunID = exports.getUploadValue = exports.printDebugLogs = exports.isAnalyzingDefaultBranch = exports.getWorkflowEvent = exports.getRelativeScriptPath = exports.isRunningLocalAction = exports.getWorkflowEventName = exports.getActionVersion = exports.getRef = exports.determineMergeBaseCommitOid = exports.getCommitOid = exports.getTemporaryDirectory = exports.getOptionalInput = exports.getRequiredInput = void 0;
|
||||
const fs = __importStar(require("fs"));
|
||||
const path = __importStar(require("path"));
|
||||
const core = __importStar(require("@actions/core"));
|
||||
|
|
@ -275,6 +275,7 @@ function getWorkflowEvent() {
|
|||
throw new Error(`Unable to read workflow event JSON from ${eventJsonFile}: ${e}`);
|
||||
}
|
||||
}
|
||||
exports.getWorkflowEvent = getWorkflowEvent;
|
||||
function removeRefsHeadsPrefix(ref) {
|
||||
return ref.startsWith("refs/heads/") ? ref.slice("refs/heads/".length) : ref;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
16
lib/analyze-action.js
generated
16
lib/analyze-action.js
generated
|
|
@ -48,7 +48,7 @@ const status_report_1 = require("./status-report");
|
|||
const trap_caching_1 = require("./trap-caching");
|
||||
const uploadLib = __importStar(require("./upload-lib"));
|
||||
const util = __importStar(require("./util"));
|
||||
async function sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger) {
|
||||
async function sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, trapCacheCleanup, logger) {
|
||||
const status = (0, status_report_1.getActionsStatus)(error, stats?.analyze_failure_language);
|
||||
const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Analyze, status, startedAt, config, await util.checkDiskUsage(), logger, error?.message, error?.stack);
|
||||
if (statusReportBase !== undefined) {
|
||||
|
|
@ -56,6 +56,7 @@ async function sendStatusReport(startedAt, config, stats, error, trapCacheUpload
|
|||
...statusReportBase,
|
||||
...(stats || {}),
|
||||
...(dbCreationTimings || {}),
|
||||
...(trapCacheCleanup || {}),
|
||||
};
|
||||
if (config && didUploadTrapCaches) {
|
||||
const trapCacheUploadStatusReport = {
|
||||
|
|
@ -141,6 +142,7 @@ async function run() {
|
|||
let uploadResult = undefined;
|
||||
let runStats = undefined;
|
||||
let config = undefined;
|
||||
let trapCacheCleanupTelemetry = undefined;
|
||||
let trapCacheUploadTime = undefined;
|
||||
let dbCreationTimings = undefined;
|
||||
let didUploadTrapCaches = false;
|
||||
|
|
@ -196,6 +198,8 @@ async function run() {
|
|||
const trapCacheUploadStartTime = perf_hooks_1.performance.now();
|
||||
didUploadTrapCaches = await (0, trap_caching_1.uploadTrapCaches)(codeql, config, logger);
|
||||
trapCacheUploadTime = perf_hooks_1.performance.now() - trapCacheUploadStartTime;
|
||||
// Clean up TRAP caches
|
||||
trapCacheCleanupTelemetry = await (0, trap_caching_1.cleanupTrapCaches)(config, features, logger);
|
||||
// We don't upload results in test mode, so don't wait for processing
|
||||
if (util.isInTestMode()) {
|
||||
logger.debug("In test mode. Waiting for processing is disabled.");
|
||||
|
|
@ -218,10 +222,10 @@ async function run() {
|
|||
}
|
||||
if (error instanceof analyze_1.CodeQLAnalysisError) {
|
||||
const stats = { ...error.queriesStatusReport };
|
||||
await sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger);
|
||||
await sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, trapCacheCleanupTelemetry, logger);
|
||||
}
|
||||
else {
|
||||
await sendStatusReport(startedAt, config, undefined, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger);
|
||||
await sendStatusReport(startedAt, config, undefined, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, trapCacheCleanupTelemetry, logger);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -229,13 +233,13 @@ async function run() {
|
|||
await sendStatusReport(startedAt, config, {
|
||||
...runStats,
|
||||
...uploadResult.statusReport,
|
||||
}, undefined, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger);
|
||||
}, undefined, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, trapCacheCleanupTelemetry, logger);
|
||||
}
|
||||
else if (runStats) {
|
||||
await sendStatusReport(startedAt, config, { ...runStats }, undefined, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger);
|
||||
await sendStatusReport(startedAt, config, { ...runStats }, undefined, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, trapCacheCleanupTelemetry, logger);
|
||||
}
|
||||
else {
|
||||
await sendStatusReport(startedAt, config, undefined, undefined, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger);
|
||||
await sendStatusReport(startedAt, config, undefined, undefined, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, trapCacheCleanupTelemetry, logger);
|
||||
}
|
||||
}
|
||||
exports.runPromise = run();
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
24
lib/api-client.js
generated
24
lib/api-client.js
generated
|
|
@ -26,12 +26,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.wrapApiConfigurationError = exports.computeAutomationID = exports.getAutomationID = exports.getAnalysisKey = exports.getWorkflowRelativePath = exports.getGitHubVersion = exports.getGitHubVersionFromApi = exports.getApiClientWithExternalAuth = exports.getApiClient = exports.getApiDetails = exports.DisallowedAPIVersionReason = void 0;
|
||||
exports.wrapApiConfigurationError = exports.deleteActionsCache = exports.listActionsCaches = exports.computeAutomationID = exports.getAutomationID = exports.getAnalysisKey = exports.getWorkflowRelativePath = exports.getGitHubVersion = exports.getGitHubVersionFromApi = exports.getApiClientWithExternalAuth = exports.getApiClient = exports.getApiDetails = exports.DisallowedAPIVersionReason = void 0;
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const githubUtils = __importStar(require("@actions/github/lib/utils"));
|
||||
const retry = __importStar(require("@octokit/plugin-retry"));
|
||||
const console_log_level_1 = __importDefault(require("console-log-level"));
|
||||
const actions_util_1 = require("./actions-util");
|
||||
const repository_1 = require("./repository");
|
||||
const util_1 = require("./util");
|
||||
const GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version";
|
||||
var DisallowedAPIVersionReason;
|
||||
|
|
@ -163,6 +164,27 @@ function computeAutomationID(analysis_key, environment) {
|
|||
return automationID;
|
||||
}
|
||||
exports.computeAutomationID = computeAutomationID;
|
||||
/** List all Actions cache entries matching the provided key and ref. */
|
||||
async function listActionsCaches(key, ref) {
|
||||
const repositoryNwo = (0, repository_1.parseRepositoryNwo)((0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY"));
|
||||
return await getApiClient().paginate("GET /repos/{owner}/{repo}/actions/caches", {
|
||||
owner: repositoryNwo.owner,
|
||||
repo: repositoryNwo.repo,
|
||||
key,
|
||||
ref,
|
||||
});
|
||||
}
|
||||
exports.listActionsCaches = listActionsCaches;
|
||||
/** Delete an Actions cache item by its ID. */
|
||||
async function deleteActionsCache(id) {
|
||||
const repositoryNwo = (0, repository_1.parseRepositoryNwo)((0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY"));
|
||||
await getApiClient().rest.actions.deleteActionsCacheById({
|
||||
owner: repositoryNwo.owner,
|
||||
repo: repositoryNwo.repo,
|
||||
cache_id: id,
|
||||
});
|
||||
}
|
||||
exports.deleteActionsCache = deleteActionsCache;
|
||||
function wrapApiConfigurationError(e) {
|
||||
if ((0, util_1.isHTTPError)(e)) {
|
||||
if (e.message.includes("API rate limit exceeded for site ID installation") ||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"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H,GAAG;KACJ,CACF,CAAC;AACJ,CAAC;AAjBD,8CAiBC;AAED,8CAA8C;AACvC,KAAK,UAAU,kBAAkB,CAAC,EAAU;IACjD,MAAM,aAAa,GAAG,IAAA,+BAAkB,EACtC,IAAA,0BAAmB,EAAC,mBAAmB,CAAC,CACzC,CAAC;IAEF,MAAM,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC;QACvD,KAAK,EAAE,aAAa,CAAC,KAAK;QAC1B,IAAI,EAAE,aAAa,CAAC,IAAI;QACxB,QAAQ,EAAE,EAAE;KACb,CAAC,CAAC;AACL,CAAC;AAVD,gDAUC;AAED,SAAgB,yBAAyB,CAAC,CAAU;IAClD,IAAI,IAAA,kBAAW,EAAC,CAAC,CAAC,EAAE,CAAC;QACnB,IACE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,kDAAkD,CAAC;YACtE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YACtC,uCAAuC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EACvD,CAAC;YACD,OAAO,IAAI,yBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAXD,8DAWC"}
|
||||
27
lib/cli-errors.js
generated
27
lib/cli-errors.js
generated
|
|
@ -117,10 +117,10 @@ function ensureEndsInPeriod(text) {
|
|||
var CliConfigErrorCategory;
|
||||
(function (CliConfigErrorCategory) {
|
||||
CliConfigErrorCategory["ExternalRepositoryCloneFailed"] = "ExternalRepositoryCloneFailed";
|
||||
CliConfigErrorCategory["GracefulOutOfMemory"] = "GracefulOutOfMemory";
|
||||
CliConfigErrorCategory["GradleBuildFailed"] = "GradleBuildFailed";
|
||||
CliConfigErrorCategory["IncompatibleWithActionVersion"] = "IncompatibleWithActionVersion";
|
||||
CliConfigErrorCategory["InitCalledTwice"] = "InitCalledTwice";
|
||||
CliConfigErrorCategory["InvalidConfigFile"] = "InvalidConfigFile";
|
||||
CliConfigErrorCategory["InvalidSourceRoot"] = "InvalidSourceRoot";
|
||||
CliConfigErrorCategory["MavenBuildFailed"] = "MavenBuildFailed";
|
||||
CliConfigErrorCategory["NoBuildCommandAutodetected"] = "NoBuildCommandAutodetected";
|
||||
|
|
@ -128,7 +128,9 @@ var CliConfigErrorCategory;
|
|||
CliConfigErrorCategory["NoSourceCodeSeen"] = "NoSourceCodeSeen";
|
||||
CliConfigErrorCategory["NoSupportedBuildCommandSucceeded"] = "NoSupportedBuildCommandSucceeded";
|
||||
CliConfigErrorCategory["NoSupportedBuildSystemDetected"] = "NoSupportedBuildSystemDetected";
|
||||
CliConfigErrorCategory["OutOfMemoryOrDisk"] = "OutOfMemoryOrDisk";
|
||||
CliConfigErrorCategory["PackCannotBeFound"] = "PackCannotBeFound";
|
||||
CliConfigErrorCategory["PackMissingAuth"] = "PackMissingAuth";
|
||||
CliConfigErrorCategory["SwiftBuildFailed"] = "SwiftBuildFailed";
|
||||
CliConfigErrorCategory["UnsupportedBuildMode"] = "UnsupportedBuildMode";
|
||||
})(CliConfigErrorCategory || (exports.CliConfigErrorCategory = CliConfigErrorCategory = {}));
|
||||
|
|
@ -142,9 +144,6 @@ exports.cliErrorsConfig = {
|
|||
new RegExp("Failed to clone external Git repository"),
|
||||
],
|
||||
},
|
||||
[CliConfigErrorCategory.GracefulOutOfMemory]: {
|
||||
cliErrorMessageCandidates: [new RegExp("CodeQL is out of memory.")],
|
||||
},
|
||||
[CliConfigErrorCategory.GradleBuildFailed]: {
|
||||
cliErrorMessageCandidates: [
|
||||
new RegExp("[autobuild] FAILURE: Build failed with an exception."),
|
||||
|
|
@ -162,6 +161,12 @@ exports.cliErrorsConfig = {
|
|||
],
|
||||
additionalErrorMessageToAppend: `Is the "init" action called twice in the same job?`,
|
||||
},
|
||||
[CliConfigErrorCategory.InvalidConfigFile]: {
|
||||
cliErrorMessageCandidates: [
|
||||
new RegExp("Config file .* is not valid"),
|
||||
new RegExp("The supplied config file is empty"),
|
||||
],
|
||||
},
|
||||
// Expected source location for database creation does not exist
|
||||
[CliConfigErrorCategory.InvalidSourceRoot]: {
|
||||
cliErrorMessageCandidates: [new RegExp("Invalid source root")],
|
||||
|
|
@ -200,11 +205,25 @@ exports.cliErrorsConfig = {
|
|||
new RegExp("No supported build system detected"),
|
||||
],
|
||||
},
|
||||
[CliConfigErrorCategory.OutOfMemoryOrDisk]: {
|
||||
cliErrorMessageCandidates: [
|
||||
new RegExp("CodeQL is out of memory."),
|
||||
new RegExp("out of disk"),
|
||||
new RegExp("No space left on device"),
|
||||
],
|
||||
additionalErrorMessageToAppend: "For more information, see https://gh.io/troubleshooting-code-scanning/out-of-disk-or-memory",
|
||||
},
|
||||
[CliConfigErrorCategory.PackCannotBeFound]: {
|
||||
cliErrorMessageCandidates: [
|
||||
new RegExp("Query pack .* cannot be found\\. Check the spelling of the pack\\."),
|
||||
],
|
||||
},
|
||||
[CliConfigErrorCategory.PackMissingAuth]: {
|
||||
cliErrorMessageCandidates: [
|
||||
new RegExp("GitHub Container registry .* 403 Forbidden"),
|
||||
new RegExp("Do you need to specify a token to authenticate to the registry?"),
|
||||
],
|
||||
},
|
||||
[CliConfigErrorCategory.SwiftBuildFailed]: {
|
||||
cliErrorMessageCandidates: [
|
||||
new RegExp("\\[autobuilder/build\\] \\[build-command-failed\\] `autobuild` failed to run the build command"),
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
6
lib/feature-flags.js
generated
6
lib/feature-flags.js
generated
|
|
@ -50,6 +50,7 @@ exports.CODEQL_VERSION_FINE_GRAINED_PARALLELISM = "2.15.1";
|
|||
var Feature;
|
||||
(function (Feature) {
|
||||
Feature["AutobuildDirectTracing"] = "autobuild_direct_tracing";
|
||||
Feature["CleanupTrapCaches"] = "cleanup_trap_caches";
|
||||
Feature["CppDependencyInstallation"] = "cpp_dependency_installation_enabled";
|
||||
Feature["CppTrapCachingEnabled"] = "cpp_trap_caching_enabled";
|
||||
Feature["DisableJavaBuildlessEnabled"] = "disable_java_buildless_enabled";
|
||||
|
|
@ -64,6 +65,11 @@ exports.featureConfig = {
|
|||
minimumVersion: undefined,
|
||||
toolsFeature: tools_features_1.ToolsFeature.TraceCommandUseBuildMode,
|
||||
},
|
||||
[Feature.CleanupTrapCaches]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",
|
||||
minimumVersion: undefined,
|
||||
},
|
||||
[Feature.CppDependencyInstallation]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
2
lib/status-report.js
generated
2
lib/status-report.js
generated
|
|
@ -133,6 +133,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi
|
|||
if (testingEnvironment !== "") {
|
||||
core.exportVariable(environment_1.EnvVar.TESTING_ENVIRONMENT, testingEnvironment);
|
||||
}
|
||||
const isSteadyStateDefaultSetupRun = process.env["CODE_SCANNING_IS_STEADY_STATE_DEFAULT_SETUP"] === "true";
|
||||
const statusReport = {
|
||||
action_name: actionName,
|
||||
action_oid: "unknown", // TODO decide if it's possible to fill this in
|
||||
|
|
@ -149,6 +150,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi
|
|||
runner_os: runnerOs,
|
||||
started_at: workflowStartedAt,
|
||||
status,
|
||||
steady_state_default_setup: isSteadyStateDefaultSetupRun,
|
||||
testing_environment: testingEnvironment,
|
||||
workflow_name: workflowName,
|
||||
workflow_run_attempt: workflowRunAttempt,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
1
lib/status-report.test.js
generated
1
lib/status-report.test.js
generated
|
|
@ -79,6 +79,7 @@ function setupEnvironmentAndStub(tmpDir) {
|
|||
t.is(statusReport.runner_os, process.env["RUNNER_OS"]);
|
||||
t.is(statusReport.started_at, process.env[environment_1.EnvVar.WORKFLOW_STARTED_AT]);
|
||||
t.is(statusReport.status, "failure");
|
||||
t.is(statusReport.steady_state_default_setup, false);
|
||||
t.is(statusReport.workflow_name, process.env["GITHUB_WORKFLOW"] || "");
|
||||
t.is(statusReport.workflow_run_attempt, 2);
|
||||
t.is(statusReport.workflow_run_id, 100);
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
76
lib/trap-caching.js
generated
76
lib/trap-caching.js
generated
|
|
@ -23,11 +23,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getTotalCacheSize = exports.getLanguagesSupportingCaching = exports.uploadTrapCaches = exports.downloadTrapCaches = void 0;
|
||||
exports.getTotalCacheSize = exports.getLanguagesSupportingCaching = exports.cleanupTrapCaches = exports.uploadTrapCaches = exports.downloadTrapCaches = void 0;
|
||||
const fs = __importStar(require("fs"));
|
||||
const path = __importStar(require("path"));
|
||||
const cache = __importStar(require("@actions/cache"));
|
||||
const actionsCache = __importStar(require("@actions/cache"));
|
||||
const actionsUtil = __importStar(require("./actions-util"));
|
||||
const apiClient = __importStar(require("./api-client"));
|
||||
const feature_flags_1 = require("./feature-flags");
|
||||
const util_1 = require("./util");
|
||||
// This constant should be bumped if we make a breaking change
|
||||
// to how the CodeQL Action stores or retrieves the TRAP cache,
|
||||
|
|
@ -35,6 +37,7 @@ const util_1 = require("./util");
|
|||
// this for CLI/extractor changes, since the CLI version also
|
||||
// goes into the cache key.
|
||||
const CACHE_VERSION = 1;
|
||||
const CODEQL_TRAP_CACHE_PREFIX = "codeql-trap";
|
||||
// This constant sets the minimum size in megabytes of a TRAP
|
||||
// cache for us to consider it worth uploading.
|
||||
const MINIMUM_CACHE_MB_TO_UPLOAD = 10;
|
||||
|
|
@ -81,7 +84,7 @@ async function downloadTrapCaches(codeql, languages, logger) {
|
|||
// The SHA from the base of the PR is the most similar commit we might have a cache for
|
||||
const preferredKey = await cacheKey(codeql, language, baseSha);
|
||||
logger.info(`Looking in Actions cache for TRAP cache with key ${preferredKey}`);
|
||||
const found = await (0, util_1.withTimeout)(MAX_CACHE_OPERATION_MS, cache.restoreCache([cacheDir], preferredKey, [
|
||||
const found = await (0, util_1.withTimeout)(MAX_CACHE_OPERATION_MS, actionsCache.restoreCache([cacheDir], preferredKey, [
|
||||
// Fall back to any cache with the right key prefix
|
||||
await cachePrefix(codeql, language),
|
||||
]), () => {
|
||||
|
|
@ -123,13 +126,76 @@ async function uploadTrapCaches(codeql, config, logger) {
|
|||
}
|
||||
const key = await cacheKey(codeql, language, process.env.GITHUB_SHA || "unknown");
|
||||
logger.info(`Uploading TRAP cache to Actions cache with key ${key}`);
|
||||
await (0, util_1.withTimeout)(MAX_CACHE_OPERATION_MS, cache.saveCache([cacheDir], key), () => {
|
||||
await (0, util_1.withTimeout)(MAX_CACHE_OPERATION_MS, actionsCache.saveCache([cacheDir], key), () => {
|
||||
logger.info(`Timed out waiting for TRAP cache for ${language} to upload, will continue without uploading`);
|
||||
});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
exports.uploadTrapCaches = uploadTrapCaches;
|
||||
async function cleanupTrapCaches(config, features, logger) {
|
||||
if (!(await features.getValue(feature_flags_1.Feature.CleanupTrapCaches))) {
|
||||
return {
|
||||
trap_cache_cleanup_skipped_because: "feature disabled",
|
||||
};
|
||||
}
|
||||
if (!(await actionsUtil.isAnalyzingDefaultBranch())) {
|
||||
return {
|
||||
trap_cache_cleanup_skipped_because: "not analyzing default branch",
|
||||
};
|
||||
}
|
||||
try {
|
||||
let totalBytesCleanedUp = 0;
|
||||
const allCaches = await apiClient.listActionsCaches(CODEQL_TRAP_CACHE_PREFIX, await actionsUtil.getRef());
|
||||
for (const language of config.languages) {
|
||||
if (config.trapCaches[language]) {
|
||||
const cachesToRemove = await getTrapCachesForLanguage(allCaches, language, logger);
|
||||
// Dates returned by the API are in ISO 8601 format, so we can sort them lexicographically
|
||||
cachesToRemove.sort((a, b) => a.created_at.localeCompare(b.created_at));
|
||||
// Keep the most recent cache
|
||||
const mostRecentCache = cachesToRemove.pop();
|
||||
logger.debug(`Keeping most recent TRAP cache (${JSON.stringify(mostRecentCache)})`);
|
||||
if (cachesToRemove.length === 0) {
|
||||
logger.info(`No TRAP caches to clean up for ${language}.`);
|
||||
continue;
|
||||
}
|
||||
for (const cache of cachesToRemove) {
|
||||
logger.debug(`Cleaning up TRAP cache (${JSON.stringify(cache)})`);
|
||||
await apiClient.deleteActionsCache(cache.id);
|
||||
}
|
||||
const bytesCleanedUp = cachesToRemove.reduce((acc, item) => acc + item.size_in_bytes, 0);
|
||||
totalBytesCleanedUp += bytesCleanedUp;
|
||||
const megabytesCleanedUp = (bytesCleanedUp / (1024 * 1024)).toFixed(2);
|
||||
logger.info(`Cleaned up ${megabytesCleanedUp} MiB of old TRAP caches for ${language}.`);
|
||||
}
|
||||
}
|
||||
return { trap_cache_cleanup_size_bytes: totalBytesCleanedUp };
|
||||
}
|
||||
catch (e) {
|
||||
if ((0, util_1.isHTTPError)(e) && e.status === 403) {
|
||||
logger.warning("Could not cleanup TRAP caches as the token did not have the required permissions. " +
|
||||
'To clean up TRAP caches, ensure the token has the "actions:write" permission. ' +
|
||||
"For more information, see https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs");
|
||||
}
|
||||
else {
|
||||
logger.info(`Failed to cleanup TRAP caches, continuing. Details: ${e}`);
|
||||
}
|
||||
return { trap_cache_cleanup_error: (0, util_1.wrapError)(e).message };
|
||||
}
|
||||
}
|
||||
exports.cleanupTrapCaches = cleanupTrapCaches;
|
||||
async function getTrapCachesForLanguage(allCaches, language, logger) {
|
||||
logger.debug(`Listing TRAP caches for ${language}`);
|
||||
for (const cache of allCaches) {
|
||||
if (!cache.created_at || !cache.id || !cache.key || !cache.size_in_bytes) {
|
||||
throw new Error("An unexpected cache item was returned from the API that was missing one or " +
|
||||
`more required fields: ${JSON.stringify(cache)}`);
|
||||
}
|
||||
}
|
||||
return allCaches.filter((cache) => {
|
||||
return cache.key?.includes(`-${language}-`);
|
||||
});
|
||||
}
|
||||
async function getLanguagesSupportingCaching(codeql, languages, logger) {
|
||||
const result = [];
|
||||
const resolveResult = await codeql.betterResolveLanguages();
|
||||
|
|
@ -169,6 +235,6 @@ async function cacheKey(codeql, language, baseSha) {
|
|||
return `${await cachePrefix(codeql, language)}${baseSha}`;
|
||||
}
|
||||
async function cachePrefix(codeql, language) {
|
||||
return `codeql-trap-${CACHE_VERSION}-${(await codeql.getVersion()).version}-${language}-`;
|
||||
return `${CODEQL_TRAP_CACHE_PREFIX}-${CACHE_VERSION}-${(await codeql.getVersion()).version}-${language}-`;
|
||||
}
|
||||
//# sourceMappingURL=trap-caching.js.map
|
||||
File diff suppressed because one or more lines are too long
73
lib/trap-caching.test.js
generated
73
lib/trap-caching.test.js
generated
|
|
@ -32,8 +32,11 @@ const cache = __importStar(require("@actions/cache"));
|
|||
const ava_1 = __importDefault(require("ava"));
|
||||
const sinon = __importStar(require("sinon"));
|
||||
const actionsUtil = __importStar(require("./actions-util"));
|
||||
const apiClient = __importStar(require("./api-client"));
|
||||
const codeql_1 = require("./codeql");
|
||||
const feature_flags_1 = require("./feature-flags");
|
||||
const languages_1 = require("./languages");
|
||||
const logging_1 = require("./logging");
|
||||
const testing_utils_1 = require("./testing-utils");
|
||||
const trap_caching_1 = require("./trap-caching");
|
||||
const util = __importStar(require("./util"));
|
||||
|
|
@ -168,4 +171,74 @@ function getTestConfigWithTempDir(tempDir) {
|
|||
t.assert(fs.existsSync(path.resolve(tmpDir, "trapCaches", "javascript")));
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("cleanup removes only old CodeQL TRAP caches", async (t) => {
|
||||
await util.withTmpDir(async (tmpDir) => {
|
||||
// This config specifies that we are analyzing JavaScript and Ruby, but not Swift.
|
||||
const config = getTestConfigWithTempDir(tmpDir);
|
||||
sinon.stub(actionsUtil, "getRef").resolves("refs/heads/main");
|
||||
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
|
||||
const listStub = sinon.stub(apiClient, "listActionsCaches").resolves([
|
||||
// Should be kept, since it's not relevant to CodeQL. In reality, the API shouldn't return
|
||||
// this in the first place, but this is a defensive check.
|
||||
{
|
||||
id: 1,
|
||||
key: "some-other-key",
|
||||
created_at: "2024-05-23T14:25:00Z",
|
||||
size_in_bytes: 100 * 1024 * 1024,
|
||||
},
|
||||
// Should be kept, since it's the newest TRAP cache for JavaScript
|
||||
{
|
||||
id: 2,
|
||||
key: "codeql-trap-1-2.0.0-javascript-newest",
|
||||
created_at: "2024-04-23T14:25:00Z",
|
||||
size_in_bytes: 50 * 1024 * 1024,
|
||||
},
|
||||
// Should be cleaned up
|
||||
{
|
||||
id: 3,
|
||||
key: "codeql-trap-1-2.0.0-javascript-older",
|
||||
created_at: "2024-03-22T14:25:00Z",
|
||||
size_in_bytes: 200 * 1024 * 1024,
|
||||
},
|
||||
// Should be cleaned up
|
||||
{
|
||||
id: 4,
|
||||
key: "codeql-trap-1-2.0.0-javascript-oldest",
|
||||
created_at: "2024-02-21T14:25:00Z",
|
||||
size_in_bytes: 300 * 1024 * 1024,
|
||||
},
|
||||
// Should be kept, since it's the newest TRAP cache for Ruby
|
||||
{
|
||||
id: 5,
|
||||
key: "codeql-trap-1-2.0.0-ruby-newest",
|
||||
created_at: "2024-02-20T14:25:00Z",
|
||||
size_in_bytes: 300 * 1024 * 1024,
|
||||
},
|
||||
// Should be kept, since we aren't analyzing Swift
|
||||
{
|
||||
id: 6,
|
||||
key: "codeql-trap-1-2.0.0-swift-newest",
|
||||
created_at: "2024-02-22T14:25:00Z",
|
||||
size_in_bytes: 300 * 1024 * 1024,
|
||||
},
|
||||
// Should be kept, since we aren't analyzing Swift
|
||||
{
|
||||
id: 7,
|
||||
key: "codeql-trap-1-2.0.0-swift-older",
|
||||
created_at: "2024-02-21T14:25:00Z",
|
||||
size_in_bytes: 300 * 1024 * 1024,
|
||||
},
|
||||
]);
|
||||
const deleteStub = sinon.stub(apiClient, "deleteActionsCache").resolves();
|
||||
const statusReport = await (0, trap_caching_1.cleanupTrapCaches)(config, (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.CleanupTrapCaches]), (0, logging_1.getRunnerLogger)(true));
|
||||
t.is(listStub.callCount, 1);
|
||||
t.assert(listStub.calledWithExactly("codeql-trap", "refs/heads/main"));
|
||||
t.deepEqual(statusReport, {
|
||||
trap_cache_cleanup_size_bytes: 500 * 1024 * 1024,
|
||||
});
|
||||
t.is(deleteStub.callCount, 2);
|
||||
t.assert(deleteStub.calledWithExactly(3));
|
||||
t.assert(deleteStub.calledWithExactly(4));
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=trap-caching.test.js.map
|
||||
File diff suppressed because one or more lines are too long
200
node_modules/.package-lock.json
generated
vendored
200
node_modules/.package-lock.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "codeql",
|
||||
"version": "3.25.6",
|
||||
"version": "3.25.7",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
|
@ -814,9 +814,9 @@
|
|||
"integrity": "sha512-D3LxMCnkgsb4LO5sDKf6E+yahM2SqpEHmkqMPDSJis5Cy/j2MgWo/g/iq0lECK0mrPWfx3hqKm2ZJlqxwbRJQA=="
|
||||
},
|
||||
"node_modules/@sinonjs/commons": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz",
|
||||
"integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==",
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz",
|
||||
"integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"type-detect": "4.0.8"
|
||||
|
|
@ -954,16 +954,16 @@
|
|||
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA=="
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "7.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.9.0.tgz",
|
||||
"integrity": "sha512-6e+X0X3sFe/G/54aC3jt0txuMTURqLyekmEHViqyA2VnxhLMpvA6nqmcjIy+Cr9tLDHPssA74BP5Mx9HQIxBEA==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.10.0.tgz",
|
||||
"integrity": "sha512-PzCr+a/KAef5ZawX7nbyNwBDtM1HdLIT53aSA2DDlxmxMngZ43O8SIePOeX8H5S+FHXeI6t97mTt/dDdzY4Fyw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.10.0",
|
||||
"@typescript-eslint/scope-manager": "7.9.0",
|
||||
"@typescript-eslint/type-utils": "7.9.0",
|
||||
"@typescript-eslint/utils": "7.9.0",
|
||||
"@typescript-eslint/visitor-keys": "7.9.0",
|
||||
"@typescript-eslint/scope-manager": "7.10.0",
|
||||
"@typescript-eslint/type-utils": "7.10.0",
|
||||
"@typescript-eslint/utils": "7.10.0",
|
||||
"@typescript-eslint/visitor-keys": "7.10.0",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.3.1",
|
||||
"natural-compare": "^1.4.0",
|
||||
|
|
@ -987,15 +987,15 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "7.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.9.0.tgz",
|
||||
"integrity": "sha512-qHMJfkL5qvgQB2aLvhUSXxbK7OLnDkwPzFalg458pxQgfxKDfT1ZDbHQM/I6mDIf/svlMkj21kzKuQ2ixJlatQ==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.10.0.tgz",
|
||||
"integrity": "sha512-2EjZMA0LUW5V5tGQiaa2Gys+nKdfrn2xiTIBLR4fxmPmVSvgPcKNW+AE/ln9k0A4zDUti0J/GZXMDupQoI+e1w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "7.9.0",
|
||||
"@typescript-eslint/types": "7.9.0",
|
||||
"@typescript-eslint/typescript-estree": "7.9.0",
|
||||
"@typescript-eslint/visitor-keys": "7.9.0",
|
||||
"@typescript-eslint/scope-manager": "7.10.0",
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"@typescript-eslint/typescript-estree": "7.10.0",
|
||||
"@typescript-eslint/visitor-keys": "7.10.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
|
|
@ -1015,13 +1015,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "7.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.9.0.tgz",
|
||||
"integrity": "sha512-ZwPK4DeCDxr3GJltRz5iZejPFAAr4Wk3+2WIBaj1L5PYK5RgxExu/Y68FFVclN0y6GGwH8q+KgKRCvaTmFBbgQ==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.10.0.tgz",
|
||||
"integrity": "sha512-7L01/K8W/VGl7noe2mgH0K7BE29Sq6KAbVmxurj8GGaPDZXPr8EEQ2seOeAS+mEV9DnzxBQB6ax6qQQ5C6P4xg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "7.9.0",
|
||||
"@typescript-eslint/visitor-keys": "7.9.0"
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"@typescript-eslint/visitor-keys": "7.10.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || >=20.0.0"
|
||||
|
|
@ -1032,13 +1032,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "7.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.9.0.tgz",
|
||||
"integrity": "sha512-6Qy8dfut0PFrFRAZsGzuLoM4hre4gjzWJB6sUvdunCYZsYemTkzZNwF1rnGea326PHPT3zn5Lmg32M/xfJfByA==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.10.0.tgz",
|
||||
"integrity": "sha512-D7tS4WDkJWrVkuzgm90qYw9RdgBcrWmbbRkrLA4d7Pg3w0ttVGDsvYGV19SH8gPR5L7OtcN5J1hTtyenO9xE9g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/typescript-estree": "7.9.0",
|
||||
"@typescript-eslint/utils": "7.9.0",
|
||||
"@typescript-eslint/typescript-estree": "7.10.0",
|
||||
"@typescript-eslint/utils": "7.10.0",
|
||||
"debug": "^4.3.4",
|
||||
"ts-api-utils": "^1.3.0"
|
||||
},
|
||||
|
|
@ -1059,9 +1059,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "7.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.9.0.tgz",
|
||||
"integrity": "sha512-oZQD9HEWQanl9UfsbGVcZ2cGaR0YT5476xfWE0oE5kQa2sNK2frxOlkeacLOTh9po4AlUT5rtkGyYM5kew0z5w==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.10.0.tgz",
|
||||
"integrity": "sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^18.18.0 || >=20.0.0"
|
||||
|
|
@ -1072,13 +1072,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "7.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.9.0.tgz",
|
||||
"integrity": "sha512-zBCMCkrb2YjpKV3LA0ZJubtKCDxLttxfdGmwZvTqqWevUPN0FZvSI26FalGFFUZU/9YQK/A4xcQF9o/VVaCKAg==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.10.0.tgz",
|
||||
"integrity": "sha512-LXFnQJjL9XIcxeVfqmNj60YhatpRLt6UhdlFwAkjNc6jSUlK8zQOl1oktAP8PlWFzPQC1jny/8Bai3/HPuvN5g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "7.9.0",
|
||||
"@typescript-eslint/visitor-keys": "7.9.0",
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"@typescript-eslint/visitor-keys": "7.10.0",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
|
|
@ -1124,15 +1124,15 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "7.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.9.0.tgz",
|
||||
"integrity": "sha512-5KVRQCzZajmT4Ep+NEgjXCvjuypVvYHUW7RHlXzNPuak2oWpVoD1jf5xCP0dPAuNIchjC7uQyvbdaSTFaLqSdA==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.10.0.tgz",
|
||||
"integrity": "sha512-olzif1Fuo8R8m/qKkzJqT7qwy16CzPRWBvERS0uvyc+DHd8AKbO4Jb7kpAvVzMmZm8TrHnI7hvjN4I05zow+tg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.4.0",
|
||||
"@typescript-eslint/scope-manager": "7.9.0",
|
||||
"@typescript-eslint/types": "7.9.0",
|
||||
"@typescript-eslint/typescript-estree": "7.9.0"
|
||||
"@typescript-eslint/scope-manager": "7.10.0",
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"@typescript-eslint/typescript-estree": "7.10.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || >=20.0.0"
|
||||
|
|
@ -1146,12 +1146,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "7.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.9.0.tgz",
|
||||
"integrity": "sha512-iESPx2TNLDNGQLyjKhUvIKprlP49XNEK+MvIf9nIO7ZZaZdbnfWKHnXAgufpxqfA0YryH8XToi4+CjBgVnFTSQ==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.10.0.tgz",
|
||||
"integrity": "sha512-9ntIVgsi6gg6FIq9xjEO4VQJvwOqA3jaBFQJ/6TK5AvEup2+cECI6Fh7QiBxmfMHXU0V0J4RyPeOU1VDNzl9cg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "7.9.0",
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"eslint-visitor-keys": "^3.4.3"
|
||||
},
|
||||
"engines": {
|
||||
|
|
@ -1678,10 +1678,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/braces": {
|
||||
"version": "3.0.2",
|
||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||
"dependencies": {
|
||||
"fill-range": "^7.0.1"
|
||||
"fill-range": "^7.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
|
|
@ -2301,9 +2302,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/diff": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz",
|
||||
"integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==",
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz",
|
||||
"integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.3.1"
|
||||
|
|
@ -3269,8 +3270,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
"version": "7.0.1",
|
||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||
"dependencies": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
},
|
||||
|
|
@ -3944,6 +3946,7 @@
|
|||
},
|
||||
"node_modules/is-number": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||
"engines": {
|
||||
"node": ">=0.12.0"
|
||||
|
|
@ -4165,12 +4168,6 @@
|
|||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/isexe": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||
|
|
@ -4247,9 +4244,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/just-extend": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz",
|
||||
"integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==",
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/just-extend/-/just-extend-6.2.0.tgz",
|
||||
"integrity": "sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/language-subtag-registry": {
|
||||
|
|
@ -4429,11 +4426,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/micromatch": {
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
|
||||
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
|
||||
"version": "4.0.7",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz",
|
||||
"integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==",
|
||||
"dependencies": {
|
||||
"braces": "^3.0.2",
|
||||
"braces": "^3.0.3",
|
||||
"picomatch": "^2.3.1"
|
||||
},
|
||||
"engines": {
|
||||
|
|
@ -4502,43 +4499,16 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/nise": {
|
||||
"version": "5.1.5",
|
||||
"resolved": "https://registry.npmjs.org/nise/-/nise-5.1.5.tgz",
|
||||
"integrity": "sha512-VJuPIfUFaXNRzETTQEEItTOP8Y171ijr+JLq42wHes3DiryR8vT+1TXQW/Rx8JNUhyYYWyIvjXTU6dOhJcs9Nw==",
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/nise/-/nise-6.0.0.tgz",
|
||||
"integrity": "sha512-K8ePqo9BFvN31HXwEtTNGzgrPpmvgciDsFz8aztFjt4LqKO/JeFD8tBOeuDiCMXrIl/m1YvfH8auSpxfaD09wg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@sinonjs/commons": "^2.0.0",
|
||||
"@sinonjs/fake-timers": "^10.0.2",
|
||||
"@sinonjs/text-encoding": "^0.7.1",
|
||||
"just-extend": "^4.0.2",
|
||||
"path-to-regexp": "^1.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/nise/node_modules/@sinonjs/commons": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz",
|
||||
"integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"type-detect": "4.0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/nise/node_modules/@sinonjs/fake-timers": {
|
||||
"version": "10.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz",
|
||||
"integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@sinonjs/commons": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz",
|
||||
"integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"type-detect": "4.0.8"
|
||||
"@sinonjs/commons": "^3.0.0",
|
||||
"@sinonjs/fake-timers": "^11.2.2",
|
||||
"@sinonjs/text-encoding": "^0.7.2",
|
||||
"just-extend": "^6.2.0",
|
||||
"path-to-regexp": "^6.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/nock": {
|
||||
|
|
@ -4939,13 +4909,10 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"isarray": "0.0.1"
|
||||
}
|
||||
"version": "6.2.2",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.2.tgz",
|
||||
"integrity": "sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/path-type": {
|
||||
"version": "4.0.0",
|
||||
|
|
@ -5496,17 +5463,17 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/sinon": {
|
||||
"version": "17.0.1",
|
||||
"resolved": "https://registry.npmjs.org/sinon/-/sinon-17.0.1.tgz",
|
||||
"integrity": "sha512-wmwE19Lie0MLT+ZYNpDymasPHUKTaZHUH/pKEubRXIzySv9Atnlw+BUMGCzWgV7b7wO+Hw6f1TEOr0IUnmU8/g==",
|
||||
"version": "18.0.0",
|
||||
"resolved": "https://registry.npmjs.org/sinon/-/sinon-18.0.0.tgz",
|
||||
"integrity": "sha512-+dXDXzD1sBO6HlmZDd7mXZCR/y5ECiEiGCBSGuFD/kZ0bDTofPYc6JaeGmPSF+1j1MejGUWkORbYOLDyvqCWpA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@sinonjs/commons": "^3.0.0",
|
||||
"@sinonjs/commons": "^3.0.1",
|
||||
"@sinonjs/fake-timers": "^11.2.2",
|
||||
"@sinonjs/samsam": "^8.0.0",
|
||||
"diff": "^5.1.0",
|
||||
"nise": "^5.1.5",
|
||||
"supports-color": "^7.2.0"
|
||||
"diff": "^5.2.0",
|
||||
"nise": "^6.0.0",
|
||||
"supports-color": "^7"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
|
@ -5889,6 +5856,7 @@
|
|||
},
|
||||
"node_modules/to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||
"dependencies": {
|
||||
"is-number": "^7.0.0"
|
||||
|
|
|
|||
2
node_modules/@sinonjs/commons/lib/called-in-order.js
generated
vendored
2
node_modules/@sinonjs/commons/lib/called-in-order.js
generated
vendored
|
|
@ -33,7 +33,6 @@ function checkAdjacentCalls(callMap, spy, index, spies) {
|
|||
|
||||
/**
|
||||
* A Sinon proxy object (fake, spy, stub)
|
||||
*
|
||||
* @typedef {object} SinonProxy
|
||||
* @property {Function} calledBefore - A method that determines if this proxy was called before another one
|
||||
* @property {string} id - Some id
|
||||
|
|
@ -42,7 +41,6 @@ function checkAdjacentCalls(callMap, spy, index, spies) {
|
|||
|
||||
/**
|
||||
* Returns true when the spies have been called in the order they were supplied in
|
||||
*
|
||||
* @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments
|
||||
* @returns {boolean} true when spies are called in order, false otherwise
|
||||
*/
|
||||
|
|
|
|||
18
node_modules/@sinonjs/commons/lib/class-name.js
generated
vendored
18
node_modules/@sinonjs/commons/lib/class-name.js
generated
vendored
|
|
@ -1,27 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
var functionName = require("./function-name");
|
||||
|
||||
/**
|
||||
* Returns a display name for a value from a constructor
|
||||
*
|
||||
* @param {object} value A value to examine
|
||||
* @returns {(string|null)} A string or null
|
||||
*/
|
||||
function className(value) {
|
||||
return (
|
||||
(value.constructor && value.constructor.name) ||
|
||||
// The next branch is for IE11 support only:
|
||||
// Because the name property is not set on the prototype
|
||||
// of the Function object, we finally try to grab the
|
||||
// name from its definition. This will never be reached
|
||||
// in node, so we are not able to test this properly.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
|
||||
(typeof value.constructor === "function" &&
|
||||
/* istanbul ignore next */
|
||||
functionName(value.constructor)) ||
|
||||
null
|
||||
);
|
||||
const name = value.constructor && value.constructor.name;
|
||||
return name || null;
|
||||
}
|
||||
|
||||
module.exports = className;
|
||||
|
|
|
|||
3
node_modules/@sinonjs/commons/lib/deprecated.js
generated
vendored
3
node_modules/@sinonjs/commons/lib/deprecated.js
generated
vendored
|
|
@ -4,7 +4,6 @@
|
|||
/**
|
||||
* Returns a function that will invoke the supplied function and print a
|
||||
* deprecation warning to the console each time it is called.
|
||||
*
|
||||
* @param {Function} func
|
||||
* @param {string} msg
|
||||
* @returns {Function}
|
||||
|
|
@ -23,7 +22,6 @@ exports.wrap = function (func, msg) {
|
|||
/**
|
||||
* Returns a string which can be supplied to `wrap()` to notify the user that a
|
||||
* particular part of the sinon API has been deprecated.
|
||||
*
|
||||
* @param {string} packageName
|
||||
* @param {string} funcName
|
||||
* @returns {string}
|
||||
|
|
@ -34,7 +32,6 @@ exports.defaultMsg = function (packageName, funcName) {
|
|||
|
||||
/**
|
||||
* Prints a warning on the console, when it exists
|
||||
*
|
||||
* @param {string} msg
|
||||
* @returns {undefined}
|
||||
*/
|
||||
|
|
|
|||
1
node_modules/@sinonjs/commons/lib/every.js
generated
vendored
1
node_modules/@sinonjs/commons/lib/every.js
generated
vendored
|
|
@ -3,7 +3,6 @@
|
|||
/**
|
||||
* Returns true when fn returns true for all members of obj.
|
||||
* This is an every implementation that works for all iterables
|
||||
*
|
||||
* @param {object} obj
|
||||
* @param {Function} fn
|
||||
* @returns {boolean}
|
||||
|
|
|
|||
1
node_modules/@sinonjs/commons/lib/function-name.js
generated
vendored
1
node_modules/@sinonjs/commons/lib/function-name.js
generated
vendored
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
/**
|
||||
* Returns a display name for a function
|
||||
*
|
||||
* @param {Function} func
|
||||
* @returns {string}
|
||||
*/
|
||||
|
|
|
|||
1
node_modules/@sinonjs/commons/lib/global.js
generated
vendored
1
node_modules/@sinonjs/commons/lib/global.js
generated
vendored
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
/**
|
||||
* A reference to the global object
|
||||
*
|
||||
* @type {object} globalObject
|
||||
*/
|
||||
var globalObject;
|
||||
|
|
|
|||
2
node_modules/@sinonjs/commons/lib/order-by-first-call.js
generated
vendored
2
node_modules/@sinonjs/commons/lib/order-by-first-call.js
generated
vendored
|
|
@ -18,14 +18,12 @@ function comparator(a, b) {
|
|||
|
||||
/**
|
||||
* A Sinon proxy object (fake, spy, stub)
|
||||
*
|
||||
* @typedef {object} SinonProxy
|
||||
* @property {Function} getCall - A method that can return the first call
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sorts an array of SinonProxy instances (fake, spy, stub) by their first call
|
||||
*
|
||||
* @param {SinonProxy[] | SinonProxy} spies
|
||||
* @returns {SinonProxy[]}
|
||||
*/
|
||||
|
|
|
|||
2
node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js
generated
vendored
2
node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js
generated
vendored
|
|
@ -3,11 +3,9 @@
|
|||
/**
|
||||
* Is true when the environment causes an error to be thrown for accessing the
|
||||
* __proto__ property.
|
||||
*
|
||||
* This is necessary in order to support `node --disable-proto=throw`.
|
||||
*
|
||||
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
let throwsOnProto;
|
||||
|
|
|
|||
1
node_modules/@sinonjs/commons/lib/type-of.js
generated
vendored
1
node_modules/@sinonjs/commons/lib/type-of.js
generated
vendored
|
|
@ -4,7 +4,6 @@ var type = require("type-detect");
|
|||
|
||||
/**
|
||||
* Returns the lower-case result of running type from type-detect on the value
|
||||
*
|
||||
* @param {*} value
|
||||
* @returns {string}
|
||||
*/
|
||||
|
|
|
|||
1
node_modules/@sinonjs/commons/lib/value-to-string.js
generated
vendored
1
node_modules/@sinonjs/commons/lib/value-to-string.js
generated
vendored
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
/**
|
||||
* Returns a string representation of the value
|
||||
*
|
||||
* @param {*} value
|
||||
* @returns {string}
|
||||
*/
|
||||
|
|
|
|||
2
node_modules/@sinonjs/commons/package.json
generated
vendored
2
node_modules/@sinonjs/commons/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@sinonjs/commons",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"description": "Simple functions shared among the sinon end user libraries",
|
||||
"main": "lib/index.js",
|
||||
"types": "./types/index.d.ts",
|
||||
|
|
|
|||
2
node_modules/@sinonjs/commons/types/called-in-order.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/called-in-order.d.ts
generated
vendored
|
|
@ -1,7 +1,6 @@
|
|||
export = calledInOrder;
|
||||
/**
|
||||
* A Sinon proxy object (fake, spy, stub)
|
||||
*
|
||||
* @typedef {object} SinonProxy
|
||||
* @property {Function} calledBefore - A method that determines if this proxy was called before another one
|
||||
* @property {string} id - Some id
|
||||
|
|
@ -9,7 +8,6 @@ export = calledInOrder;
|
|||
*/
|
||||
/**
|
||||
* Returns true when the spies have been called in the order they were supplied in
|
||||
*
|
||||
* @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments
|
||||
* @returns {boolean} true when spies are called in order, false otherwise
|
||||
*/
|
||||
|
|
|
|||
1
node_modules/@sinonjs/commons/types/class-name.d.ts
generated
vendored
1
node_modules/@sinonjs/commons/types/class-name.d.ts
generated
vendored
|
|
@ -1,7 +1,6 @@
|
|||
export = className;
|
||||
/**
|
||||
* Returns a display name for a value from a constructor
|
||||
*
|
||||
* @param {object} value A value to examine
|
||||
* @returns {(string|null)} A string or null
|
||||
*/
|
||||
|
|
|
|||
1
node_modules/@sinonjs/commons/types/global.d.ts
generated
vendored
1
node_modules/@sinonjs/commons/types/global.d.ts
generated
vendored
|
|
@ -1,7 +1,6 @@
|
|||
export = globalObject;
|
||||
/**
|
||||
* A reference to the global object
|
||||
*
|
||||
* @type {object} globalObject
|
||||
*/
|
||||
declare var globalObject: object;
|
||||
|
|
|
|||
2
node_modules/@sinonjs/commons/types/order-by-first-call.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/order-by-first-call.d.ts
generated
vendored
|
|
@ -1,13 +1,11 @@
|
|||
export = orderByFirstCall;
|
||||
/**
|
||||
* A Sinon proxy object (fake, spy, stub)
|
||||
*
|
||||
* @typedef {object} SinonProxy
|
||||
* @property {Function} getCall - A method that can return the first call
|
||||
*/
|
||||
/**
|
||||
* Sorts an array of SinonProxy instances (fake, spy, stub) by their first call
|
||||
*
|
||||
* @param {SinonProxy[] | SinonProxy} spies
|
||||
* @returns {SinonProxy[]}
|
||||
*/
|
||||
|
|
|
|||
2
node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts
generated
vendored
|
|
@ -2,11 +2,9 @@ export = throwsOnProto;
|
|||
/**
|
||||
* Is true when the environment causes an error to be thrown for accessing the
|
||||
* __proto__ property.
|
||||
*
|
||||
* This is necessary in order to support `node --disable-proto=throw`.
|
||||
*
|
||||
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
declare let throwsOnProto: boolean;
|
||||
|
|
|
|||
1
node_modules/@sinonjs/commons/types/value-to-string.d.ts
generated
vendored
1
node_modules/@sinonjs/commons/types/value-to-string.d.ts
generated
vendored
|
|
@ -1,7 +1,6 @@
|
|||
export = valueToString;
|
||||
/**
|
||||
* Returns a string representation of the value
|
||||
*
|
||||
* @param {*} value
|
||||
* @returns {string}
|
||||
*/
|
||||
|
|
|
|||
20
node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js
generated
vendored
20
node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js
generated
vendored
|
|
@ -78,15 +78,22 @@ exports.default = (0, util_1.createRule)({
|
|||
}
|
||||
return result;
|
||||
}
|
||||
function isLikelyToContainGlobalFlag(node) {
|
||||
if (node.type === utils_1.AST_NODE_TYPES.CallExpression ||
|
||||
node.type === utils_1.AST_NODE_TYPES.NewExpression) {
|
||||
/**
|
||||
* Returns true if and only if we have syntactic proof that the /g flag is
|
||||
* absent. Returns false in all other cases (i.e. it still might or might
|
||||
* not contain the global flag).
|
||||
*/
|
||||
function definitelyDoesNotContainGlobalFlag(node) {
|
||||
if ((node.type === utils_1.AST_NODE_TYPES.CallExpression ||
|
||||
node.type === utils_1.AST_NODE_TYPES.NewExpression) &&
|
||||
node.callee.type === utils_1.AST_NODE_TYPES.Identifier &&
|
||||
node.callee.name === 'RegExp') {
|
||||
const flags = node.arguments.at(1);
|
||||
return !!(flags?.type === utils_1.AST_NODE_TYPES.Literal &&
|
||||
return !(flags?.type === utils_1.AST_NODE_TYPES.Literal &&
|
||||
typeof flags.value === 'string' &&
|
||||
flags.value.includes('g'));
|
||||
}
|
||||
return node.type === utils_1.AST_NODE_TYPES.Identifier;
|
||||
return false;
|
||||
}
|
||||
return {
|
||||
"CallExpression[arguments.length=1] > MemberExpression.callee[property.name='match'][computed=false]"(memberNode) {
|
||||
|
|
@ -98,7 +105,8 @@ exports.default = (0, util_1.createRule)({
|
|||
return;
|
||||
}
|
||||
// Don't report regular expressions with global flag.
|
||||
if ((!argumentValue && isLikelyToContainGlobalFlag(argumentNode)) ||
|
||||
if ((!argumentValue &&
|
||||
!definitelyDoesNotContainGlobalFlag(argumentNode)) ||
|
||||
(argumentValue &&
|
||||
argumentValue.value instanceof RegExp &&
|
||||
argumentValue.value.flags.includes('g'))) {
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"prefer-regexp-exec.js","sourceRoot":"","sources":["../../src/rules/prefer-regexp-exec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,oDAA0D;AAC1D,sDAAwC;AAGxC,kCAMiB;AAEjB,IAAK,YAKJ;AALD,WAAK,YAAY;IACf,iDAAS,CAAA;IACT,mDAAe,CAAA;IACf,mDAAe,CAAA;IACf,+CAAsB,CAAA;AACxB,CAAC,EALI,YAAY,KAAZ,YAAY,QAKhB;AAED,kBAAe,IAAA,iBAAU,EAAC;IACxB,IAAI,EAAE,oBAAoB;IAC1B,cAAc,EAAE,EAAE;IAElB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,MAAM;QACf,IAAI,EAAE;YACJ,WAAW,EACT,yEAAyE;YAC3E,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,yBAAyB,EAAE,yCAAyC;SACrE;QACD,MAAM,EAAE,EAAE;KACX;IAED,MAAM,CAAC,OAAO;QACZ,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,IAAA,wBAAiB,EAAC,OAAO,CAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QAElD;;;WAGG;QACH,SAAS,YAAY,CAAC,IAAa;YACjC,OAAO,IAAA,kBAAW,EAAC,OAAO,EAAE,IAAI,CAAC,KAAK,QAAQ,CAAC;QACjD,CAAC;QAED;;;WAGG;QACH,SAAS,YAAY,CAAC,IAAa;YAC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L,KAAK,YAAY,CAAC,MAAM;wBACtB,OAAO,OAAO,CAAC,MAAM,CAAC;4BACpB,IAAI,EAAE,UAAU,CAAC,QAAQ;4BACzB,SAAS,EAAE,2BAA2B;4BACtC,GAAG,EAAE,IAAA,uBAAgB,EAAC;gCACpB,UAAU,EAAE,OAAO,CAAC,UAAU;gCAC9B,IAAI,EAAE,QAAQ;gCACd,SAAS,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC;gCACrC,IAAI,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,EAAE,CACjC,UAAU,YAAY,UAAU,UAAU,GAAG;6BAChD,CAAC;yBACH,CAAC,CAAC;gBACP,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
||||
19
node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.js
generated
vendored
19
node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.js
generated
vendored
|
|
@ -81,6 +81,15 @@ function getGroup(node) {
|
|||
throw new Error(`Unexpected Type ${node.type}`);
|
||||
}
|
||||
}
|
||||
function caseSensitiveSort(a, b) {
|
||||
if (a < b) {
|
||||
return -1;
|
||||
}
|
||||
else if (a > b) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
exports.default = (0, util_1.createRule)({
|
||||
name: 'sort-type-constituents',
|
||||
meta: {
|
||||
|
|
@ -108,6 +117,10 @@ exports.default = (0, util_1.createRule)({
|
|||
description: 'Whether to check union types.',
|
||||
type: 'boolean',
|
||||
},
|
||||
caseSensitive: {
|
||||
description: 'Whether to sort using case sensitive sorting.',
|
||||
type: 'boolean',
|
||||
},
|
||||
groupOrder: {
|
||||
description: 'Ordering of the groups.',
|
||||
type: 'array',
|
||||
|
|
@ -124,6 +137,7 @@ exports.default = (0, util_1.createRule)({
|
|||
{
|
||||
checkIntersections: true,
|
||||
checkUnions: true,
|
||||
caseSensitive: false,
|
||||
groupOrder: [
|
||||
Group.named,
|
||||
Group.keyword,
|
||||
|
|
@ -140,7 +154,7 @@ exports.default = (0, util_1.createRule)({
|
|||
],
|
||||
},
|
||||
],
|
||||
create(context, [{ checkIntersections, checkUnions, groupOrder }]) {
|
||||
create(context, [{ checkIntersections, checkUnions, caseSensitive, groupOrder }]) {
|
||||
const collator = new Intl.Collator('en', {
|
||||
sensitivity: 'base',
|
||||
numeric: true,
|
||||
|
|
@ -158,6 +172,9 @@ exports.default = (0, util_1.createRule)({
|
|||
if (a.group !== b.group) {
|
||||
return a.group - b.group;
|
||||
}
|
||||
if (caseSensitive) {
|
||||
return caseSensitiveSort(a.text, b.text);
|
||||
}
|
||||
return (collator.compare(a.text, b.text) ||
|
||||
(a.text < b.text ? -1 : a.text > b.text ? 1 : 0));
|
||||
});
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.mdx
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.mdx
generated
vendored
|
|
@ -100,7 +100,7 @@ With this option set to `true`, and if you are using `no-void`, you should turn
|
|||
|
||||
### `ignoreIIFE`
|
||||
|
||||
This allows you to skip checking of async IIFEs (Immediately Invoked function Expressions).
|
||||
This allows you to skip checking of async IIFEs (Immediately Invoked Function Expressions).
|
||||
|
||||
Examples of **correct** code for this rule with `{ ignoreIIFE: true }`:
|
||||
|
||||
|
|
|
|||
23
node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-constituents.mdx
generated
vendored
23
node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-constituents.mdx
generated
vendored
|
|
@ -97,6 +97,29 @@ type T4 =
|
|||
|
||||
## Options
|
||||
|
||||
### `caseSensitive`
|
||||
|
||||
Whether to sort using case sensitive string comparisons.
|
||||
|
||||
Examples of code with `{ "caseSensitive": true }`:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="❌ Incorrect">
|
||||
|
||||
```ts option='{ "caseSensitive": true }'
|
||||
type T = 'DeletedAt' | 'DeleteForever';
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="✅ Correct">
|
||||
|
||||
```ts option='{ "caseSensitive": true }'
|
||||
type T = 'DeleteForever' | 'DeletedAt';
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### `checkIntersections`
|
||||
|
||||
Whether to check intersection types (`&`).
|
||||
|
|
|
|||
14
node_modules/@typescript-eslint/eslint-plugin/package.json
generated
vendored
14
node_modules/@typescript-eslint/eslint-plugin/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/eslint-plugin",
|
||||
"version": "7.9.0",
|
||||
"version": "7.10.0",
|
||||
"description": "TypeScript plugin for ESLint",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -62,10 +62,10 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.10.0",
|
||||
"@typescript-eslint/scope-manager": "7.9.0",
|
||||
"@typescript-eslint/type-utils": "7.9.0",
|
||||
"@typescript-eslint/utils": "7.9.0",
|
||||
"@typescript-eslint/visitor-keys": "7.9.0",
|
||||
"@typescript-eslint/scope-manager": "7.10.0",
|
||||
"@typescript-eslint/type-utils": "7.10.0",
|
||||
"@typescript-eslint/utils": "7.10.0",
|
||||
"@typescript-eslint/visitor-keys": "7.10.0",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.3.1",
|
||||
"natural-compare": "^1.4.0",
|
||||
|
|
@ -76,8 +76,8 @@
|
|||
"@types/marked": "^5.0.2",
|
||||
"@types/mdast": "^4.0.3",
|
||||
"@types/natural-compare": "*",
|
||||
"@typescript-eslint/rule-schema-to-typescript-types": "7.9.0",
|
||||
"@typescript-eslint/rule-tester": "7.9.0",
|
||||
"@typescript-eslint/rule-schema-to-typescript-types": "7.10.0",
|
||||
"@typescript-eslint/rule-tester": "7.10.0",
|
||||
"ajv": "^6.12.6",
|
||||
"cross-env": "^7.0.3",
|
||||
"cross-fetch": "*",
|
||||
|
|
|
|||
10
node_modules/@typescript-eslint/parser/package.json
generated
vendored
10
node_modules/@typescript-eslint/parser/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/parser",
|
||||
"version": "7.9.0",
|
||||
"version": "7.10.0",
|
||||
"description": "An ESLint custom parser which leverages TypeScript ESTree",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -52,10 +52,10 @@
|
|||
"eslint": "^8.56.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "7.9.0",
|
||||
"@typescript-eslint/types": "7.9.0",
|
||||
"@typescript-eslint/typescript-estree": "7.9.0",
|
||||
"@typescript-eslint/visitor-keys": "7.9.0",
|
||||
"@typescript-eslint/scope-manager": "7.10.0",
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"@typescript-eslint/typescript-estree": "7.10.0",
|
||||
"@typescript-eslint/visitor-keys": "7.10.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
8
node_modules/@typescript-eslint/scope-manager/package.json
generated
vendored
8
node_modules/@typescript-eslint/scope-manager/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/scope-manager",
|
||||
"version": "7.9.0",
|
||||
"version": "7.10.0",
|
||||
"description": "TypeScript scope analyser for ESLint",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -46,13 +46,13 @@
|
|||
"typecheck": "npx nx typecheck"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "7.9.0",
|
||||
"@typescript-eslint/visitor-keys": "7.9.0"
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"@typescript-eslint/visitor-keys": "7.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/types": "29.6.3",
|
||||
"@types/glob": "*",
|
||||
"@typescript-eslint/typescript-estree": "7.9.0",
|
||||
"@typescript-eslint/typescript-estree": "7.10.0",
|
||||
"glob": "*",
|
||||
"jest-specific-snapshot": "*",
|
||||
"make-dir": "*",
|
||||
|
|
|
|||
8
node_modules/@typescript-eslint/type-utils/package.json
generated
vendored
8
node_modules/@typescript-eslint/type-utils/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/type-utils",
|
||||
"version": "7.9.0",
|
||||
"version": "7.10.0",
|
||||
"description": "Type utilities for working with TypeScript + ESLint together",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -46,14 +46,14 @@
|
|||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/typescript-estree": "7.9.0",
|
||||
"@typescript-eslint/utils": "7.9.0",
|
||||
"@typescript-eslint/typescript-estree": "7.10.0",
|
||||
"@typescript-eslint/utils": "7.10.0",
|
||||
"debug": "^4.3.4",
|
||||
"ts-api-utils": "^1.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/types": "29.6.3",
|
||||
"@typescript-eslint/parser": "7.9.0",
|
||||
"@typescript-eslint/parser": "7.10.0",
|
||||
"ajv": "^6.12.6",
|
||||
"downlevel-dts": "*",
|
||||
"jest": "29.7.0",
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/types/package.json
generated
vendored
2
node_modules/@typescript-eslint/types/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/types",
|
||||
"version": "7.9.0",
|
||||
"version": "7.10.0",
|
||||
"description": "Types for the TypeScript-ESTree AST spec",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"useProgramFromProjectService.d.ts","sourceRoot":"","sources":["../src/useProgramFromProjectService.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAM5D,wBAAgB,4BAA4B,CAC1C,EACE,2BAA2B,EAC3B,mCAAmC,EACnC,OAAO,GACR,EAAE,sBAAsB,EACzB,aAAa,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EAC7C,sBAAsB,EAAE,OAAO,EAC/B,0BAA0B,EAAE,GAAG,CAAC,MAAM,CAAC,GACtC,qBAAqB,GAAG,SAAS,CAqFnC"}
|
||||
{"version":3,"file":"useProgramFromProjectService.d.ts","sourceRoot":"","sources":["../src/useProgramFromProjectService.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAM5D,wBAAgB,4BAA4B,CAC1C,EACE,2BAA2B,EAC3B,mCAAmC,EACnC,OAAO,GACR,EAAE,sBAAsB,EACzB,aAAa,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EAC7C,sBAAsB,EAAE,OAAO,EAC/B,0BAA0B,EAAE,GAAG,CAAC,MAAM,CAAC,GACtC,qBAAqB,GAAG,SAAS,CAuFnC"}
|
||||
|
|
@ -43,7 +43,9 @@ function useProgramFromProjectService({ allowDefaultProjectForFiles, maximumDefa
|
|||
log('Could not find project service program for: %s', filePathAbsolute);
|
||||
return undefined;
|
||||
}
|
||||
defaultProjectMatchedFiles.add(filePathAbsolute);
|
||||
if (!opened.configFileName) {
|
||||
defaultProjectMatchedFiles.add(filePathAbsolute);
|
||||
}
|
||||
if (defaultProjectMatchedFiles.size > maximumDefaultProjectFileMatchCount) {
|
||||
throw new Error(`Too many files (>${maximumDefaultProjectFileMatchCount}) have matched the default project.${validateDefaultProjectForFilesGlob_1.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION}
|
||||
Matching files:
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"useProgramFromProjectService.js","sourceRoot":"","sources":["../src/useProgramFromProjectService.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,yCAAsC;AACtC,gDAAwB;AAExB,gFAA6E;AAG7E,4GAA8G;AAG9G,MAAM,GAAG,GAAG,IAAA,eAAK,EACf,kEAAkE,CACnE,CAAC;AAEF,SAAgB,4BAA4B,CAC1C,EACE,2BAA2B,EAC3B,mCAAmC,EACnC,OAAO,GACgB,EACzB,aAA6C,EAC7C,sBAA+B,EAC/B,0BAAuC;IAEvC,iFAAiF;IACjF,yEAAyE;IACzE,MAAM,gBAAgB,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC5D,GAAG,CACD,0DAA0D,EAC1D,aAAa,CAAC,QAAQ,EACtB,gBAAgB,CACjB,CAAC;IAEF,MAAM,MAAM,GAAG,OAAO,CAAC,cAAc,CACnC,gBAAgB,EAChB,aAAa,CAAC,YAAY;IAC1B,gBAAgB,CAAC,SAAS,EAC1B,aAAa,CAAC,eAAe,CAC9B,CAAC;IAEF,GAAG,CAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC;IAE/C,IAAI,sBAAsB,EAAE,CAAC;QAC3B,GAAG,CACD,+EAA+E,EAC/E,2BAA2B,CAC5B,CAAC;QACF,MAAM,2BAA2B,GAAG,iBAAiB,CACnD,aAAa,CAAC,QAAQ,EACtB,2BAA2B,CAC5B,CAAC;QAEF,GAAG,CACD,4DAA4D,EAC5D,2BAA2B,EAC3B,MAAM,CAAC,cAAc,CACtB,CAAC;QAEF,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;YAC1B,IAAI,2BAA2B,EAAE,CAAC;gBAChC,MAAM,IAAI,KAAK,CACb,GAAG,aAAa,CAAC,QAAQ,gJAAgJ,CAC1K,CAAC;YACJ,CAAC;QACH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BAAmB,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC;AA9FD,oEA8FC;AAED,SAAS,iBAAiB,CACxB,QAAgB,EAChB,2BAAiD;IAEjD,OAAO,CAAC,CAAC,2BAA2B,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CACnD,IAAA,qBAAS,EAAC,QAAQ,EAAE,OAAO,CAAC,CAC7B,CAAC;AACJ,CAAC"}
|
||||
{"version":3,"file":"useProgramFromProjectService.js","sourceRoot":"","sources":["../src/useProgramFromProjectService.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,yCAAsC;AACtC,gDAAwB;AAExB,gFAA6E;AAG7E,4GAA8G;AAG9G,MAAM,GAAG,GAAG,IAAA,eAAK,EACf,kEAAkE,CACnE,CAAC;AAEF,SAAgB,4BAA4B,CAC1C,EACE,2BAA2B,EAC3B,mCAAmC,EACnC,OAAO,GACgB,EACzB,aAA6C,EAC7C,sBAA+B,EAC/B,0BAAuC;IAEvC,iFAAiF;IACjF,yEAAyE;IACzE,MAAM,gBAAgB,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC5D,GAAG,CACD,0DAA0D,EAC1D,aAAa,CAAC,QAAQ,EACtB,gBAAgB,CACjB,CAAC;IAEF,MAAM,MAAM,GAAG,OAAO,CAAC,cAAc,CACnC,gBAAgB,EAChB,aAAa,CAAC,YAAY;IAC1B,gBAAgB,CAAC,SAAS,EAC1B,aAAa,CAAC,eAAe,CAC9B,CAAC;IAEF,GAAG,CAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC;IAE/C,IAAI,sBAAsB,EAAE,CAAC;QAC3B,GAAG,CACD,+EAA+E,EAC/E,2BAA2B,CAC5B,CAAC;QACF,MAAM,2BAA2B,GAAG,iBAAiB,CACnD,aAAa,CAAC,QAAQ,EACtB,2BAA2B,CAC5B,CAAC;QAEF,GAAG,CACD,4DAA4D,EAC5D,2BAA2B,EAC3B,MAAM,CAAC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AE/D,OAAO,IAAA,2CAAoB,EAAC,aAAa,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEtD,SAAS,UAAU,CAAC,QAAgB;QAClC,OAAO,cAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC9B,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC;AAhGD,oEAgGC;AAED,SAAS,iBAAiB,CACxB,QAAgB,EAChB,2BAAiD;IAEjD,OAAO,CAAC,CAAC,2BAA2B,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CACnD,IAAA,qBAAS,EAAC,QAAQ,EAAE,OAAO,CAAC,CAC7B,CAAC;AACJ,CAAC"}
|
||||
6
node_modules/@typescript-eslint/typescript-estree/package.json
generated
vendored
6
node_modules/@typescript-eslint/typescript-estree/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/typescript-estree",
|
||||
"version": "7.9.0",
|
||||
"version": "7.10.0",
|
||||
"description": "A parser that converts TypeScript source code into an ESTree compatible form",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -54,8 +54,8 @@
|
|||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "7.9.0",
|
||||
"@typescript-eslint/visitor-keys": "7.9.0",
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"@typescript-eslint/visitor-keys": "7.10.0",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
|
|
|
|||
5
node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.d.ts
generated
vendored
5
node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.d.ts
generated
vendored
|
|
@ -213,7 +213,6 @@ export declare namespace FlatConfig {
|
|||
*/
|
||||
sourceType?: SourceType;
|
||||
}
|
||||
type FileSpec = string | ((filePath: string) => boolean);
|
||||
interface Config {
|
||||
/**
|
||||
* An string to identify the configuration object. Used in error messages and inspection tools.
|
||||
|
|
@ -223,12 +222,12 @@ export declare namespace FlatConfig {
|
|||
* An array of glob patterns indicating the files that the configuration object should apply to.
|
||||
* If not specified, the configuration object applies to all files matched by any other configuration object.
|
||||
*/
|
||||
files?: (FileSpec | FileSpec[])[];
|
||||
files?: (string | string[])[];
|
||||
/**
|
||||
* An array of glob patterns indicating the files that the configuration object should not apply to.
|
||||
* If not specified, the configuration object applies to all files matched by files.
|
||||
*/
|
||||
ignores?: FileSpec[];
|
||||
ignores?: string[];
|
||||
/**
|
||||
* An object containing settings related to how JavaScript is configured for linting.
|
||||
*/
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.d.ts.map
generated
vendored
2
node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.d.ts.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,KAAK,kBAAkB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAE/E,gBAAgB;AAChB,yBAAiB,YAAY,CAAC;IAC5B,KAAY,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,KAAY,cAAc,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IACtD,KAAY,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;IAElD,KAAY,mBAAmB,GAAG,CAAC,SAAS,EAAE,GAAG,OA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C;QAClB;;;;WAIG;QACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B;;;WAGG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC;QACd;;WAEG;QACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACrB;IACD,KAAY,WAAW,GAAG,MAAM,EAAE,CAAC;IACnC,KAAY,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACjD,KAAY,UAAU,GAAG,WAAW,GAAG,aAAa,CAAC;CACtD"}
|
||||
8
node_modules/@typescript-eslint/utils/package.json
generated
vendored
8
node_modules/@typescript-eslint/utils/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/utils",
|
||||
"version": "7.9.0",
|
||||
"version": "7.10.0",
|
||||
"description": "Utilities for working with TypeScript + ESLint together",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -68,9 +68,9 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.4.0",
|
||||
"@typescript-eslint/scope-manager": "7.9.0",
|
||||
"@typescript-eslint/types": "7.9.0",
|
||||
"@typescript-eslint/typescript-estree": "7.9.0"
|
||||
"@typescript-eslint/scope-manager": "7.10.0",
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"@typescript-eslint/typescript-estree": "7.10.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^8.56.0"
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/visitor-keys/package.json
generated
vendored
4
node_modules/@typescript-eslint/visitor-keys/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/visitor-keys",
|
||||
"version": "7.9.0",
|
||||
"version": "7.10.0",
|
||||
"description": "Visitor keys used to help traverse the TypeScript-ESTree AST",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "7.9.0",
|
||||
"@typescript-eslint/types": "7.10.0",
|
||||
"eslint-visitor-keys": "^3.4.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
184
node_modules/braces/CHANGELOG.md
generated
vendored
184
node_modules/braces/CHANGELOG.md
generated
vendored
|
|
@ -1,184 +0,0 @@
|
|||
# Release history
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
<details>
|
||||
<summary><strong>Guiding Principles</strong></summary>
|
||||
|
||||
- Changelogs are for humans, not machines.
|
||||
- There should be an entry for every single version.
|
||||
- The same types of changes should be grouped.
|
||||
- Versions and sections should be linkable.
|
||||
- The latest version comes first.
|
||||
- The release date of each versions is displayed.
|
||||
- Mention whether you follow Semantic Versioning.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Types of changes</strong></summary>
|
||||
|
||||
Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_):
|
||||
|
||||
- `Added` for new features.
|
||||
- `Changed` for changes in existing functionality.
|
||||
- `Deprecated` for soon-to-be removed features.
|
||||
- `Removed` for now removed features.
|
||||
- `Fixed` for any bug fixes.
|
||||
- `Security` in case of vulnerabilities.
|
||||
|
||||
</details>
|
||||
|
||||
## [3.0.0] - 2018-04-08
|
||||
|
||||
v3.0 is a complete refactor, resulting in a faster, smaller codebase, with fewer deps, and a more accurate parser and compiler.
|
||||
|
||||
**Breaking Changes**
|
||||
|
||||
- The undocumented `.makeRe` method was removed
|
||||
|
||||
**Non-breaking changes**
|
||||
|
||||
- Caching was removed
|
||||
|
||||
## [2.3.2] - 2018-04-08
|
||||
|
||||
- start refactoring
|
||||
- cover sets
|
||||
- better range handling
|
||||
|
||||
## [2.3.1] - 2018-02-17
|
||||
|
||||
- Remove unnecessary escape in Regex. (#14)
|
||||
|
||||
## [2.3.0] - 2017-10-19
|
||||
|
||||
- minor code reorganization
|
||||
- optimize regex
|
||||
- expose `maxLength` option
|
||||
|
||||
## [2.2.1] - 2017-05-30
|
||||
|
||||
- don't condense when braces contain extglobs
|
||||
|
||||
## [2.2.0] - 2017-05-28
|
||||
|
||||
- ensure word boundaries are preserved
|
||||
- fixes edge case where extglob characters precede a brace pattern
|
||||
|
||||
## [2.1.1] - 2017-04-27
|
||||
|
||||
- use snapdragon-node
|
||||
- handle edge case
|
||||
- optimizations, lint
|
||||
|
||||
## [2.0.4] - 2017-04-11
|
||||
|
||||
- pass opts to compiler
|
||||
- minor optimization in create method
|
||||
- re-write parser handlers to remove negation regex
|
||||
|
||||
## [2.0.3] - 2016-12-10
|
||||
|
||||
- use split-string
|
||||
- clear queue at the end
|
||||
- adds sequences example
|
||||
- add unit tests
|
||||
|
||||
## [2.0.2] - 2016-10-21
|
||||
|
||||
- fix comma handling in nested extglobs
|
||||
|
||||
## [2.0.1] - 2016-10-20
|
||||
|
||||
- add comments
|
||||
- more tests, ensure quotes are stripped
|
||||
|
||||
## [2.0.0] - 2016-10-19
|
||||
|
||||
- don't expand braces inside character classes
|
||||
- add quantifier pattern
|
||||
|
||||
## [1.8.5] - 2016-05-21
|
||||
|
||||
- Refactor (#10)
|
||||
|
||||
## [1.8.4] - 2016-04-20
|
||||
|
||||
- fixes https://github.com/jonschlinkert/micromatch/issues/66
|
||||
|
||||
## [1.8.0] - 2015-03-18
|
||||
|
||||
- adds exponent examples, tests
|
||||
- fixes the first example in https://github.com/jonschlinkert/micromatch/issues/38
|
||||
|
||||
## [1.6.0] - 2015-01-30
|
||||
|
||||
- optimizations, `bash` mode:
|
||||
- improve path escaping
|
||||
|
||||
## [1.5.0] - 2015-01-28
|
||||
|
||||
- Merge pull request #5 from eush77/lib-files
|
||||
|
||||
## [1.4.0] - 2015-01-24
|
||||
|
||||
- add extglob tests
|
||||
- externalize exponent function
|
||||
- better whitespace handling
|
||||
|
||||
## [1.3.0] - 2015-01-24
|
||||
|
||||
- make regex patterns explicity
|
||||
|
||||
## [1.1.0] - 2015-01-11
|
||||
|
||||
- don't create a match group with `makeRe`
|
||||
|
||||
## [1.0.0] - 2014-12-23
|
||||
|
||||
- Merge commit '97b05f5544f8348736a8efaecf5c32bbe3e2ad6e'
|
||||
- support empty brace syntax
|
||||
- better bash coverage
|
||||
- better support for regex strings
|
||||
|
||||
## [0.1.4] - 2014-11-14
|
||||
|
||||
- improve recognition of bad args, recognize mismatched argument types
|
||||
- support escaping
|
||||
- remove pathname-expansion
|
||||
- support whitespace in patterns
|
||||
|
||||
## [0.1.0]
|
||||
|
||||
- first commit
|
||||
|
||||
[2.3.2]: https://github.com/micromatch/braces/compare/2.3.1...2.3.2
|
||||
[2.3.1]: https://github.com/micromatch/braces/compare/2.3.0...2.3.1
|
||||
[2.3.0]: https://github.com/micromatch/braces/compare/2.2.1...2.3.0
|
||||
[2.2.1]: https://github.com/micromatch/braces/compare/2.2.0...2.2.1
|
||||
[2.2.0]: https://github.com/micromatch/braces/compare/2.1.1...2.2.0
|
||||
[2.1.1]: https://github.com/micromatch/braces/compare/2.1.0...2.1.1
|
||||
[2.1.0]: https://github.com/micromatch/braces/compare/2.0.4...2.1.0
|
||||
[2.0.4]: https://github.com/micromatch/braces/compare/2.0.3...2.0.4
|
||||
[2.0.3]: https://github.com/micromatch/braces/compare/2.0.2...2.0.3
|
||||
[2.0.2]: https://github.com/micromatch/braces/compare/2.0.1...2.0.2
|
||||
[2.0.1]: https://github.com/micromatch/braces/compare/2.0.0...2.0.1
|
||||
[2.0.0]: https://github.com/micromatch/braces/compare/1.8.5...2.0.0
|
||||
[1.8.5]: https://github.com/micromatch/braces/compare/1.8.4...1.8.5
|
||||
[1.8.4]: https://github.com/micromatch/braces/compare/1.8.0...1.8.4
|
||||
[1.8.0]: https://github.com/micromatch/braces/compare/1.6.0...1.8.0
|
||||
[1.6.0]: https://github.com/micromatch/braces/compare/1.5.0...1.6.0
|
||||
[1.5.0]: https://github.com/micromatch/braces/compare/1.4.0...1.5.0
|
||||
[1.4.0]: https://github.com/micromatch/braces/compare/1.3.0...1.4.0
|
||||
[1.3.0]: https://github.com/micromatch/braces/compare/1.2.0...1.3.0
|
||||
[1.2.0]: https://github.com/micromatch/braces/compare/1.1.0...1.2.0
|
||||
[1.1.0]: https://github.com/micromatch/braces/compare/1.0.0...1.1.0
|
||||
[1.0.0]: https://github.com/micromatch/braces/compare/0.1.4...1.0.0
|
||||
[0.1.4]: https://github.com/micromatch/braces/compare/0.1.0...0.1.4
|
||||
|
||||
[Unreleased]: https://github.com/micromatch/braces/compare/0.1.0...HEAD
|
||||
[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog
|
||||
2
node_modules/braces/LICENSE
generated
vendored
2
node_modules/braces/LICENSE
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2018, Jon Schlinkert.
|
||||
Copyright (c) 2014-present, Jon Schlinkert.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
|||
189
node_modules/braces/README.md
generated
vendored
189
node_modules/braces/README.md
generated
vendored
|
|
@ -20,15 +20,15 @@ See the [changelog](CHANGELOG.md) for details.
|
|||
|
||||
Brace patterns make globs more powerful by adding the ability to match specific ranges and sequences of characters.
|
||||
|
||||
* **Accurate** - complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests)
|
||||
* **[fast and performant](#benchmarks)** - Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity.
|
||||
* **Organized code base** - The parser and compiler are easy to maintain and update when edge cases crop up.
|
||||
* **Well-tested** - Thousands of test assertions, and passes all of the Bash, minimatch, and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests (as of the date this was written).
|
||||
* **Safer** - You shouldn't have to worry about users defining aggressive or malicious brace patterns that can break your application. Braces takes measures to prevent malicious regex that can be used for DDoS attacks (see [catastrophic backtracking](https://www.regular-expressions.info/catastrophic.html)).
|
||||
* [Supports lists](#lists) - (aka "sets") `a/{b,c}/d` => `['a/b/d', 'a/c/d']`
|
||||
* [Supports sequences](#sequences) - (aka "ranges") `{01..03}` => `['01', '02', '03']`
|
||||
* [Supports steps](#steps) - (aka "increments") `{2..10..2}` => `['2', '4', '6', '8', '10']`
|
||||
* [Supports escaping](#escaping) - To prevent evaluation of special characters.
|
||||
- **Accurate** - complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests)
|
||||
- **[fast and performant](#benchmarks)** - Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity.
|
||||
- **Organized code base** - The parser and compiler are easy to maintain and update when edge cases crop up.
|
||||
- **Well-tested** - Thousands of test assertions, and passes all of the Bash, minimatch, and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests (as of the date this was written).
|
||||
- **Safer** - You shouldn't have to worry about users defining aggressive or malicious brace patterns that can break your application. Braces takes measures to prevent malicious regex that can be used for DDoS attacks (see [catastrophic backtracking](https://www.regular-expressions.info/catastrophic.html)).
|
||||
- [Supports lists](#lists) - (aka "sets") `a/{b,c}/d` => `['a/b/d', 'a/c/d']`
|
||||
- [Supports sequences](#sequences) - (aka "ranges") `{01..03}` => `['01', '02', '03']`
|
||||
- [Supports steps](#steps) - (aka "increments") `{2..10..2}` => `['2', '4', '6', '8', '10']`
|
||||
- [Supports escaping](#escaping) - To prevent evaluation of special characters.
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
@ -52,9 +52,9 @@ By default, brace patterns are compiled into strings that are optimized for crea
|
|||
**Compiled**
|
||||
|
||||
```js
|
||||
console.log(braces('a/{x,y,z}/b'));
|
||||
console.log(braces('a/{x,y,z}/b'));
|
||||
//=> ['a/(x|y|z)/b']
|
||||
console.log(braces(['a/{01..20}/b', 'a/{1..5}/b']));
|
||||
console.log(braces(['a/{01..20}/b', 'a/{1..5}/b']));
|
||||
//=> [ 'a/(0[1-9]|1[0-9]|20)/b', 'a/([1-5])/b' ]
|
||||
```
|
||||
|
||||
|
|
@ -87,13 +87,13 @@ console.log(braces.expand('a/{foo,bar,baz}/*.js'));
|
|||
Expand ranges of characters (like Bash "sequences"):
|
||||
|
||||
```js
|
||||
console.log(braces.expand('{1..3}')); // ['1', '2', '3']
|
||||
console.log(braces.expand('a/{1..3}/b')); // ['a/1/b', 'a/2/b', 'a/3/b']
|
||||
console.log(braces('{a..c}', { expand: true })); // ['a', 'b', 'c']
|
||||
console.log(braces.expand('{1..3}')); // ['1', '2', '3']
|
||||
console.log(braces.expand('a/{1..3}/b')); // ['a/1/b', 'a/2/b', 'a/3/b']
|
||||
console.log(braces('{a..c}', { expand: true })); // ['a', 'b', 'c']
|
||||
console.log(braces('foo/{a..c}', { expand: true })); // ['foo/a', 'foo/b', 'foo/c']
|
||||
|
||||
// supports zero-padded ranges
|
||||
console.log(braces('a/{01..03}/b')); //=> ['a/(0[1-3])/b']
|
||||
console.log(braces('a/{01..03}/b')); //=> ['a/(0[1-3])/b']
|
||||
console.log(braces('a/{001..300}/b')); //=> ['a/(0{2}[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)/b']
|
||||
```
|
||||
|
||||
|
|
@ -178,12 +178,12 @@ console.log(braces.expand('a{b}c'));
|
|||
|
||||
**Type**: `Number`
|
||||
|
||||
**Default**: `65,536`
|
||||
**Default**: `10,000`
|
||||
|
||||
**Description**: Limit the length of the input string. Useful when the input string is generated or your application allows users to pass a string, et cetera.
|
||||
|
||||
```js
|
||||
console.log(braces('a/{b,c}/d', { maxLength: 3 })); //=> throws an error
|
||||
console.log(braces('a/{b,c}/d', { maxLength: 3 })); //=> throws an error
|
||||
```
|
||||
|
||||
### options.expand
|
||||
|
|
@ -244,7 +244,7 @@ const alpha = braces.expand('x/{a..e}/y', {
|
|||
transform(value, index) {
|
||||
// When non-numeric values are passed, "value" is a character code.
|
||||
return 'foo/' + String.fromCharCode(value) + '-' + index;
|
||||
}
|
||||
},
|
||||
});
|
||||
console.log(alpha);
|
||||
//=> [ 'x/foo/a-0/y', 'x/foo/b-1/y', 'x/foo/c-2/y', 'x/foo/d-3/y', 'x/foo/e-4/y' ]
|
||||
|
|
@ -257,9 +257,9 @@ const numeric = braces.expand('{1..5}', {
|
|||
transform(value) {
|
||||
// when numeric values are passed, "value" is a number
|
||||
return 'foo/' + value * 2;
|
||||
}
|
||||
},
|
||||
});
|
||||
console.log(numeric);
|
||||
console.log(numeric);
|
||||
//=> [ 'foo/2', 'foo/4', 'foo/6', 'foo/8', 'foo/10' ]
|
||||
```
|
||||
|
||||
|
|
@ -281,19 +281,19 @@ The `quantifiers` option tells braces to detect when [regex quantifiers](https:/
|
|||
const braces = require('braces');
|
||||
console.log(braces('a/b{1,3}/{x,y,z}'));
|
||||
//=> [ 'a/b(1|3)/(x|y|z)' ]
|
||||
console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true}));
|
||||
console.log(braces('a/b{1,3}/{x,y,z}', { quantifiers: true }));
|
||||
//=> [ 'a/b{1,3}/(x|y|z)' ]
|
||||
console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true, expand: true}));
|
||||
console.log(braces('a/b{1,3}/{x,y,z}', { quantifiers: true, expand: true }));
|
||||
//=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ]
|
||||
```
|
||||
|
||||
### options.unescape
|
||||
### options.keepEscaping
|
||||
|
||||
**Type**: `Boolean`
|
||||
|
||||
**Default**: `undefined`
|
||||
|
||||
**Description**: Strip backslashes that were used for escaping from the result.
|
||||
**Description**: Do not strip backslashes that were used for escaping from the result.
|
||||
|
||||
## What is "brace expansion"?
|
||||
|
||||
|
|
@ -301,8 +301,8 @@ Brace expansion is a type of parameter expansion that was made popular by unix s
|
|||
|
||||
In addition to "expansion", braces are also used for matching. In other words:
|
||||
|
||||
* [brace expansion](#brace-expansion) is for generating new lists
|
||||
* [brace matching](#brace-matching) is for filtering existing lists
|
||||
- [brace expansion](#brace-expansion) is for generating new lists
|
||||
- [brace matching](#brace-matching) is for filtering existing lists
|
||||
|
||||
<details>
|
||||
<summary><strong>More about brace expansion</strong> (click to expand)</summary>
|
||||
|
|
@ -382,9 +382,9 @@ Although brace patterns offer a user-friendly way of matching ranges or sets of
|
|||
|
||||
**"brace bombs"**
|
||||
|
||||
* brace expansion can eat up a huge amount of processing resources
|
||||
* as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially
|
||||
* users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!)
|
||||
- brace expansion can eat up a huge amount of processing resources
|
||||
- as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially
|
||||
- users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!)
|
||||
|
||||
For a more detailed explanation with examples, see the [geometric complexity](#geometric-complexity) section.
|
||||
|
||||
|
|
@ -406,8 +406,8 @@ For example, the following sets demonstrate quadratic (`O(n^2)`) complexity:
|
|||
But add an element to a set, and we get a n-fold Cartesian product with `O(n^c)` complexity:
|
||||
|
||||
```
|
||||
{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248
|
||||
249 257 258 259 267 268 269 347 348 349 357
|
||||
{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248
|
||||
249 257 258 259 267 268 269 347 348 349 357
|
||||
358 359 367 368 369
|
||||
```
|
||||
|
||||
|
|
@ -424,9 +424,9 @@ Although these examples are clearly contrived, they demonstrate how brace patter
|
|||
|
||||
Interested in learning more about brace expansion?
|
||||
|
||||
* [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion)
|
||||
* [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion)
|
||||
* [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product)
|
||||
- [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion)
|
||||
- [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion)
|
||||
- [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product)
|
||||
|
||||
</details>
|
||||
|
||||
|
|
@ -444,25 +444,25 @@ Instead, convert the pattern into an optimized regular expression. This is easie
|
|||
|
||||
Minimatch gets exponentially slower as patterns increase in complexity, braces does not. The following results were generated using `braces()` and `minimatch.braceExpand()`, respectively.
|
||||
|
||||
| **Pattern** | **braces** | **[minimatch][]** |
|
||||
| --- | --- | --- |
|
||||
| `{1..9007199254740991}`[^1] | `298 B` (5ms 459μs)| N/A (freezes) |
|
||||
| `{1..1000000000000000}` | `41 B` (1ms 15μs) | N/A (freezes) |
|
||||
| `{1..100000000000000}` | `40 B` (890μs) | N/A (freezes) |
|
||||
| `{1..10000000000000}` | `39 B` (2ms 49μs) | N/A (freezes) |
|
||||
| `{1..1000000000000}` | `38 B` (608μs) | N/A (freezes) |
|
||||
| `{1..100000000000}` | `37 B` (397μs) | N/A (freezes) |
|
||||
| `{1..10000000000}` | `35 B` (983μs) | N/A (freezes) |
|
||||
| `{1..1000000000}` | `34 B` (798μs) | N/A (freezes) |
|
||||
| `{1..100000000}` | `33 B` (733μs) | N/A (freezes) |
|
||||
| `{1..10000000}` | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) |
|
||||
| `{1..1000000}` | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs) |
|
||||
| `{1..100000}` | `30 B` (950μs) | `588.89 kB` (146ms 921μs) |
|
||||
| `{1..10000}` | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs) |
|
||||
| `{1..1000}` | `28 B` (760μs) | `3.89 kB` (1ms 453μs) |
|
||||
| `{1..100}` | `22 B` (345μs) | `291 B` (196μs) |
|
||||
| `{1..10}` | `10 B` (533μs) | `20 B` (37μs) |
|
||||
| `{1..3}` | `7 B` (190μs) | `5 B` (27μs) |
|
||||
| **Pattern** | **braces** | **[minimatch][]** |
|
||||
| --------------------------- | ------------------- | ---------------------------- |
|
||||
| `{1..9007199254740991}`[^1] | `298 B` (5ms 459μs) | N/A (freezes) |
|
||||
| `{1..1000000000000000}` | `41 B` (1ms 15μs) | N/A (freezes) |
|
||||
| `{1..100000000000000}` | `40 B` (890μs) | N/A (freezes) |
|
||||
| `{1..10000000000000}` | `39 B` (2ms 49μs) | N/A (freezes) |
|
||||
| `{1..1000000000000}` | `38 B` (608μs) | N/A (freezes) |
|
||||
| `{1..100000000000}` | `37 B` (397μs) | N/A (freezes) |
|
||||
| `{1..10000000000}` | `35 B` (983μs) | N/A (freezes) |
|
||||
| `{1..1000000000}` | `34 B` (798μs) | N/A (freezes) |
|
||||
| `{1..100000000}` | `33 B` (733μs) | N/A (freezes) |
|
||||
| `{1..10000000}` | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) |
|
||||
| `{1..1000000}` | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs) |
|
||||
| `{1..100000}` | `30 B` (950μs) | `588.89 kB` (146ms 921μs) |
|
||||
| `{1..10000}` | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs) |
|
||||
| `{1..1000}` | `28 B` (760μs) | `3.89 kB` (1ms 453μs) |
|
||||
| `{1..100}` | `22 B` (345μs) | `291 B` (196μs) |
|
||||
| `{1..10}` | `10 B` (533μs) | `20 B` (37μs) |
|
||||
| `{1..3}` | `7 B` (190μs) | `5 B` (27μs) |
|
||||
|
||||
### Faster algorithms
|
||||
|
||||
|
|
@ -471,7 +471,7 @@ When you need expansion, braces is still much faster.
|
|||
_(the following results were generated using `braces.expand()` and `minimatch.braceExpand()`, respectively)_
|
||||
|
||||
| **Pattern** | **braces** | **[minimatch][]** |
|
||||
| --- | --- | --- |
|
||||
| --------------- | --------------------------- | ---------------------------- |
|
||||
| `{1..10000000}` | `78.89 MB` (2s 698ms 642μs) | `78.89 MB` (18s 601ms 974μs) |
|
||||
| `{1..1000000}` | `6.89 MB` (458ms 576μs) | `6.89 MB` (1s 491ms 621μs) |
|
||||
| `{1..100000}` | `588.89 kB` (20ms 728μs) | `588.89 kB` (156ms 919μs) |
|
||||
|
|
@ -498,37 +498,30 @@ npm i -d && npm benchmark
|
|||
Braces is more accurate, without sacrificing performance.
|
||||
|
||||
```bash
|
||||
# range (expanded)
|
||||
braces x 29,040 ops/sec ±3.69% (91 runs sampled))
|
||||
minimatch x 4,735 ops/sec ±1.28% (90 runs sampled)
|
||||
|
||||
# range (optimized for regex)
|
||||
braces x 382,878 ops/sec ±0.56% (94 runs sampled)
|
||||
minimatch x 1,040 ops/sec ±0.44% (93 runs sampled)
|
||||
|
||||
# nested ranges (expanded)
|
||||
braces x 19,744 ops/sec ±2.27% (92 runs sampled))
|
||||
minimatch x 4,579 ops/sec ±0.50% (93 runs sampled)
|
||||
|
||||
# nested ranges (optimized for regex)
|
||||
braces x 246,019 ops/sec ±2.02% (93 runs sampled)
|
||||
minimatch x 1,028 ops/sec ±0.39% (94 runs sampled)
|
||||
|
||||
# set (expanded)
|
||||
braces x 138,641 ops/sec ±0.53% (95 runs sampled)
|
||||
minimatch x 219,582 ops/sec ±0.98% (94 runs sampled)
|
||||
|
||||
# set (optimized for regex)
|
||||
braces x 388,408 ops/sec ±0.41% (95 runs sampled)
|
||||
minimatch x 44,724 ops/sec ±0.91% (89 runs sampled)
|
||||
|
||||
# nested sets (expanded)
|
||||
braces x 84,966 ops/sec ±0.48% (94 runs sampled)
|
||||
minimatch x 140,720 ops/sec ±0.37% (95 runs sampled)
|
||||
|
||||
# nested sets (optimized for regex)
|
||||
braces x 263,340 ops/sec ±2.06% (92 runs sampled)
|
||||
minimatch x 28,714 ops/sec ±0.40% (90 runs sampled)
|
||||
● expand - range (expanded)
|
||||
braces x 53,167 ops/sec ±0.12% (102 runs sampled)
|
||||
minimatch x 11,378 ops/sec ±0.10% (102 runs sampled)
|
||||
● expand - range (optimized for regex)
|
||||
braces x 373,442 ops/sec ±0.04% (100 runs sampled)
|
||||
minimatch x 3,262 ops/sec ±0.18% (100 runs sampled)
|
||||
● expand - nested ranges (expanded)
|
||||
braces x 33,921 ops/sec ±0.09% (99 runs sampled)
|
||||
minimatch x 10,855 ops/sec ±0.28% (100 runs sampled)
|
||||
● expand - nested ranges (optimized for regex)
|
||||
braces x 287,479 ops/sec ±0.52% (98 runs sampled)
|
||||
minimatch x 3,219 ops/sec ±0.28% (101 runs sampled)
|
||||
● expand - set (expanded)
|
||||
braces x 238,243 ops/sec ±0.19% (97 runs sampled)
|
||||
minimatch x 538,268 ops/sec ±0.31% (96 runs sampled)
|
||||
● expand - set (optimized for regex)
|
||||
braces x 321,844 ops/sec ±0.10% (97 runs sampled)
|
||||
minimatch x 140,600 ops/sec ±0.15% (100 runs sampled)
|
||||
● expand - nested sets (expanded)
|
||||
braces x 165,371 ops/sec ±0.42% (96 runs sampled)
|
||||
minimatch x 337,720 ops/sec ±0.28% (100 runs sampled)
|
||||
● expand - nested sets (optimized for regex)
|
||||
braces x 242,948 ops/sec ±0.12% (99 runs sampled)
|
||||
minimatch x 87,403 ops/sec ±0.79% (96 runs sampled)
|
||||
```
|
||||
|
||||
## About
|
||||
|
|
@ -566,28 +559,28 @@ $ npm install -g verbose/verb#dev verb-generate-readme && verb
|
|||
|
||||
### Contributors
|
||||
|
||||
| **Commits** | **Contributor** |
|
||||
| --- | --- |
|
||||
| 197 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 4 | [doowb](https://github.com/doowb) |
|
||||
| 1 | [es128](https://github.com/es128) |
|
||||
| 1 | [eush77](https://github.com/eush77) |
|
||||
| 1 | [hemanth](https://github.com/hemanth) |
|
||||
| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
|
||||
| **Commits** | **Contributor** |
|
||||
| ----------- | ------------------------------------------------------------- |
|
||||
| 197 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 4 | [doowb](https://github.com/doowb) |
|
||||
| 1 | [es128](https://github.com/es128) |
|
||||
| 1 | [eush77](https://github.com/eush77) |
|
||||
| 1 | [hemanth](https://github.com/hemanth) |
|
||||
| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [GitHub Profile](https://github.com/jonschlinkert)
|
||||
* [Twitter Profile](https://twitter.com/jonschlinkert)
|
||||
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
|
||||
- [GitHub Profile](https://github.com/jonschlinkert)
|
||||
- [Twitter Profile](https://twitter.com/jonschlinkert)
|
||||
- [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
***
|
||||
---
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._
|
||||
|
|
|
|||
6
node_modules/braces/index.js
generated
vendored
6
node_modules/braces/index.js
generated
vendored
|
|
@ -23,8 +23,8 @@ const braces = (input, options = {}) => {
|
|||
let output = [];
|
||||
|
||||
if (Array.isArray(input)) {
|
||||
for (let pattern of input) {
|
||||
let result = braces.create(pattern, options);
|
||||
for (const pattern of input) {
|
||||
const result = braces.create(pattern, options);
|
||||
if (Array.isArray(result)) {
|
||||
output.push(...result);
|
||||
} else {
|
||||
|
|
@ -158,7 +158,7 @@ braces.create = (input, options = {}) => {
|
|||
return [input];
|
||||
}
|
||||
|
||||
return options.expand !== true
|
||||
return options.expand !== true
|
||||
? braces.compile(input, options)
|
||||
: braces.expand(input, options);
|
||||
};
|
||||
|
|
|
|||
25
node_modules/braces/lib/compile.js
generated
vendored
25
node_modules/braces/lib/compile.js
generated
vendored
|
|
@ -4,30 +4,32 @@ const fill = require('fill-range');
|
|||
const utils = require('./utils');
|
||||
|
||||
const compile = (ast, options = {}) => {
|
||||
let walk = (node, parent = {}) => {
|
||||
let invalidBlock = utils.isInvalidBrace(parent);
|
||||
let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
||||
let invalid = invalidBlock === true || invalidNode === true;
|
||||
let prefix = options.escapeInvalid === true ? '\\' : '';
|
||||
const walk = (node, parent = {}) => {
|
||||
const invalidBlock = utils.isInvalidBrace(parent);
|
||||
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
||||
const invalid = invalidBlock === true || invalidNode === true;
|
||||
const prefix = options.escapeInvalid === true ? '\\' : '';
|
||||
let output = '';
|
||||
|
||||
if (node.isOpen === true) {
|
||||
return prefix + node.value;
|
||||
}
|
||||
|
||||
if (node.isClose === true) {
|
||||
console.log('node.isClose', prefix, node.value);
|
||||
return prefix + node.value;
|
||||
}
|
||||
|
||||
if (node.type === 'open') {
|
||||
return invalid ? (prefix + node.value) : '(';
|
||||
return invalid ? prefix + node.value : '(';
|
||||
}
|
||||
|
||||
if (node.type === 'close') {
|
||||
return invalid ? (prefix + node.value) : ')';
|
||||
return invalid ? prefix + node.value : ')';
|
||||
}
|
||||
|
||||
if (node.type === 'comma') {
|
||||
return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|');
|
||||
return node.prev.type === 'comma' ? '' : invalid ? node.value : '|';
|
||||
}
|
||||
|
||||
if (node.value) {
|
||||
|
|
@ -35,8 +37,8 @@ const compile = (ast, options = {}) => {
|
|||
}
|
||||
|
||||
if (node.nodes && node.ranges > 0) {
|
||||
let args = utils.reduce(node.nodes);
|
||||
let range = fill(...args, { ...options, wrap: false, toRegex: true });
|
||||
const args = utils.reduce(node.nodes);
|
||||
const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
|
||||
|
||||
if (range.length !== 0) {
|
||||
return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
||||
|
|
@ -44,10 +46,11 @@ const compile = (ast, options = {}) => {
|
|||
}
|
||||
|
||||
if (node.nodes) {
|
||||
for (let child of node.nodes) {
|
||||
for (const child of node.nodes) {
|
||||
output += walk(child, node);
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
};
|
||||
|
||||
|
|
|
|||
2
node_modules/braces/lib/constants.js
generated
vendored
2
node_modules/braces/lib/constants.js
generated
vendored
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
MAX_LENGTH: 1024 * 64,
|
||||
MAX_LENGTH: 10000,
|
||||
|
||||
// Digits
|
||||
CHAR_0: '0', /* 0 */
|
||||
|
|
|
|||
18
node_modules/braces/lib/expand.js
generated
vendored
18
node_modules/braces/lib/expand.js
generated
vendored
|
|
@ -5,7 +5,7 @@ const stringify = require('./stringify');
|
|||
const utils = require('./utils');
|
||||
|
||||
const append = (queue = '', stash = '', enclose = false) => {
|
||||
let result = [];
|
||||
const result = [];
|
||||
|
||||
queue = [].concat(queue);
|
||||
stash = [].concat(stash);
|
||||
|
|
@ -15,15 +15,15 @@ const append = (queue = '', stash = '', enclose = false) => {
|
|||
return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash;
|
||||
}
|
||||
|
||||
for (let item of queue) {
|
||||
for (const item of queue) {
|
||||
if (Array.isArray(item)) {
|
||||
for (let value of item) {
|
||||
for (const value of item) {
|
||||
result.push(append(value, stash, enclose));
|
||||
}
|
||||
} else {
|
||||
for (let ele of stash) {
|
||||
if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
|
||||
result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele));
|
||||
result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -31,9 +31,9 @@ const append = (queue = '', stash = '', enclose = false) => {
|
|||
};
|
||||
|
||||
const expand = (ast, options = {}) => {
|
||||
let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit;
|
||||
const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit;
|
||||
|
||||
let walk = (node, parent = {}) => {
|
||||
const walk = (node, parent = {}) => {
|
||||
node.queue = [];
|
||||
|
||||
let p = parent;
|
||||
|
|
@ -55,7 +55,7 @@ const expand = (ast, options = {}) => {
|
|||
}
|
||||
|
||||
if (node.nodes && node.ranges > 0) {
|
||||
let args = utils.reduce(node.nodes);
|
||||
const args = utils.reduce(node.nodes);
|
||||
|
||||
if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
|
||||
throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
|
||||
|
|
@ -71,7 +71,7 @@ const expand = (ast, options = {}) => {
|
|||
return;
|
||||
}
|
||||
|
||||
let enclose = utils.encloseBrace(node);
|
||||
const enclose = utils.encloseBrace(node);
|
||||
let queue = node.queue;
|
||||
let block = node;
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ const expand = (ast, options = {}) => {
|
|||
}
|
||||
|
||||
for (let i = 0; i < node.nodes.length; i++) {
|
||||
let child = node.nodes[i];
|
||||
const child = node.nodes[i];
|
||||
|
||||
if (child.type === 'comma' && node.type === 'brace') {
|
||||
if (i === 1) queue.push('');
|
||||
|
|
|
|||
30
node_modules/braces/lib/parse.js
generated
vendored
30
node_modules/braces/lib/parse.js
generated
vendored
|
|
@ -33,22 +33,21 @@ const parse = (input, options = {}) => {
|
|||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
let opts = options || {};
|
||||
let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
||||
const opts = options || {};
|
||||
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
||||
if (input.length > max) {
|
||||
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
||||
}
|
||||
|
||||
let ast = { type: 'root', input, nodes: [] };
|
||||
let stack = [ast];
|
||||
const ast = { type: 'root', input, nodes: [] };
|
||||
const stack = [ast];
|
||||
let block = ast;
|
||||
let prev = ast;
|
||||
let brackets = 0;
|
||||
let length = input.length;
|
||||
const length = input.length;
|
||||
let index = 0;
|
||||
let depth = 0;
|
||||
let value;
|
||||
let memo = {};
|
||||
|
||||
/**
|
||||
* Helpers
|
||||
|
|
@ -111,7 +110,6 @@ const parse = (input, options = {}) => {
|
|||
if (value === CHAR_LEFT_SQUARE_BRACKET) {
|
||||
brackets++;
|
||||
|
||||
let closed = true;
|
||||
let next;
|
||||
|
||||
while (index < length && (next = advance())) {
|
||||
|
|
@ -167,7 +165,7 @@ const parse = (input, options = {}) => {
|
|||
*/
|
||||
|
||||
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
||||
let open = value;
|
||||
const open = value;
|
||||
let next;
|
||||
|
||||
if (options.keepQuotes !== true) {
|
||||
|
|
@ -199,8 +197,8 @@ const parse = (input, options = {}) => {
|
|||
if (value === CHAR_LEFT_CURLY_BRACE) {
|
||||
depth++;
|
||||
|
||||
let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
|
||||
let brace = {
|
||||
const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
|
||||
const brace = {
|
||||
type: 'brace',
|
||||
open: true,
|
||||
close: false,
|
||||
|
|
@ -227,7 +225,7 @@ const parse = (input, options = {}) => {
|
|||
continue;
|
||||
}
|
||||
|
||||
let type = 'close';
|
||||
const type = 'close';
|
||||
block = stack.pop();
|
||||
block.close = true;
|
||||
|
||||
|
|
@ -245,7 +243,7 @@ const parse = (input, options = {}) => {
|
|||
if (value === CHAR_COMMA && depth > 0) {
|
||||
if (block.ranges > 0) {
|
||||
block.ranges = 0;
|
||||
let open = block.nodes.shift();
|
||||
const open = block.nodes.shift();
|
||||
block.nodes = [open, { type: 'text', value: stringify(block) }];
|
||||
}
|
||||
|
||||
|
|
@ -259,7 +257,7 @@ const parse = (input, options = {}) => {
|
|||
*/
|
||||
|
||||
if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
|
||||
let siblings = block.nodes;
|
||||
const siblings = block.nodes;
|
||||
|
||||
if (depth === 0 || siblings.length === 0) {
|
||||
push({ type: 'text', value });
|
||||
|
|
@ -286,7 +284,7 @@ const parse = (input, options = {}) => {
|
|||
if (prev.type === 'range') {
|
||||
siblings.pop();
|
||||
|
||||
let before = siblings[siblings.length - 1];
|
||||
const before = siblings[siblings.length - 1];
|
||||
before.value += prev.value + value;
|
||||
prev = before;
|
||||
block.ranges--;
|
||||
|
|
@ -319,8 +317,8 @@ const parse = (input, options = {}) => {
|
|||
});
|
||||
|
||||
// get the location of the block on parent.nodes (block's siblings)
|
||||
let parent = stack[stack.length - 1];
|
||||
let index = parent.nodes.indexOf(block);
|
||||
const parent = stack[stack.length - 1];
|
||||
const index = parent.nodes.indexOf(block);
|
||||
// replace the (invalid) block with it's nodes
|
||||
parent.nodes.splice(index, 1, ...block.nodes);
|
||||
}
|
||||
|
|
|
|||
8
node_modules/braces/lib/stringify.js
generated
vendored
8
node_modules/braces/lib/stringify.js
generated
vendored
|
|
@ -3,9 +3,9 @@
|
|||
const utils = require('./utils');
|
||||
|
||||
module.exports = (ast, options = {}) => {
|
||||
let stringify = (node, parent = {}) => {
|
||||
let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
|
||||
let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
||||
const stringify = (node, parent = {}) => {
|
||||
const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
|
||||
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
||||
let output = '';
|
||||
|
||||
if (node.value) {
|
||||
|
|
@ -20,7 +20,7 @@ module.exports = (ast, options = {}) => {
|
|||
}
|
||||
|
||||
if (node.nodes) {
|
||||
for (let child of node.nodes) {
|
||||
for (const child of node.nodes) {
|
||||
output += stringify(child);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
16
node_modules/braces/lib/utils.js
generated
vendored
16
node_modules/braces/lib/utils.js
generated
vendored
|
|
@ -31,7 +31,7 @@ exports.exceedsLimit = (min, max, step = 1, limit) => {
|
|||
*/
|
||||
|
||||
exports.escapeNode = (block, n = 0, type) => {
|
||||
let node = block.nodes[n];
|
||||
const node = block.nodes[n];
|
||||
if (!node) return;
|
||||
|
||||
if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
|
||||
|
|
@ -100,13 +100,23 @@ exports.reduce = nodes => nodes.reduce((acc, node) => {
|
|||
|
||||
exports.flatten = (...args) => {
|
||||
const result = [];
|
||||
|
||||
const flat = arr => {
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
let ele = arr[i];
|
||||
Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
|
||||
const ele = arr[i];
|
||||
|
||||
if (Array.isArray(ele)) {
|
||||
flat(ele);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ele !== undefined) {
|
||||
result.push(ele);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
flat(args);
|
||||
return result;
|
||||
};
|
||||
|
|
|
|||
4
node_modules/braces/package.json
generated
vendored
4
node_modules/braces/package.json
generated
vendored
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "braces",
|
||||
"description": "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.",
|
||||
"version": "3.0.2",
|
||||
"version": "3.0.3",
|
||||
"homepage": "https://github.com/micromatch/braces",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"contributors": [
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
"benchmark": "node benchmark"
|
||||
},
|
||||
"dependencies": {
|
||||
"fill-range": "^7.0.1"
|
||||
"fill-range": "^7.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ansi-colors": "^3.2.4",
|
||||
|
|
|
|||
17
node_modules/diff/CONTRIBUTING.md
generated
vendored
17
node_modules/diff/CONTRIBUTING.md
generated
vendored
|
|
@ -15,25 +15,22 @@ Generally we like to see pull requests that
|
|||
## Building
|
||||
|
||||
```
|
||||
npm install
|
||||
npm test
|
||||
yarn
|
||||
yarn test
|
||||
```
|
||||
|
||||
The `npm test -- dev` implements watching for tests within Node and `karma start` may be used for manual testing in browsers.
|
||||
Running `yarn test -- dev` will watch for tests within Node and `karma start` may be used for manual testing in browsers.
|
||||
|
||||
If you notice any problems, please report them to the GitHub issue tracker at
|
||||
[http://github.com/kpdecker/jsdiff/issues](http://github.com/kpdecker/jsdiff/issues).
|
||||
|
||||
## Releasing
|
||||
|
||||
JsDiff utilizes the [release yeoman generator][generator-release] to perform most release tasks.
|
||||
|
||||
A full release may be completed with the following:
|
||||
|
||||
```
|
||||
yo release
|
||||
npm publish
|
||||
yarn clean
|
||||
yarn grunt
|
||||
yarn grunt uglify
|
||||
yarn publish
|
||||
```
|
||||
|
||||
[generator-release]: https://github.com/walmartlabs/generator-release
|
||||
[pull-request]: https://github.com/kpdecker/jsdiff/pull/new/master
|
||||
|
|
|
|||
44
node_modules/diff/LICENSE
generated
vendored
44
node_modules/diff/LICENSE
generated
vendored
|
|
@ -1,31 +1,29 @@
|
|||
Software License Agreement (BSD License)
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of Kevin Decker nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission.
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
|
|||
218
node_modules/diff/README.md
generated
vendored
218
node_modules/diff/README.md
generated
vendored
|
|
@ -3,87 +3,113 @@
|
|||
[](http://travis-ci.org/kpdecker/jsdiff)
|
||||
[](https://saucelabs.com/u/jsdiff)
|
||||
|
||||
A javascript text differencing implementation.
|
||||
A JavaScript text differencing implementation. Try it out in the **[online demo](https://kpdecker.github.io/jsdiff)**.
|
||||
|
||||
Based on the algorithm proposed in
|
||||
["An O(ND) Difference Algorithm and its Variations" (Myers, 1986)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927).
|
||||
["An O(ND) Difference Algorithm and its Variations" (Myers, 1986)](http://www.xmailserver.org/diff2.pdf).
|
||||
|
||||
## Installation
|
||||
```bash
|
||||
npm install diff --save
|
||||
```
|
||||
|
||||
## API
|
||||
## Usage
|
||||
|
||||
* `Diff.diffChars(oldStr, newStr[, options])` - diffs two blocks of text, comparing character by character.
|
||||
Broadly, jsdiff's diff functions all take an old text and a new text and perform three steps:
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
1. Split both texts into arrays of "tokens". What constitutes a token varies; in `diffChars`, each character is a token, while in `diffLines`, each line is a token.
|
||||
|
||||
2. Find the smallest set of single-token *insertions* and *deletions* needed to transform the first array of tokens into the second.
|
||||
|
||||
This step depends upon having some notion of a token from the old array being "equal" to one from the new array, and this notion of equality affects the results. Usually two tokens are equal if `===` considers them equal, but some of the diff functions use an alternative notion of equality or have options to configure it. For instance, by default `diffChars("Foo", "FOOD")` will require two deletions (`o`, `o`) and three insertions (`O`, `O`, `D`), but `diffChars("Foo", "FOOD", {ignoreCase: true})` will require just one insertion (of a `D`), since `ignoreCase` causes `o` and `O` to be considered equal.
|
||||
|
||||
3. Return an array representing the transformation computed in the previous step as a series of [change objects](#change-objects). The array is ordered from the start of the input to the end, and each change object represents *inserting* one or more tokens, *deleting* one or more tokens, or *keeping* one or more tokens.
|
||||
|
||||
### API
|
||||
|
||||
* `Diff.diffChars(oldStr, newStr[, options])` - diffs two blocks of text, treating each character as a token.
|
||||
|
||||
Returns a list of [change objects](#change-objects).
|
||||
|
||||
Options
|
||||
* `ignoreCase`: `true` to ignore casing difference. Defaults to `false`.
|
||||
* `ignoreCase`: If `true`, the uppercase and lowercase forms of a character are considered equal. Defaults to `false`.
|
||||
|
||||
* `Diff.diffWords(oldStr, newStr[, options])` - diffs two blocks of text, comparing word by word, ignoring whitespace.
|
||||
* `Diff.diffWords(oldStr, newStr[, options])` - diffs two blocks of text, treating each word and each word separator (punctuation, newline, or run of whitespace) as a token.
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
(Whitespace-only tokens are automatically treated as equal to each other, so changes like changing a space to a newline or a run of multiple spaces will be ignored.)
|
||||
|
||||
Returns a list of [change objects](#change-objects).
|
||||
|
||||
Options
|
||||
* `ignoreCase`: Same as in `diffChars`.
|
||||
* `ignoreCase`: Same as in `diffChars`. Defaults to false.
|
||||
|
||||
* `Diff.diffWordsWithSpace(oldStr, newStr[, options])` - diffs two blocks of text, comparing word by word, treating whitespace as significant.
|
||||
* `Diff.diffWordsWithSpace(oldStr, newStr[, options])` - same as `diffWords`, except whitespace-only tokens are not automatically considered equal, so e.g. changing a space to a tab is considered a change.
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
|
||||
* `Diff.diffLines(oldStr, newStr[, options])` - diffs two blocks of text, comparing line by line.
|
||||
* `Diff.diffLines(oldStr, newStr[, options])` - diffs two blocks of text, treating each line as a token.
|
||||
|
||||
Options
|
||||
* `ignoreWhitespace`: `true` to ignore leading and trailing whitespace. This is the same as `diffTrimmedLines`
|
||||
* `newlineIsToken`: `true` to treat newline characters as separate tokens. This allows for changes to the newline structure to occur independently of the line content and to be treated as such. In general this is the more human friendly form of `diffLines` and `diffLines` is better suited for patches and other computer friendly output.
|
||||
* `ignoreWhitespace`: `true` to strip all leading and trailing whitespace characters from each line before performing the diff. Defaults to `false`.
|
||||
* `stripTrailingCr`: `true` to remove all trailing CR (`\r`) characters before performing the diff. Defaults to `false`.
|
||||
This helps to get a useful diff when diffing UNIX text files against Windows text files.
|
||||
* `newlineIsToken`: `true` to treat the newline character at the end of each line as its own token. This allows for changes to the newline structure to occur independently of the line content and to be treated as such. In general this is the more human friendly form of `diffLines`; the default behavior with this option turned off is better suited for patches and other computer friendly output. Defaults to `false`.
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
Returns a list of [change objects](#change-objects).
|
||||
|
||||
* `Diff.diffTrimmedLines(oldStr, newStr[, options])` - diffs two blocks of text, comparing line by line, ignoring leading and trailing whitespace.
|
||||
* `Diff.diffTrimmedLines(oldStr, newStr[, options])` - diffs two blocks of text, comparing line by line, after stripping leading and trailing whitespace. Equivalent to calling `diffLines` with `ignoreWhitespace: true`.
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
Options
|
||||
* `stripTrailingCr`: Same as in `diffLines`. Defaults to `false`.
|
||||
* `newlineIsToken`: Same as in `diffLines`. Defaults to `false`.
|
||||
|
||||
* `Diff.diffSentences(oldStr, newStr[, options])` - diffs two blocks of text, comparing sentence by sentence.
|
||||
Returns a list of [change objects](#change-objects).
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
* `Diff.diffSentences(oldStr, newStr[, options])` - diffs two blocks of text, treating each sentence as a token.
|
||||
|
||||
Returns a list of [change objects](#change-objects).
|
||||
|
||||
* `Diff.diffCss(oldStr, newStr[, options])` - diffs two blocks of text, comparing CSS tokens.
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
Returns a list of [change objects](#change-objects).
|
||||
|
||||
* `Diff.diffJson(oldObj, newObj[, options])` - diffs two JSON objects, comparing the fields defined on each. The order of fields, etc does not matter in this comparison.
|
||||
* `Diff.diffJson(oldObj, newObj[, options])` - diffs two JSON-serializable objects by first serializing them to prettily-formatted JSON and then treating each line of the JSON as a token. Object properties are ordered alphabetically in the serialized JSON, so the order of properties in the objects being compared doesn't affect the result.
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
Returns a list of [change objects](#change-objects).
|
||||
|
||||
Options
|
||||
* `stringifyReplacer`: A custom replacer function. Operates similarly to the `replacer` parameter to [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#the_replacer_parameter), but must be a function.
|
||||
* `undefinedReplacement`: A value to replace `undefined` with. Ignored if a `stringifyReplacer` is provided.
|
||||
|
||||
* `Diff.diffArrays(oldArr, newArr[, options])` - diffs two arrays, comparing each item for strict equality (===).
|
||||
* `Diff.diffArrays(oldArr, newArr[, options])` - diffs two arrays of tokens, comparing each item for strict equality (===).
|
||||
|
||||
Options
|
||||
* `comparator`: `function(left, right)` for custom equality checks
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
Returns a list of [change objects](#change-objects).
|
||||
|
||||
* `Diff.createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader)` - creates a unified diff patch.
|
||||
* `Diff.createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr[, oldHeader[, newHeader[, options]]])` - creates a unified diff patch by first computing a diff with `diffLines` and then serializing it to unified diff format.
|
||||
|
||||
Parameters:
|
||||
* `oldFileName` : String to be output in the filename section of the patch for the removals
|
||||
* `newFileName` : String to be output in the filename section of the patch for the additions
|
||||
* `oldStr` : Original string value
|
||||
* `newStr` : New string value
|
||||
* `oldHeader` : Additional information to include in the old file header
|
||||
* `newHeader` : Additional information to include in the new file header
|
||||
* `oldHeader` : Optional additional information to include in the old file header. Default: `undefined`.
|
||||
* `newHeader` : Optional additional information to include in the new file header. Default: `undefined`.
|
||||
* `options` : An object with options.
|
||||
- `context` describes how many lines of context should be included.
|
||||
- `ignoreWhitespace`: `true` to ignore leading and trailing whitespace.
|
||||
- `newlineIsToken`: `true` to treat newline characters as separate tokens. This allows for changes to the newline structure to occur independently of the line content and to be treated as such. In general this is the more human friendly form of `diffLines` and `diffLines` is better suited for patches and other computer friendly output.
|
||||
- `context` describes how many lines of context should be included. You can set this to `Number.MAX_SAFE_INTEGER` or `Infinity` to include the entire file content in one hunk.
|
||||
- `ignoreWhitespace`: Same as in `diffLines`. Defaults to `false`.
|
||||
- `stripTrailingCr`: Same as in `diffLines`. Defaults to `false`.
|
||||
- `newlineIsToken`: Same as in `diffLines`. Defaults to `false`.
|
||||
|
||||
* `Diff.createPatch(fileName, oldStr, newStr, oldHeader, newHeader)` - creates a unified diff patch.
|
||||
* `Diff.createPatch(fileName, oldStr, newStr[, oldHeader[, newHeader[, options]]])` - creates a unified diff patch.
|
||||
|
||||
Just like Diff.createTwoFilesPatch, but with oldFileName being equal to newFileName.
|
||||
|
||||
* `Diff.formatPatch(patch)` - creates a unified diff patch.
|
||||
|
||||
* `Diff.structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options)` - returns an object with an array of hunk objects.
|
||||
`patch` may be either a single structured patch object (as returned by `structuredPatch`) or an array of them (as returned by `parsePatch`).
|
||||
|
||||
* `Diff.structuredPatch(oldFileName, newFileName, oldStr, newStr[, oldHeader[, newHeader[, options]]])` - returns an object with an array of hunk objects.
|
||||
|
||||
This method is similar to createTwoFilesPatch, but returns a data structure
|
||||
suitable for further processing. Parameters are the same as createTwoFilesPatch. The data structure returned may look like this:
|
||||
|
|
@ -99,9 +125,11 @@ npm install diff --save
|
|||
}
|
||||
```
|
||||
|
||||
* `Diff.applyPatch(source, patch[, options])` - applies a unified diff patch.
|
||||
* `Diff.applyPatch(source, patch[, options])` - attempts to apply a unified diff patch.
|
||||
|
||||
Return a string containing new version of provided data. `patch` may be a string diff or the output from the `parsePatch` or `structuredPatch` methods.
|
||||
If the patch was applied successfully, returns a string containing the patched text. If the patch could not be applied (because some hunks in the patch couldn't be fitted to the text in `source`), returns false.
|
||||
|
||||
`patch` may be a string diff or the output from the `parsePatch` or `structuredPatch` methods.
|
||||
|
||||
The optional `options` object may have the following keys:
|
||||
|
||||
|
|
@ -110,6 +138,8 @@ npm install diff --save
|
|||
|
||||
* `Diff.applyPatches(patch, options)` - applies one or more patches.
|
||||
|
||||
`patch` may be either an array of structured patch objects, or a string representing a patch in unified diff format (which may patch one or more files).
|
||||
|
||||
This method will iterate over the contents of the patch and apply to data provided through callbacks. The general flow for each patch index is:
|
||||
|
||||
- `options.loadFile(index, callback)` is called. The caller should then load the contents of the file and then pass that to the `callback(err, data)` callback. Passing an `err` will terminate further patch execution.
|
||||
|
|
@ -121,23 +151,56 @@ npm install diff --save
|
|||
|
||||
Return a JSON object representation of the a patch, suitable for use with the `applyPatch` method. This parses to the same structure returned by `Diff.structuredPatch`.
|
||||
|
||||
* `convertChangesToXML(changes)` - converts a list of changes to a serialized XML format
|
||||
* `Diff.reversePatch(patch)` - Returns a new structured patch which when applied will undo the original `patch`.
|
||||
|
||||
`patch` may be either a single structured patch object (as returned by `structuredPatch`) or an array of them (as returned by `parsePatch`).
|
||||
|
||||
All methods above which accept the optional `callback` method will run in sync mode when that parameter is omitted and in async mode when supplied. This allows for larger diffs without blocking the event loop. This may be passed either directly as the final parameter or as the `callback` field in the `options` object.
|
||||
* `Diff.convertChangesToXML(changes)` - converts a list of change objects to a serialized XML format
|
||||
|
||||
* `Diff.convertChangesToDMP(changes)` - converts a list of change objects to the format returned by Google's [diff-match-patch](https://github.com/google/diff-match-patch) library
|
||||
|
||||
#### Universal `options`
|
||||
|
||||
Certain options can be provided in the `options` object of *any* method that calculates a diff:
|
||||
|
||||
* `callback`: if provided, the diff will be computed in async mode to avoid blocking the event loop while the diff is calculated. The value of the `callback` option should be a function and will be passed the result of the diff as its second argument. The first argument will always be undefined. Only works with functions that return change objects, like `diffLines`, not those that return patches, like `structuredPatch` or `createPatch`.
|
||||
|
||||
(Note that if the ONLY option you want to provide is a callback, you can pass the callback function directly as the `options` parameter instead of passing an object with a `callback` property.)
|
||||
* `maxEditLength`: a number specifying the maximum edit distance to consider between the old and new texts. If the edit distance is higher than this, jsdiff will return `undefined` instead of a diff. You can use this to limit the computational cost of diffing large, very different texts by giving up early if the cost will be huge. Works for functions that return change objects and also for `structuredPatch`, but not other patch-generation functions.
|
||||
|
||||
* `timeout`: a number of milliseconds after which the diffing algorithm will abort and return `undefined`. Supported by the same functions as `maxEditLength`.
|
||||
|
||||
### Defining custom diffing behaviors
|
||||
|
||||
If you need behavior a little different to what any of the text diffing functions above offer, you can roll your own by customizing both the tokenization behavior used and the notion of equality used to determine if two tokens are equal.
|
||||
|
||||
The simplest way to customize tokenization behavior is to simply tokenize the texts you want to diff yourself, with your own code, then pass the arrays of tokens to `diffArrays`. For instance, if you wanted a semantically-aware diff of some code, you could try tokenizing it using a parser specific to the programming language the code is in, then passing the arrays of tokens to `diffArrays`.
|
||||
|
||||
To customize the notion of token equality used, use the `comparator` option to `diffArrays`.
|
||||
|
||||
For even more customisation of the diffing behavior, you can create a `new Diff.Diff()` object, overwrite its `castInput`, `tokenize`, `removeEmpty`, `equals`, and `join` properties with your own functions, then call its `diff(oldString, newString[, options])` method. The methods you can overwrite are used as follows:
|
||||
|
||||
* `castInput(value)`: used to transform the `oldString` and `newString` before any other steps in the diffing algorithm happen. For instance, `diffJson` uses `castInput` to serialize the objects being diffed to JSON. Defaults to a no-op.
|
||||
* `tokenize(value)`: used to convert each of `oldString` and `newString` (after they've gone through `castInput`) to an array of tokens. Defaults to returning `value.split('')` (returning an array of individual characters).
|
||||
* `removeEmpty(array)`: called on the arrays of tokens returned by `tokenize` and can be used to modify them. Defaults to stripping out falsey tokens, such as empty strings. `diffArrays` overrides this to simply return the `array`, which means that falsey values like empty strings can be handled like any other token by `diffArrays`.
|
||||
* `equals(left, right)`: called to determine if two tokens (one from the old string, one from the new string) should be considered equal. Defaults to comparing them with `===`.
|
||||
* `join(tokens)`: gets called with an array of consecutive tokens that have either all been added, all been removed, or are all common. Needs to join them into a single value that can be used as the `value` property of the [change object](#change-objects) for these tokens. Defaults to simply returning `tokens.join('')`.
|
||||
|
||||
### Change Objects
|
||||
Many of the methods above return change objects. These objects consist of the following fields:
|
||||
|
||||
* `value`: Text content
|
||||
* `value`: The concatenated content of all the tokens represented by this change object - i.e. generally the text that is either added, deleted, or common, as a single string. In cases where tokens are considered common but are non-identical (e.g. because an option like `ignoreCase` or a custom `comparator` was used), the value from the *new* string will be provided here.
|
||||
* `added`: True if the value was inserted into the new string
|
||||
* `removed`: True if the value was removed from the old string
|
||||
* `count`: How many tokens (e.g. chars for `diffChars`, lines for `diffLines`) the value in the change object consists of
|
||||
|
||||
(Change objects where `added` and `removed` are both falsey represent content that is common to the old and new strings.)
|
||||
|
||||
Note that some cases may omit a particular flag field. Comparison on the flag fields should always be done in a truthy or falsy manner.
|
||||
|
||||
## Examples
|
||||
|
||||
Basic example in Node
|
||||
#### Basic example in Node
|
||||
|
||||
```js
|
||||
require('colors');
|
||||
|
|
@ -150,10 +213,10 @@ const diff = Diff.diffChars(one, other);
|
|||
|
||||
diff.forEach((part) => {
|
||||
// green for additions, red for deletions
|
||||
// grey for common parts
|
||||
const color = part.added ? 'green' :
|
||||
part.removed ? 'red' : 'grey';
|
||||
process.stderr.write(part.value[color]);
|
||||
let text = part.added ? part.value.bgGreen :
|
||||
part.removed ? part.value.bgRed :
|
||||
part.value;
|
||||
process.stderr.write(text);
|
||||
});
|
||||
|
||||
console.log();
|
||||
|
|
@ -162,7 +225,7 @@ Running the above program should yield
|
|||
|
||||
<img src="images/node_example.png" alt="Node Example">
|
||||
|
||||
Basic example in a web page
|
||||
#### Basic example in a web page
|
||||
|
||||
```html
|
||||
<pre id="display"></pre>
|
||||
|
|
@ -198,7 +261,65 @@ Open the above .html file in a browser and you should see
|
|||
|
||||
<img src="images/web_example.png" alt="Node Example">
|
||||
|
||||
**[Full online demo](https://kpdecker.github.io/jsdiff)**
|
||||
#### Example of generating a patch from Node
|
||||
|
||||
The code below is roughly equivalent to the Unix command `diff -u file1.txt file2.txt > mydiff.patch`:
|
||||
|
||||
```
|
||||
const Diff = require('diff');
|
||||
const file1Contents = fs.readFileSync("file1.txt").toString();
|
||||
const file2Contents = fs.readFileSync("file2.txt").toString();
|
||||
const patch = Diff.createTwoFilesPatch("file1.txt", "file2.txt", file1Contents, file2Contents);
|
||||
fs.writeFileSync("mydiff.patch", patch);
|
||||
```
|
||||
|
||||
#### Examples of parsing and applying a patch from Node
|
||||
|
||||
##### Applying a patch to a specified file
|
||||
|
||||
The code below is roughly equivalent to the Unix command `patch file1.txt mydiff.patch`:
|
||||
|
||||
```
|
||||
const Diff = require('diff');
|
||||
const file1Contents = fs.readFileSync("file1.txt").toString();
|
||||
const patch = fs.readFileSync("mydiff.patch").toString();
|
||||
const patchedFile = Diff.applyPatch(file1Contents, patch);
|
||||
fs.writeFileSync("file1.txt", patchedFile);
|
||||
```
|
||||
|
||||
##### Applying a multi-file patch to the files specified by the patch file itself
|
||||
|
||||
The code below is roughly equivalent to the Unix command `patch < mydiff.patch`:
|
||||
|
||||
```
|
||||
const Diff = require('diff');
|
||||
const patch = fs.readFileSync("mydiff.patch").toString();
|
||||
Diff.applyPatches(patch, {
|
||||
loadFile: (patch, callback) => {
|
||||
let fileContents;
|
||||
try {
|
||||
fileContents = fs.readFileSync(patch.oldFileName).toString();
|
||||
} catch (e) {
|
||||
callback(`No such file: ${patch.oldFileName}`);
|
||||
return;
|
||||
}
|
||||
callback(undefined, fileContents);
|
||||
},
|
||||
patched: (patch, patchedContent, callback) => {
|
||||
if (patchedContent === false) {
|
||||
callback(`Failed to apply patch to ${patch.oldFileName}`)
|
||||
return;
|
||||
}
|
||||
fs.writeFileSync(patch.oldFileName, patchedContent);
|
||||
callback();
|
||||
},
|
||||
complete: (err) => {
|
||||
if (err) {
|
||||
console.log("Failed with error:", err);
|
||||
}
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## Compatibility
|
||||
|
||||
|
|
@ -209,3 +330,10 @@ jsdiff supports all ES3 environments with some known issues on IE8 and below. Un
|
|||
## License
|
||||
|
||||
See [LICENSE](https://github.com/kpdecker/jsdiff/blob/master/LICENSE).
|
||||
|
||||
## Deviations from the published Myers diff algorithm
|
||||
|
||||
jsdiff deviates from the published algorithm in a couple of ways that don't affect results but do affect performance:
|
||||
|
||||
* jsdiff keeps track of the diff for each diagonal using a linked list of change objects for each diagonal, rather than the historical array of furthest-reaching D-paths on each diagonal contemplated on page 8 of Myers's paper.
|
||||
* jsdiff skips considering diagonals where the furthest-reaching D-path would go off the edge of the edit graph. This dramatically reduces the time cost (from quadratic to linear) in cases where the new text just appends or truncates content at the end of the old text.
|
||||
|
|
|
|||
295
node_modules/diff/dist/diff.js
generated
vendored
295
node_modules/diff/dist/diff.js
generated
vendored
|
|
@ -1,40 +1,3 @@
|
|||
/*!
|
||||
|
||||
diff v5.1.0
|
||||
|
||||
Software License Agreement (BSD License)
|
||||
|
||||
Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of Kevin Decker nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@license
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
|
|
@ -44,6 +7,8 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
function Diff() {}
|
||||
Diff.prototype = {
|
||||
diff: function diff(oldString, newString) {
|
||||
var _options$timeout;
|
||||
|
||||
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
var callback = options.callback;
|
||||
|
||||
|
|
@ -80,64 +45,96 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
maxEditLength = Math.min(maxEditLength, options.maxEditLength);
|
||||
}
|
||||
|
||||
var maxExecutionTime = (_options$timeout = options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity;
|
||||
var abortAfterTimestamp = Date.now() + maxExecutionTime;
|
||||
var bestPath = [{
|
||||
newPos: -1,
|
||||
components: []
|
||||
oldPos: -1,
|
||||
lastComponent: undefined
|
||||
}]; // Seed editLength = 0, i.e. the content starts with the same values
|
||||
|
||||
var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
|
||||
var newPos = this.extractCommon(bestPath[0], newString, oldString, 0);
|
||||
|
||||
if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
|
||||
if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
||||
// Identity per the equality and tokenizer
|
||||
return done([{
|
||||
value: this.join(newString),
|
||||
count: newString.length
|
||||
}]);
|
||||
} // Main worker method. checks all permutations of a given edit length for acceptance.
|
||||
} // Once we hit the right edge of the edit graph on some diagonal k, we can
|
||||
// definitely reach the end of the edit graph in no more than k edits, so
|
||||
// there's no point in considering any moves to diagonal k+1 any more (from
|
||||
// which we're guaranteed to need at least k+1 more edits).
|
||||
// Similarly, once we've reached the bottom of the edit graph, there's no
|
||||
// point considering moves to lower diagonals.
|
||||
// We record this fact by setting minDiagonalToConsider and
|
||||
// maxDiagonalToConsider to some finite value once we've hit the edge of
|
||||
// the edit graph.
|
||||
// This optimization is not faithful to the original algorithm presented in
|
||||
// Myers's paper, which instead pointlessly extends D-paths off the end of
|
||||
// the edit graph - see page 7 of Myers's paper which notes this point
|
||||
// explicitly and illustrates it with a diagram. This has major performance
|
||||
// implications for some common scenarios. For instance, to compute a diff
|
||||
// where the new text simply appends d characters on the end of the
|
||||
// original text of length n, the true Myers algorithm will take O(n+d^2)
|
||||
// time while this optimization needs only O(n+d) time.
|
||||
|
||||
|
||||
var minDiagonalToConsider = -Infinity,
|
||||
maxDiagonalToConsider = Infinity; // Main worker method. checks all permutations of a given edit length for acceptance.
|
||||
|
||||
function execEditLength() {
|
||||
for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
|
||||
for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
|
||||
var basePath = void 0;
|
||||
var removePath = bestPath[diagonalPath - 1],
|
||||
addPath = bestPath[diagonalPath + 1];
|
||||
|
||||
var addPath = bestPath[diagonalPath - 1],
|
||||
removePath = bestPath[diagonalPath + 1],
|
||||
_oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
|
||||
|
||||
if (addPath) {
|
||||
if (removePath) {
|
||||
// No one else is going to attempt to use this value, clear it
|
||||
bestPath[diagonalPath - 1] = undefined;
|
||||
}
|
||||
|
||||
var canAdd = addPath && addPath.newPos + 1 < newLen,
|
||||
canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
|
||||
var canAdd = false;
|
||||
|
||||
if (addPath) {
|
||||
// what newPos will be after we do an insertion:
|
||||
var addPathNewPos = addPath.oldPos - diagonalPath;
|
||||
canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
|
||||
}
|
||||
|
||||
var canRemove = removePath && removePath.oldPos + 1 < oldLen;
|
||||
|
||||
if (!canAdd && !canRemove) {
|
||||
// If this path is a terminal then prune
|
||||
bestPath[diagonalPath] = undefined;
|
||||
continue;
|
||||
} // Select the diagonal that we want to branch from. We select the prior
|
||||
// path whose position in the new string is the farthest from the origin
|
||||
// path whose position in the old string is the farthest from the origin
|
||||
// and does not pass the bounds of the diff graph
|
||||
// TODO: Remove the `+ 1` here to make behavior match Myers algorithm
|
||||
// and prefer to order removals before insertions.
|
||||
|
||||
|
||||
if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
|
||||
basePath = clonePath(removePath);
|
||||
self.pushComponent(basePath.components, undefined, true);
|
||||
if (!canRemove || canAdd && removePath.oldPos + 1 < addPath.oldPos) {
|
||||
basePath = self.addToPath(addPath, true, undefined, 0);
|
||||
} else {
|
||||
basePath = addPath; // No need to clone, we've pulled it from the list
|
||||
|
||||
basePath.newPos++;
|
||||
self.pushComponent(basePath.components, true, undefined);
|
||||
basePath = self.addToPath(removePath, undefined, true, 1);
|
||||
}
|
||||
|
||||
_oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done
|
||||
newPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
|
||||
|
||||
if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
|
||||
return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
|
||||
if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
||||
// If we have hit the end of both strings, then we are done
|
||||
return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
|
||||
} else {
|
||||
// Otherwise track this path as a potential candidate and continue.
|
||||
bestPath[diagonalPath] = basePath;
|
||||
|
||||
if (basePath.oldPos + 1 >= oldLen) {
|
||||
maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
|
||||
}
|
||||
|
||||
if (newPos + 1 >= newLen) {
|
||||
minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -151,7 +148,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
if (callback) {
|
||||
(function exec() {
|
||||
setTimeout(function () {
|
||||
if (editLength > maxEditLength) {
|
||||
if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
|
|
@ -161,7 +158,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
}, 0);
|
||||
})();
|
||||
} else {
|
||||
while (editLength <= maxEditLength) {
|
||||
while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
|
||||
var ret = execEditLength();
|
||||
|
||||
if (ret) {
|
||||
|
|
@ -170,30 +167,36 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
}
|
||||
}
|
||||
},
|
||||
pushComponent: function pushComponent(components, added, removed) {
|
||||
var last = components[components.length - 1];
|
||||
addToPath: function addToPath(path, added, removed, oldPosInc) {
|
||||
var last = path.lastComponent;
|
||||
|
||||
if (last && last.added === added && last.removed === removed) {
|
||||
// We need to clone here as the component clone operation is just
|
||||
// as shallow array clone
|
||||
components[components.length - 1] = {
|
||||
count: last.count + 1,
|
||||
added: added,
|
||||
removed: removed
|
||||
return {
|
||||
oldPos: path.oldPos + oldPosInc,
|
||||
lastComponent: {
|
||||
count: last.count + 1,
|
||||
added: added,
|
||||
removed: removed,
|
||||
previousComponent: last.previousComponent
|
||||
}
|
||||
};
|
||||
} else {
|
||||
components.push({
|
||||
count: 1,
|
||||
added: added,
|
||||
removed: removed
|
||||
});
|
||||
return {
|
||||
oldPos: path.oldPos + oldPosInc,
|
||||
lastComponent: {
|
||||
count: 1,
|
||||
added: added,
|
||||
removed: removed,
|
||||
previousComponent: last
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
|
||||
var newLen = newString.length,
|
||||
oldLen = oldString.length,
|
||||
newPos = basePath.newPos,
|
||||
oldPos = newPos - diagonalPath,
|
||||
oldPos = basePath.oldPos,
|
||||
newPos = oldPos - diagonalPath,
|
||||
commonCount = 0;
|
||||
|
||||
while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
|
||||
|
|
@ -203,13 +206,14 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
}
|
||||
|
||||
if (commonCount) {
|
||||
basePath.components.push({
|
||||
count: commonCount
|
||||
});
|
||||
basePath.lastComponent = {
|
||||
count: commonCount,
|
||||
previousComponent: basePath.lastComponent
|
||||
};
|
||||
}
|
||||
|
||||
basePath.newPos = newPos;
|
||||
return oldPos;
|
||||
basePath.oldPos = oldPos;
|
||||
return newPos;
|
||||
},
|
||||
equals: function equals(left, right) {
|
||||
if (this.options.comparator) {
|
||||
|
|
@ -240,7 +244,20 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
}
|
||||
};
|
||||
|
||||
function buildValues(diff, components, newString, oldString, useLongestToken) {
|
||||
function buildValues(diff, lastComponent, newString, oldString, useLongestToken) {
|
||||
// First we convert our linked list of components in reverse order to an
|
||||
// array in the right order:
|
||||
var components = [];
|
||||
var nextComponent;
|
||||
|
||||
while (lastComponent) {
|
||||
components.push(lastComponent);
|
||||
nextComponent = lastComponent.previousComponent;
|
||||
delete lastComponent.previousComponent;
|
||||
lastComponent = nextComponent;
|
||||
}
|
||||
|
||||
components.reverse();
|
||||
var componentPos = 0,
|
||||
componentLen = components.length,
|
||||
newPos = 0,
|
||||
|
|
@ -283,23 +300,16 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
// This is only available for string mode.
|
||||
|
||||
|
||||
var lastComponent = components[componentLen - 1];
|
||||
var finalComponent = components[componentLen - 1];
|
||||
|
||||
if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) {
|
||||
components[componentLen - 2].value += lastComponent.value;
|
||||
if (componentLen > 1 && typeof finalComponent.value === 'string' && (finalComponent.added || finalComponent.removed) && diff.equals('', finalComponent.value)) {
|
||||
components[componentLen - 2].value += finalComponent.value;
|
||||
components.pop();
|
||||
}
|
||||
|
||||
return components;
|
||||
}
|
||||
|
||||
function clonePath(path) {
|
||||
return {
|
||||
newPos: path.newPos,
|
||||
components: path.components.slice(0)
|
||||
};
|
||||
}
|
||||
|
||||
var characterDiff = new Diff();
|
||||
function diffChars(oldStr, newStr, options) {
|
||||
return characterDiff.diff(oldStr, newStr, options);
|
||||
|
|
@ -380,6 +390,11 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
var lineDiff = new Diff();
|
||||
|
||||
lineDiff.tokenize = function (value) {
|
||||
if (this.options.stripTrailingCr) {
|
||||
// remove one \r before \n to match GNU diff's --strip-trailing-cr behavior
|
||||
value = value.replace(/\r\n/g, '\n');
|
||||
}
|
||||
|
||||
var retLines = [],
|
||||
linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line
|
||||
|
||||
|
|
@ -451,6 +466,55 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
return _typeof(obj);
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
function _toConsumableArray(arr) {
|
||||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
||||
}
|
||||
|
|
@ -883,7 +947,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
var line = _hunk.lines[j],
|
||||
operation = line.length > 0 ? line[0] : ' ',
|
||||
content = line.length > 0 ? line.substr(1) : line,
|
||||
delimiter = _hunk.linedelimiters[j];
|
||||
delimiter = _hunk.linedelimiters && _hunk.linedelimiters[j] || '\n';
|
||||
|
||||
if (operation === ' ') {
|
||||
_toPos++;
|
||||
|
|
@ -1090,6 +1154,10 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
};
|
||||
}
|
||||
function formatPatch(diff) {
|
||||
if (Array.isArray(diff)) {
|
||||
return diff.map(formatPatch).join('\n');
|
||||
}
|
||||
|
||||
var ret = [];
|
||||
|
||||
if (diff.oldFileName == diff.newFileName) {
|
||||
|
|
@ -1545,6 +1613,39 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
};
|
||||
}
|
||||
|
||||
function reversePatch(structuredPatch) {
|
||||
if (Array.isArray(structuredPatch)) {
|
||||
return structuredPatch.map(reversePatch).reverse();
|
||||
}
|
||||
|
||||
return _objectSpread2(_objectSpread2({}, structuredPatch), {}, {
|
||||
oldFileName: structuredPatch.newFileName,
|
||||
oldHeader: structuredPatch.newHeader,
|
||||
newFileName: structuredPatch.oldFileName,
|
||||
newHeader: structuredPatch.oldHeader,
|
||||
hunks: structuredPatch.hunks.map(function (hunk) {
|
||||
return {
|
||||
oldLines: hunk.newLines,
|
||||
oldStart: hunk.newStart,
|
||||
newLines: hunk.oldLines,
|
||||
newStart: hunk.oldStart,
|
||||
linedelimiters: hunk.linedelimiters,
|
||||
lines: hunk.lines.map(function (l) {
|
||||
if (l.startsWith('-')) {
|
||||
return "+".concat(l.slice(1));
|
||||
}
|
||||
|
||||
if (l.startsWith('+')) {
|
||||
return "-".concat(l.slice(1));
|
||||
}
|
||||
|
||||
return l;
|
||||
})
|
||||
};
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// See: http://code.google.com/p/google-diff-match-patch/wiki/API
|
||||
function convertChangesToDMP(changes) {
|
||||
var ret = [],
|
||||
|
|
@ -1618,8 +1719,10 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
exports.diffTrimmedLines = diffTrimmedLines;
|
||||
exports.diffWords = diffWords;
|
||||
exports.diffWordsWithSpace = diffWordsWithSpace;
|
||||
exports.formatPatch = formatPatch;
|
||||
exports.merge = merge;
|
||||
exports.parsePatch = parsePatch;
|
||||
exports.reversePatch = reversePatch;
|
||||
exports.structuredPatch = structuredPatch;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
|
|
|||
39
node_modules/diff/dist/diff.min.js
generated
vendored
39
node_modules/diff/dist/diff.min.js
generated
vendored
File diff suppressed because one or more lines are too long
169
node_modules/diff/lib/diff/base.js
generated
vendored
169
node_modules/diff/lib/diff/base.js
generated
vendored
File diff suppressed because one or more lines are too long
7
node_modules/diff/lib/diff/line.js
generated
vendored
7
node_modules/diff/lib/diff/line.js
generated
vendored
|
|
@ -39,6 +39,11 @@ exports.lineDiff = lineDiff;
|
|||
|
||||
/*istanbul ignore end*/
|
||||
lineDiff.tokenize = function (value) {
|
||||
if (this.options.stripTrailingCr) {
|
||||
// remove one \r before \n to match GNU diff's --strip-trailing-cr behavior
|
||||
value = value.replace(/\r\n/g, '\n');
|
||||
}
|
||||
|
||||
var retLines = [],
|
||||
linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line
|
||||
|
||||
|
|
@ -86,4 +91,4 @@ function diffTrimmedLines(oldStr, newStr, callback) {
|
|||
});
|
||||
return lineDiff.diff(oldStr, newStr, options);
|
||||
}
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2xpbmUuanMiXSwibmFtZXMiOlsibGluZURpZmYiLCJEaWZmIiwidG9rZW5pemUiLCJ2YWx1ZSIsInJldExpbmVzIiwibGluZXNBbmROZXdsaW5lcyIsInNwbGl0IiwibGVuZ3RoIiwicG9wIiwiaSIsImxpbmUiLCJvcHRpb25zIiwibmV3bGluZUlzVG9rZW4iLCJpZ25vcmVXaGl0ZXNwYWNlIiwidHJpbSIsInB1c2giLCJkaWZmTGluZXMiLCJvbGRTdHIiLCJuZXdTdHIiLCJjYWxsYmFjayIsImRpZmYiLCJkaWZmVHJpbW1lZExpbmVzIiwiZ2VuZXJhdGVPcHRpb25zIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7O0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTs7Ozs7QUFFTyxJQUFNQSxRQUFRLEdBQUc7QUFBSUM7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUEsQ0FBSixFQUFqQjs7Ozs7O0FBQ1BELFFBQVEsQ0FBQ0UsUUFBVCxHQUFvQixVQUFTQyxLQUFULEVBQWdCO0FBQ2xDLE1BQUlDLFFBQVEsR0FBRyxFQUFmO0FBQUEsTUFDSUMsZ0JBQWdCLEdBQUdGLEtBQUssQ0FBQ0csS0FBTixDQUFZLFdBQVosQ0FEdkIsQ0FEa0MsQ0FJbEM7O0FBQ0EsTUFBSSxDQUFDRCxnQkFB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5ndGggLSAxXSArPSBsaW5lO1xuICAgIH0gZWxzZSB7XG4gICAgICBpZiAodGhpcy5vcHRpb25zLmlnbm9yZVdoaXRlc3BhY2UpIHtcbiAgICAgICAgbGluZSA9IGxpbmUudHJpbSgpO1xuICAgICAgfVxuICAgICAgcmV0TGluZXMucHVzaChsaW5lKTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gcmV0TGluZXM7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZkxpbmVzKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykgeyByZXR1cm4gbGluZURpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spOyB9XG5leHBvcnQgZnVuY3Rpb24gZGlmZlRyaW1tZWRMaW5lcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHtcbiAgbGV0IG9wdGlvbnMgPSBnZW5lcmF0ZU9wdGlvbnMoY2FsbGJhY2ssIHtpZ25vcmVXaGl0ZXNwYWNlOiB0cnVlfSk7XG4gIHJldHVybiBsaW5lRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTtcbn1cbiJdfQ==
|
||||
|
|
|
|||
258
node_modules/diff/lib/index.es6.js
generated
vendored
258
node_modules/diff/lib/index.es6.js
generated
vendored
|
|
@ -1,6 +1,8 @@
|
|||
function Diff() {}
|
||||
Diff.prototype = {
|
||||
diff: function diff(oldString, newString) {
|
||||
var _options$timeout;
|
||||
|
||||
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
var callback = options.callback;
|
||||
|
||||
|
|
@ -37,64 +39,96 @@ Diff.prototype = {
|
|||
maxEditLength = Math.min(maxEditLength, options.maxEditLength);
|
||||
}
|
||||
|
||||
var maxExecutionTime = (_options$timeout = options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity;
|
||||
var abortAfterTimestamp = Date.now() + maxExecutionTime;
|
||||
var bestPath = [{
|
||||
newPos: -1,
|
||||
components: []
|
||||
oldPos: -1,
|
||||
lastComponent: undefined
|
||||
}]; // Seed editLength = 0, i.e. the content starts with the same values
|
||||
|
||||
var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
|
||||
var newPos = this.extractCommon(bestPath[0], newString, oldString, 0);
|
||||
|
||||
if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
|
||||
if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
||||
// Identity per the equality and tokenizer
|
||||
return done([{
|
||||
value: this.join(newString),
|
||||
count: newString.length
|
||||
}]);
|
||||
} // Main worker method. checks all permutations of a given edit length for acceptance.
|
||||
} // Once we hit the right edge of the edit graph on some diagonal k, we can
|
||||
// definitely reach the end of the edit graph in no more than k edits, so
|
||||
// there's no point in considering any moves to diagonal k+1 any more (from
|
||||
// which we're guaranteed to need at least k+1 more edits).
|
||||
// Similarly, once we've reached the bottom of the edit graph, there's no
|
||||
// point considering moves to lower diagonals.
|
||||
// We record this fact by setting minDiagonalToConsider and
|
||||
// maxDiagonalToConsider to some finite value once we've hit the edge of
|
||||
// the edit graph.
|
||||
// This optimization is not faithful to the original algorithm presented in
|
||||
// Myers's paper, which instead pointlessly extends D-paths off the end of
|
||||
// the edit graph - see page 7 of Myers's paper which notes this point
|
||||
// explicitly and illustrates it with a diagram. This has major performance
|
||||
// implications for some common scenarios. For instance, to compute a diff
|
||||
// where the new text simply appends d characters on the end of the
|
||||
// original text of length n, the true Myers algorithm will take O(n+d^2)
|
||||
// time while this optimization needs only O(n+d) time.
|
||||
|
||||
|
||||
var minDiagonalToConsider = -Infinity,
|
||||
maxDiagonalToConsider = Infinity; // Main worker method. checks all permutations of a given edit length for acceptance.
|
||||
|
||||
function execEditLength() {
|
||||
for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
|
||||
for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
|
||||
var basePath = void 0;
|
||||
var removePath = bestPath[diagonalPath - 1],
|
||||
addPath = bestPath[diagonalPath + 1];
|
||||
|
||||
var addPath = bestPath[diagonalPath - 1],
|
||||
removePath = bestPath[diagonalPath + 1],
|
||||
_oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
|
||||
|
||||
if (addPath) {
|
||||
if (removePath) {
|
||||
// No one else is going to attempt to use this value, clear it
|
||||
bestPath[diagonalPath - 1] = undefined;
|
||||
}
|
||||
|
||||
var canAdd = addPath && addPath.newPos + 1 < newLen,
|
||||
canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
|
||||
var canAdd = false;
|
||||
|
||||
if (addPath) {
|
||||
// what newPos will be after we do an insertion:
|
||||
var addPathNewPos = addPath.oldPos - diagonalPath;
|
||||
canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
|
||||
}
|
||||
|
||||
var canRemove = removePath && removePath.oldPos + 1 < oldLen;
|
||||
|
||||
if (!canAdd && !canRemove) {
|
||||
// If this path is a terminal then prune
|
||||
bestPath[diagonalPath] = undefined;
|
||||
continue;
|
||||
} // Select the diagonal that we want to branch from. We select the prior
|
||||
// path whose position in the new string is the farthest from the origin
|
||||
// path whose position in the old string is the farthest from the origin
|
||||
// and does not pass the bounds of the diff graph
|
||||
// TODO: Remove the `+ 1` here to make behavior match Myers algorithm
|
||||
// and prefer to order removals before insertions.
|
||||
|
||||
|
||||
if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
|
||||
basePath = clonePath(removePath);
|
||||
self.pushComponent(basePath.components, undefined, true);
|
||||
if (!canRemove || canAdd && removePath.oldPos + 1 < addPath.oldPos) {
|
||||
basePath = self.addToPath(addPath, true, undefined, 0);
|
||||
} else {
|
||||
basePath = addPath; // No need to clone, we've pulled it from the list
|
||||
|
||||
basePath.newPos++;
|
||||
self.pushComponent(basePath.components, true, undefined);
|
||||
basePath = self.addToPath(removePath, undefined, true, 1);
|
||||
}
|
||||
|
||||
_oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done
|
||||
newPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
|
||||
|
||||
if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
|
||||
return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
|
||||
if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
||||
// If we have hit the end of both strings, then we are done
|
||||
return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
|
||||
} else {
|
||||
// Otherwise track this path as a potential candidate and continue.
|
||||
bestPath[diagonalPath] = basePath;
|
||||
|
||||
if (basePath.oldPos + 1 >= oldLen) {
|
||||
maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
|
||||
}
|
||||
|
||||
if (newPos + 1 >= newLen) {
|
||||
minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -108,7 +142,7 @@ Diff.prototype = {
|
|||
if (callback) {
|
||||
(function exec() {
|
||||
setTimeout(function () {
|
||||
if (editLength > maxEditLength) {
|
||||
if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +152,7 @@ Diff.prototype = {
|
|||
}, 0);
|
||||
})();
|
||||
} else {
|
||||
while (editLength <= maxEditLength) {
|
||||
while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
|
||||
var ret = execEditLength();
|
||||
|
||||
if (ret) {
|
||||
|
|
@ -127,30 +161,36 @@ Diff.prototype = {
|
|||
}
|
||||
}
|
||||
},
|
||||
pushComponent: function pushComponent(components, added, removed) {
|
||||
var last = components[components.length - 1];
|
||||
addToPath: function addToPath(path, added, removed, oldPosInc) {
|
||||
var last = path.lastComponent;
|
||||
|
||||
if (last && last.added === added && last.removed === removed) {
|
||||
// We need to clone here as the component clone operation is just
|
||||
// as shallow array clone
|
||||
components[components.length - 1] = {
|
||||
count: last.count + 1,
|
||||
added: added,
|
||||
removed: removed
|
||||
return {
|
||||
oldPos: path.oldPos + oldPosInc,
|
||||
lastComponent: {
|
||||
count: last.count + 1,
|
||||
added: added,
|
||||
removed: removed,
|
||||
previousComponent: last.previousComponent
|
||||
}
|
||||
};
|
||||
} else {
|
||||
components.push({
|
||||
count: 1,
|
||||
added: added,
|
||||
removed: removed
|
||||
});
|
||||
return {
|
||||
oldPos: path.oldPos + oldPosInc,
|
||||
lastComponent: {
|
||||
count: 1,
|
||||
added: added,
|
||||
removed: removed,
|
||||
previousComponent: last
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
|
||||
var newLen = newString.length,
|
||||
oldLen = oldString.length,
|
||||
newPos = basePath.newPos,
|
||||
oldPos = newPos - diagonalPath,
|
||||
oldPos = basePath.oldPos,
|
||||
newPos = oldPos - diagonalPath,
|
||||
commonCount = 0;
|
||||
|
||||
while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
|
||||
|
|
@ -160,13 +200,14 @@ Diff.prototype = {
|
|||
}
|
||||
|
||||
if (commonCount) {
|
||||
basePath.components.push({
|
||||
count: commonCount
|
||||
});
|
||||
basePath.lastComponent = {
|
||||
count: commonCount,
|
||||
previousComponent: basePath.lastComponent
|
||||
};
|
||||
}
|
||||
|
||||
basePath.newPos = newPos;
|
||||
return oldPos;
|
||||
basePath.oldPos = oldPos;
|
||||
return newPos;
|
||||
},
|
||||
equals: function equals(left, right) {
|
||||
if (this.options.comparator) {
|
||||
|
|
@ -197,7 +238,20 @@ Diff.prototype = {
|
|||
}
|
||||
};
|
||||
|
||||
function buildValues(diff, components, newString, oldString, useLongestToken) {
|
||||
function buildValues(diff, lastComponent, newString, oldString, useLongestToken) {
|
||||
// First we convert our linked list of components in reverse order to an
|
||||
// array in the right order:
|
||||
var components = [];
|
||||
var nextComponent;
|
||||
|
||||
while (lastComponent) {
|
||||
components.push(lastComponent);
|
||||
nextComponent = lastComponent.previousComponent;
|
||||
delete lastComponent.previousComponent;
|
||||
lastComponent = nextComponent;
|
||||
}
|
||||
|
||||
components.reverse();
|
||||
var componentPos = 0,
|
||||
componentLen = components.length,
|
||||
newPos = 0,
|
||||
|
|
@ -240,23 +294,16 @@ function buildValues(diff, components, newString, oldString, useLongestToken) {
|
|||
// This is only available for string mode.
|
||||
|
||||
|
||||
var lastComponent = components[componentLen - 1];
|
||||
var finalComponent = components[componentLen - 1];
|
||||
|
||||
if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) {
|
||||
components[componentLen - 2].value += lastComponent.value;
|
||||
if (componentLen > 1 && typeof finalComponent.value === 'string' && (finalComponent.added || finalComponent.removed) && diff.equals('', finalComponent.value)) {
|
||||
components[componentLen - 2].value += finalComponent.value;
|
||||
components.pop();
|
||||
}
|
||||
|
||||
return components;
|
||||
}
|
||||
|
||||
function clonePath(path) {
|
||||
return {
|
||||
newPos: path.newPos,
|
||||
components: path.components.slice(0)
|
||||
};
|
||||
}
|
||||
|
||||
var characterDiff = new Diff();
|
||||
function diffChars(oldStr, newStr, options) {
|
||||
return characterDiff.diff(oldStr, newStr, options);
|
||||
|
|
@ -337,6 +384,11 @@ function diffWordsWithSpace(oldStr, newStr, options) {
|
|||
var lineDiff = new Diff();
|
||||
|
||||
lineDiff.tokenize = function (value) {
|
||||
if (this.options.stripTrailingCr) {
|
||||
// remove one \r before \n to match GNU diff's --strip-trailing-cr behavior
|
||||
value = value.replace(/\r\n/g, '\n');
|
||||
}
|
||||
|
||||
var retLines = [],
|
||||
linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line
|
||||
|
||||
|
|
@ -408,6 +460,55 @@ function _typeof(obj) {
|
|||
return _typeof(obj);
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
function _toConsumableArray(arr) {
|
||||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
||||
}
|
||||
|
|
@ -840,7 +941,7 @@ function applyPatch(source, uniDiff) {
|
|||
var line = _hunk.lines[j],
|
||||
operation = line.length > 0 ? line[0] : ' ',
|
||||
content = line.length > 0 ? line.substr(1) : line,
|
||||
delimiter = _hunk.linedelimiters[j];
|
||||
delimiter = _hunk.linedelimiters && _hunk.linedelimiters[j] || '\n';
|
||||
|
||||
if (operation === ' ') {
|
||||
_toPos++;
|
||||
|
|
@ -1047,6 +1148,10 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
|
|||
};
|
||||
}
|
||||
function formatPatch(diff) {
|
||||
if (Array.isArray(diff)) {
|
||||
return diff.map(formatPatch).join('\n');
|
||||
}
|
||||
|
||||
var ret = [];
|
||||
|
||||
if (diff.oldFileName == diff.newFileName) {
|
||||
|
|
@ -1502,6 +1607,39 @@ function calcOldNewLineCount(lines) {
|
|||
};
|
||||
}
|
||||
|
||||
function reversePatch(structuredPatch) {
|
||||
if (Array.isArray(structuredPatch)) {
|
||||
return structuredPatch.map(reversePatch).reverse();
|
||||
}
|
||||
|
||||
return _objectSpread2(_objectSpread2({}, structuredPatch), {}, {
|
||||
oldFileName: structuredPatch.newFileName,
|
||||
oldHeader: structuredPatch.newHeader,
|
||||
newFileName: structuredPatch.oldFileName,
|
||||
newHeader: structuredPatch.oldHeader,
|
||||
hunks: structuredPatch.hunks.map(function (hunk) {
|
||||
return {
|
||||
oldLines: hunk.newLines,
|
||||
oldStart: hunk.newStart,
|
||||
newLines: hunk.oldLines,
|
||||
newStart: hunk.oldStart,
|
||||
linedelimiters: hunk.linedelimiters,
|
||||
lines: hunk.lines.map(function (l) {
|
||||
if (l.startsWith('-')) {
|
||||
return "+".concat(l.slice(1));
|
||||
}
|
||||
|
||||
if (l.startsWith('+')) {
|
||||
return "-".concat(l.slice(1));
|
||||
}
|
||||
|
||||
return l;
|
||||
})
|
||||
};
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// See: http://code.google.com/p/google-diff-match-patch/wiki/API
|
||||
function convertChangesToDMP(changes) {
|
||||
var ret = [],
|
||||
|
|
@ -1558,4 +1696,4 @@ function escapeHTML(s) {
|
|||
return n;
|
||||
}
|
||||
|
||||
export { Diff, applyPatch, applyPatches, canonicalize, convertChangesToDMP, convertChangesToXML, createPatch, createTwoFilesPatch, diffArrays, diffChars, diffCss, diffJson, diffLines, diffSentences, diffTrimmedLines, diffWords, diffWordsWithSpace, merge, parsePatch, structuredPatch };
|
||||
export { Diff, applyPatch, applyPatches, canonicalize, convertChangesToDMP, convertChangesToXML, createPatch, createTwoFilesPatch, diffArrays, diffChars, diffCss, diffJson, diffLines, diffSentences, diffTrimmedLines, diffWords, diffWordsWithSpace, formatPatch, merge, parsePatch, reversePatch, structuredPatch };
|
||||
|
|
|
|||
20
node_modules/diff/lib/index.js
generated
vendored
20
node_modules/diff/lib/index.js
generated
vendored
|
|
@ -94,6 +94,12 @@ Object.defineProperty(exports, "merge", {
|
|||
return _merge.merge;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "reversePatch", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _reverse.reversePatch;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "structuredPatch", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
|
|
@ -112,6 +118,12 @@ Object.defineProperty(exports, "createPatch", {
|
|||
return _create.createPatch;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "formatPatch", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _create.formatPatch;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "convertChangesToDMP", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
|
|
@ -192,6 +204,12 @@ _merge = require("./patch/merge")
|
|||
/*istanbul ignore end*/
|
||||
;
|
||||
|
||||
var
|
||||
/*istanbul ignore start*/
|
||||
_reverse = require("./patch/reverse")
|
||||
/*istanbul ignore end*/
|
||||
;
|
||||
|
||||
var
|
||||
/*istanbul ignore start*/
|
||||
_create = require("./patch/create")
|
||||
|
|
@ -213,4 +231,4 @@ _xml = require("./convert/xml")
|
|||
/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
||||
|
||||
/*istanbul ignore end*/
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5q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xuaW1wb3J0IHtyZXZlcnNlUGF0Y2h9IGZyb20gJy4vcGF0Y2gvcmV2ZXJzZSc7XG5pbXBvcnQge3N0cnVjdHVyZWRQYXRjaCwgY3JlYXRlVHdvRmlsZXNQYXRjaCwgY3JlYXRlUGF0Y2gsIGZvcm1hdFBhdGNofSBmcm9tICcuL3BhdGNoL2NyZWF0ZSc7XG5cbmltcG9ydCB7Y29udmVydENoYW5nZXNUb0RNUH0gZnJvbSAnLi9jb252ZXJ0L2RtcCc7XG5pbXBvcnQge2NvbnZlcnRDaGFuZ2VzVG9YTUx9IGZyb20gJy4vY29udmVydC94bWwnO1xuXG5leHBvcnQge1xuICBEaWZmLFxuXG4gIGRpZmZDaGFycyxcbiAgZGlmZldvcmRzLFxuICBkaWZmV29yZHNXaXRoU3BhY2UsXG4gIGRpZmZMaW5lcyxcbiAgZGlmZlRyaW1tZWRMaW5lcyxcbiAgZGlmZlNlbnRlbmNlcyxcblxuICBkaWZmQ3NzLFxuICBkaWZmSnNvbixcblxuICBkaWZmQXJyYXlzLFxuXG4gIHN0cnVjdHVyZWRQYXRjaCxcbiAgY3JlYXRlVHdvRmlsZXNQYXRjaCxcbiAgY3JlYXRlUGF0Y2gsXG4gIGZvcm1hdFBhdGNoLFxuICBhcHBseVBhdGNoLFxuICBhcHBseVBhdGNoZXMsXG4gIHBhcnNlUGF0Y2gsXG4gIG1lcmdlLFxuICByZXZlcnNlUGF0Y2gsXG4gIGNvbnZlcnRDaGFuZ2VzVG9ETVAsXG4gIGNvbnZlcnRDaGFuZ2VzVG9YTUwsXG4gIGNhbm9uaWNhbGl6ZVxufTtcbiJdfQ==
|
||||
|
|
|
|||
258
node_modules/diff/lib/index.mjs
generated
vendored
258
node_modules/diff/lib/index.mjs
generated
vendored
|
|
@ -1,6 +1,8 @@
|
|||
function Diff() {}
|
||||
Diff.prototype = {
|
||||
diff: function diff(oldString, newString) {
|
||||
var _options$timeout;
|
||||
|
||||
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
var callback = options.callback;
|
||||
|
||||
|
|
@ -37,64 +39,96 @@ Diff.prototype = {
|
|||
maxEditLength = Math.min(maxEditLength, options.maxEditLength);
|
||||
}
|
||||
|
||||
var maxExecutionTime = (_options$timeout = options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity;
|
||||
var abortAfterTimestamp = Date.now() + maxExecutionTime;
|
||||
var bestPath = [{
|
||||
newPos: -1,
|
||||
components: []
|
||||
oldPos: -1,
|
||||
lastComponent: undefined
|
||||
}]; // Seed editLength = 0, i.e. the content starts with the same values
|
||||
|
||||
var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
|
||||
var newPos = this.extractCommon(bestPath[0], newString, oldString, 0);
|
||||
|
||||
if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
|
||||
if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
||||
// Identity per the equality and tokenizer
|
||||
return done([{
|
||||
value: this.join(newString),
|
||||
count: newString.length
|
||||
}]);
|
||||
} // Main worker method. checks all permutations of a given edit length for acceptance.
|
||||
} // Once we hit the right edge of the edit graph on some diagonal k, we can
|
||||
// definitely reach the end of the edit graph in no more than k edits, so
|
||||
// there's no point in considering any moves to diagonal k+1 any more (from
|
||||
// which we're guaranteed to need at least k+1 more edits).
|
||||
// Similarly, once we've reached the bottom of the edit graph, there's no
|
||||
// point considering moves to lower diagonals.
|
||||
// We record this fact by setting minDiagonalToConsider and
|
||||
// maxDiagonalToConsider to some finite value once we've hit the edge of
|
||||
// the edit graph.
|
||||
// This optimization is not faithful to the original algorithm presented in
|
||||
// Myers's paper, which instead pointlessly extends D-paths off the end of
|
||||
// the edit graph - see page 7 of Myers's paper which notes this point
|
||||
// explicitly and illustrates it with a diagram. This has major performance
|
||||
// implications for some common scenarios. For instance, to compute a diff
|
||||
// where the new text simply appends d characters on the end of the
|
||||
// original text of length n, the true Myers algorithm will take O(n+d^2)
|
||||
// time while this optimization needs only O(n+d) time.
|
||||
|
||||
|
||||
var minDiagonalToConsider = -Infinity,
|
||||
maxDiagonalToConsider = Infinity; // Main worker method. checks all permutations of a given edit length for acceptance.
|
||||
|
||||
function execEditLength() {
|
||||
for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
|
||||
for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
|
||||
var basePath = void 0;
|
||||
var removePath = bestPath[diagonalPath - 1],
|
||||
addPath = bestPath[diagonalPath + 1];
|
||||
|
||||
var addPath = bestPath[diagonalPath - 1],
|
||||
removePath = bestPath[diagonalPath + 1],
|
||||
_oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
|
||||
|
||||
if (addPath) {
|
||||
if (removePath) {
|
||||
// No one else is going to attempt to use this value, clear it
|
||||
bestPath[diagonalPath - 1] = undefined;
|
||||
}
|
||||
|
||||
var canAdd = addPath && addPath.newPos + 1 < newLen,
|
||||
canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
|
||||
var canAdd = false;
|
||||
|
||||
if (addPath) {
|
||||
// what newPos will be after we do an insertion:
|
||||
var addPathNewPos = addPath.oldPos - diagonalPath;
|
||||
canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
|
||||
}
|
||||
|
||||
var canRemove = removePath && removePath.oldPos + 1 < oldLen;
|
||||
|
||||
if (!canAdd && !canRemove) {
|
||||
// If this path is a terminal then prune
|
||||
bestPath[diagonalPath] = undefined;
|
||||
continue;
|
||||
} // Select the diagonal that we want to branch from. We select the prior
|
||||
// path whose position in the new string is the farthest from the origin
|
||||
// path whose position in the old string is the farthest from the origin
|
||||
// and does not pass the bounds of the diff graph
|
||||
// TODO: Remove the `+ 1` here to make behavior match Myers algorithm
|
||||
// and prefer to order removals before insertions.
|
||||
|
||||
|
||||
if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
|
||||
basePath = clonePath(removePath);
|
||||
self.pushComponent(basePath.components, undefined, true);
|
||||
if (!canRemove || canAdd && removePath.oldPos + 1 < addPath.oldPos) {
|
||||
basePath = self.addToPath(addPath, true, undefined, 0);
|
||||
} else {
|
||||
basePath = addPath; // No need to clone, we've pulled it from the list
|
||||
|
||||
basePath.newPos++;
|
||||
self.pushComponent(basePath.components, true, undefined);
|
||||
basePath = self.addToPath(removePath, undefined, true, 1);
|
||||
}
|
||||
|
||||
_oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done
|
||||
newPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
|
||||
|
||||
if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
|
||||
return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
|
||||
if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
||||
// If we have hit the end of both strings, then we are done
|
||||
return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
|
||||
} else {
|
||||
// Otherwise track this path as a potential candidate and continue.
|
||||
bestPath[diagonalPath] = basePath;
|
||||
|
||||
if (basePath.oldPos + 1 >= oldLen) {
|
||||
maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
|
||||
}
|
||||
|
||||
if (newPos + 1 >= newLen) {
|
||||
minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -108,7 +142,7 @@ Diff.prototype = {
|
|||
if (callback) {
|
||||
(function exec() {
|
||||
setTimeout(function () {
|
||||
if (editLength > maxEditLength) {
|
||||
if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +152,7 @@ Diff.prototype = {
|
|||
}, 0);
|
||||
})();
|
||||
} else {
|
||||
while (editLength <= maxEditLength) {
|
||||
while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
|
||||
var ret = execEditLength();
|
||||
|
||||
if (ret) {
|
||||
|
|
@ -127,30 +161,36 @@ Diff.prototype = {
|
|||
}
|
||||
}
|
||||
},
|
||||
pushComponent: function pushComponent(components, added, removed) {
|
||||
var last = components[components.length - 1];
|
||||
addToPath: function addToPath(path, added, removed, oldPosInc) {
|
||||
var last = path.lastComponent;
|
||||
|
||||
if (last && last.added === added && last.removed === removed) {
|
||||
// We need to clone here as the component clone operation is just
|
||||
// as shallow array clone
|
||||
components[components.length - 1] = {
|
||||
count: last.count + 1,
|
||||
added: added,
|
||||
removed: removed
|
||||
return {
|
||||
oldPos: path.oldPos + oldPosInc,
|
||||
lastComponent: {
|
||||
count: last.count + 1,
|
||||
added: added,
|
||||
removed: removed,
|
||||
previousComponent: last.previousComponent
|
||||
}
|
||||
};
|
||||
} else {
|
||||
components.push({
|
||||
count: 1,
|
||||
added: added,
|
||||
removed: removed
|
||||
});
|
||||
return {
|
||||
oldPos: path.oldPos + oldPosInc,
|
||||
lastComponent: {
|
||||
count: 1,
|
||||
added: added,
|
||||
removed: removed,
|
||||
previousComponent: last
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
|
||||
var newLen = newString.length,
|
||||
oldLen = oldString.length,
|
||||
newPos = basePath.newPos,
|
||||
oldPos = newPos - diagonalPath,
|
||||
oldPos = basePath.oldPos,
|
||||
newPos = oldPos - diagonalPath,
|
||||
commonCount = 0;
|
||||
|
||||
while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
|
||||
|
|
@ -160,13 +200,14 @@ Diff.prototype = {
|
|||
}
|
||||
|
||||
if (commonCount) {
|
||||
basePath.components.push({
|
||||
count: commonCount
|
||||
});
|
||||
basePath.lastComponent = {
|
||||
count: commonCount,
|
||||
previousComponent: basePath.lastComponent
|
||||
};
|
||||
}
|
||||
|
||||
basePath.newPos = newPos;
|
||||
return oldPos;
|
||||
basePath.oldPos = oldPos;
|
||||
return newPos;
|
||||
},
|
||||
equals: function equals(left, right) {
|
||||
if (this.options.comparator) {
|
||||
|
|
@ -197,7 +238,20 @@ Diff.prototype = {
|
|||
}
|
||||
};
|
||||
|
||||
function buildValues(diff, components, newString, oldString, useLongestToken) {
|
||||
function buildValues(diff, lastComponent, newString, oldString, useLongestToken) {
|
||||
// First we convert our linked list of components in reverse order to an
|
||||
// array in the right order:
|
||||
var components = [];
|
||||
var nextComponent;
|
||||
|
||||
while (lastComponent) {
|
||||
components.push(lastComponent);
|
||||
nextComponent = lastComponent.previousComponent;
|
||||
delete lastComponent.previousComponent;
|
||||
lastComponent = nextComponent;
|
||||
}
|
||||
|
||||
components.reverse();
|
||||
var componentPos = 0,
|
||||
componentLen = components.length,
|
||||
newPos = 0,
|
||||
|
|
@ -240,23 +294,16 @@ function buildValues(diff, components, newString, oldString, useLongestToken) {
|
|||
// This is only available for string mode.
|
||||
|
||||
|
||||
var lastComponent = components[componentLen - 1];
|
||||
var finalComponent = components[componentLen - 1];
|
||||
|
||||
if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) {
|
||||
components[componentLen - 2].value += lastComponent.value;
|
||||
if (componentLen > 1 && typeof finalComponent.value === 'string' && (finalComponent.added || finalComponent.removed) && diff.equals('', finalComponent.value)) {
|
||||
components[componentLen - 2].value += finalComponent.value;
|
||||
components.pop();
|
||||
}
|
||||
|
||||
return components;
|
||||
}
|
||||
|
||||
function clonePath(path) {
|
||||
return {
|
||||
newPos: path.newPos,
|
||||
components: path.components.slice(0)
|
||||
};
|
||||
}
|
||||
|
||||
var characterDiff = new Diff();
|
||||
function diffChars(oldStr, newStr, options) {
|
||||
return characterDiff.diff(oldStr, newStr, options);
|
||||
|
|
@ -337,6 +384,11 @@ function diffWordsWithSpace(oldStr, newStr, options) {
|
|||
var lineDiff = new Diff();
|
||||
|
||||
lineDiff.tokenize = function (value) {
|
||||
if (this.options.stripTrailingCr) {
|
||||
// remove one \r before \n to match GNU diff's --strip-trailing-cr behavior
|
||||
value = value.replace(/\r\n/g, '\n');
|
||||
}
|
||||
|
||||
var retLines = [],
|
||||
linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line
|
||||
|
||||
|
|
@ -408,6 +460,55 @@ function _typeof(obj) {
|
|||
return _typeof(obj);
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
function _toConsumableArray(arr) {
|
||||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
||||
}
|
||||
|
|
@ -840,7 +941,7 @@ function applyPatch(source, uniDiff) {
|
|||
var line = _hunk.lines[j],
|
||||
operation = line.length > 0 ? line[0] : ' ',
|
||||
content = line.length > 0 ? line.substr(1) : line,
|
||||
delimiter = _hunk.linedelimiters[j];
|
||||
delimiter = _hunk.linedelimiters && _hunk.linedelimiters[j] || '\n';
|
||||
|
||||
if (operation === ' ') {
|
||||
_toPos++;
|
||||
|
|
@ -1047,6 +1148,10 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
|
|||
};
|
||||
}
|
||||
function formatPatch(diff) {
|
||||
if (Array.isArray(diff)) {
|
||||
return diff.map(formatPatch).join('\n');
|
||||
}
|
||||
|
||||
var ret = [];
|
||||
|
||||
if (diff.oldFileName == diff.newFileName) {
|
||||
|
|
@ -1502,6 +1607,39 @@ function calcOldNewLineCount(lines) {
|
|||
};
|
||||
}
|
||||
|
||||
function reversePatch(structuredPatch) {
|
||||
if (Array.isArray(structuredPatch)) {
|
||||
return structuredPatch.map(reversePatch).reverse();
|
||||
}
|
||||
|
||||
return _objectSpread2(_objectSpread2({}, structuredPatch), {}, {
|
||||
oldFileName: structuredPatch.newFileName,
|
||||
oldHeader: structuredPatch.newHeader,
|
||||
newFileName: structuredPatch.oldFileName,
|
||||
newHeader: structuredPatch.oldHeader,
|
||||
hunks: structuredPatch.hunks.map(function (hunk) {
|
||||
return {
|
||||
oldLines: hunk.newLines,
|
||||
oldStart: hunk.newStart,
|
||||
newLines: hunk.oldLines,
|
||||
newStart: hunk.oldStart,
|
||||
linedelimiters: hunk.linedelimiters,
|
||||
lines: hunk.lines.map(function (l) {
|
||||
if (l.startsWith('-')) {
|
||||
return "+".concat(l.slice(1));
|
||||
}
|
||||
|
||||
if (l.startsWith('+')) {
|
||||
return "-".concat(l.slice(1));
|
||||
}
|
||||
|
||||
return l;
|
||||
})
|
||||
};
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// See: http://code.google.com/p/google-diff-match-patch/wiki/API
|
||||
function convertChangesToDMP(changes) {
|
||||
var ret = [],
|
||||
|
|
@ -1558,4 +1696,4 @@ function escapeHTML(s) {
|
|||
return n;
|
||||
}
|
||||
|
||||
export { Diff, applyPatch, applyPatches, canonicalize, convertChangesToDMP, convertChangesToXML, createPatch, createTwoFilesPatch, diffArrays, diffChars, diffCss, diffJson, diffLines, diffSentences, diffTrimmedLines, diffWords, diffWordsWithSpace, merge, parsePatch, structuredPatch };
|
||||
export { Diff, applyPatch, applyPatches, canonicalize, convertChangesToDMP, convertChangesToXML, createPatch, createTwoFilesPatch, diffArrays, diffChars, diffCss, diffJson, diffLines, diffSentences, diffTrimmedLines, diffWords, diffWordsWithSpace, formatPatch, merge, parsePatch, reversePatch, structuredPatch };
|
||||
|
|
|
|||
4
node_modules/diff/lib/patch/apply.js
generated
vendored
4
node_modules/diff/lib/patch/apply.js
generated
vendored
File diff suppressed because one or more lines are too long
6
node_modules/diff/lib/patch/create.js
generated
vendored
6
node_modules/diff/lib/patch/create.js
generated
vendored
File diff suppressed because one or more lines are too long
63
node_modules/diff/lib/patch/reverse.js
generated
vendored
Normal file
63
node_modules/diff/lib/patch/reverse.js
generated
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/*istanbul ignore start*/
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.reversePatch = reversePatch;
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/*istanbul ignore end*/
|
||||
function reversePatch(structuredPatch) {
|
||||
if (Array.isArray(structuredPatch)) {
|
||||
return structuredPatch.map(reversePatch).reverse();
|
||||
}
|
||||
|
||||
return (
|
||||
/*istanbul ignore start*/
|
||||
_objectSpread(_objectSpread({},
|
||||
/*istanbul ignore end*/
|
||||
structuredPatch), {}, {
|
||||
oldFileName: structuredPatch.newFileName,
|
||||
oldHeader: structuredPatch.newHeader,
|
||||
newFileName: structuredPatch.oldFileName,
|
||||
newHeader: structuredPatch.oldHeader,
|
||||
hunks: structuredPatch.hunks.map(function (hunk) {
|
||||
return {
|
||||
oldLines: hunk.newLines,
|
||||
oldStart: hunk.newStart,
|
||||
newLines: hunk.oldLines,
|
||||
newStart: hunk.oldStart,
|
||||
linedelimiters: hunk.linedelimiters,
|
||||
lines: hunk.lines.map(function (l) {
|
||||
if (l.startsWith('-')) {
|
||||
return (
|
||||
/*istanbul ignore start*/
|
||||
"+".concat(
|
||||
/*istanbul ignore end*/
|
||||
l.slice(1))
|
||||
);
|
||||
}
|
||||
|
||||
if (l.startsWith('+')) {
|
||||
return (
|
||||
/*istanbul ignore start*/
|
||||
"-".concat(
|
||||
/*istanbul ignore end*/
|
||||
l.slice(1))
|
||||
);
|
||||
}
|
||||
|
||||
return l;
|
||||
})
|
||||
};
|
||||
})
|
||||
})
|
||||
);
|
||||
}
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9yZXZlcnNlLmpzIl0sIm5hbWVzIjpb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FkZXIsXG4gICAgbmV3RmlsZU5hbWU6IHN0cnVjdHVyZWRQYXRjaC5vbGRGaWxlTmFtZSxcbiAgICBuZXdIZWFkZXI6IHN0cnVjdHVyZWRQYXRjaC5vbGRIZWFkZXIsXG4gICAgaHVua3M6IHN0cnVjdHVyZWRQYXRjaC5odW5rcy5tYXAoaHVuayA9PiB7XG4gICAgICByZXR1cm4ge1xuICAgICAgICBvbGRMaW5lczogaHVuay5uZXdMaW5lcyxcbiAgICAgICAgb2xkU3RhcnQ6IGh1bmsubmV3U3RhcnQsXG4gICAgICAgIG5ld0xpbmVzOiBodW5rLm9sZExpbmVzLFxuICAgICAgICBuZXdTdGFydDogaHVuay5vbGRTdGFydCxcbiAgICAgICAgbGluZWRlbGltaXRlcnM6IGh1bmsubGluZWRlbGltaXRlcnMsXG4gICAgICAgIGxpbmVzOiBodW5rLmxpbmVzLm1hcChsID0+IHtcbiAgICAgICAgICBpZiAobC5zdGFydHNXaXRoKCctJykpIHsgcmV0dXJuIGArJHtsLnNsaWNlKDEpfWA7IH1cbiAgICAgICAgICBpZiAobC5zdGFydHNXaXRoKCcrJykpIHsgcmV0dXJuIGAtJHtsLnNsaWNlKDEpfWA7IH1cbiAgICAgICAgICByZXR1cm4gbDtcbiAgICAgICAgfSlcbiAgICAgIH07XG4gICAgfSlcbiAgfTtcbn1cbiJdfQ==
|
||||
14
node_modules/diff/package.json
generated
vendored
14
node_modules/diff/package.json
generated
vendored
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "diff",
|
||||
"version": "5.1.0",
|
||||
"description": "A javascript text diff implementation.",
|
||||
"version": "5.2.0",
|
||||
"description": "A JavaScript text diff implementation.",
|
||||
"keywords": [
|
||||
"diff",
|
||||
"jsdiff",
|
||||
|
|
@ -13,7 +13,8 @@
|
|||
"javascript"
|
||||
],
|
||||
"maintainers": [
|
||||
"Kevin Decker <kpdecker@gmail.com> (http://incaseofstairs.com)"
|
||||
"Kevin Decker <kpdecker@gmail.com> (http://incaseofstairs.com)",
|
||||
"Mark Amery <markrobertamery+jsdiff@gmail.com>"
|
||||
],
|
||||
"bugs": {
|
||||
"email": "kpdecker@gmail.com",
|
||||
|
|
@ -37,7 +38,8 @@
|
|||
"require": "./lib/index.js"
|
||||
},
|
||||
"./package.json": "./package.json",
|
||||
"./": "./"
|
||||
"./": "./",
|
||||
"./*": "./*"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rm -rf lib/ dist/",
|
||||
|
|
@ -50,10 +52,10 @@
|
|||
"@babel/plugin-transform-modules-commonjs": "^7.2.0",
|
||||
"@babel/preset-env": "^7.2.3",
|
||||
"@babel/register": "^7.0.0",
|
||||
"@colors/colors": "^1.3.3",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-loader": "^8.0.5",
|
||||
"chai": "^4.2.0",
|
||||
"colors": "^1.3.3",
|
||||
"eslint": "^5.12.0",
|
||||
"grunt": "^1.0.3",
|
||||
"grunt-babel": "^8.0.0",
|
||||
|
|
@ -69,7 +71,7 @@
|
|||
"grunt-mocha-test": "^0.13.3",
|
||||
"grunt-webpack": "^3.1.3",
|
||||
"istanbul": "github:kpdecker/istanbul",
|
||||
"karma": "^5.1.1",
|
||||
"karma": "^6.3.16",
|
||||
"karma-chrome-launcher": "^3.1.0",
|
||||
"karma-mocha": "^2.0.1",
|
||||
"karma-mocha-reporter": "^2.0.0",
|
||||
|
|
|
|||
14
node_modules/diff/release-notes.md
generated
vendored
14
node_modules/diff/release-notes.md
generated
vendored
|
|
@ -1,14 +1,22 @@
|
|||
# Release Notes
|
||||
|
||||
## Development
|
||||
## v5.2.0
|
||||
|
||||
[Commits](https://github.com/kpdecker/jsdiff/compare/v5.0.0...master)
|
||||
[Commits](https://github.com/kpdecker/jsdiff/compare/v5.1.0...master)
|
||||
|
||||
- [#411](https://github.com/kpdecker/jsdiff/pull/411) Big performance improvement. Previously an O(n) array-copying operation inside the innermost loop of jsdiff's base diffing code increased the overall worst-case time complexity of computing a diff from O(n²) to O(n³). This is now fixed, bringing the worst-case time complexity down to what it theoretically should be for a Myers diff implementation.
|
||||
- [#448](https://github.com/kpdecker/jsdiff/pull/411) Performance improvement. Diagonals whose furthest-reaching D-path would go off the edge of the edit graph are now skipped, rather than being pointlessly considered as called for by the original Myers diff algorithm. This dramatically speeds up computing diffs where the new text just appends or truncates content at the end of the old text.
|
||||
- [#351](https://github.com/kpdecker/jsdiff/issues/351) Importing from the lib folder - e.g. `require("diff/lib/diff/word.js")` - will work again now. This had been broken for users on the latest version of Node since Node 17.5.0, which changed how Node interprets the `exports` property in jsdiff's `package.json` file.
|
||||
- [#344](https://github.com/kpdecker/jsdiff/issues/344) `diffLines`, `createTwoFilesPatch`, and other patch-creation methods now take an optional `stripTrailingCr: true` option which causes Windows-style `\r\n` line endings to be replaced with Unix-style `\n` line endings before calculating the diff, just like GNU `diff`'s `--strip-trailing-cr` flag.
|
||||
- [#451](https://github.com/kpdecker/jsdiff/pull/451) Added `diff.formatPatch`.
|
||||
- [#450](https://github.com/kpdecker/jsdiff/pull/450) Added `diff.reversePatch`.
|
||||
- [#478](https://github.com/kpdecker/jsdiff/pull/478) Added `timeout` option.
|
||||
|
||||
## v5.1.0
|
||||
|
||||
- [#365](https://github.com/kpdecker/jsdiff/issues/365) Allow early termination to limit execution time with degenerate cases
|
||||
|
||||
[Commits](https://github.com/kpdecker/jsdiff/compare/v5.0.0...v5.0.1)
|
||||
[Commits](https://github.com/kpdecker/jsdiff/compare/v5.0.0...v5.1.0)
|
||||
|
||||
## v5.0.0
|
||||
|
||||
|
|
|
|||
9
node_modules/fill-range/index.js
generated
vendored
9
node_modules/fill-range/index.js
generated
vendored
|
|
@ -60,7 +60,7 @@ const toMaxLen = (input, maxLength) => {
|
|||
return negative ? ('-' + input) : input;
|
||||
};
|
||||
|
||||
const toSequence = (parts, options) => {
|
||||
const toSequence = (parts, options, maxLen) => {
|
||||
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
||||
parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
||||
|
||||
|
|
@ -70,11 +70,11 @@ const toSequence = (parts, options) => {
|
|||
let result;
|
||||
|
||||
if (parts.positives.length) {
|
||||
positives = parts.positives.join('|');
|
||||
positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|');
|
||||
}
|
||||
|
||||
if (parts.negatives.length) {
|
||||
negatives = `-(${prefix}${parts.negatives.join('|')})`;
|
||||
negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`;
|
||||
}
|
||||
|
||||
if (positives && negatives) {
|
||||
|
|
@ -172,7 +172,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
|
|||
|
||||
if (options.toRegex === true) {
|
||||
return step > 1
|
||||
? toSequence(parts, options)
|
||||
? toSequence(parts, options, maxLen)
|
||||
: toRegex(range, null, { wrap: false, ...options });
|
||||
}
|
||||
|
||||
|
|
@ -184,7 +184,6 @@ const fillLetters = (start, end, step = 1, options = {}) => {
|
|||
return invalidRange(start, end, options);
|
||||
}
|
||||
|
||||
|
||||
let format = options.transform || (val => String.fromCharCode(val));
|
||||
let a = `${start}`.charCodeAt(0);
|
||||
let b = `${end}`.charCodeAt(0);
|
||||
|
|
|
|||
11
node_modules/fill-range/package.json
generated
vendored
11
node_modules/fill-range/package.json
generated
vendored
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "fill-range",
|
||||
"description": "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`",
|
||||
"version": "7.0.1",
|
||||
"version": "7.1.1",
|
||||
"homepage": "https://github.com/jonschlinkert/fill-range",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"contributors": [
|
||||
|
|
@ -24,14 +24,19 @@
|
|||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
"lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .",
|
||||
"mocha": "mocha --reporter dot",
|
||||
"test": "npm run lint && npm run mocha",
|
||||
"test:ci": "npm run test:cover",
|
||||
"test:cover": "nyc npm run mocha"
|
||||
},
|
||||
"dependencies": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp-format-md": "^2.0.0",
|
||||
"mocha": "^6.1.1"
|
||||
"mocha": "^6.1.1",
|
||||
"nyc": "^15.1.0"
|
||||
},
|
||||
"keywords": [
|
||||
"alpha",
|
||||
|
|
|
|||
54
node_modules/isarray/README.md
generated
vendored
54
node_modules/isarray/README.md
generated
vendored
|
|
@ -1,54 +0,0 @@
|
|||
|
||||
# isarray
|
||||
|
||||
`Array#isArray` for older browsers.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var isArray = require('isarray');
|
||||
|
||||
console.log(isArray([])); // => true
|
||||
console.log(isArray({})); // => false
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
With [npm](http://npmjs.org) do
|
||||
|
||||
```bash
|
||||
$ npm install isarray
|
||||
```
|
||||
|
||||
Then bundle for the browser with
|
||||
[browserify](https://github.com/substack/browserify).
|
||||
|
||||
With [component](http://component.io) do
|
||||
|
||||
```bash
|
||||
$ component install juliangruber/isarray
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
(MIT)
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
||||
|
||||
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.
|
||||
209
node_modules/isarray/build/build.js
generated
vendored
209
node_modules/isarray/build/build.js
generated
vendored
|
|
@ -1,209 +0,0 @@
|
|||
|
||||
/**
|
||||
* Require the given path.
|
||||
*
|
||||
* @param {String} path
|
||||
* @return {Object} exports
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function require(path, parent, orig) {
|
||||
var resolved = require.resolve(path);
|
||||
|
||||
// lookup failed
|
||||
if (null == resolved) {
|
||||
orig = orig || path;
|
||||
parent = parent || 'root';
|
||||
var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
|
||||
err.path = orig;
|
||||
err.parent = parent;
|
||||
err.require = true;
|
||||
throw err;
|
||||
}
|
||||
|
||||
var module = require.modules[resolved];
|
||||
|
||||
// perform real require()
|
||||
// by invoking the module's
|
||||
// registered function
|
||||
if (!module.exports) {
|
||||
module.exports = {};
|
||||
module.client = module.component = true;
|
||||
module.call(this, module.exports, require.relative(resolved), module);
|
||||
}
|
||||
|
||||
return module.exports;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registered modules.
|
||||
*/
|
||||
|
||||
require.modules = {};
|
||||
|
||||
/**
|
||||
* Registered aliases.
|
||||
*/
|
||||
|
||||
require.aliases = {};
|
||||
|
||||
/**
|
||||
* Resolve `path`.
|
||||
*
|
||||
* Lookup:
|
||||
*
|
||||
* - PATH/index.js
|
||||
* - PATH.js
|
||||
* - PATH
|
||||
*
|
||||
* @param {String} path
|
||||
* @return {String} path or null
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.resolve = function(path) {
|
||||
if (path.charAt(0) === '/') path = path.slice(1);
|
||||
var index = path + '/index.js';
|
||||
|
||||
var paths = [
|
||||
path,
|
||||
path + '.js',
|
||||
path + '.json',
|
||||
path + '/index.js',
|
||||
path + '/index.json'
|
||||
];
|
||||
|
||||
for (var i = 0; i < paths.length; i++) {
|
||||
var path = paths[i];
|
||||
if (require.modules.hasOwnProperty(path)) return path;
|
||||
}
|
||||
|
||||
if (require.aliases.hasOwnProperty(index)) {
|
||||
return require.aliases[index];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Normalize `path` relative to the current path.
|
||||
*
|
||||
* @param {String} curr
|
||||
* @param {String} path
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.normalize = function(curr, path) {
|
||||
var segs = [];
|
||||
|
||||
if ('.' != path.charAt(0)) return path;
|
||||
|
||||
curr = curr.split('/');
|
||||
path = path.split('/');
|
||||
|
||||
for (var i = 0; i < path.length; ++i) {
|
||||
if ('..' == path[i]) {
|
||||
curr.pop();
|
||||
} else if ('.' != path[i] && '' != path[i]) {
|
||||
segs.push(path[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return curr.concat(segs).join('/');
|
||||
};
|
||||
|
||||
/**
|
||||
* Register module at `path` with callback `definition`.
|
||||
*
|
||||
* @param {String} path
|
||||
* @param {Function} definition
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.register = function(path, definition) {
|
||||
require.modules[path] = definition;
|
||||
};
|
||||
|
||||
/**
|
||||
* Alias a module definition.
|
||||
*
|
||||
* @param {String} from
|
||||
* @param {String} to
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.alias = function(from, to) {
|
||||
if (!require.modules.hasOwnProperty(from)) {
|
||||
throw new Error('Failed to alias "' + from + '", it does not exist');
|
||||
}
|
||||
require.aliases[to] = from;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return a require function relative to the `parent` path.
|
||||
*
|
||||
* @param {String} parent
|
||||
* @return {Function}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.relative = function(parent) {
|
||||
var p = require.normalize(parent, '..');
|
||||
|
||||
/**
|
||||
* lastIndexOf helper.
|
||||
*/
|
||||
|
||||
function lastIndexOf(arr, obj) {
|
||||
var i = arr.length;
|
||||
while (i--) {
|
||||
if (arr[i] === obj) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* The relative require() itself.
|
||||
*/
|
||||
|
||||
function localRequire(path) {
|
||||
var resolved = localRequire.resolve(path);
|
||||
return require(resolved, parent, path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve relative to the parent.
|
||||
*/
|
||||
|
||||
localRequire.resolve = function(path) {
|
||||
var c = path.charAt(0);
|
||||
if ('/' == c) return path.slice(1);
|
||||
if ('.' == c) return require.normalize(p, path);
|
||||
|
||||
// resolve deps by returning
|
||||
// the dep in the nearest "deps"
|
||||
// directory
|
||||
var segs = parent.split('/');
|
||||
var i = lastIndexOf(segs, 'deps') + 1;
|
||||
if (!i) i = 0;
|
||||
path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
|
||||
return path;
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if module is defined at `path`.
|
||||
*/
|
||||
|
||||
localRequire.exists = function(path) {
|
||||
return require.modules.hasOwnProperty(localRequire.resolve(path));
|
||||
};
|
||||
|
||||
return localRequire;
|
||||
};
|
||||
require.register("isarray/index.js", function(exports, require, module){
|
||||
module.exports = Array.isArray || function (arr) {
|
||||
return Object.prototype.toString.call(arr) == '[object Array]';
|
||||
};
|
||||
|
||||
});
|
||||
require.alias("isarray/index.js", "isarray/index.js");
|
||||
|
||||
19
node_modules/isarray/component.json
generated
vendored
19
node_modules/isarray/component.json
generated
vendored
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"name" : "isarray",
|
||||
"description" : "Array#isArray for older browsers",
|
||||
"version" : "0.0.1",
|
||||
"repository" : "juliangruber/isarray",
|
||||
"homepage": "https://github.com/juliangruber/isarray",
|
||||
"main" : "index.js",
|
||||
"scripts" : [
|
||||
"index.js"
|
||||
],
|
||||
"dependencies" : {},
|
||||
"keywords": ["browser","isarray","array"],
|
||||
"author": {
|
||||
"name": "Julian Gruber",
|
||||
"email": "mail@juliangruber.com",
|
||||
"url": "http://juliangruber.com"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
3
node_modules/isarray/index.js
generated
vendored
3
node_modules/isarray/index.js
generated
vendored
|
|
@ -1,3 +0,0 @@
|
|||
module.exports = Array.isArray || function (arr) {
|
||||
return Object.prototype.toString.call(arr) == '[object Array]';
|
||||
};
|
||||
29
node_modules/isarray/package.json
generated
vendored
29
node_modules/isarray/package.json
generated
vendored
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"name": "isarray",
|
||||
"description": "Array#isArray for older browsers",
|
||||
"version": "0.0.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/juliangruber/isarray.git"
|
||||
},
|
||||
"homepage": "https://github.com/juliangruber/isarray",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "tap test/*.js"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"tap": "*"
|
||||
},
|
||||
"keywords": [
|
||||
"browser",
|
||||
"isarray",
|
||||
"array"
|
||||
],
|
||||
"author": {
|
||||
"name": "Julian Gruber",
|
||||
"email": "mail@juliangruber.com",
|
||||
"url": "http://juliangruber.com"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
19
node_modules/just-extend/CHANGELOG.md
generated
vendored
Normal file
19
node_modules/just-extend/CHANGELOG.md
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# just-extend
|
||||
|
||||
## 6.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Rename node module .js -> .cjs
|
||||
|
||||
## 6.1.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- fix: reorder exports to set default last #488
|
||||
|
||||
## 6.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- package.json updates to fix #467 and #483
|
||||
16
node_modules/just-extend/README.md
generated
vendored
16
node_modules/just-extend/README.md
generated
vendored
|
|
@ -1,9 +1,21 @@
|
|||
<!-- DO NOT EDIT THIS FILE! THIS FILE WAS AUTOGENERATED BY TEMPLATE-MATE -->
|
||||
<!-- SEE https://github.com/angus-c/just/blob/master/CONTRIBUTING.md#readme-template -->
|
||||
|
||||
## just-extend
|
||||
|
||||
Part of a [library](../../../../) of zero-dependency npm modules that do just do one thing.
|
||||
Part of a [library](https://anguscroll.com/just) of zero-dependency npm modules that do just do one thing.
|
||||
Guilt-free utilities for every occasion.
|
||||
|
||||
[Try it now](http://anguscroll.com/just/just-extend)
|
||||
[`🍦 Try it`](https://anguscroll.com/just/just-extend)
|
||||
|
||||
```shell
|
||||
npm install just-extend
|
||||
```
|
||||
```shell
|
||||
yarn add just-extend
|
||||
```
|
||||
|
||||
Extend an object
|
||||
|
||||
```js
|
||||
import extend from 'just-extend';
|
||||
|
|
|
|||
0
node_modules/just-extend/index.js → node_modules/just-extend/index.cjs
generated
vendored
0
node_modules/just-extend/index.js → node_modules/just-extend/index.cjs
generated
vendored
2
node_modules/just-extend/index.d.ts
generated
vendored
2
node_modules/just-extend/index.d.ts
generated
vendored
|
|
@ -1,4 +1,4 @@
|
|||
// Definitions by: Peter Safranek <https://github.com/pe8ter>
|
||||
declare function extend(obj1: object, ...objn: any[]): object;
|
||||
declare function extend(deep: boolean, obj1: object, ...objn: any[]): object;
|
||||
export = extend;
|
||||
export default extend;
|
||||
|
|
|
|||
74
node_modules/just-extend/index.mjs
generated
vendored
Normal file
74
node_modules/just-extend/index.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
var objectExtend = extend;
|
||||
|
||||
/*
|
||||
var obj = {a: 3, b: 5};
|
||||
extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
|
||||
obj; // {a: 4, b: 5, c: 8}
|
||||
|
||||
var obj = {a: 3, b: 5};
|
||||
extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
|
||||
obj; // {a: 3, b: 5}
|
||||
|
||||
var arr = [1, 2, 3];
|
||||
var obj = {a: 3, b: 5};
|
||||
extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
|
||||
arr.push(4);
|
||||
obj; // {a: 3, b: 5, c: [1, 2, 3, 4]}
|
||||
|
||||
var arr = [1, 2, 3];
|
||||
var obj = {a: 3, b: 5};
|
||||
extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
|
||||
arr.push(4);
|
||||
obj; // {a: 3, b: 5, c: [1, 2, 3]}
|
||||
|
||||
extend({a: 4, b: 5}); // {a: 4, b: 5}
|
||||
extend({a: 4, b: 5}, 3); {a: 4, b: 5}
|
||||
extend({a: 4, b: 5}, true); {a: 4, b: 5}
|
||||
extend('hello', {a: 4, b: 5}); // throws
|
||||
extend(3, {a: 4, b: 5}); // throws
|
||||
*/
|
||||
|
||||
function extend(/* [deep], obj1, obj2, [objn] */) {
|
||||
var args = [].slice.call(arguments);
|
||||
var deep = false;
|
||||
if (typeof args[0] == 'boolean') {
|
||||
deep = args.shift();
|
||||
}
|
||||
var result = args[0];
|
||||
if (isUnextendable(result)) {
|
||||
throw new Error('extendee must be an object');
|
||||
}
|
||||
var extenders = args.slice(1);
|
||||
var len = extenders.length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
var extender = extenders[i];
|
||||
for (var key in extender) {
|
||||
if (Object.prototype.hasOwnProperty.call(extender, key)) {
|
||||
var value = extender[key];
|
||||
if (deep && isCloneable(value)) {
|
||||
var base = Array.isArray(value) ? [] : {};
|
||||
result[key] = extend(
|
||||
true,
|
||||
Object.prototype.hasOwnProperty.call(result, key) && !isUnextendable(result[key])
|
||||
? result[key]
|
||||
: base,
|
||||
value
|
||||
);
|
||||
} else {
|
||||
result[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function isCloneable(obj) {
|
||||
return Array.isArray(obj) || {}.toString.call(obj) == '[object Object]';
|
||||
}
|
||||
|
||||
function isUnextendable(val) {
|
||||
return !val || (typeof val != 'object' && typeof val != 'function');
|
||||
}
|
||||
|
||||
export {objectExtend as default};
|
||||
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