mirror of
https://github.com/github/codeql-action.git
synced 2025-12-07 08:18:08 +08:00
Compare commits
146 Commits
codeql-bun
...
codeql-bun
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c6b76bc5a | ||
|
|
19debd424c | ||
|
|
3fdc5a23fa | ||
|
|
68365ec944 | ||
|
|
474bbf07f9 | ||
|
|
58f66fa60a | ||
|
|
3d2ad0b9c8 | ||
|
|
7e15b9612a | ||
|
|
7f9dca2982 | ||
|
|
87bfa0ea7a | ||
|
|
a6d606becc | ||
|
|
f2027c51f7 | ||
|
|
70e63f4b08 | ||
|
|
88073a5f6e | ||
|
|
eb172af46d | ||
|
|
a777a982cb | ||
|
|
8f27994474 | ||
|
|
8e2954c3fa | ||
|
|
8768b0f5a3 | ||
|
|
c72c200f52 | ||
|
|
34c777f8d0 | ||
|
|
8dd2b9ac2f | ||
|
|
b8047e5610 | ||
|
|
edd03fbd2c | ||
|
|
f9607205db | ||
|
|
b870f13d6d | ||
|
|
2890d306c3 | ||
|
|
2b46439dd5 | ||
|
|
6d8390b7cb | ||
|
|
4eb03fb6f3 | ||
|
|
03c64ef07d | ||
|
|
cc622a02a9 | ||
|
|
c95a3d854c | ||
|
|
f888be73ce | ||
|
|
16d4068732 | ||
|
|
aab545260e | ||
|
|
501fe7ff12 | ||
|
|
ad40e4a8f8 | ||
|
|
537b2f873a | ||
|
|
9f32fc9b9d | ||
|
|
904d0acf90 | ||
|
|
9b14aa7c84 | ||
|
|
1cddec9558 | ||
|
|
a005206838 | ||
|
|
ff33f031e8 | ||
|
|
6a6a3203dd | ||
|
|
942b34d547 | ||
|
|
3469c69bba | ||
|
|
d57c2761c9 | ||
|
|
6081b90eae | ||
|
|
78eb2c9c00 | ||
|
|
b2af0740e4 | ||
|
|
77194581b7 | ||
|
|
1a5b604256 | ||
|
|
9bfa05fb03 | ||
|
|
e9aa623c5d | ||
|
|
ce89f1b611 | ||
|
|
57f34a1569 | ||
|
|
941e382c65 | ||
|
|
6c6b8c33c4 | ||
|
|
13f97c81fe | ||
|
|
36419a79c1 | ||
|
|
9a40cc5274 | ||
|
|
ec0b3ae7ff | ||
|
|
e836f97769 | ||
|
|
11639426e6 | ||
|
|
a9da9fc959 | ||
|
|
ae8741006b | ||
|
|
72f9a88bc5 | ||
|
|
9f36b75178 | ||
|
|
dfe2bc4e49 | ||
|
|
63d0c7856c | ||
|
|
3cc87990f0 | ||
|
|
260b4d5dc4 | ||
|
|
1bfa9ace60 | ||
|
|
1eaaf07b91 | ||
|
|
5916f9896d | ||
|
|
0dd4dbf9d9 | ||
|
|
980fd4ed38 | ||
|
|
e9aa2c6f62 | ||
|
|
e9d52340a3 | ||
|
|
392931027a | ||
|
|
ba2b46d53e | ||
|
|
a602dbedb7 | ||
|
|
66777347f6 | ||
|
|
ce6e94b1b8 | ||
|
|
30790fe430 | ||
|
|
1a927e9307 | ||
|
|
ea2ef8554d | ||
|
|
bbb9c53c65 | ||
|
|
9664bae55e | ||
|
|
3a741b6cf5 | ||
|
|
1498bce660 | ||
|
|
c260382f36 | ||
|
|
6410c0691e | ||
|
|
8e07ec6ce2 | ||
|
|
c337e5f2f3 | ||
|
|
9673b562d9 | ||
|
|
253bc84963 | ||
|
|
bc4366e948 | ||
|
|
3b831aafd9 | ||
|
|
14b1fecf33 | ||
|
|
5e23536180 | ||
|
|
5f30e2466f | ||
|
|
05981c5829 | ||
|
|
486633d442 | ||
|
|
d6360c9075 | ||
|
|
d3a0787934 | ||
|
|
e13c8bbfb7 | ||
|
|
1c9a1f5d01 | ||
|
|
1f7dab4ba2 | ||
|
|
8a36468d11 | ||
|
|
f8c38c1af3 | ||
|
|
10249d1591 | ||
|
|
e6bcd71529 | ||
|
|
806fc12eb2 | ||
|
|
ba352d365b | ||
|
|
751af2a9e3 | ||
|
|
1a686e7d76 | ||
|
|
0479586f61 | ||
|
|
708446c6e4 | ||
|
|
392316b555 | ||
|
|
5604c0a3ad | ||
|
|
7d8ca8fa93 | ||
|
|
8b37404d56 | ||
|
|
c180f23bb1 | ||
|
|
a7adbce22c | ||
|
|
3b4e4d44dc | ||
|
|
f18151cc59 | ||
|
|
e175dea369 | ||
|
|
752ae5743f | ||
|
|
0dabead789 | ||
|
|
5e69ce82f8 | ||
|
|
fdb92bbffe | ||
|
|
14b4839253 | ||
|
|
d76304cd8e | ||
|
|
57c4e974c2 | ||
|
|
c2fb041dc1 | ||
|
|
ac9d34fbc6 | ||
|
|
384cfc42b2 | ||
|
|
5a1e31dc6a | ||
|
|
67c0353a8c | ||
|
|
7ec25e02e3 | ||
|
|
713eacdf6c | ||
|
|
c8290d07f0 | ||
|
|
51126e5cd1 |
@@ -10,7 +10,8 @@
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
||||
"plugin:github/recommended",
|
||||
"plugin:github/typescript"
|
||||
"plugin:github/typescript",
|
||||
"plugin:import/typescript"
|
||||
],
|
||||
"rules": {
|
||||
"filenames/match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"],
|
||||
|
||||
60
.github/workflows/__analyze-ref-input.yml
generated
vendored
Normal file
60
.github/workflows/__analyze-ref-input.yml
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
# Warning: This file is generated automatically, and should not be modified.
|
||||
# Instead, please modify the template in the pr-checks directory and run:
|
||||
# pip install ruamel.yaml && python3 sync.py
|
||||
# to regenerate this file.
|
||||
|
||||
name: "PR Check - Analyze: 'ref' and 'sha' from inputs"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GO111MODULE: auto
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- v1
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
- ready_for_review
|
||||
workflow_dispatch: {}
|
||||
jobs:
|
||||
analyze-ref-input:
|
||||
strategy:
|
||||
matrix:
|
||||
version:
|
||||
- stable-20201028
|
||||
- stable-20210319
|
||||
- stable-20210809
|
||||
- cached
|
||||
- latest
|
||||
- nightly-latest
|
||||
os: [ubuntu-latest, macos-latest, windows-2019]
|
||||
name: "Analyze: 'ref' and 'sha' from inputs"
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Prepare test
|
||||
id: prepare-test
|
||||
uses: ./.github/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
- uses: ./../action/init
|
||||
with:
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
languages: cpp,csharp,java,javascript,python
|
||||
config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
|
||||
github.sha }}
|
||||
- name: Build code
|
||||
shell: bash
|
||||
run: ./build.sh
|
||||
- uses: ./../action/analyze
|
||||
with:
|
||||
ref: refs/heads/main
|
||||
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
|
||||
env:
|
||||
TEST_MODE: true
|
||||
env:
|
||||
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||
5
.github/workflows/__go-custom-queries.yml
generated
vendored
5
.github/workflows/__go-custom-queries.yml
generated
vendored
@@ -30,10 +30,7 @@ jobs:
|
||||
- cached
|
||||
- latest
|
||||
- nightly-latest
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
os: [ubuntu-latest, macos-latest, windows-2019]
|
||||
name: 'Go: Custom queries'
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
|
||||
5
.github/workflows/__go-custom-tracing.yml
generated
vendored
5
.github/workflows/__go-custom-tracing.yml
generated
vendored
@@ -30,10 +30,7 @@ jobs:
|
||||
- cached
|
||||
- latest
|
||||
- nightly-latest
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
os: [ubuntu-latest, macos-latest, windows-2019]
|
||||
name: 'Go: Custom tracing'
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
|
||||
7
.github/workflows/__remote-config.yml
generated
vendored
7
.github/workflows/__remote-config.yml
generated
vendored
@@ -30,10 +30,7 @@ jobs:
|
||||
- cached
|
||||
- latest
|
||||
- nightly-latest
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
os: [ubuntu-latest, macos-latest, windows-2019]
|
||||
name: Remote config file
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
@@ -48,7 +45,7 @@ jobs:
|
||||
with:
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
languages: cpp,csharp,java,javascript,python
|
||||
config-file: github/codeql-action/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
|
||||
config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
|
||||
github.sha }}
|
||||
- name: Build code
|
||||
shell: bash
|
||||
|
||||
67
.github/workflows/__upload-ref-sha-input.yml
generated
vendored
Normal file
67
.github/workflows/__upload-ref-sha-input.yml
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
# Warning: This file is generated automatically, and should not be modified.
|
||||
# Instead, please modify the template in the pr-checks directory and run:
|
||||
# pip install ruamel.yaml && python3 sync.py
|
||||
# to regenerate this file.
|
||||
|
||||
name: "PR Check - Upload-sarif: 'ref' and 'sha' from inputs"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GO111MODULE: auto
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- v1
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
- ready_for_review
|
||||
workflow_dispatch: {}
|
||||
jobs:
|
||||
upload-ref-sha-input:
|
||||
strategy:
|
||||
matrix:
|
||||
version:
|
||||
- stable-20201028
|
||||
- stable-20210319
|
||||
- stable-20210809
|
||||
- cached
|
||||
- latest
|
||||
- nightly-latest
|
||||
os: [ubuntu-latest, macos-latest, windows-2019]
|
||||
name: "Upload-sarif: 'ref' and 'sha' from inputs"
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Prepare test
|
||||
id: prepare-test
|
||||
uses: ./.github/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
- uses: ./../action/init
|
||||
with:
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
languages: cpp,csharp,java,javascript,python
|
||||
config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
|
||||
github.sha }}
|
||||
- name: Build code
|
||||
shell: bash
|
||||
run: ./build.sh
|
||||
- uses: ./../action/analyze
|
||||
with:
|
||||
ref: refs/heads/main
|
||||
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
|
||||
upload: false
|
||||
env:
|
||||
TEST_MODE: true
|
||||
- uses: ./../action/upload-sarif
|
||||
with:
|
||||
ref: refs/heads/main
|
||||
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
|
||||
env:
|
||||
TEST_MODE: true
|
||||
env:
|
||||
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
|
||||
8
.github/workflows/pr-checks.yml
vendored
8
.github/workflows/pr-checks.yml
vendored
@@ -182,7 +182,9 @@ jobs:
|
||||
runner-analyze-csharp-windows:
|
||||
name: Runner windows C# analyze
|
||||
needs: [check-js, check-node-modules]
|
||||
runs-on: windows-latest
|
||||
# Build tracing currently does not support Windows 2022, so use `windows-2019` instead of
|
||||
# `windows-latest`.
|
||||
runs-on: windows-2019
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -301,7 +303,9 @@ jobs:
|
||||
runner-analyze-csharp-autobuild-windows:
|
||||
name: Runner windows autobuild C# analyze
|
||||
needs: [check-js, check-node-modules]
|
||||
runs-on: windows-latest
|
||||
# Build tracing currently does not support Windows 2022, so use `windows-2019` instead of
|
||||
# `windows-latest`.
|
||||
runs-on: windows-2019
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
2
.github/workflows/python-deps.yml
vendored
2
.github/workflows/python-deps.yml
vendored
@@ -125,7 +125,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
python-version: ${{ matrix.python_version }}
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: ./init
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +1,4 @@
|
||||
/runner/dist/
|
||||
/runner/node_modules/
|
||||
# Ignore for example failing-tests.json from AVA
|
||||
node_modules/.cache
|
||||
|
||||
27
CHANGELOG.md
27
CHANGELOG.md
@@ -4,6 +4,31 @@
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 1.1.0 - 11 Feb 2022
|
||||
|
||||
- The CodeQL Action now uses Node.js v16. [#909](https://github.com/github/codeql-action/pull/909)
|
||||
- Beware that the CodeQL build tracer in this release (and in all earlier releases) is incompatible with Windows 11 and Windows Server 2022. This incompatibility affects database extraction for compiled languages: cpp, csharp, go, and java. As a result, analyzing these languages with the `windows-latest` or `windows-2022` Actions virtual environments is currently unsupported. If you use any of these languages, please use the `windows-2019` Actions virtual environment or otherwise avoid these specific Windows versions until a new release fixes this incompatibility.
|
||||
|
||||
## 1.0.32 - 07 Feb 2022
|
||||
|
||||
- Add `sarif-id` as an output for the `upload-sarif` and `analyze` actions. [#889](https://github.com/github/codeql-action/pull/889)
|
||||
- Add `ref` and `sha` inputs to the `analyze` action, which override the defaults provided by the GitHub Action context. [#889](https://github.com/github/codeql-action/pull/889)
|
||||
- Update default CodeQL bundle version to 2.8.0. [#911](https://github.com/github/codeql-action/pull/911)
|
||||
|
||||
## 1.0.31 - 31 Jan 2022
|
||||
|
||||
- Remove `experimental` message when using custom CodeQL packages. [#888](https://github.com/github/codeql-action/pull/888)
|
||||
- Add a better warning message stating that experimental features will be disabled if the workflow has been triggered by a pull request from a fork or the `security-events: write` permission is not present. [#882](https://github.com/github/codeql-action/pull/882)
|
||||
|
||||
## 1.0.30 - 24 Jan 2022
|
||||
|
||||
- Display a better error message when encountering a workflow that runs the `codeql-action/init` action multiple times. [#876](https://github.com/github/codeql-action/pull/876)
|
||||
- Update default CodeQL bundle version to 2.7.6. [#877](https://github.com/github/codeql-action/pull/877)
|
||||
|
||||
## 1.0.29 - 21 Jan 2022
|
||||
|
||||
- The feature to wait for SARIF processing to complete after upload has been disabled by default due to a bug in its interaction with pull requests from forks.
|
||||
|
||||
## 1.0.28 - 18 Jan 2022
|
||||
|
||||
- Update default CodeQL bundle version to 2.7.5. [#866](https://github.com/github/codeql-action/pull/866)
|
||||
@@ -11,7 +36,7 @@ No user facing changes.
|
||||
|
||||
## 1.0.27 - 11 Jan 2022
|
||||
|
||||
- The `analyze` and `upload-sarif` actions will now wait up to 2 minutes for processing to complete after they have uploaded the results so they can report any processing errors that occurred. This behavior can be disabled by setting the `wait-for-processing` action input to `"false"`.
|
||||
- The `analyze` and `upload-sarif` actions will now wait up to 2 minutes for processing to complete after they have uploaded the results so they can report any processing errors that occurred. This behavior can be disabled by setting the `wait-for-processing` action input to `"false"`. [#855](https://github.com/github/codeql-action/pull/855)
|
||||
|
||||
## 1.0.26 - 10 Dec 2021
|
||||
|
||||
|
||||
@@ -39,7 +39,8 @@ on:
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
|
||||
# If you're only analyzing JavaScript or Python, CodeQL runs on ubuntu-latest, windows-latest, and macos-latest.
|
||||
# If you're analyzing C/C++, C#, Go, or Java, CodeQL runs on ubuntu-latest, windows-2019, and macos-latest.
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
|
||||
@@ -45,6 +45,12 @@ inputs:
|
||||
description: "The path at which the analyzed repository was checked out. Used to relativize any absolute paths in the uploaded SARIF file."
|
||||
required: false
|
||||
default: ${{ github.workspace }}
|
||||
ref:
|
||||
description: "The ref where results will be uploaded. If not provided, the Action will use the GITHUB_REF environment variable. If provided, the sha input must be provided as well. This input is not available in pull requests from forks."
|
||||
required: false
|
||||
sha:
|
||||
description: "The sha of the HEAD of the ref where results will be uploaded. If not provided, the Action will use the GITHUB_SHA environment variable. If provided, the ref input must be provided as well. This input is not available in pull requests from forks."
|
||||
required: false
|
||||
category:
|
||||
description: String used by Code Scanning for matching the analyses
|
||||
required: false
|
||||
@@ -55,7 +61,7 @@ inputs:
|
||||
wait-for-processing:
|
||||
description: If true, the Action will wait for the uploaded SARIF to be processed before completing.
|
||||
required: true
|
||||
default: "true"
|
||||
default: "false"
|
||||
token:
|
||||
default: ${{ github.token }}
|
||||
matrix:
|
||||
@@ -63,6 +69,8 @@ inputs:
|
||||
outputs:
|
||||
db-locations:
|
||||
description: A map from language to absolute path for each database created by CodeQL.
|
||||
sarif-id:
|
||||
description: The ID of the uploaded SARIF file.
|
||||
runs:
|
||||
using: "node12"
|
||||
using: "node16"
|
||||
main: "../lib/analyze-action.js"
|
||||
|
||||
@@ -7,5 +7,5 @@ inputs:
|
||||
matrix:
|
||||
default: ${{ toJson(matrix) }}
|
||||
runs:
|
||||
using: 'node12'
|
||||
using: 'node16'
|
||||
main: '../lib/autobuild-action.js'
|
||||
@@ -73,5 +73,5 @@ outputs:
|
||||
codeql-path:
|
||||
description: The path of the CodeQL binary used for analysis
|
||||
runs:
|
||||
using: 'node12'
|
||||
using: 'node16'
|
||||
main: '../lib/init-action.js'
|
||||
|
||||
86
lib/actions-util.js
generated
86
lib/actions-util.js
generated
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.sanitizeArifactName = exports.isAnalyzingDefaultBranch = exports.getRelativeScriptPath = exports.isRunningLocalAction = exports.sendStatusReport = exports.createStatusReportBase = exports.getRef = exports.computeAutomationID = exports.getAutomationID = exports.getAnalysisKey = exports.getWorkflowRunID = exports.getWorkflow = exports.formatWorkflowCause = exports.formatWorkflowErrors = exports.validateWorkflow = exports.getWorkflowErrors = exports.WorkflowErrors = exports.patternIsSuperset = exports.getCommitOid = exports.getToolCacheDirectory = exports.getTemporaryDirectory = exports.getOptionalInput = exports.getRequiredInput = void 0;
|
||||
exports.sanitizeArifactName = exports.isAnalyzingDefaultBranch = exports.getRelativeScriptPath = exports.isRunningLocalAction = exports.sendStatusReport = exports.createStatusReportBase = exports.getRef = exports.computeAutomationID = exports.getAutomationID = exports.getAnalysisKey = exports.getWorkflowRunID = exports.getWorkflow = exports.formatWorkflowCause = exports.formatWorkflowErrors = exports.validateWorkflow = exports.getWorkflowErrors = exports.WorkflowErrors = exports.patternIsSuperset = exports.determineMergeBaseCommitOid = exports.getCommitOid = exports.getToolCacheDirectory = exports.getTemporaryDirectory = exports.getOptionalInput = exports.getRequiredInput = void 0;
|
||||
const fs = __importStar(require("fs"));
|
||||
const path = __importStar(require("path"));
|
||||
const core = __importStar(require("@actions/core"));
|
||||
@@ -51,10 +51,10 @@ exports.getRequiredInput = getRequiredInput;
|
||||
* This allows us to get stronger type checking of required/optional inputs
|
||||
* and make behaviour more consistent between actions and the runner.
|
||||
*/
|
||||
function getOptionalInput(name) {
|
||||
const getOptionalInput = function (name) {
|
||||
const value = core.getInput(name);
|
||||
return value.length > 0 ? value : undefined;
|
||||
}
|
||||
};
|
||||
exports.getOptionalInput = getOptionalInput;
|
||||
function getTemporaryDirectory() {
|
||||
const value = process.env["CODEQL_ACTION_TEMP"];
|
||||
@@ -97,12 +97,61 @@ const getCommitOid = async function (ref = "HEAD") {
|
||||
return commitOid.trim();
|
||||
}
|
||||
catch (e) {
|
||||
core.info(`Failed to call git to get current commit. Continuing with data from environment: ${e}`);
|
||||
core.info(`Failed to call git to get current commit. Continuing with data from environment or input: ${e}`);
|
||||
core.info(e.stack || "NO STACK");
|
||||
return (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
||||
return (0, exports.getOptionalInput)("sha") || (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
||||
}
|
||||
};
|
||||
exports.getCommitOid = getCommitOid;
|
||||
/**
|
||||
* If the action was triggered by a pull request, determine the commit sha of the merge base.
|
||||
* Returns undefined if run by other triggers or the merge base cannot be determined.
|
||||
*/
|
||||
const determineMergeBaseCommitOid = async function () {
|
||||
if (process.env.GITHUB_EVENT_NAME !== "pull_request") {
|
||||
return undefined;
|
||||
}
|
||||
const mergeSha = (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
||||
try {
|
||||
let commitOid = "";
|
||||
let baseOid = "";
|
||||
let headOid = "";
|
||||
await new toolrunner.ToolRunner(await safeWhich.safeWhich("git"), ["show", "-s", "--format=raw", mergeSha], {
|
||||
silent: true,
|
||||
listeners: {
|
||||
stdline: (data) => {
|
||||
if (data.startsWith("commit ") && commitOid === "") {
|
||||
commitOid = data.substring(7);
|
||||
}
|
||||
else if (data.startsWith("parent ")) {
|
||||
if (baseOid === "") {
|
||||
baseOid = data.substring(7);
|
||||
}
|
||||
else if (headOid === "") {
|
||||
headOid = data.substring(7);
|
||||
}
|
||||
}
|
||||
},
|
||||
stderr: (data) => {
|
||||
process.stderr.write(data);
|
||||
},
|
||||
},
|
||||
}).exec();
|
||||
// Let's confirm our assumptions: We had a merge commit and the parsed parent data looks correct
|
||||
if (commitOid === mergeSha &&
|
||||
headOid.length === 40 &&
|
||||
baseOid.length === 40) {
|
||||
return baseOid;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
catch (e) {
|
||||
core.info(`Failed to call git to determine merge base. Continuing with data from environment: ${e}`);
|
||||
core.info(e.stack || "NO STACK");
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
exports.determineMergeBaseCommitOid = determineMergeBaseCommitOid;
|
||||
function isObject(o) {
|
||||
return o !== null && typeof o === "object";
|
||||
}
|
||||
@@ -373,8 +422,21 @@ exports.computeAutomationID = computeAutomationID;
|
||||
async function getRef() {
|
||||
// Will be in the form "refs/heads/master" on a push event
|
||||
// or in the form "refs/pull/N/merge" on a pull_request event
|
||||
const ref = (0, util_1.getRequiredEnvParam)("GITHUB_REF");
|
||||
const sha = (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
||||
const refInput = (0, exports.getOptionalInput)("ref");
|
||||
const shaInput = (0, exports.getOptionalInput)("sha");
|
||||
const hasRefInput = !!refInput;
|
||||
const hasShaInput = !!shaInput;
|
||||
// If one of 'ref' or 'sha' are provided, both are required
|
||||
if ((hasRefInput || hasShaInput) && !(hasRefInput && hasShaInput)) {
|
||||
throw new Error("Both 'ref' and 'sha' are required if one of them is provided.");
|
||||
}
|
||||
const ref = refInput || (0, util_1.getRequiredEnvParam)("GITHUB_REF");
|
||||
const sha = shaInput || (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
|
||||
// If the ref is a user-provided input, we have to skip logic
|
||||
// and assume that it is really where they want to upload the results.
|
||||
if (refInput) {
|
||||
return refInput;
|
||||
}
|
||||
// For pull request refs we want to detect whether the workflow
|
||||
// has run `git checkout HEAD^2` to analyze the 'head' ref rather
|
||||
// than the 'merge' ref. If so, we want to convert the ref that
|
||||
@@ -412,7 +474,7 @@ exports.getRef = getRef;
|
||||
* @param exception Exception (only supply if status is 'failure')
|
||||
*/
|
||||
async function createStatusReportBase(actionName, status, actionStartedAt, cause, exception) {
|
||||
const commitOid = process.env["GITHUB_SHA"] || "";
|
||||
const commitOid = (0, exports.getOptionalInput)("sha") || process.env["GITHUB_SHA"] || "";
|
||||
const ref = await getRef();
|
||||
const workflowRunIDStr = process.env["GITHUB_RUN_ID"];
|
||||
let workflowRunID = -1;
|
||||
@@ -464,7 +526,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause
|
||||
}
|
||||
exports.createStatusReportBase = createStatusReportBase;
|
||||
const GENERIC_403_MSG = "The repo on which this action is running is not opted-in to CodeQL code scanning.";
|
||||
const GENERIC_404_MSG = "Not authorized to used the CodeQL code scanning feature on this repo.";
|
||||
const GENERIC_404_MSG = "Not authorized to use the CodeQL code scanning feature on this repo.";
|
||||
const OUT_OF_DATE_MSG = "CodeQL Action is out-of-date. Please upgrade to the latest version of codeql-action.";
|
||||
const INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the code scanning endpoint. Please update to a compatible version of codeql-action.";
|
||||
/**
|
||||
@@ -479,6 +541,12 @@ const INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the code sc
|
||||
async function sendStatusReport(statusReport) {
|
||||
const statusReportJSON = JSON.stringify(statusReport);
|
||||
core.debug(`Sending status report: ${statusReportJSON}`);
|
||||
// If in test mode we don't want to upload the results
|
||||
const testMode = process.env["TEST_MODE"] === "true" || false;
|
||||
if (testMode) {
|
||||
core.debug("In test mode. Status reports are not uploaded.");
|
||||
return true;
|
||||
}
|
||||
const nwo = (0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY");
|
||||
const [owner, repo] = nwo.split("/");
|
||||
const client = api.getActionsApiClient();
|
||||
|
||||
File diff suppressed because one or more lines are too long
37
lib/actions-util.test.js
generated
37
lib/actions-util.test.js
generated
@@ -71,6 +71,43 @@ function errorCodes(actual, expected) {
|
||||
t.deepEqual(actualRef, "refs/pull/1/head");
|
||||
callback.restore();
|
||||
});
|
||||
(0, ava_1.default)("getRef() returns ref provided as an input and ignores current HEAD", async (t) => {
|
||||
const getAdditionalInputStub = sinon.stub(actionsutil, "getOptionalInput");
|
||||
getAdditionalInputStub.withArgs("ref").resolves("refs/pull/2/merge");
|
||||
getAdditionalInputStub.withArgs("sha").resolves("b".repeat(40));
|
||||
// These values are be ignored
|
||||
process.env["GITHUB_REF"] = "refs/pull/1/merge";
|
||||
process.env["GITHUB_SHA"] = "a".repeat(40);
|
||||
const callback = sinon.stub(actionsutil, "getCommitOid");
|
||||
callback.withArgs("refs/pull/1/merge").resolves("b".repeat(40));
|
||||
callback.withArgs("HEAD").resolves("b".repeat(40));
|
||||
const actualRef = await actionsutil.getRef();
|
||||
t.deepEqual(actualRef, "refs/pull/2/merge");
|
||||
callback.restore();
|
||||
getAdditionalInputStub.restore();
|
||||
});
|
||||
(0, ava_1.default)("getRef() throws an error if only `ref` is provided as an input", async (t) => {
|
||||
const getAdditionalInputStub = sinon.stub(actionsutil, "getOptionalInput");
|
||||
getAdditionalInputStub.withArgs("ref").resolves("refs/pull/1/merge");
|
||||
await t.throwsAsync(async () => {
|
||||
await actionsutil.getRef();
|
||||
}, {
|
||||
instanceOf: Error,
|
||||
message: "Both 'ref' and 'sha' are required if one of them is provided.",
|
||||
});
|
||||
getAdditionalInputStub.restore();
|
||||
});
|
||||
(0, ava_1.default)("getRef() throws an error if only `sha` is provided as an input", async (t) => {
|
||||
const getAdditionalInputStub = sinon.stub(actionsutil, "getOptionalInput");
|
||||
getAdditionalInputStub.withArgs("sha").resolves("a".repeat(40));
|
||||
await t.throwsAsync(async () => {
|
||||
await actionsutil.getRef();
|
||||
}, {
|
||||
instanceOf: Error,
|
||||
message: "Both 'ref' and 'sha' are required if one of them is provided.",
|
||||
});
|
||||
getAdditionalInputStub.restore();
|
||||
});
|
||||
(0, ava_1.default)("computeAutomationID()", async (t) => {
|
||||
let actualAutomationID = actionsutil.computeAutomationID(".github/workflows/codeql-analysis.yml:analyze", '{"language": "javascript", "os": "linux"}');
|
||||
t.deepEqual(actualAutomationID, ".github/workflows/codeql-analysis.yml:analyze/language:javascript/os:linux/");
|
||||
|
||||
File diff suppressed because one or more lines are too long
6
lib/analyze-action.js
generated
6
lib/analyze-action.js
generated
@@ -74,11 +74,6 @@ async function run() {
|
||||
const memory = util.getMemoryFlag(actionsUtil.getOptionalInput("ram") || process.env["CODEQL_RAM"]);
|
||||
const repositoryNwo = (0, repository_1.parseRepositoryNwo)(util.getRequiredEnvParam("GITHUB_REPOSITORY"));
|
||||
const featureFlags = new feature_flags_1.GitHubFeatureFlags(config.gitHubVersion, apiDetails, repositoryNwo, logger);
|
||||
// We currently perform an API request in both the `init` and `analyze` Actions to determine
|
||||
// what feature flags are enabled. At the time of writing, this redundant API call is acceptable
|
||||
// to us, but if we wanted to avoid it, we could do so by serializing the feature flags as part
|
||||
// of the config file.
|
||||
void featureFlags.preloadFeatureFlags();
|
||||
await (0, analyze_1.runFinalize)(outputDir, threads, memory, config, logger);
|
||||
if (actionsUtil.getRequiredInput("skip-queries") !== "true") {
|
||||
runStats = await (0, analyze_1.runQueries)(outputDir, memory, util.getAddSnippetsFlag(actionsUtil.getRequiredInput("add-snippets")), threads, actionsUtil.getOptionalInput("category"), config, logger);
|
||||
@@ -114,6 +109,7 @@ async function run() {
|
||||
core.setOutput("db-locations", dbLocations);
|
||||
if (runStats && actionsUtil.getRequiredInput("upload") === "true") {
|
||||
uploadResult = await upload_lib.uploadFromActions(outputDir, config.gitHubVersion, apiDetails, logger);
|
||||
core.setOutput("sarif-id", uploadResult.sarifID);
|
||||
}
|
||||
else {
|
||||
logger.info("Not uploading results");
|
||||
|
||||
File diff suppressed because one or more lines are too long
5
lib/analyze.js
generated
5
lib/analyze.js
generated
@@ -132,10 +132,7 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
|
||||
}
|
||||
try {
|
||||
if (hasPackWithCustomQueries) {
|
||||
logger.info("*************");
|
||||
logger.info("Performing analysis with custom QL Packs. QL Packs are an experimental feature.");
|
||||
logger.info("And should not be used in production yet.");
|
||||
logger.info("*************");
|
||||
logger.info("Performing analysis with custom CodeQL Packs.");
|
||||
logger.startGroup(`Downloading custom packs for ${language}`);
|
||||
const codeql = await (0, codeql_1.getCodeQL)(config.codeQLCmd);
|
||||
const results = await codeql.packDownload(packsWithVersion);
|
||||
|
||||
File diff suppressed because one or more lines are too long
9
lib/codeql.js
generated
9
lib/codeql.js
generated
@@ -512,7 +512,12 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
||||
await (0, toolrunner_error_catcher_1.toolrunnerErrorCatcher)(cmd, args, error_matcher_1.errorMatchers);
|
||||
},
|
||||
async resolveLanguages() {
|
||||
const codeqlArgs = ["resolve", "languages", "--format=json"];
|
||||
const codeqlArgs = [
|
||||
"resolve",
|
||||
"languages",
|
||||
"--format=json",
|
||||
...getExtraOptionsFromEnv(["resolve", "languages"]),
|
||||
];
|
||||
const output = await runTool(cmd, codeqlArgs);
|
||||
try {
|
||||
return JSON.parse(output);
|
||||
@@ -635,6 +640,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
||||
"cleanup",
|
||||
databasePath,
|
||||
`--mode=${cleanupLevel}`,
|
||||
...getExtraOptionsFromEnv(["database", "cleanup"]),
|
||||
];
|
||||
await runTool(cmd, codeqlArgs);
|
||||
},
|
||||
@@ -645,6 +651,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
||||
databasePath,
|
||||
`--output=${outputFilePath}`,
|
||||
`--name=${databaseName}`,
|
||||
...getExtraOptionsFromEnv(["database", "bundle"]),
|
||||
];
|
||||
await new toolrunner.ToolRunner(cmd, args).exec();
|
||||
},
|
||||
|
||||
File diff suppressed because one or more lines are too long
13
lib/config-utils.js
generated
13
lib/config-utils.js
generated
@@ -120,24 +120,23 @@ const builtinSuites = ["security-extended", "security-and-quality"];
|
||||
* Throws an error if suiteName is not a valid builtin suite.
|
||||
*/
|
||||
async function addBuiltinSuiteQueries(languages, codeQL, resultMap, packs, suiteName, featureFlags, configFile) {
|
||||
var _a;
|
||||
const found = builtinSuites.find((suite) => suite === suiteName);
|
||||
if (!found) {
|
||||
throw new Error(getQueryUsesInvalid(configFile, suiteName));
|
||||
}
|
||||
// If we're running the JavaScript security-extended analysis (or a superset of it) and the repo
|
||||
// is opted into the ML-powered queries beta, then add the ML-powered query pack so that we run
|
||||
// the ML-powered queries.
|
||||
// If we're running the JavaScript security-extended analysis (or a superset of it), the repo is
|
||||
// opted into the ML-powered queries beta, and a user hasn't already added the ML-powered query
|
||||
// pack, then add the ML-powered query pack so that we run ML-powered queries.
|
||||
if (languages.includes("javascript") &&
|
||||
(found === "security-extended" || found === "security-and-quality") &&
|
||||
!((_a = packs.javascript) === null || _a === void 0 ? void 0 : _a.some((pack) => pack.packName === util_1.ML_POWERED_JS_QUERIES_PACK.packName)) &&
|
||||
(await featureFlags.getValue(feature_flags_1.FeatureFlag.MlPoweredQueriesEnabled)) &&
|
||||
(await (0, util_1.codeQlVersionAbove)(codeQL, codeql_1.CODEQL_VERSION_ML_POWERED_QUERIES))) {
|
||||
if (!packs.javascript) {
|
||||
packs.javascript = [];
|
||||
}
|
||||
packs.javascript.push({
|
||||
packName: "codeql/javascript-experimental-atm-queries",
|
||||
version: "~0.0.2",
|
||||
});
|
||||
packs.javascript.push(util_1.ML_POWERED_JS_QUERIES_PACK);
|
||||
}
|
||||
const suites = languages.map((l) => `${l}-${suiteName}.qls`);
|
||||
await runResolveQueries(codeQL, resultMap, suites, undefined);
|
||||
|
||||
File diff suppressed because one or more lines are too long
123
lib/config-utils.test.js
generated
123
lib/config-utils.test.js
generated
@@ -117,7 +117,10 @@ function mockListLanguages(languages) {
|
||||
t.true(fs.existsSync(configUtils.getPathToParsedConfigFile(tmpDir)));
|
||||
// And that same newly-initialised config should now be returned by getConfig
|
||||
const config2 = await configUtils.getConfig(tmpDir, logger);
|
||||
t.deepEqual(config1, config2);
|
||||
t.not(config2, undefined);
|
||||
if (config2 !== undefined) {
|
||||
t.deepEqual(config1, config2);
|
||||
}
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("load input outside of workspace", async (t) => {
|
||||
@@ -760,28 +763,26 @@ const invalidPaths = ["a/***/b", "a/**b", "a/b**", "**"];
|
||||
/**
|
||||
* Test macro for ensuring the packs block is valid
|
||||
*/
|
||||
function parsePacksMacro(t, packsByLanguage, languages, expected) {
|
||||
t.deepEqual(configUtils.parsePacksFromConfig(packsByLanguage, languages, "/a/b"), expected);
|
||||
}
|
||||
parsePacksMacro.title = (providedTitle) => `Parse Packs: ${providedTitle}`;
|
||||
const parsePacksMacro = ava_1.default.macro({
|
||||
exec: (t, packsByLanguage, languages, expected) => t.deepEqual(configUtils.parsePacksFromConfig(packsByLanguage, languages, "/a/b"), expected),
|
||||
title: (providedTitle = "") => `Parse Packs: ${providedTitle}`,
|
||||
});
|
||||
/**
|
||||
* Test macro for testing when the packs block is invalid
|
||||
*/
|
||||
function parsePacksErrorMacro(t, packsByLanguage, languages, expected) {
|
||||
t.throws(() => {
|
||||
configUtils.parsePacksFromConfig(packsByLanguage, languages, "/a/b");
|
||||
}, {
|
||||
const parsePacksErrorMacro = ava_1.default.macro({
|
||||
exec: (t, packsByLanguage, languages, expected) => t.throws(() => configUtils.parsePacksFromConfig(packsByLanguage, languages, "/a/b"), {
|
||||
message: expected,
|
||||
});
|
||||
}
|
||||
parsePacksErrorMacro.title = (providedTitle) => `Parse Packs Error: ${providedTitle}`;
|
||||
}),
|
||||
title: (providedTitle = "") => `Parse Packs Error: ${providedTitle}`,
|
||||
});
|
||||
/**
|
||||
* Test macro for testing when the packs block is invalid
|
||||
*/
|
||||
function invalidPackNameMacro(t, name) {
|
||||
parsePacksErrorMacro(t, { [languages_1.Language.cpp]: [name] }, [languages_1.Language.cpp], new RegExp(`The configuration file "/a/b" is invalid: property "packs" "${name}" is not a valid pack`));
|
||||
}
|
||||
invalidPackNameMacro.title = (_, arg) => `Invalid pack string: ${arg}`;
|
||||
const invalidPackNameMacro = ava_1.default.macro({
|
||||
exec: (t, name) => parsePacksErrorMacro.exec(t, { [languages_1.Language.cpp]: [name] }, [languages_1.Language.cpp], new RegExp(`The configuration file "/a/b" is invalid: property "packs" "${name}" is not a valid pack`)),
|
||||
title: (_providedTitle, arg) => `Invalid pack string: ${arg}`,
|
||||
});
|
||||
(0, ava_1.default)("no packs", parsePacksMacro, {}, [], {});
|
||||
(0, ava_1.default)("two packs", parsePacksMacro, ["a/b", "c/d@1.2.3"], [languages_1.Language.cpp], {
|
||||
[languages_1.Language.cpp]: [
|
||||
@@ -870,50 +871,50 @@ parseInputAndConfigErrorMacro.title = (providedTitle) => `Parse Packs input and
|
||||
(0, ava_1.default)("input with two languages", parseInputAndConfigErrorMacro, {}, "c/d", [languages_1.Language.cpp, languages_1.Language.csharp], /multi-language analysis/);
|
||||
(0, ava_1.default)("input with + only", parseInputAndConfigErrorMacro, {}, " + ", [languages_1.Language.cpp], /remove the '\+'/);
|
||||
(0, ava_1.default)("input with invalid pack name", parseInputAndConfigErrorMacro, {}, " xxx", [languages_1.Language.cpp], /"xxx" is not a valid pack/);
|
||||
async function mlPoweredQueriesMacro(t, codeQLVersion, isMlPoweredQueriesFlagEnabled, queriesInput, shouldRunMlPoweredQueries) {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
const codeQL = (0, codeql_1.setCodeQL)({
|
||||
async getVersion() {
|
||||
return codeQLVersion;
|
||||
},
|
||||
async resolveQueries() {
|
||||
return {
|
||||
byLanguage: {
|
||||
javascript: { "fake-query.ql": {} },
|
||||
},
|
||||
noDeclaredLanguage: {},
|
||||
multipleDeclaredLanguages: {},
|
||||
};
|
||||
},
|
||||
});
|
||||
const { packs } = await configUtils.initConfig("javascript", queriesInput, undefined, undefined, undefined, false, "", "", { owner: "github", repo: "example " }, tmpDir, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, (0, feature_flags_1.createFeatureFlags)(isMlPoweredQueriesFlagEnabled
|
||||
? [feature_flags_1.FeatureFlag.MlPoweredQueriesEnabled]
|
||||
: []), (0, logging_1.getRunnerLogger)(true));
|
||||
if (shouldRunMlPoweredQueries) {
|
||||
t.deepEqual(packs, {
|
||||
[languages_1.Language.javascript]: [
|
||||
{
|
||||
packName: "codeql/javascript-experimental-atm-queries",
|
||||
version: "~0.0.2",
|
||||
},
|
||||
],
|
||||
const mlPoweredQueriesMacro = ava_1.default.macro({
|
||||
exec: async (t, codeQLVersion, isMlPoweredQueriesFlagEnabled, packsInput, queriesInput, expectedVersionString) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
const codeQL = (0, codeql_1.setCodeQL)({
|
||||
async getVersion() {
|
||||
return codeQLVersion;
|
||||
},
|
||||
async resolveQueries() {
|
||||
return {
|
||||
byLanguage: {
|
||||
javascript: { "fake-query.ql": {} },
|
||||
},
|
||||
noDeclaredLanguage: {},
|
||||
multipleDeclaredLanguages: {},
|
||||
};
|
||||
},
|
||||
});
|
||||
}
|
||||
else {
|
||||
t.deepEqual(packs, {});
|
||||
}
|
||||
});
|
||||
}
|
||||
mlPoweredQueriesMacro.title = (_providedTitle, codeQLVersion, isMlPoweredQueriesFlagEnabled, queriesInput, shouldRunMlPoweredQueries) => {
|
||||
const queriesInputDescription = queriesInput
|
||||
? `'queries: ${queriesInput}'`
|
||||
: "default config";
|
||||
return `ML-powered queries ${shouldRunMlPoweredQueries ? "are" : "aren't"} loaded for ${queriesInputDescription} using CLI v${codeQLVersion} when feature flag is ${isMlPoweredQueriesFlagEnabled ? "enabled" : "disabled"}`;
|
||||
};
|
||||
// macro, isMlPoweredQueriesFlagEnabled, queriesInput, shouldRunMlPoweredQueries
|
||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.7.4", true, "security-extended", false);
|
||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.7.5", false, "security-extended", false);
|
||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.7.5", true, undefined, false);
|
||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.7.5", true, "security-extended", true);
|
||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.7.5", true, "security-and-quality", true);
|
||||
const { packs } = await configUtils.initConfig("javascript", queriesInput, packsInput, undefined, undefined, false, "", "", { owner: "github", repo: "example " }, tmpDir, tmpDir, codeQL, tmpDir, gitHubVersion, sampleApiDetails, (0, feature_flags_1.createFeatureFlags)(isMlPoweredQueriesFlagEnabled
|
||||
? [feature_flags_1.FeatureFlag.MlPoweredQueriesEnabled]
|
||||
: []), (0, logging_1.getRunnerLogger)(true));
|
||||
if (expectedVersionString !== undefined) {
|
||||
t.deepEqual(packs, {
|
||||
[languages_1.Language.javascript]: [
|
||||
{
|
||||
packName: "codeql/javascript-experimental-atm-queries",
|
||||
version: expectedVersionString,
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
else {
|
||||
t.deepEqual(packs, {});
|
||||
}
|
||||
});
|
||||
},
|
||||
title: (_providedTitle, codeQLVersion, isMlPoweredQueriesFlagEnabled, packsInput, queriesInput, expectedVersionString) => `ML-powered queries ${expectedVersionString !== undefined
|
||||
? `${expectedVersionString} are`
|
||||
: "aren't"} loaded for packs: ${packsInput}, queries: ${queriesInput} using CLI v${codeQLVersion} when feature flag is ${isMlPoweredQueriesFlagEnabled ? "enabled" : "disabled"}`,
|
||||
});
|
||||
// macro, isMlPoweredQueriesFlagEnabled, packsInput, queriesInput, versionString
|
||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.7.4", true, undefined, "security-extended", undefined);
|
||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.7.5", false, undefined, "security-extended", undefined);
|
||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.7.5", true, undefined, undefined, undefined);
|
||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.7.5", true, undefined, "security-extended", "~0.0.2");
|
||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.7.5", true, undefined, "security-and-quality", "~0.0.2");
|
||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.7.5", true, "codeql/javascript-experimental-atm-queries@0.0.1", "security-and-quality", "0.0.1");
|
||||
//# sourceMappingURL=config-utils.test.js.map
|
||||
File diff suppressed because one or more lines are too long
32
lib/database-upload.js
generated
32
lib/database-upload.js
generated
@@ -48,7 +48,6 @@ async function uploadDatabases(repositoryNwo, config, featureFlags, apiDetails,
|
||||
}
|
||||
const client = (0, api_client_1.getApiClient)(apiDetails);
|
||||
const codeql = await (0, codeql_1.getCodeQL)(config.codeQLCmd);
|
||||
const useUploadDomain = await featureFlags.getValue(feature_flags_1.FeatureFlag.UploadsDomainEnabled);
|
||||
for (const language of config.languages) {
|
||||
// Upload the database bundle.
|
||||
// Although we are uploading arbitrary file contents to the API, it's worth
|
||||
@@ -56,26 +55,17 @@ async function uploadDatabases(repositoryNwo, config, featureFlags, apiDetails,
|
||||
// This API method is available to anyone with write access to the repo.
|
||||
const payload = fs.readFileSync(await (0, util_1.bundleDb)(config, language, codeql, language));
|
||||
try {
|
||||
if (useUploadDomain) {
|
||||
await client.request(`POST https://uploads.github.com/repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name`, {
|
||||
owner: repositoryNwo.owner,
|
||||
repo: repositoryNwo.repo,
|
||||
language,
|
||||
name: `${language}-database`,
|
||||
data: payload,
|
||||
headers: {
|
||||
authorization: `token ${apiDetails.auth}`,
|
||||
},
|
||||
});
|
||||
}
|
||||
else {
|
||||
await client.request(`PUT /repos/:owner/:repo/code-scanning/codeql/databases/:language`, {
|
||||
owner: repositoryNwo.owner,
|
||||
repo: repositoryNwo.repo,
|
||||
language,
|
||||
data: payload,
|
||||
});
|
||||
}
|
||||
await client.request(`POST https://uploads.github.com/repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name`, {
|
||||
owner: repositoryNwo.owner,
|
||||
repo: repositoryNwo.repo,
|
||||
language,
|
||||
name: `${language}-database`,
|
||||
data: payload,
|
||||
headers: {
|
||||
authorization: `token ${apiDetails.auth}`,
|
||||
"Content-Type": "application/zip",
|
||||
},
|
||||
});
|
||||
logger.debug(`Successfully uploaded database for ${language}`);
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"database-upload.js","sourceRoot":"","sources":["../src/database-upload.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAEzB,4DAA8C;AAC9C,6CAA8D;AAC9D,qCAAqC;AAErC,mDAA4D;AAG5D,6CAA+B;AAC/B,iCAAkC;AAE3B,KAAK,UAAU,eAAe,CACnC,aAA4B,EAC5B,MAAc,EACd,YAA0B,EAC1B,UAA4B,EAC5B,MAAc;IAEd,IAAI,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,MAAM,EA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;KACF;AACH,CAAC;AAhED,0CAgEC"}
|
||||
15
lib/database-upload.test.js
generated
15
lib/database-upload.test.js
generated
@@ -40,7 +40,6 @@ ava_1.default.beforeEach(() => {
|
||||
});
|
||||
const uploadToUploadsDomainFlags = (0, feature_flags_1.createFeatureFlags)([
|
||||
feature_flags_1.FeatureFlag.DatabaseUploadsEnabled,
|
||||
feature_flags_1.FeatureFlag.UploadsDomainEnabled,
|
||||
]);
|
||||
const testRepoName = { owner: "github", repo: "example" };
|
||||
const testApiDetails = {
|
||||
@@ -65,13 +64,11 @@ function getTestConfig(tmpDir) {
|
||||
debugDatabaseName: util_1.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
};
|
||||
}
|
||||
async function mockHttpRequests(featureFlags, databaseUploadStatusCode) {
|
||||
async function mockHttpRequests(databaseUploadStatusCode) {
|
||||
// Passing an auth token is required, so we just use a dummy value
|
||||
const client = github.getOctokit("123");
|
||||
const requestSpy = sinon.stub(client, "request");
|
||||
const url = (await featureFlags.getValue(feature_flags_1.FeatureFlag.UploadsDomainEnabled))
|
||||
? "POST https://uploads.github.com/repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name"
|
||||
: "PUT /repos/:owner/:repo/code-scanning/codeql/databases/:language";
|
||||
const url = "POST https://uploads.github.com/repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name";
|
||||
const databaseUploadSpy = requestSpy.withArgs(url);
|
||||
if (databaseUploadStatusCode < 300) {
|
||||
databaseUploadSpy.resolves(undefined);
|
||||
@@ -155,7 +152,7 @@ async function mockHttpRequests(featureFlags, databaseUploadStatusCode) {
|
||||
},
|
||||
});
|
||||
const loggedMessages = [];
|
||||
await (0, database_upload_1.uploadDatabases)(testRepoName, getTestConfig(tmpDir), (0, feature_flags_1.createFeatureFlags)([feature_flags_1.FeatureFlag.UploadsDomainEnabled]), testApiDetails, (0, testing_utils_1.getRecordingLogger)(loggedMessages));
|
||||
await (0, database_upload_1.uploadDatabases)(testRepoName, getTestConfig(tmpDir), (0, feature_flags_1.createFeatureFlags)([]), testApiDetails, (0, testing_utils_1.getRecordingLogger)(loggedMessages));
|
||||
t.assert(loggedMessages.find((v) => v.type === "debug" &&
|
||||
v.message ===
|
||||
"Repository is not opted in to database uploads. Skipping upload.") !== undefined);
|
||||
@@ -172,7 +169,7 @@ async function mockHttpRequests(featureFlags, databaseUploadStatusCode) {
|
||||
const featureFlags = (0, feature_flags_1.createFeatureFlags)([
|
||||
feature_flags_1.FeatureFlag.DatabaseUploadsEnabled,
|
||||
]);
|
||||
await mockHttpRequests(featureFlags, 500);
|
||||
await mockHttpRequests(500);
|
||||
(0, codeql_1.setCodeQL)({
|
||||
async databaseBundle(_, outputFilePath) {
|
||||
fs.writeFileSync(outputFilePath, "");
|
||||
@@ -193,7 +190,7 @@ async function mockHttpRequests(featureFlags, databaseUploadStatusCode) {
|
||||
.withArgs("upload-database")
|
||||
.returns("true");
|
||||
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
|
||||
await mockHttpRequests(uploadToUploadsDomainFlags, 201);
|
||||
await mockHttpRequests(201);
|
||||
(0, codeql_1.setCodeQL)({
|
||||
async databaseBundle(_, outputFilePath) {
|
||||
fs.writeFileSync(outputFilePath, "");
|
||||
@@ -213,7 +210,7 @@ async function mockHttpRequests(featureFlags, databaseUploadStatusCode) {
|
||||
.withArgs("upload-database")
|
||||
.returns("true");
|
||||
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
|
||||
await mockHttpRequests(uploadToUploadsDomainFlags, 201);
|
||||
await mockHttpRequests(201);
|
||||
(0, codeql_1.setCodeQL)({
|
||||
async databaseBundle(_, outputFilePath) {
|
||||
fs.writeFileSync(outputFilePath, "");
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"bundleVersion": "codeql-bundle-20220112"
|
||||
"bundleVersion": "codeql-bundle-20220128"
|
||||
}
|
||||
|
||||
22
lib/feature-flags.js
generated
22
lib/feature-flags.js
generated
@@ -26,7 +26,6 @@ var FeatureFlag;
|
||||
(function (FeatureFlag) {
|
||||
FeatureFlag["DatabaseUploadsEnabled"] = "database_uploads_enabled";
|
||||
FeatureFlag["MlPoweredQueriesEnabled"] = "ml_powered_queries_enabled";
|
||||
FeatureFlag["UploadsDomainEnabled"] = "uploads_domain_enabled";
|
||||
})(FeatureFlag = exports.FeatureFlag || (exports.FeatureFlag = {}));
|
||||
class GitHubFeatureFlags {
|
||||
constructor(gitHubVersion, apiDetails, repositoryNwo, logger) {
|
||||
@@ -43,9 +42,6 @@ class GitHubFeatureFlags {
|
||||
}
|
||||
return response;
|
||||
}
|
||||
async preloadFeatureFlags() {
|
||||
await this.getApiResponse();
|
||||
}
|
||||
async getApiResponse() {
|
||||
const loadApiResponse = async () => {
|
||||
// Do nothing when not running against github.com
|
||||
@@ -62,11 +58,19 @@ class GitHubFeatureFlags {
|
||||
return response.data;
|
||||
}
|
||||
catch (e) {
|
||||
// Some feature flags, such as `ml_powered_queries_enabled` affect the produced alerts.
|
||||
// Considering these feature flags disabled in the event of a transient error could
|
||||
// therefore lead to alert churn. As a result, we crash if we cannot determine the value of
|
||||
// the feature flags.
|
||||
throw new Error(`Encountered an error while trying to load feature flags: ${e}`);
|
||||
if (util.isHTTPError(e) && e.status === 403) {
|
||||
this.logger.warning("This run of the CodeQL Action does not have permission to access Code Scanning API endpoints. " +
|
||||
"As a result, it will not be opted into any experimental features. " +
|
||||
"This could be because the Action is running on a pull request from a fork. If not, " +
|
||||
`please ensure the Action has the 'security-events: write' permission. Details: ${e}`);
|
||||
}
|
||||
else {
|
||||
// Some feature flags, such as `ml_powered_queries_enabled` affect the produced alerts.
|
||||
// Considering these feature flags disabled in the event of a transient error could
|
||||
// therefore lead to alert churn. As a result, we crash if we cannot determine the value of
|
||||
// the feature flags.
|
||||
throw new Error(`Encountered an error while trying to load feature flags: ${e}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
const apiResponse = this.cachedApiResponse || (await loadApi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qBAAM;oBACL,uFAAuF;oBACvF,mFAAmF;oBACnF,2FAA2F;oBAC3F,qBAAqB;oBACrB,MAAM,IAAI,KAAK,CACb,4DAA4D,CAAC,EAAE,CAChE,CAAC;iBACH;aACF;QACH,CAAC,CAAC;QAEF,MAAM,WAAW,GAAG,IAAI,CAAC,iBAAiB,IAAI,CAAC,MAAM,eAAe,EAAE,CAAC,CAAC;QACxE,IAAI,CAAC,iBAAiB,GAAG,WAAW,CAAC;QACrC,OAAO,WAAW,CAAC;IACrB,CAAC;CACF;AAhED,gDAgEC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,YAA2B;IAC5D,OAAO;QACL,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YACvB,OAAO,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACrC,CAAC;KACF,CAAC;AACJ,CAAC;AAND,gDAMC"}
|
||||
5
lib/feature-flags.test.js
generated
5
lib/feature-flags.test.js
generated
@@ -52,7 +52,6 @@ for (const variant of ALL_FEATURE_FLAGS_DISABLED_VARIANTS) {
|
||||
for (const featureFlag of [
|
||||
"database_uploads_enabled",
|
||||
"ml_powered_queries_enabled",
|
||||
"uploads_domain_enabled",
|
||||
]) {
|
||||
t.assert(loggedMessages.find((v) => v.type === "debug" &&
|
||||
v.message ===
|
||||
@@ -65,7 +64,7 @@ for (const variant of ALL_FEATURE_FLAGS_DISABLED_VARIANTS) {
|
||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||
const featureFlags = new feature_flags_1.GitHubFeatureFlags({ type: util_1.GitHubVariant.DOTCOM }, testApiDetails, testRepositoryNwo, (0, logging_1.getRunnerLogger)(true));
|
||||
(0, testing_utils_1.mockFeatureFlagApiEndpoint)(500, {});
|
||||
await t.throwsAsync(async () => featureFlags.preloadFeatureFlags(), {
|
||||
await t.throwsAsync(async () => featureFlags.getValue(feature_flags_1.FeatureFlag.DatabaseUploadsEnabled), {
|
||||
message: "Encountered an error while trying to load feature flags: Error: some error message",
|
||||
});
|
||||
});
|
||||
@@ -73,7 +72,6 @@ for (const variant of ALL_FEATURE_FLAGS_DISABLED_VARIANTS) {
|
||||
const FEATURE_FLAGS = [
|
||||
"database_uploads_enabled",
|
||||
"ml_powered_queries_enabled",
|
||||
"uploads_domain_enabled",
|
||||
];
|
||||
for (const featureFlag of FEATURE_FLAGS) {
|
||||
(0, ava_1.default)(`Feature flag '${featureFlag}' is enabled if enabled in the API response`, async (t) => {
|
||||
@@ -89,7 +87,6 @@ for (const featureFlag of FEATURE_FLAGS) {
|
||||
const actualFeatureFlags = {
|
||||
database_uploads_enabled: await featureFlags.getValue(feature_flags_1.FeatureFlag.DatabaseUploadsEnabled),
|
||||
ml_powered_queries_enabled: await featureFlags.getValue(feature_flags_1.FeatureFlag.MlPoweredQueriesEnabled),
|
||||
uploads_domain_enabled: await featureFlags.getValue(feature_flags_1.FeatureFlag.UploadsDomainEnabled),
|
||||
};
|
||||
t.deepEqual(actualFeatureFlags, expectedFeatureFlags);
|
||||
});
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"feature-flags.test.js","sourceRoot":"","sources":["../src/feature-flags.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AAGvB,mDAAkE;AAClE,uCAA4C;AAC5C,6CAAkD;AAClD,mDAMyB;AAEzB,iCAAgF;AAEhF,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,aAAI,CAAC,UAAU,CAAC,GAAG,EAAE;IACnB,IAAA,4BAAqB,EAAC,WAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC;AAEH,MAAM,cAAc,GAAqB;IACvC,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,oBAAoB;CAC1B,CAAC;AAEF,MAAM,iBAAiB,GAAG,IAAA,+BAAkB,EAAC,gBAAgB,CAAC,CAAC;AAE/D,MAAM,mCAAmC,GAGpC;IACH;QACE,WAAW,EAA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iB,EACjB,IAAA,yBAAe,EAAC,IAAI,CAAC,CACtB,CAAC;YAEF,MAAM,oBAAoB,GAAgC,EAAE,CAAC;YAC7D,KAAK,MAAM,CAAC,IAAI,aAAa,EAAE;gBAC7B,oBAAoB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;aACjC;YACD,oBAAoB,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;YACzC,IAAA,0CAA0B,EAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;YAEtD,MAAM,kBAAkB,GAAgC;gBACtD,wBAAwB,EAAE,MAAM,YAAY,CAAC,QAAQ,CACnD,2BAAW,CAAC,sBAAsB,CACnC;gBACD,0BAA0B,EAAE,MAAM,YAAY,CAAC,QAAQ,CACrD,2BAAW,CAAC,uBAAuB,CACpC;aACF,CAAC;YAEF,CAAC,CAAC,SAAS,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;CACJ"}
|
||||
6
lib/init-action.js
generated
6
lib/init-action.js
generated
@@ -54,14 +54,15 @@ async function sendSuccessStatusReport(startedAt, config, toolsVersion) {
|
||||
}
|
||||
const statusReport = {
|
||||
...statusReportBase,
|
||||
disable_default_queries: disableDefaultQueries,
|
||||
languages,
|
||||
workflow_languages: workflowLanguages || "",
|
||||
ml_powered_javascript_queries: (0, util_1.getMlPoweredJsQueriesStatus)(config),
|
||||
paths,
|
||||
paths_ignore: pathsIgnore,
|
||||
disable_default_queries: disableDefaultQueries,
|
||||
queries: queries.join(","),
|
||||
tools_input: (0, actions_util_1.getOptionalInput)("tools") || "",
|
||||
tools_resolved_version: toolsVersion,
|
||||
workflow_languages: workflowLanguages || "",
|
||||
};
|
||||
await (0, actions_util_1.sendStatusReport)(statusReport);
|
||||
}
|
||||
@@ -81,7 +82,6 @@ async function run() {
|
||||
(0, util_1.checkGitHubVersionInRange)(gitHubVersion, logger, util_1.Mode.actions);
|
||||
const repositoryNwo = (0, repository_1.parseRepositoryNwo)((0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY"));
|
||||
const featureFlags = new feature_flags_1.GitHubFeatureFlags(gitHubVersion, apiDetails, repositoryNwo, logger);
|
||||
void featureFlags.preloadFeatureFlags();
|
||||
try {
|
||||
const workflowErrors = await (0, actions_util_1.validateWorkflow)();
|
||||
if (!(await (0, actions_util_1.sendStatusReport)(await (0, actions_util_1.createStatusReportBase)("init", "starting", startedAt, workflowErrors)))) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
29
lib/init.js
generated
29
lib/init.js
generated
@@ -47,15 +47,30 @@ async function initConfig(languagesInput, queriesInput, packsInput, configFile,
|
||||
}
|
||||
exports.initConfig = initConfig;
|
||||
async function runInit(codeql, config, sourceRoot, processName, processLevel) {
|
||||
var _a;
|
||||
fs.mkdirSync(config.dbLocation, { recursive: true });
|
||||
if (await (0, util_1.codeQlVersionAbove)(codeql, codeql_1.CODEQL_VERSION_NEW_TRACING)) {
|
||||
// Init a database cluster
|
||||
await codeql.databaseInitCluster(config.dbLocation, config.languages, sourceRoot, processName, processLevel);
|
||||
try {
|
||||
if (await (0, util_1.codeQlVersionAbove)(codeql, codeql_1.CODEQL_VERSION_NEW_TRACING)) {
|
||||
// Init a database cluster
|
||||
await codeql.databaseInitCluster(config.dbLocation, config.languages, sourceRoot, processName, processLevel);
|
||||
}
|
||||
else {
|
||||
for (const language of config.languages) {
|
||||
// Init language database
|
||||
await codeql.databaseInit(util.getCodeQLDatabasePath(config, language), language, sourceRoot);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (const language of config.languages) {
|
||||
// Init language database
|
||||
await codeql.databaseInit(util.getCodeQLDatabasePath(config, language), language, sourceRoot);
|
||||
catch (e) {
|
||||
// Handle the situation where init is called twice
|
||||
// for the same database in the same job.
|
||||
if (e instanceof Error &&
|
||||
((_a = e.message) === null || _a === void 0 ? void 0 : _a.includes("Refusing to create databases")) &&
|
||||
e.message.includes("exists and is not an empty directory.")) {
|
||||
throw new Error(`Is the "init" action called twice in the same job? ${e.message}`);
|
||||
}
|
||||
else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
return await (0, tracer_config_1.getCombinedTracerConfig)(config, codeql);
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,yEAA2D;AAC3D,kEAAoD;AAEpD,gEAAkD;AAElD,qCAA2E;AAC3E,4DAA8C;AAI9C,mDAAwE;AACxE,6CAA+B;AAC/B,iCAA4C;AAErC,KAAK,UAAU,UAAU,CAC9B,SAA6B,EAC7B,UAA4B,EAC5B,OAAe,EACf,YAAoB,EACpB,OAA2B,EAC3B,MAAc;IAEd,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAA,oBAAW,EAChD,SAAS,EACT,UAAU,EACV,OAAO,EACP,YAAY,EACZ,OAAO,EACP,MAAM,EACN,IAAI,CACL,CAAC;IACF,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;IAC5B,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AAClC,CAAC;AArBD,gCAqBC;AAEM,KAAK,UAAU,UAAU,CAC9B,cAAkC,EAClC,YAAgC,EAChC,UAA8B,EAC9B,UAA8B,EAC9B,UAA8B,EAC9B,SAAkB,EAClB,iBAAyB,EACzB,iBAAyB,EACzB,UAAyB,EACzB,OAAe,EACf,YAAoB,EACpB,MAAc,EACd,aAAqB,EACrB,aAAiC,EACjC,UAAoC,EACpC,YAA0B,EAC1B,MAAc;IAEd,MAAM,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,UAAU,CACzC,cAAc,E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BC"}
|
||||
5
lib/tracer-config.test.js
generated
5
lib/tracer-config.test.js
generated
@@ -162,7 +162,10 @@ function getTestConfig(tmpDir) {
|
||||
javascript: { spec, env: { a: "a", b: "b" } },
|
||||
python: { spec, env: { b: "c" } },
|
||||
}, config));
|
||||
t.deepEqual(e.message, "Incompatible values in environment parameter b: b and c");
|
||||
// If e is undefined, then the previous assertion will fail.
|
||||
if (e !== undefined) {
|
||||
t.deepEqual(e.message, "Incompatible values in environment parameter b: b and c");
|
||||
}
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("concatTracerConfigs - cpp spec lines come last if present", async (t) => {
|
||||
|
||||
File diff suppressed because one or more lines are too long
27
lib/upload-lib.js
generated
27
lib/upload-lib.js
generated
@@ -95,6 +95,7 @@ async function uploadPayload(payload, repositoryNwo, apiDetails, logger) {
|
||||
// If in test mode we don't want to upload the results
|
||||
const testMode = process.env["TEST_MODE"] === "true" || false;
|
||||
if (testMode) {
|
||||
logger.debug("In test mode. Results are not uploaded.");
|
||||
return;
|
||||
}
|
||||
const client = api.getApiClient(apiDetails);
|
||||
@@ -203,7 +204,7 @@ function validateSarifFileSchema(sarifFilePath, logger) {
|
||||
exports.validateSarifFileSchema = validateSarifFileSchema;
|
||||
// buildPayload constructs a map ready to be uploaded to the API from the given
|
||||
// parameters, respecting the current mode and target GitHub instance version.
|
||||
function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, workflowRunID, checkoutURI, environment, toolNames, gitHubVersion) {
|
||||
function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, workflowRunID, checkoutURI, environment, toolNames, gitHubVersion, mergeBaseCommitOid) {
|
||||
if (util.isActions()) {
|
||||
const payloadObj = {
|
||||
commit_oid: commitOid,
|
||||
@@ -222,11 +223,23 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo
|
||||
// This behaviour can be made the default when support for GHES 3.0 is discontinued.
|
||||
if (gitHubVersion.type !== util.GitHubVariant.GHES ||
|
||||
semver.satisfies(gitHubVersion.version, `>=3.1`)) {
|
||||
if (process.env.GITHUB_EVENT_NAME === "pull_request" &&
|
||||
process.env.GITHUB_EVENT_PATH) {
|
||||
const githubEvent = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8"));
|
||||
payloadObj.base_ref = `refs/heads/${githubEvent.pull_request.base.ref}`;
|
||||
payloadObj.base_sha = githubEvent.pull_request.base.sha;
|
||||
if (process.env.GITHUB_EVENT_NAME === "pull_request") {
|
||||
if (commitOid === util.getRequiredEnvParam("GITHUB_SHA") &&
|
||||
mergeBaseCommitOid) {
|
||||
// We're uploading results for the merge commit
|
||||
// and were able to determine the merge base.
|
||||
// So we use that as the most accurate base.
|
||||
payloadObj.base_ref = `refs/heads/${util.getRequiredEnvParam("GITHUB_BASE_REF")}`;
|
||||
payloadObj.base_sha = mergeBaseCommitOid;
|
||||
}
|
||||
else if (process.env.GITHUB_EVENT_PATH) {
|
||||
// Either we're not uploading results for the merge commit
|
||||
// or we could not determine the merge base.
|
||||
// Using the PR base is the only option here
|
||||
const githubEvent = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8"));
|
||||
payloadObj.base_ref = `refs/heads/${githubEvent.pull_request.base.ref}`;
|
||||
payloadObj.base_sha = githubEvent.pull_request.base.sha;
|
||||
}
|
||||
}
|
||||
}
|
||||
return payloadObj;
|
||||
@@ -259,7 +272,7 @@ async function uploadFiles(sarifFiles, repositoryNwo, commitOid, ref, analysisKe
|
||||
const sarifPayload = JSON.stringify(sarif);
|
||||
const zippedSarif = zlib_1.default.gzipSync(sarifPayload).toString("base64");
|
||||
const checkoutURI = (0, file_url_1.default)(sourceRoot);
|
||||
const payload = buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, workflowRunID, checkoutURI, environment, toolNames, gitHubVersion);
|
||||
const payload = buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, workflowRunID, checkoutURI, environment, toolNames, gitHubVersion, await actionsUtil.determineMergeBaseCommitOid());
|
||||
// Log some useful debug info about the info
|
||||
const rawUploadSizeBytes = sarifPayload.length;
|
||||
logger.debug(`Raw upload size: ${rawUploadSizeBytes} bytes`);
|
||||
|
||||
File diff suppressed because one or more lines are too long
15
lib/upload-lib.test.js
generated
15
lib/upload-lib.test.js
generated
@@ -53,20 +53,29 @@ ava_1.default.beforeEach(() => {
|
||||
const allVersions = newVersions.concat(oldVersions);
|
||||
process.env["GITHUB_EVENT_NAME"] = "push";
|
||||
for (const version of allVersions) {
|
||||
const payload = uploadLib.buildPayload("commit", "refs/heads/master", "key", undefined, "", undefined, "/opt/src", undefined, ["CodeQL", "eslint"], version);
|
||||
const payload = uploadLib.buildPayload("commit", "refs/heads/master", "key", undefined, "", undefined, "/opt/src", undefined, ["CodeQL", "eslint"], version, "mergeBaseCommit");
|
||||
// Not triggered by a pull request
|
||||
t.falsy(payload.base_ref);
|
||||
t.falsy(payload.base_sha);
|
||||
}
|
||||
process.env["GITHUB_EVENT_NAME"] = "pull_request";
|
||||
process.env["GITHUB_SHA"] = "commit";
|
||||
process.env["GITHUB_BASE_REF"] = "master";
|
||||
process.env["GITHUB_EVENT_PATH"] = `${__dirname}/../src/testdata/pull_request.json`;
|
||||
for (const version of newVersions) {
|
||||
const payload = uploadLib.buildPayload("commit", "refs/pull/123/merge", "key", undefined, "", undefined, "/opt/src", undefined, ["CodeQL", "eslint"], version);
|
||||
const payload = uploadLib.buildPayload("commit", "refs/pull/123/merge", "key", undefined, "", undefined, "/opt/src", undefined, ["CodeQL", "eslint"], version, "mergeBaseCommit");
|
||||
// Uploads for a merge commit use the merge base
|
||||
t.deepEqual(payload.base_ref, "refs/heads/master");
|
||||
t.deepEqual(payload.base_sha, "mergeBaseCommit");
|
||||
}
|
||||
for (const version of newVersions) {
|
||||
const payload = uploadLib.buildPayload("headCommit", "refs/pull/123/head", "key", undefined, "", undefined, "/opt/src", undefined, ["CodeQL", "eslint"], version, "mergeBaseCommit");
|
||||
// Uploads for the head use the PR base
|
||||
t.deepEqual(payload.base_ref, "refs/heads/master");
|
||||
t.deepEqual(payload.base_sha, "f95f852bd8fca8fcc58a9a2d6c842781e32a215e");
|
||||
}
|
||||
for (const version of oldVersions) {
|
||||
const payload = uploadLib.buildPayload("commit", "refs/pull/123/merge", "key", undefined, "", undefined, "/opt/src", undefined, ["CodeQL", "eslint"], version);
|
||||
const payload = uploadLib.buildPayload("commit", "refs/pull/123/merge", "key", undefined, "", undefined, "/opt/src", undefined, ["CodeQL", "eslint"], version, "mergeBaseCommit");
|
||||
// These older versions won't expect these values
|
||||
t.falsy(payload.base_ref);
|
||||
t.falsy(payload.base_sha);
|
||||
|
||||
File diff suppressed because one or more lines are too long
1
lib/upload-sarif-action.js
generated
1
lib/upload-sarif-action.js
generated
@@ -48,6 +48,7 @@ async function run() {
|
||||
};
|
||||
const gitHubVersion = await (0, util_1.getGitHubVersion)(apiDetails);
|
||||
const uploadResult = await upload_lib.uploadFromActions(actionsUtil.getRequiredInput("sarif_file"), gitHubVersion, apiDetails, (0, logging_1.getActionsLogger)());
|
||||
core.setOutput("sarif-id", uploadResult.sarifID);
|
||||
if (actionsUtil.getRequiredInput("wait-for-processing") === "true") {
|
||||
await upload_lib.waitForProcessing((0, repository_1.parseRepositoryNwo)((0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY")), uploadResult.sarifID, apiDetails, (0, logging_1.getActionsLogger)());
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"upload-sarif-action.js","sourceRoot":"","sources":["../src/upload-sarif-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,uCAA6C;AAC7C,6CAAkD;AAClD,yDAA2C;AAC3C,iCAKgB;AAEhB,8CAA8C;AAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAMvC,KAAK,UAAU,uBAAuB,CACpC,SAAe,EACf,WAA0C;IAE1C,MAAM,gBAAg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M,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,MAAM,KAAK,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,MAAM,WAAW,CAAC,gBAAgB,CAChC,MAAM,WAAW,CAAC,sBAAsB,CACtC,cAAc,EACd,SAAS,EACT,SAAS,EACT,OAAO,EACP,KAAK,CACN,CACF,CAAC;QACF,OAAO;KACR;AACH,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,sCAAsC,KAAK,EAAE,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
||||
55
lib/util.js
generated
55
lib/util.js
generated
@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.checkNotWindows11 = exports.isGoodVersion = exports.delay = exports.bundleDb = exports.codeQlVersionAbove = exports.isHTTPError = exports.HTTPError = exports.getRequiredEnvParam = exports.isActions = exports.getMode = exports.enrichEnvironment = exports.initializeEnvironment = exports.Mode = exports.assertNever = exports.getGitHubAuth = exports.apiVersionInRange = exports.DisallowedAPIVersionReason = exports.checkGitHubVersionInRange = exports.getGitHubVersion = exports.GitHubVariant = exports.parseGitHubUrl = exports.getCodeQLDatabasePath = exports.getThreadsFlag = exports.getThreadsFlagValue = exports.getAddSnippetsFlag = exports.getMemoryFlag = exports.getMemoryFlagValue = exports.withTmpDir = exports.getToolNames = exports.getExtraOptionsEnvParam = exports.DEFAULT_DEBUG_DATABASE_NAME = exports.DEFAULT_DEBUG_ARTIFACT_NAME = exports.GITHUB_DOTCOM_URL = void 0;
|
||||
exports.getMlPoweredJsQueriesStatus = exports.ML_POWERED_JS_QUERIES_PACK = exports.checkNotWindows11 = exports.isGoodVersion = exports.delay = exports.bundleDb = exports.codeQlVersionAbove = exports.isHTTPError = exports.HTTPError = exports.getRequiredEnvParam = exports.isActions = exports.getMode = exports.enrichEnvironment = exports.initializeEnvironment = exports.Mode = exports.assertNever = exports.getGitHubAuth = exports.apiVersionInRange = exports.DisallowedAPIVersionReason = exports.checkGitHubVersionInRange = exports.getGitHubVersion = exports.GitHubVariant = exports.parseGitHubUrl = exports.getCodeQLDatabasePath = exports.getThreadsFlag = exports.getThreadsFlagValue = exports.getAddSnippetsFlag = exports.getMemoryFlag = exports.getMemoryFlagValue = exports.withTmpDir = exports.getToolNames = exports.getExtraOptionsEnvParam = exports.DEFAULT_DEBUG_DATABASE_NAME = exports.DEFAULT_DEBUG_ARTIFACT_NAME = exports.GITHUB_DOTCOM_URL = void 0;
|
||||
const fs = __importStar(require("fs"));
|
||||
const os = __importStar(require("os"));
|
||||
const path = __importStar(require("path"));
|
||||
@@ -524,4 +524,57 @@ function checkNotWindows11() {
|
||||
}
|
||||
}
|
||||
exports.checkNotWindows11 = checkNotWindows11;
|
||||
/**
|
||||
* The ML-powered JS query pack to add to the analysis if a repo is opted into the ML-powered
|
||||
* queries beta.
|
||||
*/
|
||||
exports.ML_POWERED_JS_QUERIES_PACK = {
|
||||
packName: "codeql/javascript-experimental-atm-queries",
|
||||
version: "~0.0.2",
|
||||
};
|
||||
/**
|
||||
* Get information about ML-powered JS queries to populate status reports with.
|
||||
*
|
||||
* This will be:
|
||||
*
|
||||
* - The version string if the analysis is using the ML-powered query pack that will be added to the
|
||||
* analysis if the repo is opted into the ML-powered queries beta, i.e.
|
||||
* {@link ML_POWERED_JS_QUERIES_PACK.version}. If the version string
|
||||
* {@link ML_POWERED_JS_QUERIES_PACK.version} is undefined, then the status report string will be
|
||||
* "latest", however this shouldn't occur in practice (see comment below).
|
||||
* - "false" if the analysis won't run any ML-powered JS queries.
|
||||
* - "other" in all other cases.
|
||||
*
|
||||
* Our goal of the status report here is to allow us to compare the occurrence of timeouts and other
|
||||
* errors with ML-powered queries turned on and off. We also want to be able to compare minor
|
||||
* version bumps caused by us bumping the version range of `ML_POWERED_JS_QUERIES_PACK` in a new
|
||||
* version of the CodeQL Action. For instance, we might want to compare the `~0.1.0` and `~0.0.2`
|
||||
* version strings.
|
||||
*
|
||||
* We restrict the set of strings we report here by excluding other version strings and combinations
|
||||
* of version strings. We do this to limit the cardinality of the ML-powered JS queries status
|
||||
* report field, since some platforms that ingest this status report bill based on the cardinality
|
||||
* of its fields.
|
||||
*
|
||||
* This function lives here rather than in `init-action.ts` so it's easier to test, since tests for
|
||||
* `init-action.ts` would each need to live in their own file. See `analyze-action-env.ts` for an
|
||||
* explanation as to why this is.
|
||||
*/
|
||||
function getMlPoweredJsQueriesStatus(config) {
|
||||
const mlPoweredJsQueryPacks = (config.packs.javascript || []).filter((pack) => pack.packName === exports.ML_POWERED_JS_QUERIES_PACK.packName);
|
||||
if (mlPoweredJsQueryPacks.length === 0) {
|
||||
return "false";
|
||||
}
|
||||
const firstVersionString = mlPoweredJsQueryPacks[0].version;
|
||||
if (mlPoweredJsQueryPacks.length === 1 &&
|
||||
exports.ML_POWERED_JS_QUERIES_PACK.version === firstVersionString) {
|
||||
// We should always specify an explicit version string in `ML_POWERED_JS_QUERIES_PACK`,
|
||||
// otherwise we won't be able to make changes to the pack unless those changes are compatible
|
||||
// with each version of the CodeQL Action. Therefore in practice, we should never hit the
|
||||
// `latest` case here.
|
||||
return exports.ML_POWERED_JS_QUERIES_PACK.version || "latest";
|
||||
}
|
||||
return "other";
|
||||
}
|
||||
exports.getMlPoweredJsQueriesStatus = getMlPoweredJsQueriesStatus;
|
||||
//# sourceMappingURL=util.js.map
|
||||
File diff suppressed because one or more lines are too long
58
lib/util.test.js
generated
58
lib/util.test.js
generated
@@ -204,4 +204,62 @@ async function mockStdInForAuthExpectError(t, mockLogger, ...text) {
|
||||
const stdin = stream.Readable.from(text);
|
||||
await t.throwsAsync(async () => util.getGitHubAuth(mockLogger, undefined, true, stdin));
|
||||
}
|
||||
const ML_POWERED_JS_STATUS_TESTS = [
|
||||
[[], "false"],
|
||||
[[{ packName: "someOtherPack" }], "false"],
|
||||
[
|
||||
[{ packName: "someOtherPack" }, util.ML_POWERED_JS_QUERIES_PACK],
|
||||
util.ML_POWERED_JS_QUERIES_PACK.version,
|
||||
],
|
||||
[[util.ML_POWERED_JS_QUERIES_PACK], util.ML_POWERED_JS_QUERIES_PACK.version],
|
||||
[[{ packName: util.ML_POWERED_JS_QUERIES_PACK.packName }], "other"],
|
||||
[
|
||||
[{ packName: util.ML_POWERED_JS_QUERIES_PACK.packName, version: "~0.0.1" }],
|
||||
"other",
|
||||
],
|
||||
[
|
||||
[
|
||||
{ packName: util.ML_POWERED_JS_QUERIES_PACK.packName, version: "0.0.1" },
|
||||
{ packName: util.ML_POWERED_JS_QUERIES_PACK.packName, version: "0.0.2" },
|
||||
],
|
||||
"other",
|
||||
],
|
||||
[
|
||||
[
|
||||
{ packName: "someOtherPack" },
|
||||
{ packName: util.ML_POWERED_JS_QUERIES_PACK.packName },
|
||||
],
|
||||
"other",
|
||||
],
|
||||
];
|
||||
for (const [packs, expectedStatus] of ML_POWERED_JS_STATUS_TESTS) {
|
||||
const packDescriptions = `[${packs
|
||||
.map((pack) => JSON.stringify(pack))
|
||||
.join(", ")}]`;
|
||||
(0, ava_1.default)(`ML-powered JS queries status report is "${expectedStatus}" for packs = ${packDescriptions}`, (t) => {
|
||||
return util.withTmpDir(async (tmpDir) => {
|
||||
const config = {
|
||||
languages: [],
|
||||
queries: {},
|
||||
paths: [],
|
||||
pathsIgnore: [],
|
||||
originalUserInput: {},
|
||||
tempDir: tmpDir,
|
||||
toolCacheDir: tmpDir,
|
||||
codeQLCmd: "",
|
||||
gitHubVersion: {
|
||||
type: util.GitHubVariant.DOTCOM,
|
||||
},
|
||||
dbLocation: "",
|
||||
packs: {
|
||||
javascript: packs,
|
||||
},
|
||||
debugMode: false,
|
||||
debugArtifactName: util.DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: util.DEFAULT_DEBUG_DATABASE_NAME,
|
||||
};
|
||||
t.is(util.getMlPoweredJsQueriesStatus(config), expectedStatus);
|
||||
});
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=util.test.js.map
|
||||
File diff suppressed because one or more lines are too long
2
node_modules/.bin/ava
generated
vendored
2
node_modules/.bin/ava
generated
vendored
@@ -1 +1 @@
|
||||
../ava/cli.js
|
||||
../ava/entrypoints/cli.mjs
|
||||
1
node_modules/.bin/import-local-fixture
generated
vendored
1
node_modules/.bin/import-local-fixture
generated
vendored
@@ -1 +0,0 @@
|
||||
../import-local/fixtures/cli.js
|
||||
1
node_modules/.bin/is-ci
generated
vendored
1
node_modules/.bin/is-ci
generated
vendored
@@ -1 +0,0 @@
|
||||
../is-ci/bin.js
|
||||
1
node_modules/.bin/rc
generated
vendored
1
node_modules/.bin/rc
generated
vendored
@@ -1 +0,0 @@
|
||||
../rc/cli.js
|
||||
2225
node_modules/.package-lock.json
generated
vendored
2225
node_modules/.package-lock.json
generated
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
Copyright (c) Mark Wubben (https://novemberborn.net)
|
||||
|
||||
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:
|
||||
|
||||
16
node_modules/@ava/typescript/README.md
generated
vendored
16
node_modules/@ava/typescript/README.md
generated
vendored
@@ -1,11 +1,21 @@
|
||||
# @ava/typescript
|
||||
|
||||
Adds [TypeScript](https://www.typescriptlang.org/) support to [AVA](https://avajs.dev).
|
||||
Adds [TypeScript](https://www.typescriptlang.org/) support to [AVA 4](https://avajs.dev).
|
||||
|
||||
This is designed to work for projects that precompile TypeScript. It allows AVA to load the compiled JavaScript, while configuring AVA to treat the TypeScript files as test files.
|
||||
|
||||
In other words, say you have a test file at `src/test.ts`. You've configured TypeScript to output to `build/`. Using `@ava/typescript` you can run the test using `npx ava src/test.ts`.
|
||||
|
||||
## For AVA 3 users
|
||||
|
||||
Use version 2:
|
||||
|
||||
```console
|
||||
npm install --save-dev @ava/typescript@2
|
||||
```
|
||||
|
||||
Note that v2 does not support ES modules. This requires v3 and AVA 4.
|
||||
|
||||
## Enabling TypeScript support
|
||||
|
||||
Add this package to your project:
|
||||
@@ -39,6 +49,10 @@ Output files are expected to have the `.js` extension.
|
||||
|
||||
AVA searches your entire project for `*.js`, `*.cjs`, `*.mjs` and `*.ts` files (or other extensions you've configured). It will ignore such files found in the `rewritePaths` targets (e.g. `build/`). If you use more specific paths, for instance `build/main/`, you may need to change AVA's `files` configuration to ignore other directories.
|
||||
|
||||
## ES Modules
|
||||
|
||||
If your `package.json` has configured `"type": "module"`, or you've configured AVA to treat the `js` extension as `module`, then `@ava/typescript` will import the output file as an ES module. Note that this is based on the *output file*, not the `ts` extension.
|
||||
|
||||
## Add additional extensions
|
||||
|
||||
You can configure AVA to recognize additional file extensions. To add (partial†) JSX support:
|
||||
|
||||
66
node_modules/@ava/typescript/index.js
generated
vendored
66
node_modules/@ava/typescript/index.js
generated
vendored
@@ -1,9 +1,10 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const escapeStringRegexp = require('escape-string-regexp');
|
||||
const execa = require('execa');
|
||||
const pkg = require('./package.json');
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import {pathToFileURL} from 'node:url';
|
||||
import escapeStringRegexp from 'escape-string-regexp';
|
||||
import execa from 'execa';
|
||||
|
||||
const pkg = JSON.parse(fs.readFileSync(new URL('package.json', import.meta.url)));
|
||||
const help = `See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md`;
|
||||
|
||||
function isPlainObject(x) {
|
||||
@@ -44,7 +45,7 @@ const configProperties = {
|
||||
required: true,
|
||||
isValid(compile) {
|
||||
return compile === false || compile === 'tsc';
|
||||
}
|
||||
},
|
||||
},
|
||||
rewritePaths: {
|
||||
required: true,
|
||||
@@ -53,23 +54,21 @@ const configProperties = {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Object.entries(rewritePaths).every(([from, to]) => {
|
||||
return from.endsWith('/') && typeof to === 'string' && to.endsWith('/');
|
||||
});
|
||||
}
|
||||
return Object.entries(rewritePaths).every(([from, to]) => from.endsWith('/') && typeof to === 'string' && to.endsWith('/'));
|
||||
},
|
||||
},
|
||||
extensions: {
|
||||
required: false,
|
||||
isValid(extensions) {
|
||||
return Array.isArray(extensions) &&
|
||||
extensions.length > 0 &&
|
||||
extensions.every(ext => typeof ext === 'string' && ext !== '') &&
|
||||
new Set(extensions).size === extensions.length;
|
||||
}
|
||||
}
|
||||
return Array.isArray(extensions)
|
||||
&& extensions.length > 0
|
||||
&& extensions.every(ext => typeof ext === 'string' && ext !== '')
|
||||
&& new Set(extensions).size === extensions.length;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = ({negotiateProtocol}) => {
|
||||
export default function typescriptProvider({negotiateProtocol}) {
|
||||
const protocol = negotiateProtocol(['ava-3.2'], {version: pkg.version});
|
||||
if (protocol === null) {
|
||||
return;
|
||||
@@ -86,12 +85,12 @@ module.exports = ({negotiateProtocol}) => {
|
||||
const {
|
||||
extensions = ['ts'],
|
||||
rewritePaths: relativeRewritePaths,
|
||||
compile
|
||||
compile,
|
||||
} = config;
|
||||
|
||||
const rewritePaths = Object.entries(relativeRewritePaths).map(([from, to]) => [
|
||||
path.join(protocol.projectDir, from),
|
||||
path.join(protocol.projectDir, to)
|
||||
path.join(protocol.projectDir, to),
|
||||
]);
|
||||
const testFileExtension = new RegExp(`\\.(${extensions.map(ext => escapeStringRegexp(ext)).join('|')})$`);
|
||||
|
||||
@@ -102,13 +101,13 @@ module.exports = ({negotiateProtocol}) => {
|
||||
}
|
||||
|
||||
return {
|
||||
extensions: extensions.slice(),
|
||||
rewritePaths: rewritePaths.slice()
|
||||
extensions: [...extensions],
|
||||
rewritePaths: [...rewritePaths],
|
||||
};
|
||||
},
|
||||
|
||||
get extensions() {
|
||||
return extensions.slice();
|
||||
return [...extensions];
|
||||
},
|
||||
|
||||
ignoreChange(filePath) {
|
||||
@@ -139,18 +138,19 @@ module.exports = ({negotiateProtocol}) => {
|
||||
filePatterns: [
|
||||
...filePatterns,
|
||||
'!**/*.d.ts',
|
||||
...Object.values(relativeRewritePaths).map(to => `!${to}**`)
|
||||
...Object.values(relativeRewritePaths).map(to => `!${to}**`),
|
||||
],
|
||||
ignoredByWatcherPatterns: [
|
||||
...ignoredByWatcherPatterns,
|
||||
...Object.values(relativeRewritePaths).map(to => `${to}**/*.js.map`)
|
||||
]
|
||||
...Object.values(relativeRewritePaths).map(to => `${to}**/*.js.map`),
|
||||
],
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
worker({extensionsToLoadAsModules, state: {extensions, rewritePaths}}) {
|
||||
const useImport = extensionsToLoadAsModules.includes('js');
|
||||
const testFileExtension = new RegExp(`\\.(${extensions.map(ext => escapeStringRegexp(ext)).join('|')})$`);
|
||||
|
||||
return {
|
||||
@@ -159,18 +159,12 @@ module.exports = ({negotiateProtocol}) => {
|
||||
},
|
||||
|
||||
async load(ref, {requireFn}) {
|
||||
for (const extension of extensionsToLoadAsModules) {
|
||||
if (ref.endsWith(`.${extension}`)) {
|
||||
throw new Error('@ava/typescript cannot yet load ESM files');
|
||||
}
|
||||
}
|
||||
|
||||
const [from, to] = rewritePaths.find(([from]) => ref.startsWith(from));
|
||||
// TODO: Support JSX preserve mode — https://www.typescriptlang.org/docs/handbook/jsx.html
|
||||
const rewritten = `${to}${ref.slice(from.length)}`.replace(testFileExtension, '.js');
|
||||
return requireFn(rewritten);
|
||||
}
|
||||
return useImport ? import(pathToFileURL(rewritten)) : requireFn(rewritten); // eslint-disable-line node/no-unsupported-features/es-syntax
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
6
node_modules/@ava/typescript/node_modules/escape-string-regexp/index.d.ts
generated
vendored
6
node_modules/@ava/typescript/node_modules/escape-string-regexp/index.d.ts
generated
vendored
@@ -5,7 +5,7 @@ You can also use this to escape a string that is inserted into the middle of a r
|
||||
|
||||
@example
|
||||
```
|
||||
import escapeStringRegexp = require('escape-string-regexp');
|
||||
import escapeStringRegexp from 'escape-string-regexp';
|
||||
|
||||
const escapedString = escapeStringRegexp('How much $ for a 🦄?');
|
||||
//=> 'How much \\$ for a 🦄\\?'
|
||||
@@ -13,6 +13,4 @@ const escapedString = escapeStringRegexp('How much $ for a 🦄?');
|
||||
new RegExp(escapedString);
|
||||
```
|
||||
*/
|
||||
declare const escapeStringRegexp: (string: string) => string;
|
||||
|
||||
export = escapeStringRegexp;
|
||||
export default function escapeStringRegexp(string: string): string;
|
||||
|
||||
8
node_modules/@ava/typescript/node_modules/escape-string-regexp/index.js
generated
vendored
8
node_modules/@ava/typescript/node_modules/escape-string-regexp/index.js
generated
vendored
@@ -1,13 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = string => {
|
||||
export default function escapeStringRegexp(string) {
|
||||
if (typeof string !== 'string') {
|
||||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
// Escape characters with special meaning either inside or outside character sets.
|
||||
// Use a simple backslash escape when it’s always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
|
||||
// Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
|
||||
return string
|
||||
.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
|
||||
.replace(/-/g, '\\x2d');
|
||||
};
|
||||
}
|
||||
|
||||
12
node_modules/@ava/typescript/node_modules/escape-string-regexp/package.json
generated
vendored
12
node_modules/@ava/typescript/node_modules/escape-string-regexp/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "escape-string-regexp",
|
||||
"version": "4.0.0",
|
||||
"version": "5.0.0",
|
||||
"description": "Escape RegExp special characters",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/escape-string-regexp",
|
||||
@@ -10,8 +10,10 @@
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": "./index.js",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
"node": ">=12"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
@@ -31,8 +33,8 @@
|
||||
"characters"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.11.0",
|
||||
"xo": "^0.28.3"
|
||||
"ava": "^3.15.0",
|
||||
"tsd": "^0.14.0",
|
||||
"xo": "^0.38.2"
|
||||
}
|
||||
}
|
||||
4
node_modules/@ava/typescript/node_modules/escape-string-regexp/readme.md
generated
vendored
4
node_modules/@ava/typescript/node_modules/escape-string-regexp/readme.md
generated
vendored
@@ -1,4 +1,4 @@
|
||||
# escape-string-regexp [](https://travis-ci.org/sindresorhus/escape-string-regexp)
|
||||
# escape-string-regexp
|
||||
|
||||
> Escape RegExp special characters
|
||||
|
||||
@@ -11,7 +11,7 @@ $ npm install escape-string-regexp
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const escapeStringRegexp = require('escape-string-regexp');
|
||||
import escapeStringRegexp from 'escape-string-regexp';
|
||||
|
||||
const escapedString = escapeStringRegexp('How much $ for a 🦄?');
|
||||
//=> 'How much \\$ for a 🦄\\?'
|
||||
|
||||
29
node_modules/@ava/typescript/package.json
generated
vendored
29
node_modules/@ava/typescript/package.json
generated
vendored
@@ -1,13 +1,17 @@
|
||||
{
|
||||
"name": "@ava/typescript",
|
||||
"version": "2.0.0",
|
||||
"version": "3.0.1",
|
||||
"description": "TypeScript provider for AVA",
|
||||
"engines": {
|
||||
"node": ">=12.22 <13 || >=14.16 <15 || >=15"
|
||||
"node": ">=12.22 <13 || >=14.17 <15 || >=16.4 <17 || >=17"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"exports": {
|
||||
".": "./index.js"
|
||||
},
|
||||
"type": "module",
|
||||
"author": "Mark Wubben (https://novemberborn.net)",
|
||||
"repository": "avajs/typescript",
|
||||
"license": "MIT",
|
||||
@@ -19,15 +23,15 @@
|
||||
"test": "xo && c8 ava"
|
||||
},
|
||||
"dependencies": {
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"execa": "^5.0.0"
|
||||
"escape-string-regexp": "^5.0.0",
|
||||
"execa": "^5.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^3.15.0",
|
||||
"c8": "^7.7.1",
|
||||
"ava": "4.0.0-rc.1",
|
||||
"c8": "^7.10.0",
|
||||
"del": "^6.0.0",
|
||||
"typescript": "^4.2.4",
|
||||
"xo": "^0.38.2"
|
||||
"typescript": "^4.4.4",
|
||||
"xo": "^0.46.3"
|
||||
},
|
||||
"c8": {
|
||||
"reporter": [
|
||||
@@ -40,14 +44,15 @@
|
||||
"files": [
|
||||
"!test/broken-fixtures/**"
|
||||
],
|
||||
"ignoredByWatcher": [
|
||||
"test/fixtures/**",
|
||||
"test/broken-fixtures/**"
|
||||
],
|
||||
"timeout": "60s"
|
||||
},
|
||||
"xo": {
|
||||
"ignores": [
|
||||
"test/broken-fixtures"
|
||||
],
|
||||
"rules": {
|
||||
"import/order": "off"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
14
node_modules/@concordance/react/LICENSE
generated
vendored
14
node_modules/@concordance/react/LICENSE
generated
vendored
@@ -1,14 +0,0 @@
|
||||
ISC License (ISC)
|
||||
Copyright (c) 2017, Mark Wubben <mark@novemberborn.net> (novemberborn.net)
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose
|
||||
with or without fee is hereby granted, provided that the above copyright notice
|
||||
and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||
THIS SOFTWARE.
|
||||
18
node_modules/@concordance/react/README.md
generated
vendored
18
node_modules/@concordance/react/README.md
generated
vendored
@@ -1,18 +0,0 @@
|
||||
# @concordance/react
|
||||
|
||||
React plugin for [Concordance](https://github.com/concordancejs/concordance).
|
||||
|
||||
Allows
|
||||
[`React.createElement()`](https://facebook.github.io/react/docs/react-api.html#createelement)
|
||||
objects to be compared, formatted, diffed and serialized. Also supports
|
||||
`toJSON()` renderings of
|
||||
[`react-test-renderer`](https://www.npmjs.com/package/react-test-renderer).
|
||||
These may be compared to `React.createElement()` objects.
|
||||
|
||||
When comparing [React
|
||||
component](https://facebook.github.io/react/docs/components-and-props.html)
|
||||
elements, the element type is compared by identity. After deserialization the
|
||||
element types are compared by function name.
|
||||
|
||||
Component elements are formatted with a ⍟ character after the element
|
||||
name. Properties and children are formatted by [Concordance](https://github.com/concordancejs/concordance).
|
||||
75
node_modules/@concordance/react/index.js
generated
vendored
75
node_modules/@concordance/react/index.js
generated
vendored
@@ -1,75 +0,0 @@
|
||||
'use strict'
|
||||
|
||||
const pkg = require('./package.json')
|
||||
const elementFactory = require('./lib/elementFactory')
|
||||
const testJsonFactory = require('./lib/testJsonFactory')
|
||||
|
||||
// Must be unique across all registered plugins.
|
||||
exports.name = pkg.name
|
||||
|
||||
// Expected API version to be passed to register().
|
||||
exports.apiVersion = 1
|
||||
|
||||
// Expected minimal version of Concordance. Concordance will increment its API
|
||||
// version for breaking changes, this is useful if you rely on features or
|
||||
// patches that were introduced in a specific version of Concordance.
|
||||
exports.minimalConcordanceVersion = '1.0.0'
|
||||
|
||||
// Plugin-specific version of its serialization output.
|
||||
exports.serializerVersion = 2
|
||||
|
||||
exports.theme = {
|
||||
react: {
|
||||
functionType: '\u235F',
|
||||
openTag: {
|
||||
start: '<',
|
||||
end: '>',
|
||||
selfClose: '/',
|
||||
selfCloseVoid: ' /'
|
||||
},
|
||||
closeTag: {
|
||||
open: '</',
|
||||
close: '>'
|
||||
},
|
||||
tagName: {open: '', close: ''},
|
||||
attribute: {
|
||||
separator: '=',
|
||||
value: {
|
||||
openBracket: '{',
|
||||
closeBracket: '}',
|
||||
string: {
|
||||
line: {open: '"', close: '"', escapeQuote: '"'}
|
||||
}
|
||||
}
|
||||
},
|
||||
child: {
|
||||
openBracket: '{',
|
||||
closeBracket: '}',
|
||||
string: {
|
||||
line: {open: '', close: '', escapeQuote: ''},
|
||||
multiline: {start: '', end: '', escapeQuote: ''}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const ELEMENT = Symbol.for('react.element')
|
||||
const TEST_JSON = Symbol.for('react.test.json')
|
||||
|
||||
function register (api) {
|
||||
const reactTags = new Set()
|
||||
const element = elementFactory(api, reactTags)
|
||||
const testJson = testJsonFactory(api, element)
|
||||
|
||||
api.addDescriptor(0x01, element.tag, element.deserialize)
|
||||
api.addDescriptor(0x02, testJson.tag, testJson.deserialize)
|
||||
|
||||
reactTags.add(element.tag).add(testJson.tag)
|
||||
|
||||
return value => {
|
||||
if (value.$$typeof === ELEMENT) return element.describe
|
||||
if (value.$$typeof === TEST_JSON) return testJson.describe
|
||||
return null
|
||||
}
|
||||
}
|
||||
exports.register = register
|
||||
239
node_modules/@concordance/react/lib/diffShallow.js
generated
vendored
239
node_modules/@concordance/react/lib/diffShallow.js
generated
vendored
@@ -1,239 +0,0 @@
|
||||
'use strict'
|
||||
|
||||
function diffShallow (api, actual, expected, theme, indent) {
|
||||
const childBuffer = api.lineBuilder.buffer()
|
||||
const propertyBuffer = api.lineBuilder.buffer()
|
||||
|
||||
return {
|
||||
append (formatted, origin) {
|
||||
if (origin.isItem === true) {
|
||||
childBuffer.append(formatted)
|
||||
} else {
|
||||
propertyBuffer.append(formatted)
|
||||
}
|
||||
},
|
||||
|
||||
finalize: () => {
|
||||
const namesAreEqual = actual.compareNames(expected)
|
||||
const actualName = actual.formatName(theme)
|
||||
const expectedName = expected.formatName(theme)
|
||||
|
||||
const openTag = theme.react.openTag
|
||||
const innerIndentation = indent.increase()
|
||||
|
||||
const allChildren = childBuffer.withFirstPrefixed(innerIndentation)
|
||||
const children = allChildren.decompose()
|
||||
|
||||
const allProperties = propertyBuffer.withFirstPrefixed(innerIndentation)
|
||||
const properties = allProperties.decompose()
|
||||
// If the first properties are also the last, and either side has no
|
||||
// children, ensure the properties are treated as being last. This
|
||||
// leads to a better balanced diff.
|
||||
if (properties.remaining.isEmpty && (!actual.hasChildren || !expected.hasChildren)) {
|
||||
properties.last = properties.first
|
||||
properties.first = {actual: api.lineBuilder.buffer(), expected: api.lineBuilder.buffer()}
|
||||
}
|
||||
|
||||
const result = api.lineBuilder.buffer()
|
||||
|
||||
// Create a custom diff that is as neat as possible. It's likely
|
||||
// there's a generic algorithm that can be used, but for expediency's
|
||||
// sake handles all possible diffs by brute force instead.
|
||||
if (actual.hasProperties && expected.hasProperties) {
|
||||
if (namesAreEqual) {
|
||||
result
|
||||
.append(api.lineBuilder.first(openTag.start + actualName))
|
||||
.append(properties.first.actual.stripFlags())
|
||||
.append(properties.first.expected.stripFlags())
|
||||
} else {
|
||||
result
|
||||
.append(api.lineBuilder.actual.first(openTag.start + actualName))
|
||||
.append(properties.first.actual.stripFlags())
|
||||
.append(api.lineBuilder.expected.first(openTag.start + expectedName))
|
||||
.append(properties.first.expected.stripFlags())
|
||||
}
|
||||
result.append(properties.remaining.stripFlags())
|
||||
|
||||
if (actual.hasChildren && expected.hasChildren) {
|
||||
result
|
||||
.append(properties.last.actual.stripFlags())
|
||||
.append(properties.last.expected.stripFlags())
|
||||
.append(api.lineBuilder.line(indent + openTag.end))
|
||||
|
||||
if (namesAreEqual) {
|
||||
result
|
||||
.append(allChildren.stripFlags())
|
||||
.append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
|
||||
} else {
|
||||
result
|
||||
.append(children.first.actual.stripFlags())
|
||||
.append(children.first.expected.stripFlags())
|
||||
.append(children.remaining.stripFlags())
|
||||
.append(children.last.actual.stripFlags())
|
||||
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
|
||||
.append(children.last.expected.stripFlags())
|
||||
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName)))
|
||||
}
|
||||
} else if (actual.hasChildren) {
|
||||
result
|
||||
.append(properties.last.actual.stripFlags())
|
||||
.append(api.lineBuilder.actual.line(indent + openTag.end))
|
||||
.append(allChildren.stripFlags())
|
||||
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
|
||||
.append(properties.last.expected.stripFlags())
|
||||
.append(api.lineBuilder.expected.last(indent + openTag.selfClose + openTag.end))
|
||||
} else if (expected.hasChildren) {
|
||||
result
|
||||
.append(properties.last.actual.stripFlags())
|
||||
.append(api.lineBuilder.actual.last(indent + openTag.selfClose + openTag.end))
|
||||
.append(properties.last.expected.stripFlags())
|
||||
.append(api.lineBuilder.expected.line(indent + openTag.end))
|
||||
.append(allChildren.stripFlags())
|
||||
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName)))
|
||||
} else {
|
||||
result
|
||||
.append(properties.last.actual.stripFlags())
|
||||
.append(properties.last.expected.stripFlags())
|
||||
.append(api.lineBuilder.last(indent + openTag.selfClose + openTag.end))
|
||||
}
|
||||
} else if (actual.hasProperties) {
|
||||
result
|
||||
.append(api.lineBuilder.actual.first(openTag.start + actualName))
|
||||
.append(allProperties.stripFlags())
|
||||
|
||||
if (actual.hasChildren && expected.hasChildren) {
|
||||
result
|
||||
.append(api.lineBuilder.actual.line(indent + openTag.end))
|
||||
.append(children.first.actual.stripFlags())
|
||||
.append(api.lineBuilder.expected.first(openTag.start + expectedName + openTag.end))
|
||||
.append(children.first.expected.stripFlags())
|
||||
.append(children.remaining.stripFlags())
|
||||
|
||||
if (namesAreEqual) {
|
||||
result
|
||||
.append(children.last.actual.stripFlags())
|
||||
.append(children.last.expected.stripFlags())
|
||||
.append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
|
||||
} else {
|
||||
result
|
||||
.append(children.last.actual.stripFlags())
|
||||
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
|
||||
.append(children.last.expected.stripFlags())
|
||||
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName)))
|
||||
}
|
||||
} else if (actual.hasChildren) {
|
||||
result
|
||||
.append(api.lineBuilder.actual.last(indent + openTag.selfClose + openTag.end))
|
||||
.append(allChildren.stripFlags())
|
||||
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
|
||||
.append(api.lineBuilder.expected.single(openTag.start + expectedName + openTag.selfCloseVoid + openTag.end))
|
||||
} else if (expected.hasChildren) {
|
||||
result
|
||||
.append(api.lineBuilder.actual.last(indent + openTag.selfClose + openTag.end))
|
||||
.append(api.lineBuilder.expected.first(openTag.start + expectedName + openTag.end))
|
||||
.append(allChildren.stripFlags())
|
||||
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName)))
|
||||
} else {
|
||||
result
|
||||
.append(api.lineBuilder.actual.last(indent + openTag.selfClose + openTag.end))
|
||||
.append(api.lineBuilder.expected.single(openTag.start + expectedName + openTag.selfCloseVoid + openTag.end))
|
||||
}
|
||||
} else if (expected.hasProperties) {
|
||||
if (actual.hasChildren && expected.hasChildren) {
|
||||
result
|
||||
.append(api.lineBuilder.actual.first(openTag.start + actualName + openTag.end))
|
||||
.append(children.first.actual.stripFlags())
|
||||
.append(api.lineBuilder.expected.first(openTag.start + expectedName))
|
||||
.append(allProperties.stripFlags())
|
||||
.append(api.lineBuilder.expected.line(indent + openTag.end))
|
||||
.append(children.first.expected.stripFlags())
|
||||
.append(children.remaining.stripFlags())
|
||||
|
||||
if (namesAreEqual) {
|
||||
result
|
||||
.append(children.last.actual.stripFlags())
|
||||
.append(children.last.expected.stripFlags())
|
||||
.append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
|
||||
} else {
|
||||
result
|
||||
.append(children.last.actual.stripFlags())
|
||||
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
|
||||
.append(children.last.expected.stripFlags())
|
||||
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName)))
|
||||
}
|
||||
} else if (actual.hasChildren) {
|
||||
result
|
||||
.append(api.lineBuilder.actual.first(openTag.start + actualName + openTag.end))
|
||||
.append(allChildren.stripFlags())
|
||||
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
|
||||
.append(api.lineBuilder.expected.first(openTag.start + expectedName))
|
||||
.append(allProperties.stripFlags())
|
||||
.append(api.lineBuilder.expected.last(indent + openTag.selfClose + openTag.end))
|
||||
} else if (expected.hasChildren) {
|
||||
result
|
||||
.append(api.lineBuilder.actual.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end))
|
||||
.append(api.lineBuilder.expected.first(openTag.start + expectedName))
|
||||
.append(allProperties.stripFlags())
|
||||
.append(api.lineBuilder.expected.line(indent + openTag.end))
|
||||
.append(allChildren.stripFlags())
|
||||
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName)))
|
||||
} else {
|
||||
result
|
||||
.append(api.lineBuilder.actual.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end))
|
||||
.append(api.lineBuilder.expected.first(openTag.start + expectedName))
|
||||
.append(allProperties.stripFlags())
|
||||
.append(api.lineBuilder.expected.last(indent + openTag.selfCloseVoid + openTag.end))
|
||||
}
|
||||
} else {
|
||||
if (actual.hasChildren && expected.hasChildren) {
|
||||
if (namesAreEqual) {
|
||||
result
|
||||
.append(api.lineBuilder.first(openTag.start + actualName + openTag.end))
|
||||
.append(allChildren.stripFlags())
|
||||
.append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
|
||||
} else {
|
||||
result
|
||||
.append(api.lineBuilder.actual.first(openTag.start + actualName + openTag.end))
|
||||
.append(children.first.actual.stripFlags())
|
||||
.append(api.lineBuilder.expected.first(openTag.start + expectedName + openTag.end))
|
||||
.append(children.first.expected.stripFlags())
|
||||
.append(children.remaining.stripFlags())
|
||||
.append(children.last.actual.stripFlags())
|
||||
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
|
||||
.append(children.last.expected.stripFlags())
|
||||
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName)))
|
||||
}
|
||||
} else if (actual.hasChildren) {
|
||||
result
|
||||
.append(api.lineBuilder.actual.first(openTag.start + actualName + openTag.end))
|
||||
.append(allChildren.stripFlags())
|
||||
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
|
||||
.append(api.lineBuilder.expected.single(openTag.start + expectedName + openTag.selfCloseVoid + openTag.end))
|
||||
} else if (expected.hasChildren) {
|
||||
result
|
||||
.append(api.lineBuilder.actual.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end))
|
||||
.append(api.lineBuilder.expected.first(openTag.start + expectedName + openTag.end))
|
||||
.append(allChildren.stripFlags())
|
||||
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
|
||||
} else {
|
||||
if (namesAreEqual) {
|
||||
result.append(api.lineBuilder.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end))
|
||||
} else {
|
||||
result
|
||||
.append(api.lineBuilder.actual.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end))
|
||||
.append(api.lineBuilder.expected.single(openTag.start + expectedName + openTag.selfCloseVoid + openTag.end))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
},
|
||||
|
||||
shouldFormat (subject) {
|
||||
return subject.isItem === true || subject.isProperty === true
|
||||
},
|
||||
|
||||
increaseIndent: true
|
||||
}
|
||||
}
|
||||
module.exports = diffShallow
|
||||
353
node_modules/@concordance/react/lib/elementFactory.js
generated
vendored
353
node_modules/@concordance/react/lib/elementFactory.js
generated
vendored
@@ -1,353 +0,0 @@
|
||||
'use strict'
|
||||
|
||||
const arrify = require('arrify')
|
||||
const diffShallow = require('./diffShallow')
|
||||
const escapeText = require('./escapeText')
|
||||
|
||||
const FRAGMENT_NAME = Symbol.for('react.fragment')
|
||||
|
||||
function factory (api, reactTags) {
|
||||
const tag = Symbol('@concordance/react.ElementValue')
|
||||
|
||||
function customPropertyFormatter (theme, indent, key, value) {
|
||||
const separator = theme.react.attribute.separator + theme.react.attribute.value.openBracket
|
||||
if (value.isSingle) {
|
||||
return value
|
||||
.withFirstPrefixed(key.formatAsKey(theme) + separator)
|
||||
.withLastPostfixed(theme.react.attribute.value.closeBracket)
|
||||
}
|
||||
|
||||
return api.lineBuilder.first(key.formatAsKey(theme) + separator)
|
||||
.concat(value.withFirstPrefixed(indent.increase()).stripFlags())
|
||||
.append(api.lineBuilder.last(indent + theme.react.attribute.value.closeBracket))
|
||||
}
|
||||
|
||||
function themeProperty (theme) {
|
||||
theme.property.increaseValueIndent = true
|
||||
theme.property.customFormat = customPropertyFormatter
|
||||
}
|
||||
|
||||
function themeStringProperty (theme) {
|
||||
theme.property.separator = theme.react.attribute.separator
|
||||
theme.property.after = ''
|
||||
Object.assign(theme.string.line, theme.react.attribute.value.string.line)
|
||||
}
|
||||
|
||||
function customItemFormatter (theme, indent, value) {
|
||||
if (value.isSingle) {
|
||||
return value
|
||||
.withFirstPrefixed(theme.react.child.openBracket)
|
||||
.withLastPostfixed(theme.react.child.closeBracket)
|
||||
}
|
||||
|
||||
return api.lineBuilder.first(theme.react.child.openBracket)
|
||||
.concat(value.withFirstPrefixed(indent.increase()).stripFlags())
|
||||
.append(api.lineBuilder.last(indent + theme.react.child.closeBracket))
|
||||
}
|
||||
|
||||
function themeChild (theme) {
|
||||
theme.item.increaseValueIndent = true
|
||||
theme.item.customFormat = customItemFormatter
|
||||
}
|
||||
|
||||
function themeReactChild (theme) {
|
||||
theme.item.after = ''
|
||||
}
|
||||
|
||||
function themeStringChild (theme) {
|
||||
theme.item.after = ''
|
||||
Object.assign(theme.string, theme.react.child.string)
|
||||
}
|
||||
|
||||
function describe (props) {
|
||||
const element = props.value
|
||||
|
||||
const type = element.type
|
||||
const hasTypeFn = typeof type === 'function'
|
||||
const typeFn = hasTypeFn ? type : null
|
||||
const name = hasTypeFn ? type.displayName || type.name : type
|
||||
|
||||
const children = arrify(element.props.children)
|
||||
|
||||
const properties = Object.assign({}, element.props)
|
||||
delete properties.children
|
||||
if (element.key !== null) {
|
||||
properties.key = element.key
|
||||
}
|
||||
const hasProperties = Object.keys(properties).length > 0
|
||||
|
||||
return new DescribedElementValue(Object.assign({
|
||||
children,
|
||||
hasProperties,
|
||||
hasTypeFn,
|
||||
name,
|
||||
properties,
|
||||
typeFn,
|
||||
isList: children.length > 0
|
||||
}, props))
|
||||
}
|
||||
|
||||
function deserialize (state, recursor) {
|
||||
return new DeserializedElementValue(state, recursor)
|
||||
}
|
||||
|
||||
class ElementValue extends api.ObjectValue {
|
||||
constructor (props) {
|
||||
super(props)
|
||||
this.isFragment = props.name === FRAGMENT_NAME
|
||||
this.name = props.name
|
||||
this.hasProperties = props.hasProperties
|
||||
this.hasTypeFn = props.hasTypeFn
|
||||
|
||||
this.hasChildren = this.isList
|
||||
}
|
||||
|
||||
compare (expected) {
|
||||
return this.tag === expected.tag && this.name === expected.name
|
||||
? api.SHALLOW_EQUAL
|
||||
: api.UNEQUAL
|
||||
}
|
||||
|
||||
formatName (theme) {
|
||||
const formatted = api.wrapFromTheme(theme.react.tagName, this.isFragment ? 'React.Fragment' : this.name)
|
||||
return this.hasTypeFn
|
||||
? formatted + theme.react.functionType
|
||||
: formatted
|
||||
}
|
||||
|
||||
compareNames (expected) {
|
||||
return this.name === expected.name && this.hasTypeFn === expected.hasTypeFn
|
||||
}
|
||||
|
||||
formatShallow (theme, indent) {
|
||||
const childBuffer = api.lineBuilder.buffer()
|
||||
const propertyBuffer = api.lineBuilder.buffer()
|
||||
|
||||
return {
|
||||
append (formatted, origin) {
|
||||
if (origin.isItem === true) {
|
||||
childBuffer.append(formatted)
|
||||
} else {
|
||||
propertyBuffer.append(formatted)
|
||||
}
|
||||
},
|
||||
|
||||
finalize: () => {
|
||||
const name = this.formatName(theme)
|
||||
const openTag = theme.react.openTag
|
||||
|
||||
if (!this.hasChildren && !this.hasProperties) {
|
||||
return api.lineBuilder.single(openTag.start + name + openTag.selfCloseVoid + openTag.end)
|
||||
}
|
||||
|
||||
const innerIndentation = indent.increase()
|
||||
const children = childBuffer.withFirstPrefixed(innerIndentation).stripFlags()
|
||||
const properties = propertyBuffer.withFirstPrefixed(innerIndentation).stripFlags()
|
||||
|
||||
const result = api.lineBuilder.buffer()
|
||||
if (this.hasProperties) {
|
||||
result
|
||||
.append(api.lineBuilder.first(openTag.start + name))
|
||||
.append(properties)
|
||||
|
||||
if (this.hasChildren) {
|
||||
result.append(api.lineBuilder.line(indent + openTag.end))
|
||||
} else {
|
||||
result.append(api.lineBuilder.last(indent + openTag.selfClose + openTag.end))
|
||||
}
|
||||
} else {
|
||||
result.append(api.lineBuilder.first(openTag.start + name + openTag.end))
|
||||
}
|
||||
|
||||
if (this.hasChildren) {
|
||||
result
|
||||
.append(children)
|
||||
.append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, name)))
|
||||
}
|
||||
|
||||
return result
|
||||
},
|
||||
|
||||
maxDepth: () => {
|
||||
const name = this.formatName(theme)
|
||||
const openTag = theme.react.openTag
|
||||
|
||||
if (!this.hasChildren && !this.hasProperties) {
|
||||
return api.lineBuilder.single(openTag.start + name + openTag.selfCloseVoid + openTag.end)
|
||||
}
|
||||
|
||||
let str = openTag.start + name
|
||||
if (this.hasProperties) {
|
||||
str += theme.maxDepth
|
||||
if (this.hasChildren) {
|
||||
str += openTag.end
|
||||
} else {
|
||||
str += ' ' + openTag.selfClose + openTag.end
|
||||
}
|
||||
} else {
|
||||
str += openTag.end
|
||||
}
|
||||
|
||||
if (this.hasChildren) {
|
||||
str += theme.maxDepth + api.wrapFromTheme(theme.react.closeTag, name)
|
||||
}
|
||||
|
||||
return api.lineBuilder.single(str)
|
||||
},
|
||||
|
||||
shouldFormat (subject) {
|
||||
return subject.isItem === true || subject.isProperty === true
|
||||
},
|
||||
|
||||
increaseIndent: true
|
||||
}
|
||||
}
|
||||
|
||||
prepareDiff (expected) {
|
||||
return {
|
||||
compareResult: this.tag === expected.tag
|
||||
? api.SHALLOW_EQUAL
|
||||
: api.UNEQUAL
|
||||
}
|
||||
}
|
||||
|
||||
diffShallow (expected, theme, indent) {
|
||||
return diffShallow(api, this, expected, theme, indent)
|
||||
}
|
||||
|
||||
serialize () {
|
||||
return [this.isFragment, this.isFragment ? null : this.name, this.hasProperties, this.hasTypeFn, super.serialize()]
|
||||
}
|
||||
}
|
||||
Object.defineProperty(ElementValue.prototype, 'tag', {value: tag})
|
||||
|
||||
function modifyThemes (recursor) {
|
||||
return api.mapRecursor(recursor, next => {
|
||||
let modifier
|
||||
if (next.isItem === true) {
|
||||
if (next.tag === api.descriptorTags.primitiveItem && next.value.tag === api.descriptorTags.string) {
|
||||
modifier = themeStringChild
|
||||
} else if (next.tag === api.descriptorTags.complexItem && reactTags.has(next.value.tag)) {
|
||||
modifier = themeReactChild
|
||||
} else {
|
||||
modifier = themeChild
|
||||
}
|
||||
} else if (next.isProperty === true) {
|
||||
if (
|
||||
next.tag === api.descriptorTags.primitiveProperty &&
|
||||
next.value.tag === api.descriptorTags.string &&
|
||||
!next.value.includesLinebreaks
|
||||
) {
|
||||
modifier = themeStringProperty
|
||||
} else {
|
||||
modifier = themeProperty
|
||||
}
|
||||
}
|
||||
|
||||
return modifier
|
||||
? api.modifyTheme(next, modifier)
|
||||
: next
|
||||
})
|
||||
}
|
||||
|
||||
function DescribedMixin (base) {
|
||||
return class extends api.DescribedMixin(base) {
|
||||
constructor (props) {
|
||||
super(props)
|
||||
this.children = props.children
|
||||
this.properties = props.properties
|
||||
this.typeFn = props.typeFn
|
||||
}
|
||||
|
||||
compare (expected) {
|
||||
const result = super.compare(expected)
|
||||
return result === api.SHALLOW_EQUAL && this.typeFn !== expected.typeFn
|
||||
? api.UNEQUAL
|
||||
: result
|
||||
}
|
||||
|
||||
compareNames (expected) {
|
||||
return super.compareNames(expected) && this.typeFn === expected.typeFn
|
||||
}
|
||||
|
||||
createPropertyRecursor () {
|
||||
// Symbols are not valid property keys for React elements. This code
|
||||
// also assumes that the keys can be formatted as JSX-like attribute
|
||||
// names. Keys are not pre-escaped before being passed to Concordance's
|
||||
// property descriptor.
|
||||
const keys = Object.keys(this.properties).sort()
|
||||
const size = keys.length
|
||||
|
||||
let index = 0
|
||||
const next = () => {
|
||||
if (index === size) return null
|
||||
|
||||
const key = keys[index++]
|
||||
// Note that string values are not specifically escaped such that the
|
||||
// output is valid JSX.
|
||||
return this.describeProperty(key, this.describeAny(this.properties[key]))
|
||||
}
|
||||
|
||||
return {size, next}
|
||||
}
|
||||
|
||||
createListRecursor () {
|
||||
if (!this.isList) return super.createListRecursor()
|
||||
|
||||
const size = this.children.length
|
||||
|
||||
let index = 0
|
||||
const next = () => {
|
||||
if (index === size) return null
|
||||
|
||||
const current = index++
|
||||
const child = this.children[current]
|
||||
const type = typeof child
|
||||
let descriptor
|
||||
if (type === 'string') {
|
||||
descriptor = this.describeAny(escapeText(child))
|
||||
} else {
|
||||
descriptor = this.describeAny(child)
|
||||
}
|
||||
|
||||
return this.describeItem(current, descriptor)
|
||||
}
|
||||
|
||||
return {size, next}
|
||||
}
|
||||
|
||||
createRecursor () {
|
||||
return modifyThemes(super.createRecursor())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function DeserializedMixin (base) {
|
||||
return class extends api.DeserializedMixin(base) {
|
||||
constructor (state, recursor) {
|
||||
super(state[4], recursor)
|
||||
this.isFragment = state[0]
|
||||
this.name = this.isFragment ? FRAGMENT_NAME : state[1]
|
||||
this.hasProperties = state[2]
|
||||
this.hasTypeFn = state[3]
|
||||
}
|
||||
|
||||
createRecursor () {
|
||||
return modifyThemes(super.createRecursor())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const DescribedElementValue = DescribedMixin(ElementValue)
|
||||
const DeserializedElementValue = DeserializedMixin(ElementValue)
|
||||
|
||||
return {
|
||||
DescribedMixin,
|
||||
DeserializedMixin,
|
||||
ElementValue,
|
||||
describe,
|
||||
deserialize,
|
||||
tag
|
||||
}
|
||||
}
|
||||
module.exports = factory
|
||||
10
node_modules/@concordance/react/lib/escapeText.js
generated
vendored
10
node_modules/@concordance/react/lib/escapeText.js
generated
vendored
@@ -1,10 +0,0 @@
|
||||
'use strict'
|
||||
|
||||
function escapeText (text) {
|
||||
return text
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
// TODO: Escape characters that Concordance would otherwise replace with \u
|
||||
// sequences.
|
||||
}
|
||||
module.exports = escapeText
|
||||
59
node_modules/@concordance/react/lib/testJsonFactory.js
generated
vendored
59
node_modules/@concordance/react/lib/testJsonFactory.js
generated
vendored
@@ -1,59 +0,0 @@
|
||||
'use strict'
|
||||
|
||||
const arrify = require('arrify')
|
||||
|
||||
function factory (api, element) {
|
||||
const tag = Symbol('@concordance/react.TestJsonValue')
|
||||
|
||||
function describe (props) {
|
||||
const obj = props.value
|
||||
|
||||
const name = obj.type
|
||||
const children = arrify(obj.children)
|
||||
const properties = Object.assign({}, obj.props)
|
||||
const hasProperties = Object.keys(properties).length > 0
|
||||
|
||||
return new DescribedTestJsonValue(Object.assign({
|
||||
children,
|
||||
hasProperties,
|
||||
hasTypeFn: false,
|
||||
name,
|
||||
properties,
|
||||
typeFn: null,
|
||||
isList: children.length > 0
|
||||
}, props))
|
||||
}
|
||||
|
||||
function deserialize (state, recursor) {
|
||||
return new DeserializedTestJsonValue(state, recursor)
|
||||
}
|
||||
|
||||
class TestJsonValue extends element.ElementValue {
|
||||
compare (expected) {
|
||||
// Allow expected value to be a React element.
|
||||
return (this.tag === expected.tag || expected.tag === element.tag) && this.name === expected.name
|
||||
? api.SHALLOW_EQUAL
|
||||
: api.UNEQUAL
|
||||
}
|
||||
|
||||
prepareDiff (expected) {
|
||||
return {
|
||||
// Allow expected value to be a React element.
|
||||
compareResult: this.tag === expected.tag || expected.tag === element.tag
|
||||
? api.SHALLOW_EQUAL
|
||||
: api.UNEQUAL
|
||||
}
|
||||
}
|
||||
}
|
||||
Object.defineProperty(TestJsonValue.prototype, 'tag', {value: tag})
|
||||
|
||||
const DescribedTestJsonValue = element.DescribedMixin(TestJsonValue)
|
||||
const DeserializedTestJsonValue = element.DeserializedMixin(TestJsonValue)
|
||||
|
||||
return {
|
||||
describe,
|
||||
deserialize,
|
||||
tag
|
||||
}
|
||||
}
|
||||
module.exports = factory
|
||||
8
node_modules/@concordance/react/node_modules/arrify/index.js
generated
vendored
8
node_modules/@concordance/react/node_modules/arrify/index.js
generated
vendored
@@ -1,8 +0,0 @@
|
||||
'use strict';
|
||||
module.exports = function (val) {
|
||||
if (val === null || val === undefined) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return Array.isArray(val) ? val : [val];
|
||||
};
|
||||
21
node_modules/@concordance/react/node_modules/arrify/license
generated
vendored
21
node_modules/@concordance/react/node_modules/arrify/license
generated
vendored
@@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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.
|
||||
36
node_modules/@concordance/react/node_modules/arrify/readme.md
generated
vendored
36
node_modules/@concordance/react/node_modules/arrify/readme.md
generated
vendored
@@ -1,36 +0,0 @@
|
||||
# arrify [](https://travis-ci.org/sindresorhus/arrify)
|
||||
|
||||
> Convert a value to an array
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save arrify
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const arrify = require('arrify');
|
||||
|
||||
arrify('unicorn');
|
||||
//=> ['unicorn']
|
||||
|
||||
arrify(['unicorn']);
|
||||
//=> ['unicorn']
|
||||
|
||||
arrify(null);
|
||||
//=> []
|
||||
|
||||
arrify(undefined);
|
||||
//=> []
|
||||
```
|
||||
|
||||
*Supplying `null` or `undefined` results in an empty array.*
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
75
node_modules/@concordance/react/package.json
generated
vendored
75
node_modules/@concordance/react/package.json
generated
vendored
@@ -1,75 +0,0 @@
|
||||
{
|
||||
"name": "@concordance/react",
|
||||
"version": "2.0.0",
|
||||
"description": "Compare, format, diff and serialize React trees with Concordance",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"lib",
|
||||
"index.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=6.12.3 <7 || >=8.9.4 <9 || >=10.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build:fixtures": "babel --presets=module:@babel/preset-react,module:ava/stage-4 --out-dir=test/fixtures/react --extensions=.jsx test/fixtures/react",
|
||||
"lint": "as-i-preach",
|
||||
"pretest": "npm run -s build:fixtures",
|
||||
"test": "npm run -s lint && nyc ava"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/concordancejs/react.git"
|
||||
},
|
||||
"author": "Mark Wubben (https://novemberborn.net/)",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://github.com/concordancejs/react/issues"
|
||||
},
|
||||
"homepage": "https://github.com/concordancejs/react#readme",
|
||||
"keywords": [
|
||||
"concordance-plugin",
|
||||
"concordance",
|
||||
"react"
|
||||
],
|
||||
"dependencies": {
|
||||
"arrify": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.1.0",
|
||||
"@babel/core": "^7.1.0",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"@novemberborn/as-i-preach": "^10.1.0",
|
||||
"ava": "1.0.0-beta.8",
|
||||
"codecov": "^3.1.0",
|
||||
"concordance": "^4.0.0",
|
||||
"nyc": "^13.0.1",
|
||||
"react": "^16.5.2",
|
||||
"react-test-renderer": "^16.5.2"
|
||||
},
|
||||
"as-i-preach": {
|
||||
"allowDevDependencies": [
|
||||
"test/**/*.js",
|
||||
"test/**/*.jsx"
|
||||
],
|
||||
"ignore": [
|
||||
"test/fixtures/react/*.js"
|
||||
]
|
||||
},
|
||||
"ava": {
|
||||
"babel": {
|
||||
"testOptions": {
|
||||
"presets": [
|
||||
"module:@babel/preset-react"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"nyc": {
|
||||
"reporter": [
|
||||
"html",
|
||||
"lcov",
|
||||
"text"
|
||||
]
|
||||
},
|
||||
"standard-engine": "@novemberborn/as-i-preach"
|
||||
}
|
||||
132
node_modules/@sindresorhus/is/dist/index.d.ts
generated
vendored
132
node_modules/@sindresorhus/is/dist/index.d.ts
generated
vendored
@@ -1,132 +0,0 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference lib="es2016" />
|
||||
/// <reference lib="es2017.sharedmemory" />
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/// <reference lib="dom" />
|
||||
declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
|
||||
declare type Primitive = null | undefined | string | number | boolean | Symbol;
|
||||
export interface ArrayLike {
|
||||
length: number;
|
||||
}
|
||||
export interface Class<T = unknown> {
|
||||
new (...args: any[]): T;
|
||||
}
|
||||
declare type DomElement = object & {
|
||||
nodeType: 1;
|
||||
nodeName: string;
|
||||
};
|
||||
declare type NodeStream = object & {
|
||||
pipe: Function;
|
||||
};
|
||||
export declare const enum TypeName {
|
||||
null = "null",
|
||||
boolean = "boolean",
|
||||
undefined = "undefined",
|
||||
string = "string",
|
||||
number = "number",
|
||||
symbol = "symbol",
|
||||
Function = "Function",
|
||||
GeneratorFunction = "GeneratorFunction",
|
||||
AsyncFunction = "AsyncFunction",
|
||||
Observable = "Observable",
|
||||
Array = "Array",
|
||||
Buffer = "Buffer",
|
||||
Object = "Object",
|
||||
RegExp = "RegExp",
|
||||
Date = "Date",
|
||||
Error = "Error",
|
||||
Map = "Map",
|
||||
Set = "Set",
|
||||
WeakMap = "WeakMap",
|
||||
WeakSet = "WeakSet",
|
||||
Int8Array = "Int8Array",
|
||||
Uint8Array = "Uint8Array",
|
||||
Uint8ClampedArray = "Uint8ClampedArray",
|
||||
Int16Array = "Int16Array",
|
||||
Uint16Array = "Uint16Array",
|
||||
Int32Array = "Int32Array",
|
||||
Uint32Array = "Uint32Array",
|
||||
Float32Array = "Float32Array",
|
||||
Float64Array = "Float64Array",
|
||||
ArrayBuffer = "ArrayBuffer",
|
||||
SharedArrayBuffer = "SharedArrayBuffer",
|
||||
DataView = "DataView",
|
||||
Promise = "Promise",
|
||||
URL = "URL"
|
||||
}
|
||||
declare function is(value: unknown): TypeName;
|
||||
declare namespace is {
|
||||
const undefined: (value: unknown) => value is undefined;
|
||||
const string: (value: unknown) => value is string;
|
||||
const number: (value: unknown) => value is number;
|
||||
const function_: (value: unknown) => value is Function;
|
||||
const null_: (value: unknown) => value is null;
|
||||
const class_: (value: unknown) => value is Class<unknown>;
|
||||
const boolean: (value: unknown) => value is boolean;
|
||||
const symbol: (value: unknown) => value is Symbol;
|
||||
const numericString: (value: unknown) => boolean;
|
||||
const array: (arg: any) => arg is any[];
|
||||
const buffer: (input: unknown) => input is Buffer;
|
||||
const nullOrUndefined: (value: unknown) => value is null | undefined;
|
||||
const object: (value: unknown) => value is object;
|
||||
const iterable: (value: unknown) => value is IterableIterator<unknown>;
|
||||
const asyncIterable: (value: unknown) => value is AsyncIterableIterator<unknown>;
|
||||
const generator: (value: unknown) => value is Generator;
|
||||
const nativePromise: (value: unknown) => value is Promise<unknown>;
|
||||
const promise: (value: unknown) => value is Promise<unknown>;
|
||||
const generatorFunction: (value: unknown) => value is GeneratorFunction;
|
||||
const asyncFunction: (value: unknown) => value is Function;
|
||||
const boundFunction: (value: unknown) => value is Function;
|
||||
const regExp: (value: unknown) => value is RegExp;
|
||||
const date: (value: unknown) => value is Date;
|
||||
const error: (value: unknown) => value is Error;
|
||||
const map: (value: unknown) => value is Map<unknown, unknown>;
|
||||
const set: (value: unknown) => value is Set<unknown>;
|
||||
const weakMap: (value: unknown) => value is WeakMap<object, unknown>;
|
||||
const weakSet: (value: unknown) => value is WeakSet<object>;
|
||||
const int8Array: (value: unknown) => value is Int8Array;
|
||||
const uint8Array: (value: unknown) => value is Uint8Array;
|
||||
const uint8ClampedArray: (value: unknown) => value is Uint8ClampedArray;
|
||||
const int16Array: (value: unknown) => value is Int16Array;
|
||||
const uint16Array: (value: unknown) => value is Uint16Array;
|
||||
const int32Array: (value: unknown) => value is Int32Array;
|
||||
const uint32Array: (value: unknown) => value is Uint32Array;
|
||||
const float32Array: (value: unknown) => value is Float32Array;
|
||||
const float64Array: (value: unknown) => value is Float64Array;
|
||||
const arrayBuffer: (value: unknown) => value is ArrayBuffer;
|
||||
const sharedArrayBuffer: (value: unknown) => value is SharedArrayBuffer;
|
||||
const dataView: (value: unknown) => value is DataView;
|
||||
const directInstanceOf: <T>(instance: unknown, klass: Class<T>) => instance is T;
|
||||
const urlInstance: (value: unknown) => value is URL;
|
||||
const urlString: (value: unknown) => boolean;
|
||||
const truthy: (value: unknown) => boolean;
|
||||
const falsy: (value: unknown) => boolean;
|
||||
const nan: (value: unknown) => boolean;
|
||||
const primitive: (value: unknown) => value is Primitive;
|
||||
const integer: (value: unknown) => value is number;
|
||||
const safeInteger: (value: unknown) => value is number;
|
||||
const plainObject: (value: unknown) => boolean;
|
||||
const typedArray: (value: unknown) => value is TypedArray;
|
||||
const arrayLike: (value: unknown) => value is ArrayLike;
|
||||
const inRange: (value: number, range: number | number[]) => boolean;
|
||||
const domElement: (value: unknown) => value is DomElement;
|
||||
const observable: (value: unknown) => boolean;
|
||||
const nodeStream: (value: unknown) => value is NodeStream;
|
||||
const infinite: (value: unknown) => boolean;
|
||||
const even: (value: number) => boolean;
|
||||
const odd: (value: number) => boolean;
|
||||
const emptyArray: (value: unknown) => boolean;
|
||||
const nonEmptyArray: (value: unknown) => boolean;
|
||||
const emptyString: (value: unknown) => boolean;
|
||||
const nonEmptyString: (value: unknown) => boolean;
|
||||
const emptyStringOrWhitespace: (value: unknown) => boolean;
|
||||
const emptyObject: (value: unknown) => boolean;
|
||||
const nonEmptyObject: (value: unknown) => boolean;
|
||||
const emptySet: (value: unknown) => boolean;
|
||||
const nonEmptySet: (value: unknown) => boolean;
|
||||
const emptyMap: (value: unknown) => boolean;
|
||||
const nonEmptyMap: (value: unknown) => boolean;
|
||||
const any: (predicate: unknown, ...values: unknown[]) => boolean;
|
||||
const all: (predicate: unknown, ...values: unknown[]) => boolean;
|
||||
}
|
||||
export default is;
|
||||
245
node_modules/@sindresorhus/is/dist/index.js
generated
vendored
245
node_modules/@sindresorhus/is/dist/index.js
generated
vendored
@@ -1,245 +0,0 @@
|
||||
"use strict";
|
||||
/// <reference lib="es2016"/>
|
||||
/// <reference lib="es2017.sharedmemory"/>
|
||||
/// <reference lib="esnext.asynciterable"/>
|
||||
/// <reference lib="dom"/>
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// TODO: Use the `URL` global when targeting Node.js 10
|
||||
// tslint:disable-next-line
|
||||
const URLGlobal = typeof URL === 'undefined' ? require('url').URL : URL;
|
||||
const toString = Object.prototype.toString;
|
||||
const isOfType = (type) => (value) => typeof value === type;
|
||||
const isBuffer = (input) => !is.nullOrUndefined(input) && !is.nullOrUndefined(input.constructor) && is.function_(input.constructor.isBuffer) && input.constructor.isBuffer(input);
|
||||
const getObjectType = (value) => {
|
||||
const objectName = toString.call(value).slice(8, -1);
|
||||
if (objectName) {
|
||||
return objectName;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const isObjectOfType = (type) => (value) => getObjectType(value) === type;
|
||||
function is(value) {
|
||||
switch (value) {
|
||||
case null:
|
||||
return "null" /* null */;
|
||||
case true:
|
||||
case false:
|
||||
return "boolean" /* boolean */;
|
||||
default:
|
||||
}
|
||||
switch (typeof value) {
|
||||
case 'undefined':
|
||||
return "undefined" /* undefined */;
|
||||
case 'string':
|
||||
return "string" /* string */;
|
||||
case 'number':
|
||||
return "number" /* number */;
|
||||
case 'symbol':
|
||||
return "symbol" /* symbol */;
|
||||
default:
|
||||
}
|
||||
if (is.function_(value)) {
|
||||
return "Function" /* Function */;
|
||||
}
|
||||
if (is.observable(value)) {
|
||||
return "Observable" /* Observable */;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
return "Array" /* Array */;
|
||||
}
|
||||
if (isBuffer(value)) {
|
||||
return "Buffer" /* Buffer */;
|
||||
}
|
||||
const tagType = getObjectType(value);
|
||||
if (tagType) {
|
||||
return tagType;
|
||||
}
|
||||
if (value instanceof String || value instanceof Boolean || value instanceof Number) {
|
||||
throw new TypeError('Please don\'t use object wrappers for primitive types');
|
||||
}
|
||||
return "Object" /* Object */;
|
||||
}
|
||||
(function (is) {
|
||||
// tslint:disable-next-line:strict-type-predicates
|
||||
const isObject = (value) => typeof value === 'object';
|
||||
// tslint:disable:variable-name
|
||||
is.undefined = isOfType('undefined');
|
||||
is.string = isOfType('string');
|
||||
is.number = isOfType('number');
|
||||
is.function_ = isOfType('function');
|
||||
// tslint:disable-next-line:strict-type-predicates
|
||||
is.null_ = (value) => value === null;
|
||||
is.class_ = (value) => is.function_(value) && value.toString().startsWith('class ');
|
||||
is.boolean = (value) => value === true || value === false;
|
||||
is.symbol = isOfType('symbol');
|
||||
// tslint:enable:variable-name
|
||||
is.numericString = (value) => is.string(value) && value.length > 0 && !Number.isNaN(Number(value));
|
||||
is.array = Array.isArray;
|
||||
is.buffer = isBuffer;
|
||||
is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value);
|
||||
is.object = (value) => !is.nullOrUndefined(value) && (is.function_(value) || isObject(value));
|
||||
is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]);
|
||||
is.asyncIterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.asyncIterator]);
|
||||
is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw);
|
||||
is.nativePromise = (value) => isObjectOfType("Promise" /* Promise */)(value);
|
||||
const hasPromiseAPI = (value) => !is.null_(value) &&
|
||||
isObject(value) &&
|
||||
is.function_(value.then) &&
|
||||
is.function_(value.catch);
|
||||
is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value);
|
||||
is.generatorFunction = isObjectOfType("GeneratorFunction" /* GeneratorFunction */);
|
||||
is.asyncFunction = isObjectOfType("AsyncFunction" /* AsyncFunction */);
|
||||
is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype');
|
||||
is.regExp = isObjectOfType("RegExp" /* RegExp */);
|
||||
is.date = isObjectOfType("Date" /* Date */);
|
||||
is.error = isObjectOfType("Error" /* Error */);
|
||||
is.map = (value) => isObjectOfType("Map" /* Map */)(value);
|
||||
is.set = (value) => isObjectOfType("Set" /* Set */)(value);
|
||||
is.weakMap = (value) => isObjectOfType("WeakMap" /* WeakMap */)(value);
|
||||
is.weakSet = (value) => isObjectOfType("WeakSet" /* WeakSet */)(value);
|
||||
is.int8Array = isObjectOfType("Int8Array" /* Int8Array */);
|
||||
is.uint8Array = isObjectOfType("Uint8Array" /* Uint8Array */);
|
||||
is.uint8ClampedArray = isObjectOfType("Uint8ClampedArray" /* Uint8ClampedArray */);
|
||||
is.int16Array = isObjectOfType("Int16Array" /* Int16Array */);
|
||||
is.uint16Array = isObjectOfType("Uint16Array" /* Uint16Array */);
|
||||
is.int32Array = isObjectOfType("Int32Array" /* Int32Array */);
|
||||
is.uint32Array = isObjectOfType("Uint32Array" /* Uint32Array */);
|
||||
is.float32Array = isObjectOfType("Float32Array" /* Float32Array */);
|
||||
is.float64Array = isObjectOfType("Float64Array" /* Float64Array */);
|
||||
is.arrayBuffer = isObjectOfType("ArrayBuffer" /* ArrayBuffer */);
|
||||
is.sharedArrayBuffer = isObjectOfType("SharedArrayBuffer" /* SharedArrayBuffer */);
|
||||
is.dataView = isObjectOfType("DataView" /* DataView */);
|
||||
is.directInstanceOf = (instance, klass) => Object.getPrototypeOf(instance) === klass.prototype;
|
||||
is.urlInstance = (value) => isObjectOfType("URL" /* URL */)(value);
|
||||
is.urlString = (value) => {
|
||||
if (!is.string(value)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
new URLGlobal(value); // tslint:disable-line no-unused-expression
|
||||
return true;
|
||||
}
|
||||
catch (_a) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
is.truthy = (value) => Boolean(value);
|
||||
is.falsy = (value) => !value;
|
||||
is.nan = (value) => Number.isNaN(value);
|
||||
const primitiveTypes = new Set([
|
||||
'undefined',
|
||||
'string',
|
||||
'number',
|
||||
'boolean',
|
||||
'symbol'
|
||||
]);
|
||||
is.primitive = (value) => is.null_(value) || primitiveTypes.has(typeof value);
|
||||
is.integer = (value) => Number.isInteger(value);
|
||||
is.safeInteger = (value) => Number.isSafeInteger(value);
|
||||
is.plainObject = (value) => {
|
||||
// From: https://github.com/sindresorhus/is-plain-obj/blob/master/index.js
|
||||
let prototype;
|
||||
return getObjectType(value) === "Object" /* Object */ &&
|
||||
(prototype = Object.getPrototypeOf(value), prototype === null || // tslint:disable-line:ban-comma-operator
|
||||
prototype === Object.getPrototypeOf({}));
|
||||
};
|
||||
const typedArrayTypes = new Set([
|
||||
"Int8Array" /* Int8Array */,
|
||||
"Uint8Array" /* Uint8Array */,
|
||||
"Uint8ClampedArray" /* Uint8ClampedArray */,
|
||||
"Int16Array" /* Int16Array */,
|
||||
"Uint16Array" /* Uint16Array */,
|
||||
"Int32Array" /* Int32Array */,
|
||||
"Uint32Array" /* Uint32Array */,
|
||||
"Float32Array" /* Float32Array */,
|
||||
"Float64Array" /* Float64Array */
|
||||
]);
|
||||
is.typedArray = (value) => {
|
||||
const objectType = getObjectType(value);
|
||||
if (objectType === null) {
|
||||
return false;
|
||||
}
|
||||
return typedArrayTypes.has(objectType);
|
||||
};
|
||||
const isValidLength = (value) => is.safeInteger(value) && value > -1;
|
||||
is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length);
|
||||
is.inRange = (value, range) => {
|
||||
if (is.number(range)) {
|
||||
return value >= Math.min(0, range) && value <= Math.max(range, 0);
|
||||
}
|
||||
if (is.array(range) && range.length === 2) {
|
||||
return value >= Math.min(...range) && value <= Math.max(...range);
|
||||
}
|
||||
throw new TypeError(`Invalid range: ${JSON.stringify(range)}`);
|
||||
};
|
||||
const NODE_TYPE_ELEMENT = 1;
|
||||
const DOM_PROPERTIES_TO_CHECK = [
|
||||
'innerHTML',
|
||||
'ownerDocument',
|
||||
'style',
|
||||
'attributes',
|
||||
'nodeValue'
|
||||
];
|
||||
is.domElement = (value) => is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) &&
|
||||
!is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value);
|
||||
is.observable = (value) => {
|
||||
if (!value) {
|
||||
return false;
|
||||
}
|
||||
if (value[Symbol.observable] && value === value[Symbol.observable]()) {
|
||||
return true;
|
||||
}
|
||||
if (value['@@observable'] && value === value['@@observable']()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
is.nodeStream = (value) => !is.nullOrUndefined(value) && isObject(value) && is.function_(value.pipe) && !is.observable(value);
|
||||
is.infinite = (value) => value === Infinity || value === -Infinity;
|
||||
const isAbsoluteMod2 = (rem) => (value) => is.integer(value) && Math.abs(value % 2) === rem;
|
||||
is.even = isAbsoluteMod2(0);
|
||||
is.odd = isAbsoluteMod2(1);
|
||||
const isWhiteSpaceString = (value) => is.string(value) && /\S/.test(value) === false;
|
||||
is.emptyArray = (value) => is.array(value) && value.length === 0;
|
||||
is.nonEmptyArray = (value) => is.array(value) && value.length > 0;
|
||||
is.emptyString = (value) => is.string(value) && value.length === 0;
|
||||
is.nonEmptyString = (value) => is.string(value) && value.length > 0;
|
||||
is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value);
|
||||
is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0;
|
||||
is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0;
|
||||
is.emptySet = (value) => is.set(value) && value.size === 0;
|
||||
is.nonEmptySet = (value) => is.set(value) && value.size > 0;
|
||||
is.emptyMap = (value) => is.map(value) && value.size === 0;
|
||||
is.nonEmptyMap = (value) => is.map(value) && value.size > 0;
|
||||
const predicateOnArray = (method, predicate, values) => {
|
||||
if (is.function_(predicate) === false) {
|
||||
throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`);
|
||||
}
|
||||
if (values.length === 0) {
|
||||
throw new TypeError('Invalid number of values');
|
||||
}
|
||||
return method.call(values, predicate);
|
||||
};
|
||||
// tslint:disable variable-name
|
||||
is.any = (predicate, ...values) => predicateOnArray(Array.prototype.some, predicate, values);
|
||||
is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values);
|
||||
// tslint:enable variable-name
|
||||
})(is || (is = {}));
|
||||
// Some few keywords are reserved, but we'll populate them for Node.js users
|
||||
// See https://github.com/Microsoft/TypeScript/issues/2536
|
||||
Object.defineProperties(is, {
|
||||
class: {
|
||||
value: is.class_
|
||||
},
|
||||
function: {
|
||||
value: is.function_
|
||||
},
|
||||
null: {
|
||||
value: is.null_
|
||||
}
|
||||
});
|
||||
exports.default = is;
|
||||
// For CommonJS default export support
|
||||
module.exports = is;
|
||||
module.exports.default = is;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@sindresorhus/is/dist/index.js.map
generated
vendored
1
node_modules/@sindresorhus/is/dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
63
node_modules/@sindresorhus/is/package.json
generated
vendored
63
node_modules/@sindresorhus/is/package.json
generated
vendored
@@ -1,63 +0,0 @@
|
||||
{
|
||||
"name": "@sindresorhus/is",
|
||||
"version": "0.14.0",
|
||||
"description": "Type check values: `is.string('🦄') //=> true`",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/is",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "tslint --format stylish --project .",
|
||||
"build": "del dist && tsc",
|
||||
"test": "npm run lint && npm run build && ava dist/tests",
|
||||
"prepublish": "npm run build && del dist/tests"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"keywords": [
|
||||
"type",
|
||||
"types",
|
||||
"is",
|
||||
"check",
|
||||
"checking",
|
||||
"validate",
|
||||
"validation",
|
||||
"utility",
|
||||
"util",
|
||||
"typeof",
|
||||
"instanceof",
|
||||
"object",
|
||||
"assert",
|
||||
"assertion",
|
||||
"test",
|
||||
"kind",
|
||||
"primitive",
|
||||
"verify",
|
||||
"compare"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@sindresorhus/tsconfig": "^0.1.0",
|
||||
"@types/jsdom": "^11.12.0",
|
||||
"@types/node": "^10.12.10",
|
||||
"@types/tempy": "^0.2.0",
|
||||
"@types/zen-observable": "^0.8.0",
|
||||
"ava": "^0.25.0",
|
||||
"del-cli": "^1.1.0",
|
||||
"jsdom": "^11.6.2",
|
||||
"rxjs": "^6.3.3",
|
||||
"tempy": "^0.2.1",
|
||||
"tslint": "^5.9.1",
|
||||
"tslint-xo": "^0.10.0",
|
||||
"typescript": "^3.2.1",
|
||||
"zen-observable": "^0.8.8"
|
||||
},
|
||||
"types": "dist/index.d.ts"
|
||||
}
|
||||
451
node_modules/@sindresorhus/is/readme.md
generated
vendored
451
node_modules/@sindresorhus/is/readme.md
generated
vendored
@@ -1,451 +0,0 @@
|
||||
# is [](https://travis-ci.org/sindresorhus/is)
|
||||
|
||||
> Type check values: `is.string('🦄') //=> true`
|
||||
|
||||
<img src="header.gif" width="182" align="right">
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install @sindresorhus/is
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const is = require('@sindresorhus/is');
|
||||
|
||||
is('🦄');
|
||||
//=> 'string'
|
||||
|
||||
is(new Map());
|
||||
//=> 'Map'
|
||||
|
||||
is.number(6);
|
||||
//=> true
|
||||
```
|
||||
|
||||
When using `is` together with TypeScript, [type guards](http://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types) are being used to infer the correct type inside if-else statements.
|
||||
|
||||
```ts
|
||||
import is from '@sindresorhus/is';
|
||||
|
||||
const padLeft = (value: string, padding: string | number) => {
|
||||
if (is.number(padding)) {
|
||||
// `padding` is typed as `number`
|
||||
return Array(padding + 1).join(' ') + value;
|
||||
}
|
||||
|
||||
if (is.string(padding)) {
|
||||
// `padding` is typed as `string`
|
||||
return padding + value;
|
||||
}
|
||||
|
||||
throw new TypeError(`Expected 'padding' to be of type 'string' or 'number', got '${is(padding)}'.`);
|
||||
}
|
||||
|
||||
padLeft('🦄', 3);
|
||||
//=> ' 🦄'
|
||||
|
||||
padLeft('🦄', '🌈');
|
||||
//=> '🌈🦄'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### is(value)
|
||||
|
||||
Returns the type of `value`.
|
||||
|
||||
Primitives are lowercase and object types are camelcase.
|
||||
|
||||
Example:
|
||||
|
||||
- `'undefined'`
|
||||
- `'null'`
|
||||
- `'string'`
|
||||
- `'symbol'`
|
||||
- `'Array'`
|
||||
- `'Function'`
|
||||
- `'Object'`
|
||||
|
||||
Note: It will throw an error if you try to feed it object-wrapped primitives, as that's a bad practice. For example `new String('foo')`.
|
||||
|
||||
### is.{method}
|
||||
|
||||
All the below methods accept a value and returns a boolean for whether the value is of the desired type.
|
||||
|
||||
#### Primitives
|
||||
|
||||
##### .undefined(value)
|
||||
##### .null(value)
|
||||
##### .string(value)
|
||||
##### .number(value)
|
||||
##### .boolean(value)
|
||||
##### .symbol(value)
|
||||
|
||||
#### Built-in types
|
||||
|
||||
##### .array(value)
|
||||
##### .function(value)
|
||||
##### .buffer(value)
|
||||
##### .object(value)
|
||||
|
||||
Keep in mind that [functions are objects too](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions).
|
||||
|
||||
##### .numericString(value)
|
||||
|
||||
Returns `true` for a string that represents a number. For example, `'42'` and `'-8'`.
|
||||
|
||||
Note: `'NaN'` returns `false`, but `'Infinity'` and `'-Infinity'` return `true`.
|
||||
|
||||
##### .regExp(value)
|
||||
##### .date(value)
|
||||
##### .error(value)
|
||||
##### .nativePromise(value)
|
||||
##### .promise(value)
|
||||
|
||||
Returns `true` for any object with a `.then()` and `.catch()` method. Prefer this one over `.nativePromise()` as you usually want to allow userland promise implementations too.
|
||||
|
||||
##### .generator(value)
|
||||
|
||||
Returns `true` for any object that implements its own `.next()` and `.throw()` methods and has a function definition for `Symbol.iterator`.
|
||||
|
||||
##### .generatorFunction(value)
|
||||
|
||||
##### .asyncFunction(value)
|
||||
|
||||
Returns `true` for any `async` function that can be called with the `await` operator.
|
||||
|
||||
```js
|
||||
is.asyncFunction(async () => {});
|
||||
// => true
|
||||
|
||||
is.asyncFunction(() => {});
|
||||
// => false
|
||||
```
|
||||
|
||||
##### .boundFunction(value)
|
||||
|
||||
Returns `true` for any `bound` function.
|
||||
|
||||
```js
|
||||
is.boundFunction(() => {});
|
||||
// => true
|
||||
|
||||
is.boundFunction(function () {}.bind(null));
|
||||
// => true
|
||||
|
||||
is.boundFunction(function () {});
|
||||
// => false
|
||||
```
|
||||
|
||||
##### .map(value)
|
||||
##### .set(value)
|
||||
##### .weakMap(value)
|
||||
##### .weakSet(value)
|
||||
|
||||
#### Typed arrays
|
||||
|
||||
##### .int8Array(value)
|
||||
##### .uint8Array(value)
|
||||
##### .uint8ClampedArray(value)
|
||||
##### .int16Array(value)
|
||||
##### .uint16Array(value)
|
||||
##### .int32Array(value)
|
||||
##### .uint32Array(value)
|
||||
##### .float32Array(value)
|
||||
##### .float64Array(value)
|
||||
|
||||
#### Structured data
|
||||
|
||||
##### .arrayBuffer(value)
|
||||
##### .sharedArrayBuffer(value)
|
||||
##### .dataView(value)
|
||||
|
||||
#### Emptiness
|
||||
|
||||
##### .emptyString(value)
|
||||
|
||||
Returns `true` if the value is a `string` and the `.length` is 0.
|
||||
|
||||
##### .nonEmptyString(value)
|
||||
|
||||
Returns `true` if the value is a `string` and the `.length` is more than 0.
|
||||
|
||||
##### .emptyStringOrWhitespace(value)
|
||||
|
||||
Returns `true` if `is.emptyString(value)` or if it's a `string` that is all whitespace.
|
||||
|
||||
##### .emptyArray(value)
|
||||
|
||||
Returns `true` if the value is an `Array` and the `.length` is 0.
|
||||
|
||||
##### .nonEmptyArray(value)
|
||||
|
||||
Returns `true` if the value is an `Array` and the `.length` is more than 0.
|
||||
|
||||
##### .emptyObject(value)
|
||||
|
||||
Returns `true` if the value is an `Object` and `Object.keys(value).length` is 0.
|
||||
|
||||
Please note that `Object.keys` returns only own enumerable properties. Hence something like this can happen:
|
||||
|
||||
```js
|
||||
const object1 = {};
|
||||
|
||||
Object.defineProperty(object1, 'property1', {
|
||||
value: 42,
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
is.emptyObject(object1);
|
||||
// => true
|
||||
```
|
||||
|
||||
##### .nonEmptyObject(value)
|
||||
|
||||
Returns `true` if the value is an `Object` and `Object.keys(value).length` is more than 0.
|
||||
|
||||
##### .emptySet(value)
|
||||
|
||||
Returns `true` if the value is a `Set` and the `.size` is 0.
|
||||
|
||||
##### .nonEmptySet(Value)
|
||||
|
||||
Returns `true` if the value is a `Set` and the `.size` is more than 0.
|
||||
|
||||
##### .emptyMap(value)
|
||||
|
||||
Returns `true` if the value is a `Map` and the `.size` is 0.
|
||||
|
||||
##### .nonEmptyMap(value)
|
||||
|
||||
Returns `true` if the value is a `Map` and the `.size` is more than 0.
|
||||
|
||||
#### Miscellaneous
|
||||
|
||||
##### .directInstanceOf(value, class)
|
||||
|
||||
Returns `true` if `value` is a direct instance of `class`.
|
||||
|
||||
```js
|
||||
is.directInstanceOf(new Error(), Error);
|
||||
//=> true
|
||||
|
||||
class UnicornError extends Error {}
|
||||
|
||||
is.directInstanceOf(new UnicornError(), Error);
|
||||
//=> false
|
||||
```
|
||||
|
||||
##### .urlInstance(value)
|
||||
|
||||
Returns `true` if `value` is an instance of the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL).
|
||||
|
||||
```js
|
||||
const url = new URL('https://example.com');
|
||||
|
||||
is.urlInstance(url);
|
||||
//=> true
|
||||
```
|
||||
|
||||
### .url(value)
|
||||
|
||||
Returns `true` if `value` is a URL string.
|
||||
|
||||
Note: this only does basic checking using the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL) constructor.
|
||||
|
||||
```js
|
||||
const url = 'https://example.com';
|
||||
|
||||
is.url(url);
|
||||
//=> true
|
||||
|
||||
is.url(new URL(url));
|
||||
//=> false
|
||||
```
|
||||
|
||||
##### .truthy(value)
|
||||
|
||||
Returns `true` for all values that evaluate to true in a boolean context:
|
||||
|
||||
```js
|
||||
is.truthy('🦄');
|
||||
//=> true
|
||||
|
||||
is.truthy(undefined);
|
||||
//=> false
|
||||
```
|
||||
|
||||
##### .falsy(value)
|
||||
|
||||
Returns `true` if `value` is one of: `false`, `0`, `''`, `null`, `undefined`, `NaN`.
|
||||
|
||||
##### .nan(value)
|
||||
##### .nullOrUndefined(value)
|
||||
##### .primitive(value)
|
||||
|
||||
JavaScript primitives are as follows: `null`, `undefined`, `string`, `number`, `boolean`, `symbol`.
|
||||
|
||||
##### .integer(value)
|
||||
|
||||
##### .safeInteger(value)
|
||||
|
||||
Returns `true` if `value` is a [safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger).
|
||||
|
||||
##### .plainObject(value)
|
||||
|
||||
An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`.
|
||||
|
||||
##### .iterable(value)
|
||||
##### .asyncIterable(value)
|
||||
##### .class(value)
|
||||
|
||||
Returns `true` for instances created by a class.
|
||||
|
||||
##### .typedArray(value)
|
||||
|
||||
##### .arrayLike(value)
|
||||
|
||||
A `value` is array-like if it is not a function and has a `value.length` that is a safe integer greater than or equal to 0.
|
||||
|
||||
```js
|
||||
is.arrayLike(document.forms);
|
||||
//=> true
|
||||
|
||||
function foo() {
|
||||
is.arrayLike(arguments);
|
||||
//=> true
|
||||
}
|
||||
foo();
|
||||
```
|
||||
|
||||
##### .inRange(value, range)
|
||||
|
||||
Check if `value` (number) is in the given `range`. The range is an array of two values, lower bound and upper bound, in no specific order.
|
||||
|
||||
```js
|
||||
is.inRange(3, [0, 5]);
|
||||
is.inRange(3, [5, 0]);
|
||||
is.inRange(0, [-2, 2]);
|
||||
```
|
||||
|
||||
##### .inRange(value, upperBound)
|
||||
|
||||
Check if `value` (number) is in the range of `0` to `upperBound`.
|
||||
|
||||
```js
|
||||
is.inRange(3, 10);
|
||||
```
|
||||
|
||||
##### .domElement(value)
|
||||
|
||||
Returns `true` if `value` is a DOM Element.
|
||||
|
||||
##### .nodeStream(value)
|
||||
|
||||
Returns `true` if `value` is a Node.js [stream](https://nodejs.org/api/stream.html).
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
|
||||
is.nodeStream(fs.createReadStream('unicorn.png'));
|
||||
//=> true
|
||||
```
|
||||
|
||||
##### .observable(value)
|
||||
|
||||
Returns `true` if `value` is an `Observable`.
|
||||
|
||||
```js
|
||||
const {Observable} = require('rxjs');
|
||||
|
||||
is.observable(new Observable());
|
||||
//=> true
|
||||
```
|
||||
|
||||
##### .infinite(value)
|
||||
|
||||
Check if `value` is `Infinity` or `-Infinity`.
|
||||
|
||||
##### .even(value)
|
||||
|
||||
Returns `true` if `value` is an even integer.
|
||||
|
||||
##### .odd(value)
|
||||
|
||||
Returns `true` if `value` is an odd integer.
|
||||
|
||||
##### .any(predicate, ...values)
|
||||
|
||||
Returns `true` if **any** of the input `values` returns true in the `predicate`:
|
||||
|
||||
```js
|
||||
is.any(is.string, {}, true, '🦄');
|
||||
//=> true
|
||||
|
||||
is.any(is.boolean, 'unicorns', [], new Map());
|
||||
//=> false
|
||||
```
|
||||
|
||||
##### .all(predicate, ...values)
|
||||
|
||||
Returns `true` if **all** of the input `values` returns true in the `predicate`:
|
||||
|
||||
```js
|
||||
is.all(is.object, {}, new Map(), new Set());
|
||||
//=> true
|
||||
|
||||
is.all(is.string, '🦄', [], 'unicorns');
|
||||
//=> false
|
||||
```
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
### Why yet another type checking module?
|
||||
|
||||
There are hundreds of type checking modules on npm, unfortunately, I couldn't find any that fit my needs:
|
||||
|
||||
- Includes both type methods and ability to get the type
|
||||
- Types of primitives returned as lowercase and object types as camelcase
|
||||
- Covers all built-ins
|
||||
- Unsurprising behavior
|
||||
- Well-maintained
|
||||
- Comprehensive test suite
|
||||
|
||||
For the ones I found, pick 3 of these.
|
||||
|
||||
The most common mistakes I noticed in these modules was using `instanceof` for type checking, forgetting that functions are objects, and omitting `symbol` as a primitive.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [ow](https://github.com/sindresorhus/ow) - Function argument validation for humans
|
||||
- [is-stream](https://github.com/sindresorhus/is-stream) - Check if something is a Node.js stream
|
||||
- [is-observable](https://github.com/sindresorhus/is-observable) - Check if a value is an Observable
|
||||
- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array
|
||||
- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address
|
||||
- [is-array-sorted](https://github.com/sindresorhus/is-array-sorted) - Check if an Array is sorted
|
||||
- [is-error-constructor](https://github.com/sindresorhus/is-error-constructor) - Check if a value is an error constructor
|
||||
- [is-empty-iterable](https://github.com/sindresorhus/is-empty-iterable) - Check if an Iterable is empty
|
||||
- [is-blob](https://github.com/sindresorhus/is-blob) - Check if a value is a Blob - File-like object of immutable, raw data
|
||||
- [has-emoji](https://github.com/sindresorhus/has-emoji) - Check whether a string has any emoji
|
||||
|
||||
|
||||
## Created by
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Giora Guttsait](https://github.com/gioragutt)
|
||||
- [Brandon Smith](https://github.com/brandon93s)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
226
node_modules/@sinonjs/samsam/CHANGES.md
generated
vendored
226
node_modules/@sinonjs/samsam/CHANGES.md
generated
vendored
@@ -1,226 +0,0 @@
|
||||
# Changes
|
||||
|
||||
## 6.0.2
|
||||
|
||||
- [`144204d`](https://github.com/sinonjs/samsam/commit/144204d505526d5c382cb2f3dc2c2dd1378fe12d)
|
||||
Fix deep equal comparison between promises (#217) (David G. Miguel)
|
||||
|
||||
_Released on 2021-05-24._
|
||||
|
||||
## 6.0.1
|
||||
|
||||
- [`decfafe`](https://github.com/sinonjs/samsam/commit/decfafe72d8b2d159cfc49440a8f4af6d3e9c574)
|
||||
Bump y18n from 4.0.0 to 4.0.1 (dependabot[bot])
|
||||
>
|
||||
> Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
|
||||
> - [Release notes](https://github.com/yargs/y18n/releases)
|
||||
> - [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
|
||||
> - [Commits](https://github.com/yargs/y18n/commits)
|
||||
>
|
||||
> Signed-off-by: dependabot[bot] <support@github.com>
|
||||
|
||||
_Released on 2021-04-08._
|
||||
|
||||
## 6.0.0
|
||||
|
||||
- [`95d1dce`](https://github.com/sinonjs/samsam/commit/95d1dce07f47b7bbb84111c42f44ecd9466dc2c8)
|
||||
Use @sinonjs/eslint-config (Morgan Roderick)
|
||||
>
|
||||
> This drops support for legacy runtimes like IE11, legacy Edge, Safari 9 and the like
|
||||
|
||||
_Released on 2021-03-30._
|
||||
|
||||
## 5.3.1
|
||||
|
||||
- [`04e0faa`](https://github.com/sinonjs/samsam/commit/04e0faa88d8a08325c6d70febed9dad4e7eeabfe)
|
||||
Distribute package as source (Morgan Roderick)
|
||||
>
|
||||
> This library is not meant for writing end user applications or even for
|
||||
> being used directly when writing tests. It is not meant to be loaded
|
||||
> directly by browsers.
|
||||
>
|
||||
> Consumers of this package are assumed to use their own bundlers, should
|
||||
> they need to bundle code for use in browsers or workers.
|
||||
>
|
||||
> Therefore, it is safe to distribute the package as source files and not
|
||||
> bundle them up.
|
||||
>
|
||||
> This allows us to remove the bundler and its transitive dependencies,
|
||||
> which reduces the maintenance burden of managing the library.
|
||||
>
|
||||
|
||||
_Released on 2021-01-13._
|
||||
|
||||
## 5.3.0
|
||||
|
||||
- [`fd8aabd`](https://github.com/sinonjs/samsam/commit/fd8aabd3768c199abc717dc6d793ef136419be72)
|
||||
Generate .d.ts from JSDoc (Morgan Roderick)
|
||||
>
|
||||
> See https://humanwhocodes.com/snippets/2020/10/create-typescript-declarations-from-javascript-jsdoc/
|
||||
>
|
||||
|
||||
_Released on 2020-11-16._
|
||||
|
||||
## 5.2.0
|
||||
|
||||
- [`f27b87c`](https://github.com/sinonjs/samsam/commit/f27b87cbd493a09e4a3181cf36f503facbbb23fb)
|
||||
Add match.json (Maximilian Antoni)
|
||||
|
||||
_Released by [Maximilian Antoni](https://github.com/mantoni) on 2020-10-06._
|
||||
|
||||
## 5.1.0
|
||||
|
||||
- [`820c296`](https://github.com/sinonjs/samsam/commit/820c2961f70208367e1c072ae9a581eefd0d8d18)
|
||||
Evaluate symbol keys for object matchers (#206) (Joel Bradshaw)
|
||||
>
|
||||
> * Make match() work for objects with symbol keys
|
||||
|
||||
_Released on 2020-08-11._
|
||||
|
||||
## 5.0.3
|
||||
|
||||
- [`9d2add0`](https://github.com/sinonjs/samsam/commit/9d2add01eba85eb17ddb91ac22404fb6c23e8d39)
|
||||
Remove unused @sinonjs/formatio (Morgan Roderick)
|
||||
>
|
||||
> As can be seen with searching the codebase, @sinonjs/formatio is never
|
||||
> imported, and is thus not a direct dependency of @sinonjs/samsam.
|
||||
>
|
||||
|
||||
_Released on 2020-02-28._
|
||||
|
||||
## 5.0.2
|
||||
|
||||
- [`f9e845a`](https://github.com/sinonjs/samsam/commit/f9e845a52ba50916df91335d2003a81a808a4ade)
|
||||
Bump formatio to latest major (Morgan Roderick)
|
||||
>
|
||||
> This will remove some duplication in Sinon, see https://github.com/sinonjs/sinon/issues/2224
|
||||
>
|
||||
|
||||
_Released on 2020-02-20._
|
||||
|
||||
## 5.0.1
|
||||
|
||||
- [`fe5d035`](https://github.com/sinonjs/samsam/commit/fe5d03532ea6cdbec857c49d18392d668cca8ef2)
|
||||
Bump jsdom from 15.2.1 to 16.2.0 (dependabot-preview[bot])
|
||||
>
|
||||
> Bumps [jsdom](https://github.com/jsdom/jsdom) from 15.2.1 to 16.2.0.
|
||||
> - [Release notes](https://github.com/jsdom/jsdom/releases)
|
||||
> - [Changelog](https://github.com/jsdom/jsdom/blob/master/Changelog.md)
|
||||
> - [Commits](https://github.com/jsdom/jsdom/compare/15.2.1...16.2.0)
|
||||
>
|
||||
> Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
|
||||
- [`910af18`](https://github.com/sinonjs/samsam/commit/910af18be1bd57c6237399ca04cbef91d994a38a)
|
||||
Remove maintenance junk from CHANGES.md (Morgan Roderick)
|
||||
|
||||
_Released on 2020-02-18._
|
||||
|
||||
## 5.0.0
|
||||
|
||||
- [`f288430`](https://github.com/sinonjs/samsam/commit/f2884309c9bf68b02ecfda3bd1df8d7a7a31686b)
|
||||
Drop support for Node 8 (Morgan Roderick)
|
||||
>
|
||||
> As can be seen at https://github.com/nodejs/Release, Node 8 reached
|
||||
> "end" of life on 2019-12-31, and is no longer actively supported.
|
||||
>
|
||||
> We will stop testing in Node 8 and start testing in Node 13, which will
|
||||
> become the next LTS release from April 2020.
|
||||
>
|
||||
|
||||
_Released on 2020-02-18._
|
||||
|
||||
## 4.2.2
|
||||
|
||||
- [`c600d6c`](https://github.com/sinonjs/samsam/commit/c600d6cb6c1bec8d65bc718bd9268311204597bc)
|
||||
Fix issue with nested array matching (Jay Merrifield)
|
||||
- [`8b37566`](https://github.com/sinonjs/samsam/commit/8b37566ea73bee512fbc4203c07678288f906bda)
|
||||
Bump eslint from 6.7.2 to 6.8.0 (dependabot-preview[bot])
|
||||
>
|
||||
> Bumps [eslint](https://github.com/eslint/eslint) from 6.7.2 to 6.8.0.
|
||||
> - [Release notes](https://github.com/eslint/eslint/releases)
|
||||
> - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
|
||||
> - [Commits](https://github.com/eslint/eslint/compare/v6.7.2...v6.8.0)
|
||||
>
|
||||
> Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
|
||||
- [`b7c5db9`](https://github.com/sinonjs/samsam/commit/b7c5db9e7847204188c112843bb193248d0b5156)
|
||||
Bump eslint-plugin-prettier from 3.1.1 to 3.1.2 (dependabot-preview[bot])
|
||||
>
|
||||
> Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 3.1.1 to 3.1.2.
|
||||
> - [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
|
||||
> - [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
|
||||
> - [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v3.1.1...v3.1.2)
|
||||
>
|
||||
> Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
|
||||
- [`8965384`](https://github.com/sinonjs/samsam/commit/8965384818697b7b36537619922b3c378bfd0b42)
|
||||
Bump eslint-plugin-mocha from 6.1.1 to 6.2.2 (dependabot-preview[bot])
|
||||
>
|
||||
> Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 6.1.1 to 6.2.2.
|
||||
> - [Release notes](https://github.com/lo1tuma/eslint-plugin-mocha/releases)
|
||||
> - [Changelog](https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/CHANGELOG.md)
|
||||
> - [Commits](https://github.com/lo1tuma/eslint-plugin-mocha/compare/6.1.1...6.2.2)
|
||||
>
|
||||
> Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
|
||||
- [`8661610`](https://github.com/sinonjs/samsam/commit/866161044e212b4df56a207e55ab3e449346abf5)
|
||||
Bump eslint-config-prettier from 6.7.0 to 6.9.0 (dependabot-preview[bot])
|
||||
>
|
||||
> Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 6.7.0 to 6.9.0.
|
||||
> - [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
|
||||
> - [Changelog](https://github.com/prettier/eslint-config-prettier/blob/master/CHANGELOG.md)
|
||||
> - [Commits](https://github.com/prettier/eslint-config-prettier/commits/v6.9.0)
|
||||
>
|
||||
> Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
|
||||
- [`7d91124`](https://github.com/sinonjs/samsam/commit/7d91124a9fa95c462c1e714d86405d6cb99e3363)
|
||||
Bump rollup from 1.23.0 to 1.27.14 (dependabot-preview[bot])
|
||||
>
|
||||
> Bumps [rollup](https://github.com/rollup/rollup) from 1.23.0 to 1.27.14.
|
||||
> - [Release notes](https://github.com/rollup/rollup/releases)
|
||||
> - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
|
||||
> - [Commits](https://github.com/rollup/rollup/compare/v1.23.0...v1.27.14)
|
||||
>
|
||||
> Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
|
||||
- [`31c616a`](https://github.com/sinonjs/samsam/commit/31c616ab278e05071138e18d6e5aea8f2c250c2a)
|
||||
Bump nyc from 14.1.1 to 15.0.0 (dependabot-preview[bot])
|
||||
>
|
||||
> Bumps [nyc](https://github.com/istanbuljs/nyc) from 14.1.1 to 15.0.0.
|
||||
> - [Release notes](https://github.com/istanbuljs/nyc/releases)
|
||||
> - [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md)
|
||||
> - [Commits](https://github.com/istanbuljs/nyc/compare/v14.1.1...v15.0.0)
|
||||
>
|
||||
> Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
|
||||
- [`e82dbcf`](https://github.com/sinonjs/samsam/commit/e82dbcf9af6a052b1d466e476a7315e047324256)
|
||||
Bump @sinonjs/referee from 3.2.0 to 4.0.0 (dependabot-preview[bot])
|
||||
>
|
||||
> Bumps [@sinonjs/referee](https://github.com/sinonjs/referee) from 3.2.0 to 4.0.0.
|
||||
> - [Release notes](https://github.com/sinonjs/referee/releases)
|
||||
> - [Changelog](https://github.com/sinonjs/referee/blob/master/CHANGES.md)
|
||||
> - [Commits](https://github.com/sinonjs/referee/compare/v3.2.0...v4.0.0)
|
||||
>
|
||||
> Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
|
||||
- [`b089354`](https://github.com/sinonjs/samsam/commit/b089354118a6f64139ca64906d8b8a9f282bc376)
|
||||
Bump eslint-plugin-jsdoc from 18.4.3 to 19.2.0 (dependabot-preview[bot])
|
||||
>
|
||||
> Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 18.4.3 to 19.2.0.
|
||||
> - [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
|
||||
> - [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v18.4.3...v19.2.0)
|
||||
>
|
||||
> Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
|
||||
- [`bba8c44`](https://github.com/sinonjs/samsam/commit/bba8c441914cd3b07b505b4d917a042d16412c9e)
|
||||
Bump @sinonjs/commons from 1.6.0 to 1.7.0 (dependabot-preview[bot])
|
||||
>
|
||||
> Bumps [@sinonjs/commons](https://github.com/sinonjs/commons) from 1.6.0 to 1.7.0.
|
||||
> - [Release notes](https://github.com/sinonjs/commons/releases)
|
||||
> - [Commits](https://github.com/sinonjs/commons/compare/v1.6.0...v1.7.0)
|
||||
>
|
||||
> Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
|
||||
- [`5915960`](https://github.com/sinonjs/samsam/commit/5915960fab257e27564c544da45b419c360bc8fb)
|
||||
Publish using public access (Morgan Roderick)
|
||||
- [`28ffc83`](https://github.com/sinonjs/samsam/commit/28ffc83556274b025d1fc62b52d2ff8ea25743a4)
|
||||
4.2.1 (Morgan Roderick)
|
||||
|
||||
_Released by [Maximilian Antoni](https://github.com/mantoni) on 2020-01-09._
|
||||
|
||||
## 4.2.1
|
||||
|
||||
- [`8987966`](https://github.com/sinonjs/samsam/commit/898796645000b88f1a4045213355bed29085f46c)
|
||||
re-introduce bound deepEqual (#160) (James Garbutt)
|
||||
|
||||
_Released on 2019-12-30._
|
||||
27
node_modules/@sinonjs/samsam/lib/deep-equal.js
generated
vendored
27
node_modules/@sinonjs/samsam/lib/deep-equal.js
generated
vendored
@@ -10,8 +10,10 @@ var mapForEach = require("@sinonjs/commons").prototypes.map.forEach;
|
||||
var getClass = require("./get-class");
|
||||
var identical = require("./identical");
|
||||
var isArguments = require("./is-arguments");
|
||||
var isArrayType = require("./is-array-type");
|
||||
var isDate = require("./is-date");
|
||||
var isElement = require("./is-element");
|
||||
var isIterable = require("./is-iterable");
|
||||
var isMap = require("./is-map");
|
||||
var isNaN = require("./is-nan");
|
||||
var isObject = require("./is-object");
|
||||
@@ -189,6 +191,31 @@ function deepEqualCyclic(actual, expectation, match) {
|
||||
return mapsDeeplyEqual;
|
||||
}
|
||||
|
||||
var isActualNonArrayIterable =
|
||||
isIterable(actualObj) &&
|
||||
!isArrayType(actualObj) &&
|
||||
!isArguments(actualObj);
|
||||
var isExpectationNonArrayIterable =
|
||||
isIterable(expectation) &&
|
||||
!isArrayType(expectation) &&
|
||||
!isArguments(expectation);
|
||||
if (isActualNonArrayIterable || isExpectationNonArrayIterable) {
|
||||
var actualArray = Array.from(actualObj);
|
||||
var expectationArray = Array.from(expectation);
|
||||
if (actualArray.length !== expectationArray.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var arrayDeeplyEquals = true;
|
||||
every(actualArray, function (key) {
|
||||
arrayDeeplyEquals =
|
||||
arrayDeeplyEquals &&
|
||||
deepEqualCyclic(actualArray[key], expectationArray[key]);
|
||||
});
|
||||
|
||||
return arrayDeeplyEquals;
|
||||
}
|
||||
|
||||
return every(expectationKeysAndSymbols, function (key) {
|
||||
if (!hasOwnProperty(actualObj, key)) {
|
||||
return false;
|
||||
|
||||
18
node_modules/@sinonjs/samsam/lib/is-iterable.js
generated
vendored
Normal file
18
node_modules/@sinonjs/samsam/lib/is-iterable.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Returns `true` when the argument is an iterable, `false` otherwise
|
||||
*
|
||||
* @alias module:samsam.isIterable
|
||||
* @param {*} val - A value to examine
|
||||
* @returns {boolean} Returns `true` when the argument is an iterable, `false` otherwise
|
||||
*/
|
||||
function isIterable(val) {
|
||||
// checks for null and undefined
|
||||
if (typeof val !== "object") {
|
||||
return false;
|
||||
}
|
||||
return typeof val[Symbol.iterator] === "function";
|
||||
}
|
||||
|
||||
module.exports = isIterable;
|
||||
4
node_modules/@sinonjs/samsam/package.json
generated
vendored
4
node_modules/@sinonjs/samsam/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sinonjs/samsam",
|
||||
"version": "6.0.2",
|
||||
"version": "6.1.1",
|
||||
"description": "Value identification and comparison functions",
|
||||
"homepage": "http://sinonjs.github.io/samsam/",
|
||||
"author": "Christian Johansen",
|
||||
@@ -28,7 +28,7 @@
|
||||
"test-headless": "mochify --no-detect-globals --recursive -R dot --plugin [ proxyquire-universal ] \"./lib/*.test.js\"",
|
||||
"prettier:check": "prettier --check '**/*.{js,css,md}'",
|
||||
"prettier:write": "prettier --write '**/*.{js,css,md}'",
|
||||
"preversion": "npm run test-check-coverage",
|
||||
"preversion": "./check-external-dependencies.sh && npm run test-check-coverage",
|
||||
"version": "changes --commits --footer",
|
||||
"postversion": "git push --follow-tags && npm publish --access public"
|
||||
},
|
||||
|
||||
9
node_modules/@sinonjs/samsam/types/is-iterable.d.ts
generated
vendored
Normal file
9
node_modules/@sinonjs/samsam/types/is-iterable.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export = isIterable;
|
||||
/**
|
||||
* Returns `true` when the argument is an iterable, `false` otherwise
|
||||
*
|
||||
* @alias module:samsam.isIterable
|
||||
* @param {*} val - A value to examine
|
||||
* @returns {boolean} Returns `true` when the argument is an iterable, `false` otherwise
|
||||
*/
|
||||
declare function isIterable(val: any): boolean;
|
||||
21
node_modules/@szmarczak/http-timer/LICENSE
generated
vendored
21
node_modules/@szmarczak/http-timer/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Szymon Marczak
|
||||
|
||||
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.
|
||||
70
node_modules/@szmarczak/http-timer/README.md
generated
vendored
70
node_modules/@szmarczak/http-timer/README.md
generated
vendored
@@ -1,70 +0,0 @@
|
||||
# http-timer
|
||||
> Timings for HTTP requests
|
||||
|
||||
[](https://travis-ci.org/szmarczak/http-timer)
|
||||
[](https://coveralls.io/github/szmarczak/http-timer?branch=master)
|
||||
[](https://packagephobia.now.sh/result?p=@szmarczak/http-timer)
|
||||
|
||||
Inspired by the [`request` package](https://github.com/request/request).
|
||||
|
||||
## Usage
|
||||
```js
|
||||
'use strict';
|
||||
const https = require('https');
|
||||
const timer = require('@szmarczak/http-timer');
|
||||
|
||||
const request = https.get('https://httpbin.org/anything');
|
||||
const timings = timer(request);
|
||||
|
||||
request.on('response', response => {
|
||||
response.on('data', () => {}); // Consume the data somehow
|
||||
response.on('end', () => {
|
||||
console.log(timings);
|
||||
});
|
||||
});
|
||||
|
||||
// { start: 1535708511443,
|
||||
// socket: 1535708511444,
|
||||
// lookup: 1535708511444,
|
||||
// connect: 1535708511582,
|
||||
// upload: 1535708511887,
|
||||
// response: 1535708512037,
|
||||
// end: 1535708512040,
|
||||
// phases:
|
||||
// { wait: 1,
|
||||
// dns: 0,
|
||||
// tcp: 138,
|
||||
// request: 305,
|
||||
// firstByte: 150,
|
||||
// download: 3,
|
||||
// total: 597 } }
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### timer(request)
|
||||
|
||||
Returns: `Object`
|
||||
|
||||
- `start` - Time when the request started.
|
||||
- `socket` - Time when a socket was assigned to the request.
|
||||
- `lookup` - Time when the DNS lookup finished.
|
||||
- `connect` - Time when the socket successfully connected.
|
||||
- `upload` - Time when the request finished uploading.
|
||||
- `response` - Time when the request fired the `response` event.
|
||||
- `end` - Time when the response fired the `end` event.
|
||||
- `error` - Time when the request fired the `error` event.
|
||||
- `phases`
|
||||
- `wait` - `timings.socket - timings.start`
|
||||
- `dns` - `timings.lookup - timings.socket`
|
||||
- `tcp` - `timings.connect - timings.lookup`
|
||||
- `request` - `timings.upload - timings.connect`
|
||||
- `firstByte` - `timings.response - timings.upload`
|
||||
- `download` - `timings.end - timings.response`
|
||||
- `total` - `timings.end - timings.start` or `timings.error - timings.start`
|
||||
|
||||
**Note**: The time is a `number` representing the milliseconds elapsed since the UNIX epoch.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
47
node_modules/@szmarczak/http-timer/package.json
generated
vendored
47
node_modules/@szmarczak/http-timer/package.json
generated
vendored
@@ -1,47 +0,0 @@
|
||||
{
|
||||
"name": "@szmarczak/http-timer",
|
||||
"version": "1.1.2",
|
||||
"description": "Timings for HTTP requests",
|
||||
"main": "source",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava",
|
||||
"coveralls": "nyc report --reporter=text-lcov | coveralls"
|
||||
},
|
||||
"files": [
|
||||
"source"
|
||||
],
|
||||
"keywords": [
|
||||
"http",
|
||||
"https",
|
||||
"timer",
|
||||
"timings"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/szmarczak/http-timer.git"
|
||||
},
|
||||
"author": "Szymon Marczak",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/szmarczak/http-timer/issues"
|
||||
},
|
||||
"homepage": "https://github.com/szmarczak/http-timer#readme",
|
||||
"xo": {
|
||||
"rules": {
|
||||
"unicorn/filename-case": "camelCase"
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^0.25.0",
|
||||
"coveralls": "^3.0.2",
|
||||
"p-event": "^2.1.0",
|
||||
"nyc": "^12.0.2",
|
||||
"xo": "^0.22.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"defer-to-connect": "^1.0.1"
|
||||
}
|
||||
}
|
||||
99
node_modules/@szmarczak/http-timer/source/index.js
generated
vendored
99
node_modules/@szmarczak/http-timer/source/index.js
generated
vendored
@@ -1,99 +0,0 @@
|
||||
'use strict';
|
||||
const deferToConnect = require('defer-to-connect');
|
||||
|
||||
module.exports = request => {
|
||||
const timings = {
|
||||
start: Date.now(),
|
||||
socket: null,
|
||||
lookup: null,
|
||||
connect: null,
|
||||
upload: null,
|
||||
response: null,
|
||||
end: null,
|
||||
error: null,
|
||||
phases: {
|
||||
wait: null,
|
||||
dns: null,
|
||||
tcp: null,
|
||||
request: null,
|
||||
firstByte: null,
|
||||
download: null,
|
||||
total: null
|
||||
}
|
||||
};
|
||||
|
||||
const handleError = origin => {
|
||||
const emit = origin.emit.bind(origin);
|
||||
origin.emit = (event, ...args) => {
|
||||
// Catches the `error` event
|
||||
if (event === 'error') {
|
||||
timings.error = Date.now();
|
||||
timings.phases.total = timings.error - timings.start;
|
||||
|
||||
origin.emit = emit;
|
||||
}
|
||||
|
||||
// Saves the original behavior
|
||||
return emit(event, ...args);
|
||||
};
|
||||
};
|
||||
|
||||
let uploadFinished = false;
|
||||
const onUpload = () => {
|
||||
timings.upload = Date.now();
|
||||
timings.phases.request = timings.upload - timings.connect;
|
||||
};
|
||||
|
||||
handleError(request);
|
||||
|
||||
request.once('socket', socket => {
|
||||
timings.socket = Date.now();
|
||||
timings.phases.wait = timings.socket - timings.start;
|
||||
|
||||
const lookupListener = () => {
|
||||
timings.lookup = Date.now();
|
||||
timings.phases.dns = timings.lookup - timings.socket;
|
||||
};
|
||||
|
||||
socket.once('lookup', lookupListener);
|
||||
|
||||
deferToConnect(socket, () => {
|
||||
timings.connect = Date.now();
|
||||
|
||||
if (timings.lookup === null) {
|
||||
socket.removeListener('lookup', lookupListener);
|
||||
timings.lookup = timings.connect;
|
||||
timings.phases.dns = timings.lookup - timings.socket;
|
||||
}
|
||||
|
||||
timings.phases.tcp = timings.connect - timings.lookup;
|
||||
|
||||
if (uploadFinished && !timings.upload) {
|
||||
onUpload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
request.once('finish', () => {
|
||||
uploadFinished = true;
|
||||
|
||||
if (timings.connect) {
|
||||
onUpload();
|
||||
}
|
||||
});
|
||||
|
||||
request.once('response', response => {
|
||||
timings.response = Date.now();
|
||||
timings.phases.firstByte = timings.response - timings.upload;
|
||||
|
||||
handleError(response);
|
||||
|
||||
response.once('end', () => {
|
||||
timings.end = Date.now();
|
||||
timings.phases.download = timings.end - timings.response;
|
||||
timings.phases.total = timings.end - timings.start;
|
||||
});
|
||||
});
|
||||
|
||||
return timings;
|
||||
};
|
||||
21
node_modules/@types/del/LICENSE
generated
vendored
21
node_modules/@types/del/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
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
|
||||
3
node_modules/@types/del/README.md
generated
vendored
3
node_modules/@types/del/README.md
generated
vendored
@@ -1,3 +0,0 @@
|
||||
This is a stub types definition for del (https://github.com/sindresorhus/del).
|
||||
|
||||
del provides its own type definitions, so you don't need @types/del installed!
|
||||
14
node_modules/@types/del/package.json
generated
vendored
14
node_modules/@types/del/package.json
generated
vendored
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"name": "@types/del",
|
||||
"version": "4.0.0",
|
||||
"typings": null,
|
||||
"description": "Stub TypeScript definitions entry for del, which provides its own types definitions",
|
||||
"main": "",
|
||||
"scripts": {},
|
||||
"author": "",
|
||||
"repository": "https://github.com/sindresorhus/del",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"del": "*"
|
||||
}
|
||||
}
|
||||
21
node_modules/@types/jszip/LICENSE
generated
vendored
21
node_modules/@types/jszip/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
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
|
||||
3
node_modules/@types/jszip/README.md
generated
vendored
3
node_modules/@types/jszip/README.md
generated
vendored
@@ -1,3 +0,0 @@
|
||||
This is a stub types definition for jszip (https://github.com/Stuk/jszip).
|
||||
|
||||
jszip provides its own type definitions, so you don't need @types/jszip installed!
|
||||
14
node_modules/@types/jszip/package.json
generated
vendored
14
node_modules/@types/jszip/package.json
generated
vendored
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"name": "@types/jszip",
|
||||
"version": "3.4.1",
|
||||
"typings": null,
|
||||
"description": "Stub TypeScript definitions entry for jszip, which provides its own types definitions",
|
||||
"main": "",
|
||||
"scripts": {},
|
||||
"author": "",
|
||||
"repository": "https://github.com/Stuk/jszip",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jszip": "*"
|
||||
}
|
||||
}
|
||||
21
node_modules/@types/nock/LICENSE
generated
vendored
21
node_modules/@types/nock/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
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
|
||||
3
node_modules/@types/nock/README.md
generated
vendored
3
node_modules/@types/nock/README.md
generated
vendored
@@ -1,3 +0,0 @@
|
||||
This is a stub types definition for nock (https://github.com/nock/nock).
|
||||
|
||||
nock provides its own type definitions, so you don't need @types/nock installed!
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user